清空記錄
歷史記錄
取消
清空記錄
歷史記錄
本文適用于SSD20X移植Ubuntu系統(tǒng)。
IDO-SOM2D0X基于SigmaStar SSD201/202 SoC的超小SOM模組,雙核A7 1.2GHz主頻,1080P視頻解碼,支持MIPI/RGB顯示接口,支持雙以太網(wǎng),支持SDIO/USB/SPI/I2C/UART/DMIC/I2S,集成音頻Codec,支持麥克風(fēng)陣列;模組集成了WIFI和NAND Flash;支持Linux系統(tǒng);高性能,低成本;批量供貨保障,主要應(yīng)用于智能樓宇室內(nèi)機(jī),智能家居中控,86盒家庭中控,電梯樓層顯示器,IP網(wǎng)絡(luò)廣播設(shè)備等。
核心板在小而精致的空間上集成了SPI Flash/WIFI芯片,RTC電路,SSD201/202全部功能引腳引出,只需輕松擴(kuò)展底板接口,省心又省力。
獲取資源
下載Ubuntu base arm 根文件系統(tǒng):
http://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/
這里我們選硬浮點(diǎn)。
將下載好的ubuntu-base-20.04.1-base-armhf.tar.gz,拷貝至虛擬機(jī)并解壓。
安裝qemu-user-static工具
這里我們提前修改配置,為后邊安裝工具做準(zhǔn)備
修改tmp目錄權(quán)限為 777,在apt update的時(shí)候會(huì)在tmp目錄下創(chuàng)建一些臨時(shí)文件,所以要給tmp目錄寫(xiě)權(quán)限
#chmod 777 ssd20x/ubuntu_base/tmp
修改resolv.conf文件,添加dns
#vim ssd20x/ubuntu_base/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
將base文件系統(tǒng)掛載到虛擬機(jī)下
編寫(xiě)掛載腳本
在解壓目錄的上一級(jí)目錄下新建一個(gè)ms.sh文件,文件內(nèi)容如下,并賦予文件777的權(quán)限
#!/bin/bash
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 -o bind /dev/pts ${2}dev/pts
sudo chroot ${2}
}
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
echo "mnt -m pwd"
elif [ "$1" = "-u" ] && [ -n "$2" ];
then
umnt $1 $2
echo "mnt -u pwd"
else
echo ""
echo "Either 1'st, 2'nd or bothparameters were missing"
echo ""
echo "1'st parameter can be one ofthese: -m(mount) OR -u(umount)"
echo "2'nd parameter is the full pathof rootfs directory(with trailing '/')"
echo ""
echo "For example: ch-mount -m/media/sdcard/"
echo ""
echo 1st parameter : ${1}
echo 2nd parameter : ${2}
fi
掛載
sudo ./ms.sh -m home/xxxx/ssd20x/ubuntu_base/
卸載
sudo ./ms.sh -u home/xxxx/ssd20x/ubuntu_base/
模擬root也可以使用chroot命令替代
安裝軟件
掛載后即可進(jìn)入該系統(tǒng),為系統(tǒng)安裝軟件。
apt update
apt install usbutils
apt install sudo
apt install language-pack-en-base
apt install ssh
apt install net-tools
apt install ethtool
apt install ifupdown
apt install iputils-ping
apt install rsyslog
apt install htop
apt install vi
apt install dhcpcd5
apt install samba samba-common
apt install wpasupplicant
apt install jq
apt install alsa-base
apt install minicom
用戶(hù)配置
設(shè)置用戶(hù)密碼
passwd root
設(shè)置主機(jī)名稱(chēng)
echo "industio" > /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "127.0.1.1 industio" >> /etc/hosts
配置串口
需要安裝ssh后才有/lib/systemd/system/getty@.service:
vi /lib/systemd/system/getty@.service
修改為ttyS0:
串口問(wèn)題導(dǎo)致:進(jìn)入系統(tǒng)無(wú)法調(diào)試
報(bào)以下錯(cuò)誤
[ TIME ] Timed out waiting for device dev-ttyS0.device. [DEPEND] Dependency failed for Serial Getty on ttyS0.
https://dev.t-firefly.com/thread-4903-1-4.html
解決辦法參考以上鏈接
# cp /lib/systemd/system/serial-getty\@.service /lib/systemd/system/serial-getty\@ttyS0.service
# ln -s /lib/systemd/system/serial-getty\@ttyS0.service /etc/systemd/system/getty.target.wants/
到此輸入 exit 退出掛載界面,并卸載文件系統(tǒng)
sudo ./ms.sh -u home/xxxx/ssd20x/ubuntu_base/
壓縮文件系統(tǒng):
cd ubuntu_base/
sudo tar -cvf rootfs.tar ./*
將文件系統(tǒng)打包并掛載到SD卡:
#vi make_sd_rootfs.sh
#!/bin/sh
PWD=$(pwd)
images_dir=${PWD}/images_for_mksdcard
if [ "$1" == "" ]; then
echo "!!!!!!!!!!!! ./make_sd_rootfs.sh /dev/sdb !!!!!!!!!!!"
exit 0
fi
sfdisk ${1}
mkfs.ext3 -F -j ${1}1
mkdir tmp_rootfs
mount -t ext3 ${1}1 tmp_rootfs
tar -xvf ./rootfs.tar -C tmp_rootfs
umount tmp_rootfs
rm -rf tmp_rootfs
把SD卡接入到ubuntu中,首先要把SD umount掉,再執(zhí)行:
#這里根據(jù)你的掛載路徑來(lái)
umount /media/xxxx/xxxx
sudo ./make_sd_rootfs.sh /dev/sdb