創建 Ubuntu 根文件系統
準備工作
修改根文件系統
準備工作
準備網絡:
sudo cp -b /etc/resolv.conf temp/etc/resolv.conf
準備qemu
sudo cp /usr/bin/qemu-aarch64-static temp/usr/bin/
進入根文件系統進行操作:
sudo chroot temp
更新及安裝
更新:
apt update apt upgrade
安裝自己需要的功能
apt install vim git ....(根據自己需求添加)
安裝xubuntu
apt install xubuntu-desktop
可能出現錯誤:
E: Unable to locate package xxxx
安裝包的源沒有添加到/etc/apt/source.list
中,導致無法識別安裝包,可以自行添加源,也可以使用下面給出的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
添加用戶及設置密碼
添加用戶
useradd -s '/bin/bash' -m -G adm,sudo firefly
給用戶設置密碼:
passwd firefly
給root用戶設置密碼:
passwd root
修改完自己的根文件系統就可以退出了。
exit
制作根文件系統
制作自己的根文件系統,大小依據自己的根文件系統而定,注意依據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 就是最終的根文件系統映像文件了。
FAQs
根文件系統加載后,大小不正常,未占滿整個分區:
在系統正確加載后執行擴展文件系統命令:
resize2fs /dev/mtd/by-name/linuxroot
聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。
舉報投訴
-
Linux
+關注
關注
87文章
11459瀏覽量
212782 -
嵌入式主板
+關注
關注
7文章
6096瀏覽量
36138 -
Firefly
+關注
關注
2文章
541瀏覽量
7398
發布評論請先 登錄
相關推薦
熱點推薦
瑞芯微VS-RK3399《創建 Ubuntu 根文件系統》分享
瑞芯微VS-RK3399《創建 Ubuntu 根文件系統》分享更新時間:2018-3-30準備工作安裝qemu在Linux PC主機上安裝模
發表于 03-30 10:03
嵌入式Linux移植3. NFS根文件系統掛載(從Ubuntu啟動內核,文件系統)
:通過tftp使用Ubuntu中的/tftpboot中的uImage啟動rootfs根文件系統:通過NFS使用Ubuntu中的/nfs_rootfs中的
發表于 11-02 12:51
?7次下載

Core 3399KJ Linux根文件系統鏡像(arm64/arm32)
電子發燒友網站提供《Core 3399KJ Linux根文件系統鏡像(arm64/arm32).txt》資料免費下載
發表于 09-14 10:08
?3次下載

Core 3399J Linux根文件系統鏡像(arm64/arm32)
電子發燒友網站提供《Core 3399J Linux根文件系統鏡像(arm64/arm32).txt》資料免費下載
發表于 09-14 09:24
?0次下載

Core 3399 JD4 V2文件系統Linux根文件系統鏡像(arm64/arm32)
電子發燒友網站提供《Core 3399 JD4 V2文件系統Linux根文件系統鏡像(arm64/arm32).txt》資料免費下載
發表于 09-16 09:44
?10次下載

ROC RK3399 PC Pro文件系統Linux根文件系統鏡像(arm64/arm32)
電子發燒友網站提供《ROC RK3399 PC Pro文件系統Linux根文件系統鏡像(arm64/arm32).txt》資料免費下載
發表于 09-20 10:59
?5次下載

AIO 3399ProC Linux根文件系統鏡像(arm64/arm32)
電子發燒友網站提供《AIO 3399ProC Linux根文件系統鏡像(arm64/arm32).txt》資料免費下載
發表于 09-21 09:52
?11次下載

評論