From f4bfb3a6fafc60b8860a3be6bee0a4aff422ba7a Mon Sep 17 00:00:00 2001 From: hehaoyang Date: Wed, 13 Sep 2023 22:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RK3568/移远/系统环境配置(SSH).md | 8 +- RK3568/移远/系统环境配置(编译OpenCV).md | 3 +- orangepi/环境搭建.md | 131 ++++++++++++++++++++++++ 3 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 orangepi/环境搭建.md diff --git a/RK3568/移远/系统环境配置(SSH).md b/RK3568/移远/系统环境配置(SSH).md index f6afa54..7f239ae 100644 --- a/RK3568/移远/系统环境配置(SSH).md +++ b/RK3568/移远/系统环境配置(SSH).md @@ -33,15 +33,19 @@ systemctl restart sshd apt update apt upgrade ``` -报错后,重新执行 apt update -出现错误: +报错后,重新执行 apt update 出现错误: + ![报错信息](image/3FB06500-317D-4B87-BB76-EFC7B788B33E.png) + 执行 ``` apt --fix-broken install ``` + 出现错误: + ![报错信息](image/B707EB53-9FEF-493C-8095-33AB7D466E4B.png) + 执行命令 ``` dpkg -i --force-overwrite /var/cache/apt/archives/libc6-arm64-cross_2.31-0ubuntu9.9cross1_all.deb diff --git a/RK3568/移远/系统环境配置(编译OpenCV).md b/RK3568/移远/系统环境配置(编译OpenCV).md index 58467b5..c856b55 100644 --- a/RK3568/移远/系统环境配置(编译OpenCV).md +++ b/RK3568/移远/系统环境配置(编译OpenCV).md @@ -30,7 +30,8 @@ apt-get upgrade apt-get install build-essential cmake git pkg-config -y ``` -出现错误: +* 出现错误: + ![错误信息](image/CC706F1B-4AE8-477D-8275-52AC498D1966.png) ``` diff --git a/orangepi/环境搭建.md b/orangepi/环境搭建.md new file mode 100644 index 0000000..9180ea0 --- /dev/null +++ b/orangepi/环境搭建.md @@ -0,0 +1,131 @@ +# 环境搭建 + +### 找回剩余容量 + +> 参考 https://blog.csdn.net/weixin_42252435/article/details/116632826?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.essearch_pc_relevant&spm=1001.2101.3001.4242.1 + +> 首先来查看一下系统的磁盘情况 +```bash +orangepi@orangepi:~$ sudo fdisk -l + + Device Boot Start End Blocks Id System +/dev/mmcblk0p1 40960 124927 41984 83 Linux +/dev/mmcblk0p2 124928 7167999 3521536 83 Linux +``` + +> 查看第二分区的起始地址,后面会用到 + +```bash +orangepi@orangepi:~$ cat /sys/block/mmcblk0/mmcblk0p2/start +124928 +``` + +> 操作磁盘,并调整ext文件系统的空间大小 + +```bash +orangepi@orangepi:~$ sudo fdisk /dev/mmcblk0 + +Command (m for help): d +Partition number (1-4): 2 + +Command (m for help): n +Partition type: + p primary (1 primary, 0 extended, 3 free) + e extended +Select (default p): +Using default response p +Partition number (1-4, default 2): +Using default value 2 +First sector (2048-62333951, default 2048): 124928 +Last sector, +sectors or +size{K,M,G} (124928-62333951, default 62333951): +Using default value 62333951 + +Command (m for help): w +The partition table has been altered! + +Calling ioctl() to re-read partition table. + +WARNING: Re-reading the partition table failed with error 16: Device or resource busy. +The kernel still uses the old table. The new table will be used at +the next reboot or after you run partprobe(8) or kpartx(8) +Syncing disks. + +orangepi@orangepi:~$ sudo reboot +orangepi@orangepi:~$ sudo resize2fs /dev/mmcblk0p2 +``` + +### 配置环境 + +* 配置 + +```bash +sudo apt-get update +sudo apt-get install --reinstall systemd -y +sudo apt install cups-bsd -y +cp /usr/lib/cups/backend/gutenprint52+usb /usr/lib/cups/backend/gutenprint52usb +``` + +* 配置 .net core 3.1 环境 + +```bash +wget --no-check-certificate https://download.visualstudio.microsoft.com/download/pr/1b2a2fb1-b04b-485b-8a25-caed97ebe601/0c6024a3814f664558dc39fc85b34192/dotnet-sdk-3.1.416-linux-arm.tar.gz + +sudo mkdir /usr/share/dotnet +sudo tar -xvf dotnet-sdk-3.1.416-linux-arm.tar.gz -C /usr/share/dotnet +sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet +root@orangepi:~# dotnet --info +.NET Core SDK (reflecting any global.json): + Version: 3.1.416 + Commit: 8d3765c609 +``` + +* 拷贝 gcm.bin、 install.sh 进入系统 + +``` +bash install.sh +chmod +x /usr/local/gcm/bin/* +source /etc/profile.d/gcm.sh +``` +* 拷贝软件, 软件设置为服务 + +``` +vim /etc/systemd/system/printerclient.service +``` +``` +[Unit] +Description=Printer Client + +[Service] +WorkingDirectory=/root/netcoreapp3.1/ +ExecStart=/root/netcoreapp3.1/autorun.sh +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target +``` + +``` +vim netcoreapp3.1/autorun.sh +``` + +``` +#!/bin/sh + +export GCM_HOME=/usr/local/gcm +export PATH=$GCM_HOME/bin:$PATH +LD_LIBRARY_PATH=$GCM_HOME/lib:$LD_LIBRARY_PATH + +export LD_LIBRARY_PATH + +cd /root/netcoreapp3.1 + +dotnet PrinterClient.dll + +``` + +将服务设置为每次开机启动 +systemctl enable printerclient.service + +服务立即启动,下次不启动 +systemctl start printerclient.service