在线观看www成人影院-在线观看www日本免费网站-在线观看www视频-在线观看操-欧美18在线-欧美1级

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

如何制作ubuntu20.04的文件系統

嵌入式與Linux那些事 ? 來源:嵌入式與Linux那些事 ? 作者:嵌入式與Linux那些 ? 2022-10-17 12:12 ? 次閱讀

firefly自帶的文件系統,由于缺少一些基本功能模塊,因此,我們可以自己手動制作一個ubuntu20.04的文件系統。

下載Ubuntu根文件系統

安裝虛擬機

apt-getinstallqemu-user-static

解壓

mkdirubuntu-rootfs
tar-xpfubuntu-base-20.04.5-base-arm64.tar.gz-Cubuntu-rootfs

復制一下虛擬機的運行環境

cp-b/etc/resolv.confubuntu-rootfs/etc/resolv.conf
cp/usr/bin/qemu-aarch64-staticubuntu-rootfs/usr/bin/

復制官方外設驅動文件

將開發板掛載到虛擬機上,將開發板的/vendor,/system,/lib/firmware,這三個文件夾復制到我們自己的文件系統中。

掛載根文件系統

創建ch-mount.sh文件,寫入以下腳本

#!/bin/bash
#
functionmnt(){
echo"MOUNTING..."
sudomount-tproc/proc${2}proc
sudomount-tsysfs/sys${2}sys
sudomount-obind/dev${2}dev
sudomount-obind/dev/pts${2}dev/pts
echo"CHROOT..."
sudochroot${2}
echo"Success!"
}
functionumnt(){
echo"UNMOUNTING"
sudoumount${2}proc
sudoumount${2}sys
sudoumount${2}dev/pts
sudoumount${2}dev
}
if["$1"=="-m"]&&[-n"$2"];
then
mnt$1$2
elif["$1"=="-u"]&&[-n"$2"];
then
umnt$1$2
else
echo""
echo"Either1'st,2'ndorbothparametersweremissing"
echo""
echo"1'stparametercanbeoneofthese:-m(mount)OR-u(umount)"
echo"2'ndparameteristhefullpathofrootfsdirectory(withtrailing'/')"
echo""
echo"Forexample:ch-mount-m/media/sdcard/"
echo""
echo1stparameter:${1}
echo2ndparameter:${2}
fi

把下載好的腳本置于ubuntu-rootfs目錄的上一級目錄,并修改權限:

chmoda+xch-mount.sh
./ch-mount.sh-mubuntu-rootfs/

執行mount動作,注意退出后一定再執行 ./ch-mount.sh -u ubuntu-rootfs/,否則你的本機ubuntu系統會出問題,需要重啟才能恢復正常。

拷貝bash依賴庫

執行掛載腳本時遇到以下錯誤,可以拷貝bash動態庫。

?toolssudochrootubuntu-rootfs
chroot:failedtoruncommand‘/bin/zsh’:Nosuchfileordirectory

查看/bin/bash文件所依賴的動態鏈接庫,然后依次拷貝到相應目錄。由于我安裝了zsh,所以除了拷貝bash動態庫外,還需要拷貝zsh動態庫。沒有安裝zsh的可以不用拷貝zsh動態庫。

