RZ-G/RZ-G2 BSP Porting Ubuntu: Difference between revisions
Line 91: | Line 91: | ||
==== Enter Filesystem==== | ==== Enter Filesystem==== | ||
chmod +x ch-mount.sh | |||
./ch-mount.sh -m root/ | |||
chmod -R 777 /tmp | |||
====Install required software==== | ====Install required software==== |
Revision as of 08:29, 22 May 2023
← Back to RZ-G/RZ-G2_BSP_Porting
SoC: All
Specification
Target Ubuntu OS Version: 20.04, 18.04
Target reference board: RZ/G2L,/G2LC,/G2UL SMARC
Host PC Environment: Ubuntu20.04
Ubuntu Filesystem Building
Install QEMU
Run below command on Host Ubuntu PC
sudo apt-get install qemu-user-static
Download Required Files
Select the package to download based on the desired file system |
wget https://cdimage.ubuntu.com/ubuntubase/releases/20.04/release/ubuntu-base-20.04.4-base-arm64.tar.gz
wget http://cdimage.ubuntu.com/ubuntubase/releases/18.04.5/release/ubuntu-base-18.04.5-basearm64.tar.gz |
Prepare Files
In the following example, please replace "version" as below name as you need
ubuntu-base-20.04.4-base-arm64: 20.04.4
ubuntu-base-18.04.5-base-arm64: 18.04.5
Initial preparation |
mkdir root
tar -xpf ubuntu-base-<version>-base-arm64.tar.gz -C root cp /usr/bin/qemu-aarch64-static ./root/usr/bin/ cp -b /etc/resolv.conf root/etc/resolv.conf |
Create a new script file |
vim ch-mount.sh
#!/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 chroot ${2} } function umnt() { echo "UNMOUNTING" sudo umount ${2}proc sudo umount ${2}sys 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 |
Configure Filesystem
Enter Filesystem
chmod +x ch-mount.sh
./ch-mount.sh -m root/
chmod -R 777 /tmp