国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

基于訊為RK3588平臺搭建Ubuntu20.04.5根文件系統(tǒng)

這篇具有很好參考價值的文章主要介紹了基于訊為RK3588平臺搭建Ubuntu20.04.5根文件系統(tǒng)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

準備工作

在搭建系統(tǒng)之前,需要詳細閱讀訊為公司提供的一些資料(雖然他們家資料一直都做的不完善),搭建好用于開發(fā)的Ubuntu虛擬機環(huán)境,熟練使用一些常用工具如燒錄系統(tǒng)的工具RKDevTool、傳輸文件的工具FileZilla、遠程連接工具MobaXterm等等。當然,本章只針對根文件系統(tǒng),uboot、kernel的鏡像文件和驅(qū)動文件需要提前準備好,編譯訊為提供的Rockchip的SDK即可得到這些文件。

最小Ubuntu根文件系統(tǒng)

Ubuntu在鏡像網(wǎng)站Index of / (ubuntu.com)提供了各種版本的鏡像文件,我們從下面的連接下載最小系統(tǒng),之后繼續(xù)安裝桌面軟件包,進行一系列的配置就可以獲得我們需要的系統(tǒng)。

ubuntu-base-20.04.1-base-arm64.tar.gz

先尋找一個空白的文件夾放置ubuntu-base-20.04.1-base-arm64.tar.gz,然后以root權(quán)限建立一個文件夾,將根文件系統(tǒng)解壓到這個文件夾中。

sudo mkdir ubuntu-rootfs
sudo tar -xvpf ubuntu-base-20.04.5-base-arm64.tar.gz -C ubuntu-rootfs

接下來在Ubuntu虛擬機上模擬運行arm64架構(gòu)的最小文件系統(tǒng),為此需要安裝qemu-user-static。

sudo apt-get install qemu-user-static
# 適用于arm 32位架構(gòu)
sudo cp /usr/bin/qemu-arm-static ubuntu-rootfs/usr/bin/
# 適用于aarch64即arm64架構(gòu)
sudo cp /usr/bin/qemu-aarch64-static ubuntu-rootfs/usr/bin/

為了連接網(wǎng)絡,需要拷貝resolv.conf文件以及配置國內(nèi)的鏡像源。

# 拷貝文件
sudo cp -b /etc/resolv.conf ubuntu-rootfs/etc/resolv.conf
# 修改鏡像源
sudo gedit ubuntu-rootfs/etc/apt/sources.list

下面是阿里云鏡像源,可以直接復制內(nèi)容覆蓋源鏡像列表文件。

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu-ports/ focal main restricted
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates main restricted
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-updates main restricted

## 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://mirrors.aliyun.com/ubuntu-ports/ focal universe
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal universe
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu-ports/ focal multiverse
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-updates multiverse
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-updates multiverse

## 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://mirrors.aliyun.com/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security main restricted
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-security main restricted
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security universe
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-security universe
deb http://mirrors.aliyun.com/ubuntu-ports/ focal-security multiverse
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-security multiverse

編寫一個掛載腳本mount.sh,方便進入和退出arm64的文件系統(tǒng)

