Fireflyrk3288 ubuntu18.04添加Qt开发环境、安装mysql-server

1、创建一台同版本的ubuntu18.04的虚拟机

2、下载rk3288_ubuntu_18.04_armhf_ext4_v2.04_20201125-1538_DESKTOP.img

3、创建空img镜像容器

bash 复制代码
dd if=/dev/zero of=ubuntu_rootfs.img bs=1M count=10240

4、将该容器格式化成ext4文件系统

bash 复制代码
mkfs.ext4 ubuntu_rootfs.img

5、将该镜像文件挂载到一个rootfs文件夹上,然后将ubuntu_base_rootfs的文件复制到rootfs文件夹中

bash 复制代码
mkdir rootfs
sudo mount ubuntu_rootfs.img rootfs
mkdir ubuntu_base_rootfs
sudo mount rk3288_ubuntu_18.04_armhf_ext4_v2.04_20201125-1538_DESKTOP.img ubuntu_base_rootfs
sudo cp -rfp ubuntu_base_rootfs/* rootfs/

6、安装 qemu,对任何机器运行操作系统的全系统仿真。

qemu 是一个通用的、开源的机器仿真器和虚拟机,拷贝它是为了可以模拟 arm cpu 进行文件系统的配置。

bash 复制代码
sudo apt-get install qemu-user-static
sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin/

7、复制虚拟机的dns文件到rootfs系统内

bash 复制代码
echo 'nameserver 114.114.114.114' >> rootfs/etc/resolv.conf
echo 'nameserver 8.8.8.8' >> rootfs/etc/resolv.conf
echo 'DNS=114.114.114.114 8.8.8.8' >> rootfs/etc/systemd/resolved.conf

8、挂载ubuntu-base

编写挂载脚本

bash 复制代码
#!/bin/bash
mnt() {
	echo "MOUNTING"
	sudo mount -t proc /proc ${2}proc
	sudo mount -t sysfs /sys ${2}sys
	sudo mount -o bind /dev ${2}dev
	sudo mount -o bind /dev/pts ${2}dev/pts
	sudo chroot ${2}
}
umnt() {
	echo "UNMOUNTING"
	sudo umount ${2}proc
	sudo umount ${2}sys
	sudo umount ${2}dev/pts
	sudo umount ${2}dev
}
 
if [ "$1" == "-m" ] && [ -n "$2" ] ;
then
	mnt $1 $2
elif [ "$1" == "-u" ] && [ -n "$2" ];
then
	umnt $1 $2
else
	echo ""
	echo "Either 1'st, 2'nd or both parameters were missing"
	echo ""
	echo "1'st parameter can be one of these: -m(mount) OR -u(umount)"
	echo "2'nd parameter is the full path of rootfs directory(with trailing '/')"
	echo ""
	echo "For example: ch-mount -m /media/sdcard/"
	echo ""
	echo 1st parameter : ${1}
	echo 2nd parameter : ${2}
fi

9、增加脚本执行权限

bash 复制代码
sudo chmod +x mount.sh

10、运行脚本挂载根文件系统

bash 复制代码
bash mount.sh -m rootfs/

11、装软件

bash 复制代码
mkdir /tmp
chmod 777 /tmp

apt update
apt install -y gcc-7
apt install -y build-essential

apt install -y git

apt install -y libgmp-dev libudev-dev
apt install -y libusb-1.0-0 libusb-1.0-0-dev libhidapi-dev libhidapi-libusb0

apt install -y qt5-default
apt install -y libqt5* qtmultimedia5-dev qtcreator qtconnectivity5-dev 

apt install -y mysql-client mysql-common mysql-server

ln -s /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libmali.so.1  

12、配置SSH允许root用户登录

bash 复制代码
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
passwd root

13、设置NTP服务器

bash 复制代码
echo "NTP=ntp1.aliyun.com ntp.neu.edu.cn" >> /etc/systemd/timesyncd.conf

14、设置中文

bash 复制代码
 echo 'LANG="zh_CN.utf8"' > /etc/default/locale
 apt install -y language-pack-zh-hans

15、修改状态栏在底部,修改/usr/share/lxpanel/profile/Lubuntu/panels/panel,把edge=top改为

bash 复制代码
Global {
    edge=bottom

16、卸载镜像

bash 复制代码
bash mount.sh -u rootfs/

17、替换桌面背景和图标

bash 复制代码
 cp desktop_imgs/lubuntu-ff-logo.png rootfs/usr/share/lubuntu/images/lubuntu-ff-logo.png
 cp desktop_imgs/firefly-default-wallpaper.png rootfs/usr/share/lubuntu/wallpapers/firefly-default-wallpaper.png

18、用e2fsck修复及检测镜像文件系统,resize2fs 减小镜像文件的大小

bash 复制代码
sudo umount rootfs
bash 复制代码
e2fsck -p -f ubuntu_rootfs.img
resize2fs -M ubuntu_rootfs.img
相关推荐
mounter62534 分钟前
质检员与超能引擎的碰撞:KASAN 护航 eBPF JIT 的技术演进与安全抉择
linux·ebpf·linux kernel·kernel·kasan
风123456789~36 分钟前
【Linux专栏】history常用命令
linux·运维·服务器
熬夜苦读学习40 分钟前
基于websocket的多用户五子棋网页游戏
linux·服务器·网络·websocket·网络协议·游戏·五子棋
fpcc1 小时前
Linux 7.1介绍
linux·运维
三8442 小时前
磁盘管理/fdisk
linux·运维·服务器
库玛西2 小时前
深入剖析 Linux 线程机制与分页式存储管理
linux·服务器·c++·笔记
气概2 小时前
QT集成basler相机
开发语言·数码相机·qt
春卷同学2 小时前
HarmonyOS掌上记账APP开发实践第18篇:编译时优化与 ArkTS 语法限制 — 提升应用性能的编码规范
linux·运维·ubuntu
爸爸6192 小时前
鸿蒙应用开发实战【08】— AppStorage 全局状态与跨页面通信
ubuntu·华为·harmonyos·鸿蒙系统
Dovis(誓平步青云)3 小时前
《 AI直连数据库落地实践:基于MCP协议打通开发工具与数据库全链路运维分析》
大数据·linux·运维·数据库·人工智能·架构