A40idocker系统中想在文件系统安装库文件,可以通过模拟工具修改,这样就可以直接生成镜像 我这里使用的普通用户,多数命令需要加sudo sudo apt-get install
qemu-user-static 进入源码文件系统路径, 例如我的路径是/home/forlinx/Desktop/lichee/buildroot-201611/target/ubuntu16 配置修改 sudo cp
/usr/bin/qemu-arm-static usr/bin/ 拷贝PC主机端的dns配置,因为待会安装程序时要用网络: sudo cp -b /etc/resolv.conf etc/resolv.conf sudo vim etc/apt/source.list 添加 deb
http://ports.ubuntu.com/ubuntu-ports/ xenial main universe deb-src
http://ports.ubuntu.com/ubuntu-ports/ xenial main universe
写脚本 #!/bin/bash function 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 chroot ${2} } function umnt() { echo "UNMOUNTING" sudo umount ${2}proc sudo umount ${2}sys 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 挂载文件系统 chmod +x ch-mount.sh sudo ./ch-mount.sh -m 文件系统路径 修改文件系统 退出 exit 取消挂载 sudo ./ch-mount.sh -u 文件系统路径 制作镜像 进入源码路径 lichee文件路径内 sudo ./tools/build/bin/make_ext4fs -l 7168M out/sun8iw11p1/linux/common/rootfs.ext4 buildroot-201611/target/ubuntu16 e2fsck -p out/sun8iw11p1/linux/common/rootfs.ext4 resize2fs -M out/sun8iw11p1/linux/common/rootfs.ext4 不能用编译脚本会有问题 |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2025-1-9 05:58
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.