#!/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 mount -t devpts -o gid=5,mode=620 devpts ${2}dev/pts
  sudo mount -o bind /dev/pts ${2}dev/pts
  sudo chroot ${2}
}
function umnt() {
  echo "UNMOUNTING"
  sudo umount ${2}proc
  sudo umount ${2}sys
  sudo umount ${2}dev/pts
  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

更新與安裝

進入arm64的根文件系統(tǒng)后,終端將只能操作arm64的根文件系統(tǒng),通過exit命令退出并返回Ubuntu虛擬機的終端。

# 進入arm64的根文件系統(tǒng)
./mount.sh -m ubuntu-rootfs/

更新并升級根文件系統(tǒng)。

apt update
apt upgrade

安裝一些必要的軟件,如vim、sudo、網(wǎng)絡管理、藍牙管理等等。

apt install apt-utils dialog
apt install vim sudo
apt install bash-completion 
apt install net-tools iputils-ping ifupdown ethtool
apt install wireless-tools network-manager
apt install ssh rsync udev htop rsyslog
apt install bluetooth* bluez* blueman*
# 可裝可不裝
apt install curl
apt install openssh-server
apt install git
apt install ffmpeg

配置系統(tǒng)的時區(qū)、文字編碼。

apt install locales tzdata
# 時區(qū)選擇
# Asia/Shanghai
dpkg-reconfigure locales
# 勾選英文和中文環(huán)境
# en_US.UTF-8 UTF-8
# zh_CN.UTF-8 UTF-8

安裝圖形環(huán)境,依賴非常多,占用空間3G多。

apt install ubuntu-desktop

開機默認切換到圖形界面。

systemctl set-default graphical.target

Network-Manager服務會自動配置網(wǎng)卡,但是其默認配置文件將Ethernet加入了黑名單,以至于Ubuntu提示unmanned。

vi /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
# 文件內(nèi)容改為如下內(nèi)容
[keyfile]
unmanaged-devices=*,except:type:ethernet,except:type:wifi,except:type:gsm,except:type:cdma

設置主機名,增加用戶,修改賬戶密碼。

# 主機名
echo "RK3588" > /etc/hostname
# 主機IP地址
echo "127.0.0.1 localhost RK3588" > /etc/hosts
# 添加用戶
useradd -s '/bin/bash' -m -G adm,sudo user
# 設置密碼
passwd user
passwd root

安裝中英文語言包和中文輸入法。

# 英文環(huán)境
apt install language-pack-en-base 
apt install language-pack-gnome-en-base 

# 中文環(huán)境
apt install language-pack-zh-hans-base 
apt install language-pack-gnome-zh-hans-base

# 中文輸入法
apt install ibus-table-wubi ibus-pinyin ibus-sunpinyin

服務配置

桌面環(huán)境需要的包已經(jīng)基本安裝完成,接下來需要一些別的配置。

Ubuntu根文件系統(tǒng)打包成鏡像并燒錄到emmc后,所占分區(qū)大小和鏡像的大小一樣,為了充分利用emmc的空間,需要在第一次運行時擴充分區(qū)大小。根據(jù)parameter.txt中rootfs分區(qū)對應的名稱配置, 默認是對/dev/mmcblk0p6分區(qū)進行擴充。創(chuàng)建一個腳本和服務來擴充分區(qū)。

vi etc/init.d/firstboot.sh
# 以下是firstboot.sh的內(nèi)容
#!/bin/bash -e
# first boot configure
# resize filesystem mmcblk0p6
if [ ! -e "/usr/local/first_boot_flag" ] ;
then
  echo "Resizing /dev/mmcblk0p6..."
  resize2fs /dev/mmcblk0p6
  touch /usr/local/first_boot_flag
fi

添加運行權(quán)限。

chmod +x etc/init.d/firstboot.sh
vi lib/systemd/system/firstboot.service
# 以下是firstboot.service的內(nèi)容
#start
[Unit]
Description=Setup rockchip platform environment
Before=lightdm.service
After=resize-helper.service
[Service]
Type=simple
ExecStart=/etc/init.d/firstboot.sh
[Install]
WantedBy=multi-user.target
#end

啟動firstboot.service服務。

systemctl enable firstboot.service

啟用ssh的root帳號登錄。

vi /etc/ssh/sshd_config
# 將下面這項設置成yes
PermitRootLogin yes

Ubuntu默認不能用root登錄界面,可以配置啟用以root登錄界面。

vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
# 添加下面的內(nèi)容
greeter-show-manual-login=true
all-guest=false

vi /etc/pam.d/gdm-autologin
# 注釋掉下面這行
#auth   required        pam_succeed_if.so user != root quiet_success

vi /etc/pam.d/gdm-password
# 注釋掉下面這行
#auth   required        pam_succeed_if.so user != root quiet_success

vi /root/.profile
# 添加下面的內(nèi)容,替換掉 mesg n || true 這一行
tty -s && mesg n || true

可以設置界面的自動登錄。

vi /etc/gdm3/custom.conf
# 添加下面的內(nèi)容,user即賬戶名
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=user
TimedLoginEnable=true
TimedLogin=user
TimedLoginDelay=10

為方便在沒有網(wǎng)絡的時候調(diào)試,設置通過串口登錄root。

vi /lib/systemd/system/serial-getty\@.service
# 替換ExecStart這行
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM

打包鏡像

退出arm64文件系統(tǒng)環(huán)境,回到宿主機環(huán)境,卸載掛載的目錄

# 退出arm64的根文件系統(tǒng)
exit
# 卸載掛載的目錄
./mount.sh -u ubuntu-rootfs/

訊為RK3588平臺采用RTL8723du這款wifi和Bluetooth二合一基于USB總線的無線設備,其驅(qū)動被編譯成了模塊,需要安裝這些模塊才能啟用無線和藍牙,其中藍牙還需要RTL官方的固件。這些文件可以在編譯Debian后的輸出目錄的中(/lib/firmware)找到,需要將這些文件拷貝到我們的根文件系統(tǒng)中。8723du.ko是wifi的驅(qū)動,rtk_btusb.ko是藍牙的驅(qū)動。

# copy 8723du.ko to ubuntu-rootfs/lib/modules/5.10.66
# copy rtk_btusb.ko to ubuntu-rootfs/lib/modules/5.10.66
# copy rtl8723du_config rtl8723du_fw to /lib/firmware
# Linux會自動安裝modprobe安裝過的驅(qū)動
# depmod也許會提示缺少modules.order modules.builtin文件,這些文件是編譯內(nèi)核后生成的,同樣復制到ubuntu-rootfs/lib/modules/5.10.66即可
depmod
modprobe 8723du.ko
modprobe rtk_btusb.ko

制作鏡像腳本,空間分配6G

vi mkimage.sh
# mkimage.sh內(nèi)容如下
#!/bin/bash
rootfs_dir=$1
rootfs_file=$2
rootfs_mnt="mnt"
if [ ! $rootfs_dir ] || [ ! $rootfs_file ];
then
  echo "Folder or target is empty."
  exit 0
fi
if [ -f "$rootfs_file" ]; then
  echo "-- Delete exist $rootfs_file ..."
  rm -f "$rootfs_file"
fi
echo "-- Create $rootfs_file ..."
dd if=/dev/zero of="$rootfs_file" bs=1M count=6144
sudo mkfs.ext4 -F -L linuxroot "$rootfs_file"
if [ ! -d "$rootfs_mnt" ]; then
  mkdir $rootfs_mnt
fi
echo "-- Copy data to $rootfs_file ..."
sudo mount $rootfs_file $rootfs_mnt
sudo cp -rfp $rootfs_dir/* $rootfs_mnt
sudo sync
sudo umount $rootfs_mnt
rm -r $rootfs_mnt
echo "-- Resize $rootfs_file ..."
/sbin/e2fsck -p -f "$rootfs_file"
/sbin/resize2fs -M "$rootfs_file"
echo "-- Done."

制作鏡像,制作完成后即可進行燒錄。

./mkimage.sh ubuntu-rootfs rootfs.img

待解決的問題

1)Ubuntu選擇語言的界面為空,選擇輸入法的界面為空,原因未知。

rk3588 rtl8723du,RK3588學習筆記,ubuntu,linux,arm開發(fā),Powered by 金山文檔
rk3588 rtl8723du,RK3588學習筆記,ubuntu,linux,arm開發(fā),Powered by 金山文檔

2)firefly的Ubuntu鏡像優(yōu)化的很不錯,用wayland替代了XServer,界面非常流暢,但是運行在非firefly的設備上,會在開機顯示logo時提示 This's not a firefly's product。文章來源地址http://www.zghlxwxcb.cn/news/detail-781730.html

到了這里,關于基于訊為RK3588平臺搭建Ubuntu20.04.5根文件系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • Gazebo——仿真平臺搭建(基于Ubuntu20.04)
                    
            
1.gazebo--SpawnModel: Failure - model name mrobot already exists.

    Gazebo——仿真平臺搭建(基于Ubuntu20.04) 1.gazebo--SpawnModel: Failure - model name mrobot already exists.

    目錄 Gazebo安裝配置 創(chuàng)建仿真環(huán)境? 仿真使用 Rviz查看攝像頭采集的信息 Kinect仿真 問題解決: 1.gazebo--SpawnModel: Failure - model name mrobot already exists. 1.設置你的電腦來接收軟件 2.設置秘鑰 3.安裝Gazebo 4.檢查你的安裝是否有效果= 5.打開 /.gazebo文件夾 下載模型 如果出現(xiàn)fatal連接GitH

    2023年04月19日
    瀏覽(68)
  • Ubuntu20.04 搭建W版本OpenStack平臺

    Ubuntu20.04 搭建W版本OpenStack平臺

    目錄 一、基礎環(huán)境配置 1.controller、compute配置網(wǎng)卡地址 2.配置域名解析 3.NTP時間同步 二、添加OpenStack-wallaby軟件包及基本環(huán)境 1、OpenStack 服務的所有節(jié)點上添加軟件包 2、Mysql數(shù)據(jù)庫 3、Rabbitmq消息隊列 4、Memcached 5、etcd環(huán)境部署 三、keystone服務 四、glance鏡像服務 五、Placement環(huán)

    2024年02月15日
    瀏覽(25)
  • Ubuntu20.04搭建PX4仿真環(huán)境及XTDrone開發(fā)平臺(最詳細最明白)

    Ubuntu20.04搭建PX4仿真環(huán)境及XTDrone開發(fā)平臺(最詳細最明白)

    PX4-Autopilot仿真平臺是由PX4官方提供的集虛擬px4固件、真機燒錄固件、gazebo環(huán)境及模型于一體的平臺,用戶可以自己編寫程序,通過mavros接口與虛擬px4固件進行mavlink協(xié)議的通訊,并在gazebo中顯示虛擬世界和模型。因此PX官方手冊里給了一個經(jīng)典的例程:offboard.cpp和offboard.py,讓

    2024年02月04日
    瀏覽(96)
  • Rockchip平臺rk3588源碼下載編譯(基于Android13)

    Rockchip平臺rk3588源碼下載編譯(基于Android13)

    下載地址 服務器鏡像下載 需要向RK申請SDK使用權(quán)限。 由于AOSP使用的repo管理源碼倉庫,所以為了方便開發(fā)者獲取repo工具,RK也提供了repo工具的下載 本文介紹了如何使用Markdown撰寫一篇關于搭建自己的repo代碼服務器的文章。以下是詳細的步驟和指導。 環(huán)境準備 在開始之前,

    2024年02月03日
    瀏覽(88)
  • 基于Ubuntu20.04創(chuàng)建共享文件夾

    提示:文章寫完后,目錄可以自動生成,如何生成可參考右邊的幫助文檔 文章目錄 前言——什么是共享文件夾? 一、怎么創(chuàng)建共享文件夾 1.window設置 2.虛擬機設置 總結(jié) Ubuntu系統(tǒng)是安裝在 VMware 虛擬機中的,兩者之間經(jīng)常要互傳文件。 所以需要共享文件夾,所謂共享文件夾

    2024年02月08日
    瀏覽(33)
  • Re.從零開始--基于UbuntuServer 20.04-OpenStack平臺搭建_

    Re.從零開始--基于UbuntuServer 20.04-OpenStack平臺搭建_

    前言: 本文檔基于ubuntu-server20.04版本和OpenStack Victoria搭建openstack環(huán)境 部署最小化Ubuntu-openstack滿足基本服務;本文檔均采用手動環(huán)境搭建 ubuntu源指定為阿里源,故搭環(huán)境需連接外網(wǎng); ens33 ens34 節(jié)點名稱 Ubuntu-controller 192.168.100.10 192.168.200.10 controller Ubuntu-compute 192.168.100.20 192.

    2024年01月20日
    瀏覽(37)
  • 制作RK3568 ubuntu20.04桌面版鏡像

    制作RK3568 ubuntu20.04桌面版鏡像

    主控: RK3568 編譯主機: Ubuntu 20.04 AMD64 目標版本: Ubuntu 20.04 ???? RK3568 是極具性價比的高能國產(chǎn)“芯“ , 是Rockchip面向與AIOT和工業(yè)市場打造的一款高性能、低功耗、功能豐富的國產(chǎn)化應用處理器。采用四核64位Cortex-A55架構(gòu),主頻高達2.0GHz,集成Rockchip自研NPU, 1TOPS算力,滿足輕

    2024年02月19日
    瀏覽(28)
  • 【RK3399】2.制作ubuntu20.04 roomfs

    firefly自帶的文件系統(tǒng),由于缺少一些基本功能模塊,因此,我們可以自己手動制作一個ubuntu20.04的文件系統(tǒng)。 http://cdimage.ubuntu.com/ubuntu-base/releases/ 復制一下虛擬機的運行環(huán)境 將開發(fā)板掛載到虛擬機上,將開發(fā)板的/vendor,/system,/lib/firmware,這三個文件夾復制到我們自己的文件

    2024年02月01日
    瀏覽(35)
  • RK3588平臺開發(fā)系列講解(項目篇)基于yolov5的物體識別

    RK3588平臺開發(fā)系列講解(項目篇)基于yolov5的物體識別

    平臺 內(nèi)核版本 安卓版本 RK3588 Linux 5.10 Android 12 沉淀、分享、成長,讓自己和他人都能有所收獲!?? ?? 本篇將給大家介紹,如

    2024年02月06日
    瀏覽(21)
  • 基于Ubuntu20.04搭建OpenHarmony v3.0.6的qemu仿真環(huán)境

    基于Ubuntu20.04搭建OpenHarmony v3.0.6的qemu仿真環(huán)境

    出于個人興趣,也出于對國產(chǎn)操作系統(tǒng)的好奇,想嘗試一下以LiteOS為內(nèi)核的Openharmony。但過程相當不順利,主要原因是官方文檔內(nèi)容組織的不敢恭維。挺好的東西,不把說明書寫好,讓用戶怎么用?我研究的核心問題就一個:如何在基于Qemu仿真的Openharmony中輸出一個hello worl

    2024年02月09日
    瀏覽(33)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包