Firefly开源社区

打印 上一主题 下一主题

制作ubuntu文件系统,部分工具缺失问题

25

积分

0

威望

0

贡献

技术小白

积分
25

制作ubuntu文件系统,部分工具缺失问题

发表于 2018-5-31 17:14:31      浏览:4385 | 回复:1        打印      只看该作者   [复制链接] 楼主
按照[url=]ROC-RK3328-CC Manual 的步骤,制作ubuntu根文件系统,做出来的镜像烧入到SD卡启动,发现确实很多常用的基本工具,比如: ifconfig/ping/lsmod/insmod ...,但是firefly官方释放的ubuntu镜像包,这些命令都比较全,官方的跟文件系统是怎么制作出来的,是否有相关的教程指导!?[/url]

[url=]参考制作根文件系统方法:[/url]
Building Ubuntu Root FilesystemEnvironment:
  • Ubuntu 16.04 64 bit
Install required packages:
sudo apt-get install qemu qemu-user-static binfmt-support debootstrap

Download Ubuntu core:
wget -c http://cdimage.ubuntu.com/ubuntu ... 1-base-arm64.tar.gz

Create a root filesystem image file sized 1000M and populate it with the ubuntu base tar file:
fallocate -l 1000M rootfs.imgsudo mkfs.ext4 -F ROOTFS rootfs.img mkdir mnt sudo mount rootfs.img mntsudo tar -xzvf ubuntu-base-16.04.1-base-arm64.tar.gz -C mnt/sudo cp -a /usr/bin/qemu-aarch64-static mnt/usr/bin/

qemu-aarch64-static is the magic cure here, which enables chroot into an arm64 filesystem under amd64 host system.
Chroot to the new filesystem and initialize:
sudo chroot mnt/# Change the setting hereUSER=fireflyHOST=firefly# Create Useruseradd -G sudo -m -s /bin/bash $USERpasswd $USER# enter user password# Hostname & Networkecho $HOST /etc/hostnameecho "127.0.0.1    localhost.localdomain localhost" > /etc/hostsecho "127.0.0.1    $HOST" >> /etc/hostsecho "auto eth0" > /etc/network/interfaces.d/eth0echo "iface eth0 inet dhcp" >> /etc/network/interfaces.d/eth0echo "nameserver 127.0.1.1" > /etc/resolv.conf# Enable serial consoleln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service # Install packagesapt-get updateapt-get upgradeapt-get install ifupdown net-tools network-managerapt-get install udev sudo sshapt-get install vim-tiny

Unmount filesystem:
sudo umount rootfs/




回复

使用道具 举报

186

积分

1

威望

0

贡献

技术小白

积分
186
发表于 2018-6-1 10:07:17        只看该作者  沙发
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表