zhongyi@ubuntu:~$ldd/bin/zsh
linux-vdso.so.1(0x00007ffd5c1dc000)
libcap.so.2=>/lib/x86_64-linux-gnu/libcap.so.2(0x00007f4b4d9d7000)
libdl.so.2=>/lib/x86_64-linux-gnu/libdl.so.2(0x00007f4b4d7d3000)
libtinfo.so.5=>/lib/x86_64-linux-gnu/libtinfo.so.5(0x00007f4b4d5a9000)
libm.so.6=>/lib/x86_64-linux-gnu/libm.so.6(0x00007f4b4d20b000)
libc.so.6=>/lib/x86_64-linux-gnu/libc.so.6(0x00007f4b4ce1a000)
/lib64/ld-linux-x86-64.so.2(0x00007f4b4debc000)
zhongyi@ubuntu:~$ldd/bin/bash
linux-vdso.so.1(0x00007ffd8335a000)
libtinfo.so.5=>/lib/x86_64-linux-gnu/libtinfo.so.5(0x00007f50a4d2a000)
libdl.so.2=>/lib/x86_64-linux-gnu/libdl.so.2(0x00007f50a4b26000)
libc.so.6=>/lib/x86_64-linux-gnu/libc.so.6(0x00007f50a4735000)
/lib64/ld-linux-x86-64.so.2(0x00007f50a526e000)
$mkdirlib64
$cp/lib64/ld-linux-x86-64.so.2./lib64/
$mkdir./lib/x86_64-linux-gnu
$cp/lib/x86_64-linux-gnu/libtinfo.so.5./lib/x86_64-linux-gnu/
$cp/lib/x86_64-linux-gnu/libdl.so.2./lib/x86_64-linux-gnu/
$cp/lib/x86_64-linux-gnu/libc.so.6./lib/x86_64-linux-gnu/
$cp/lib/x86_64-linux-gnu/libcap.so.2./lib/x86_64-linux-gnu/
$cp/lib/x86_64-linux-gnu/libm.so.6./lib/x86_64-linux-gnu/
$cp/lib/x86_64-linux-gnu/libc.so.6./lib/x86_64-linux-gnu/
$cp/bin/bashubuntu-rootfs/bin
$cp/bin/zshubuntu-rootfs/bin

執行掛載

成功掛載后,會看到自動切換為root用戶。

