創(chuàng)建 Ubuntu 根文件系統(tǒng)
準(zhǔn)備工作
安裝qemu
sudo apt-get install qemu-user-static
下載和解壓 ubuntu-core
Firefly-rk3399 ubuntu根文件系統(tǒng)是基于Ubuntu base 16.04來創(chuàng)建的。用戶可以到ubuntu cdimg 下載,選擇下載ubuntu-base-16.04.1-base-arm64.tar.gz 。
下載完之后,創(chuàng)建臨時文件夾并解壓根文件系統(tǒng):
mkdir temp sudo tar -xpf ubuntu-base-16.04.1-base-arm64.tar.gz -C temp
修改根文件系統(tǒng)
準(zhǔn)備工作
準(zhǔn)備網(wǎng)絡(luò):
sudo cp -b /etc/resolv.conf temp/etc/resolv.conf
準(zhǔn)備qemu
sudo cp /usr/bin/qemu-aarch64-static temp/usr/bin/
進(jìn)入根文件系統(tǒng)進(jìn)行操作:
sudo chroot temp
更新及安裝
更新:
apt update apt upgrade
安裝自己需要的功能
apt install vim git ....(根據(jù)自己需求添加)
安裝xubuntu
apt install xubuntu-desktop
可能出現(xiàn)錯誤:
E: Unable to locate package xxxx
安裝包的源沒有添加到/etc/apt/source.list中,導(dǎo)致無法識別安裝包,可以自行添加源,也可以使用下面給出的source.list覆蓋原來的/etc/apt/source.list文件:
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://ports.ubuntu.com/ubuntu-ports/ xenial universe deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial universe deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse
添加用戶及設(shè)置密碼
添加用戶
useradd -s '/bin/bash' -m -G adm,sudo firefly
給用戶設(shè)置密碼:
passwd firefly
給root用戶設(shè)置密碼:
passwd root
修改完自己的根文件系統(tǒng)就可以退出了。
exit
制作根文件系統(tǒng)
制作自己的根文件系統(tǒng),大小依據(jù)自己的根文件系統(tǒng)而定,注意依據(jù)temp文件夾的大小來修改count值
dd if=/dev/zero of=linuxroot.img bs=1M count=2048 sudo mkfs.ext4 linuxroot.img mkdir rootfs sudo mount linuxroot.img rootfs/ sudo cp -rfp temp/* rootfs/ sudo umount rootfs/ e2fsck -p -f linuxroot.img resize2fs -M linuxroot.img
這樣 linuxroot.img 就是最終的根文件系統(tǒng)映像文件了。
FAQs
根文件系統(tǒng)加載后,大小不正常,未占滿整個分區(qū):
在系統(tǒng)正確加載后執(zhí)行擴(kuò)展文件系統(tǒng)命令:
resize2fs /dev/mtd/by-name/linuxroot
-
Linux
+關(guān)注
關(guān)注
88文章
11774瀏覽量
219155 -
嵌入式主板
+關(guān)注
關(guān)注
7文章
6107瀏覽量
37108 -
Firefly
+關(guān)注
關(guān)注
2文章
547瀏覽量
9129
發(fā)布評論請先 登錄
瑞芯微VS-RK3399《創(chuàng)建 Ubuntu 根文件系統(tǒng)》分享
如何制作rk3399 arm64 ubuntu18.04 根文件系統(tǒng)?
FireflyRK3128主板Ubuntu 根文件系統(tǒng)創(chuàng)建
fireflyAIO-3399C主板創(chuàng)建Ubuntu根文件系統(tǒng)
嵌入式Linux移植3. NFS根文件系統(tǒng)掛載(從Ubuntu啟動內(nèi)核,文件系統(tǒng))
Core 3399KJ Linux根文件系統(tǒng)鏡像(arm64/arm32)
Core 3399J Linux根文件系統(tǒng)鏡像(arm64/arm32)
ROC RK3399 PC Pro文件系統(tǒng)Linux根文件系統(tǒng)鏡像(arm64/arm32)
AIO 3399ProC Linux根文件系統(tǒng)鏡像(arm64/arm32)
fireflyAIO-3399J-創(chuàng)建Ubuntu根文件系統(tǒng)簡介
評論