zhongyi@ubuntu:~/tools$./ch-mount.sh-mubuntu-rootfs/
MOUNTING...
CHROOT...
zsh:failedtoloadmodule`zsh/zle':/usr/lib/x86_64-linux-gnu/zsh/5.4.2/zsh/zle.so:cannotopensharedobjectfile:Nosuchfileordirectory
#已經成功掛載
ubuntu#

安裝必要的軟件

apt-getupdate
apt-get-yinstallvimnfs-commonsudosshnet-toolsethtoolwireless-toolsxfce4-power-managerxinitnetwork-manageriputils-pingrsyslogbash-completionlxtaskhtopsynaptic--no-install-recommends

更換源

vim/etc/apt/source.list
#添加中科大源
debhttp://mirrors.ustc.edu.cn/ubuntu-ports/xenialmainmultiverserestricteduniverse
debhttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-backportsmainmultiverserestricteduniverse
debhttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-proposedmainmultiverserestricteduniverse
debhttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-securitymainmultiverserestricteduniverse
debhttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-updatesmainmultiverserestricteduniverse
deb-srchttp://mirrors.ustc.edu.cn/ubuntu-ports/xenialmainmultiverserestricteduniverse
deb-srchttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-backportsmainmultiverserestricteduniverse
deb-srchttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-proposedmainmultiverserestricteduniverse
deb-srchttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-securitymainmultiverserestricteduniverse
deb-srchttp://mirrors.ustc.edu.cn/ubuntu-ports/xenial-updatesmainmultiverserestricteduniverse

#添加阿里源
debhttp://mirrors.aliyun.com/ubuntu/focalmainrestricteduniversemultiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focalmainrestricteduniversemultiverse
debhttp://mirrors.aliyun.com/ubuntu/focal-securitymainrestricteduniversemultiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focal-securitymainrestricteduniversemultiverse
debhttp://mirrors.aliyun.com/ubuntu/focal-updatesmainrestricteduniversemultiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focal-updatesmainrestricteduniversemultiverse
debhttp://mirrors.aliyun.com/ubuntu/focal-proposedmainrestricteduniversemultiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focal-proposedmainrestricteduniversemultiverse
debhttp://mirrors.aliyun.com/ubuntu/focal-backportsmainrestricteduniversemultiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focal-backportsmainrestricteduniversemultiverse

#添加清華源
debhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focalmainrestricteduniversemultiverse
#deb-srchttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focalmainrestricteduniversemultiverse
debhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-updatesmainrestricteduniversemultiverse
#deb-srchttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-updatesmainrestricteduniversemultiverse
debhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-backportsmainrestricteduniversemultiverse
#deb-srchttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-backportsmainrestricteduniversemultiverse
debhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-securitymainrestricteduniversemultiverse
#deb-srchttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/focal-securitymainrestricteduniversemultiverse

設置賬戶名和密碼

useradd-s'/bin/bash'-m-Gadm,sudofirefly
passwdfirefly
passwdroot

設置主機名

echo'ubuntu.firefly'>/etc/hostname

添加主機入口到/etc/hosts

127.0.0.1localhost
127.0.0.1ubuntu.firefly
127.0.1.1firefly

添加nameserver

vim/etc/resolvconf/resolv.conf.d/head
#添加nameserver
nameserver114.114.114.114
nameserver8.8.8.8

取消掛載

exit
./ch-mount.sh-uubuntu-rootfs/

創建 mkrootfs.sh文件,寫入以下腳本,其中2048取決于你的根文件系統實際大小,比如安裝了桌面環境后若大小超過2048M,就改大一點

#!/bin/bash
#
ddif=/dev/zeroof=ubuntu-rootfs.imgbs=1Mcount=2048
sudomkfs.ext4ubuntu-rootfs.img
rm-rrootfs
mkdirrootfs
sudomountubuntu-rootfs.imgrootfs/
sudocp-rfpubuntu-rootfs/*rootfs/
sudoumountrootfs/
e2fsck-p-fubuntu-rootfs.img
resize2fs-Mubuntu-rootfs.img

執行制作

?tools./mkrootfs.sh
?toolsls-al|grep*.img
-rw-rw-r--1zhongyizhongyi1497706496Sep3021:32ubuntu-rootfs.img

燒寫鏡像

sudoupgrade_tooldi-rootfsubuntu-rootfs.img

審核編輯:湯梓紅

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • 文件系統
    +關注

    關注

    0

    文章

    294

    瀏覽量

    20307
  • Ubuntu
    +關注

    關注

    5

    文章

    588

    瀏覽量

    30905
  • Firefly
    +關注

    關注

    2

    文章

    541

    瀏覽量

    7424

原文標題:【RK3399】制作ubuntu20.04 roomfs

文章出處:【微信號:嵌入式與Linux那些事,微信公眾號:嵌入式與Linux那些事】歡迎添加關注!文章轉載請注明出處。

收藏 人收藏

    評論

    相關推薦
    熱點推薦

    怎樣利用Ubuntu20.04去安裝Mentor Calibre 2020?

    怎樣利用Ubuntu20.04去安裝Mentor Calibre 2020?有沒有人遇到過這個問題啊
    發表于 06-23 07:19

    請問ubuntu20.04文件系統的右鍵是哪個軟件實現的呢

    我自己制作了一個ubuntu20.04文件系統,插上usb觸摸屏后點擊好用,但是長按右鍵不好用,我試了firefly提供的18.04的文件系統右鍵是好用的,請問是哪個軟件實現的呢?
    發表于 06-27 09:24

    【ROC-RK3568-PC開發板試用體驗】Ubuntu20.04桌面系統體驗升級與GCC安裝

    本視頻進行Ubuntu20.04桌面系統體驗并升級系統安裝GCC視頻
    發表于 09-04 23:26

    RK3128制作ubuntu文件系統相關案例分享

    1、rk3128制作ubuntu文件系統  制作文件系統很簡單,重要的是縷清思路。  制作過程有很多我就不贅述了程。  下面
    發表于 11-18 16:45

    RK3588S-PC的ubuntu20.04系統上運行ros報錯

    用官方的ubuntu20.04安裝ros 運行示例時出現如下問題,請問我該怎么解決
    發表于 12-30 14:35

    RK3399升級為ubuntu20.04后無法連接wifi怎么解決?

    問題描述及復現步驟:RK3399升級為ubuntu20.04后無法連接wifi,請問是什么原因呢,怎么解決還有,log日志我也不知道傳啥,瞎弄的一個文件
    發表于 01-10 15:05

    【飛騰派4G版免費試用】如何定制飛騰平臺的ubuntu rootfs 根文件系統(1)

    binfmt-support debootstrap 5 Ubuntu20.04文件系統制作 使用debootstrap 工具生成arm64 基礎rootfs包
    發表于 12-10 19:13

    FireflyRK3128主板Ubuntu文件系統創建

    創建 Ubuntu文件系統 使用 miniroot 來創建并引導系統
    的頭像 發表于 11-29 09:00 ?3732次閱讀
    FireflyRK3128主板<b class='flag-5'>Ubuntu</b> 根<b class='flag-5'>文件系統</b>創建

    Ubuntu20.04系統中使用用STM32F2107RCT6點亮一個二極管燈

    Ubuntu20.04系統中使用用STM32F2107RCT6點亮一個二極管燈
    發表于 12-05 14:51 ?8次下載
    <b class='flag-5'>Ubuntu20.04</b><b class='flag-5'>系統</b>中使用用STM32F2107RCT6點亮一個二極管燈

    【ROC-RK3568-PC開發板試用體驗】Ubuntu20.04桌面系統體驗升級與GCC安裝

    本文來源電子發燒友社區,作者:李先生, 帖子地址: https://bbs.elecfans.com/jishu_2303743_1_1.html 本視頻進行Ubuntu20.04桌面系統體驗 并升級系統 安裝GCC 體驗視頻詳
    的頭像 發表于 10-18 16:02 ?1775次閱讀

    【ROC-RK3568-PC開發板試用體驗】燒錄Ubuntu20.04系統

    ://www.t-firefly.com/doc/download/107.html下 固件-Ubuntu 網盤下下載 Ubuntu/Ubuntu20.04/ROC-RK3568-PC-UBU
    的頭像 發表于 10-19 10:08 ?6385次閱讀
    【ROC-RK3568-PC開發板試用體驗】燒錄<b class='flag-5'>Ubuntu20.04</b><b class='flag-5'>系統</b>

    ubuntu20.04安裝教程

    Ubuntu 20.04 的安裝步驟如下: 制作啟動U盤。首先下載Ubuntu 20.04的鏡像文件
    的頭像 發表于 11-13 16:59 ?3171次閱讀

    Ubuntu 20.04如何更改用戶名

    產品簡介本文適用于所有RK3568/RK3588平臺產品在Ubuntu20.04系統上如何更改用戶名,本文以IDO-EVB3588開發板為例,在ubuntu20.04系統上修改用戶名i
    的頭像 發表于 01-26 08:34 ?1168次閱讀
    <b class='flag-5'>Ubuntu</b> <b class='flag-5'>20.04</b>如何更改用戶名

    【北京迅為】iTOP-LS2K0500開發板快速使用編譯環境ubuntu20.04第一章加載迅為提供 Ubuntu20.04

    【北京迅為】iTOP-LS2K0500開發板快速使用編譯環境ubuntu20.04第一章加載迅為提供 Ubuntu20.04
    的頭像 發表于 09-18 16:43 ?747次閱讀
    【北京迅為】iTOP-LS2K0500開發板快速使用編譯環境<b class='flag-5'>ubuntu20.04</b>第一章加載迅為提供 <b class='flag-5'>Ubuntu20.04</b>

    Ubuntu20.04取消root賬號自動登錄的方法,觸覺智能RK3568開發板演示

    Ubuntu20.04默認情況下為root賬號自動登錄,本文介紹如何取消root賬號自動登錄,改為通過輸入賬號密碼登錄,使用觸覺智能EVB3568鴻蒙開發板演示
    的頭像 發表于 01-17 15:42 ?732次閱讀
    <b class='flag-5'>Ubuntu20.04</b>取消root賬號自動登錄的方法,觸覺智能RK3568開發板演示
    主站蜘蛛池模板: 免费的黄色片 | 天堂网中文在线 | 天天干夜啪 | 色综合天天综合网看在线影院 | 97夜夜操| 日韩在线视频一区二区三区 | 天天干天天操天天操 | 日本在线不卡免费 | aaa一级| 日本免费一区二区三区视频 | 午夜久久久 | 色多多在线观看播放 | 国产一区二区丁香婷婷 | 色婷婷视频 | 屁股趴过来欠打高h | 天天cao在线 | 天天干天天谢 | 午夜不卡在线 | 奇米影视欧美 | 亚洲三区视频 | 黄色日屁 | 欧美极品在线 | 国产精品夜夜春夜夜 | 手机在线看片福利盒子 | 新版天堂资源中文在线 | 天天干在线免费视频 | 午夜亚洲国产 | 天天干天天玩天天操 | 二级特黄绝大片免费视频大片 | 六月丁香啪啪六月激情 | 狂野欧美性猛交xxxx免费 | 午夜欧美| 最好看最新的中文字幕1 | 日本不卡在线一区二区三区视频 | 国产最新网站 | 性欧美1819| 欧美三级在线观看黄 | 激情开心婷婷 | 97久久伊人精品影院 | 五月婷婷激情在线 | 黄乱色伦短篇小说h |