This guide describes how to make Ubuntu rootfs to work on
Target Ubuntu OS Version: 20.04, 18.04
Target reference board: RZ/G2L, RZ/G2LC, RZ/G2UL SMARC
Host PC Environment: Ubuntu20.04
Run below command on Host Ubuntu PC
sudo apt-get install qemu-user-static
title | Select the package to download based on the desired file system |
---|
wget https://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.4-base-arm64.tar.gz or wget https://cdimage.ubuntu.com/ubuntu-base/releases/focal/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 |
evaluation board kit.
There are many steps to make the Ubuntu environment, but the following package includes shell scripts that make the process easy.
Notice
The Ubuntu environment created by using the scripts can be used only for evaluation purpose.
Ubuntu is a registered trademark of Canonical Ltd. Users need to follow Ubuntu IPR policy. For more information, please refer to Ubuntu "Intellectual property rights policy".
Target Ubuntu OS Version: 20.04, 18.04
Target reference board: RZ/G2L,/G2LC,/G2UL SMARC
Host PC Environment: Ubuntu20.04
Run below command on Host Ubuntu PC
sudo apt-get install qemu-user-static
Expand | ||
---|---|---|
| ||
|
In the following example, please replace "version" as below name as you need
|
|
|
|
|
Expand | |||
---|---|---|---|
| |||
mkdir root sudo tar -xpf ubuntu
sudo cp /usr/bin/qemu-aarch64-static ./root/usr/bin/ sudo cp -b /etc/resolv.conf root/etc/resolv.conf
|
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
Expand | ||
---|---|---|
| ||
$ mkdir ~/work $ cd ~/work $ mkdir root $ sudo tar -xpf ubuntu-base-<version>-base-arm64.tar.gz -C root $ sudo cp /usr/bin/qemu-aarch64-static ./root/usr/bin/ $ sudo cp -b /etc/resolv.conf root/etc/resolv.conf |
Expand | ||
---|---|---|
| ||
| ||
Expand | ||
| ||
|
$ chmod +x ch-mount.sh
$ ./ch-mount.sh -m root/chmod
# chmod -R 777 /tmp
# apt-get update
# apt-get install language-pack-en-base sudo ssh net-tools network-manager ethtool ifupdown isc-dhcp-client openssh-server iputils-ping rsyslog bash-completion htop resolvconf dialog vim
Expand | ||
---|---|---|
| ||
# useradd -s '/bin/bash' -m -G adm,sudo<name> passwd <name> passwd root chown -R<name> |
Expand | ||
---|---|---|
| ||
start on stopped rc or RUNLEVEL=[12345] stop on RUNLEVEL [!12345] respawn exec /sbin/getty -L 115200 ttyLP0 vt102 |
# echo "auto eth0" > /etc/network/interfaces.d/eth0
# echo "iface eth0 inet dhcp" >> /etc/network/interfaces.d/eth0
# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# echo "nameserver 8.8.4.4" >> /etc/resolv.conf
exit
./ch-mount.sh -u root/
sudo tar cjf rootfs.tar.bz2 root .
Prepare a SD card with ext4 partition: SD Card Loading and Booting
extract ubuntu rootfs package to SD card
sudo tar -xvf rootfs.tar.gz -C /media/xxx/rootfs
Expand | ||
---|---|---|
| ||
# apt-get install pkg-config | ||
Expand | ||
| ||
libpipewire-0.2-dev libdbus-1-dev libxcb-xkb-dev libdrm-dev automakesudo # pip3 install --user meson -i https://pypi.mirrors.ustc.edu.cn/simple/ |
Copy the Wayland 1.18.0 source code from VLP Yocto build folder to SD card.i.e. copy rootfs
As currently you are still in QEMU environment, you can open a new Terminal window to copy VLP source code to rootfs.
Run below command in new Terminal:
$ sudo cp ~YOUR_VLP_FOLDER/build/tmp/work/aarch64-poky-linux/wayland/1.18.0-r0/wayland-1.18.0/to
~/work/root/home/xxx/vlp_deploy/
Expand | ||
---|---|---|
| ||
# cd /root/home/xxx/vlp_deploy/wayland-1.18.0 | folder on SD card Run below command on Reference Board
export LD_LIBRARY_PATH=$WLD/lib/aarch64-linux-gnu\ --libdir=$WLD/lib/aarch64-linux-gnu --sysconfdir=/etc |
Copy the wayland-protocol1.20.0 source code from VLP Yocto build folder to SD card.i.e. copy rootfs
Run below command in new Terminal:
$ sudo cp ~YOUR_VLP_FOLDER/build/tmp/work/aarch64-poky-linux/wayland-protocols/1.20-r0/wayland-protocols-1.20/ ~/work/to
root/home/xxx/vlp_deploy/
Expand | ||
---|---|---|
| ||
# cd /root/home/xxx/vlp_deploy/wayland-protocols-1.20 | folder on SD card Run below command on Reference Boardsudo # make install |
Copy the weston8.0.0 source code from VLP Yocto build folder to SD card.i.e. copy rootfs.
Run below command in new Terminal:
$ sudo cp ~YOUR_VLP_FOLDER/build/tmp/work/aarch64-poky-linux/weston/8.0.0-r0/weston-8.0.0/to
~/home
work/root/home/xxx/vlp_deploy/
Expand | |||
---|---|---|---|
| |||
| folder on SD card Run below command on Reference Board
|
If the configuration is correct, it will display below messages
User defined options libdir : /usr/lib/aarch64-linux-gnu prefix : /usr sysconfdir : /etc backend-drm-screencast-vaapi : false color-management-colord : false remoting : false xwayland : false
Expand | ||
---|---|---|
| ||
sudo # ninja -C build/ sudo # ninja -C build/ install |
Please refer to the StartupGuide.txt document in meta-rz-features/recipes-graphics/mali/files/mali_pkg_eval_vx.x.tar.gz
Copy the driver mali_kbase.ko from VLP Yocto build folder to SD card.i.e. copy rootfs.
Run below command in new Terminal:
$ cp ~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/kernel-module-mali/rxx-p0/image/lib/modules/5.10.xx-cip1-yocto-standard/extra/mali_kbase.koto
~/work/root/home/xxx/vlp_deploy/modules
Copy the library files to SD card.i.e. copy rootfs.
Run below command in new Terminal:
$ cp ~YOUR_VLP_FOLDER/meta-rz-features/meta-rz-graphics/recipes-graphics/mali/files/mali_um_eval_vx.x.x.tar.gzto
~/work/root/home/xxx/vlp_deploy/
Expandinstall library to reference board |
Expand | |||
---|---|---|---|
| |||
# cd /home/xxx/vlp_deploy/tar -xf mali_ um_eval_vx.x.x.tar.gzsudo # cp -r mali_um/usr/lib/* /usr/lib/aarch64-linux-gnu/sudo # cp -r /usr/lib/aarch64-linux-gnu/CL_GLES/mali_wayland/ /usr/lib/aarch64-linux-gnu/ |
sudo apt install glmark2-es2-wayland
Only root user can launch weston service, please switch to root user in advance
Please connect a USB mouse before starting weston
insmod mali_kbase.ko
export XDG_RUNTIME_DIR=/usr/lib/
export RUNLEVEL=3
weston --tty 1 &
Run glmark2 test
glmark2-es2-wayland --fullscreen
|
|
---|---|
|
In this section, we will copy codec related files from original VLP Yocto build.
i.e. core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2
Pleaes copy this .bz2 file to Ubuntu SD card and run below instruction on reference board
unzip core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2 to folder "yocto"
copy codec drivers |
|
In this section, we will copy codec related files from original VLP Yocto build.
Run below command in new Terminal:
copy codec drivers |
$ sudo cp ~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/lib/modules/5.10.201-cip41-yocto-standard/extra/* \ |
copy gstreamer related lib |
$ sudo cp -rd ~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/bin/gst-* ~/work/root/usr/bin/ |
/usr/lib/aarch64-linux-gnu/ |
~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/lib64/libmmngr* ~/work/root/usr/lib/aarch64-linux-gnu/ |
~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/lib64/libvspm.so.1* ~/work/root/usr/lib/aarch64-linux-gnu/ |
~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/libexec/gstreamer-1.0/ ~/work/root/usr/lib/aarch64-linux-gnu/ |
~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/share/ |
gstreamer-1.0/ ~/work/root/usr/share/ |
replace "lib64" as "lib/aarch64-linux-gnu"
[omxh264dec] type-name=GstOMXH264Dec core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so component-name=OMX.RENESAS.VIDEO.DECODER.H264 ····· [omxh264enc] type-name=GstOMXH264Enc core-name=~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/share/gst-plugins-base/ ~/work/root/usr/share/ |
install gstreamer dependency |
apt install gstreamer1.0-libav gstreamer1.0-plugins-bad |
login as root and insmod drivers |
insmod /home/xxx/vlp_deploy/modules/mali_kbase.ko insmod /home/xxx/vlp_deploy/modules/mmngr.ko insmod /home/xxx/vlp_deploy/modules/mmngrbuf.ko insmod /home/xxx/vlp_deploy/modules/uvcs_drv.ko insmod /home/xxx/vlp_deploy/modules/vspm.ko insmod /home/xxx/vlp_deploy/modules/vspm_if.ko |
Specify gstreamer location |
export GST_PLUGIN_SCANNER=/usr/lib/aarch64-linux-gnu/gstreamer-1.0/gst-plugin-scanner export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0 |
Launch weston |
weston –tty 1 & |
|
modify omx plugin configuration |
sudo vi ~/work/root/etc/xdg/gstomx.conf replace "lib64" as "lib/aarch64-linux-gnu" [omxh264dec]
type-name=GstOMXH264Dec
core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so
component-name=OMX.RENESAS.VIDEO.DECODER.H264
·····
[omxh264enc]
type-name=GstOMXH264Enc
core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so
component-name=OMX.RENESAS.VIDEO.ENCODER.H264
···· |
gst-launch-1.0 filesrc location=/root/video/sintel_trailer-720p.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! waylandsink
You can port Qt by following 3 methods
In this section, we will copy Qt5.6.3 related files from original VLP Yocto build.
i.e. core-image-qt-smarc-rzg2l.tar.bz2
Pleaes copy this .bz2 file to Ubuntu SD card and run below instruction on reference board
unzip core-image-qt-smarc-rzg2l.tar.bz2 to folder "yocto"
Run below command in new Terminal:
(For other version of Qt, you can modify Yocto meta-qt5\recipes-qt\qt5, please inqury Qt company for higher version QT integration)
Copy Qt lib |
$ sudo cp -rd ~YOUR_VLP_FOLDER/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs/usr/share/qt5 ~/work/root/usr/share/ |
export QT_QPA_PLATFORM=wayland
export QT_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/plugins/
Start Weston Start Weston desktop
Then run the Qt example in /usr/share/qt5/examples
You can download qt5 source to reference board and compile on board.
Or cross compile qt5 on PC
Or compile qt5 in PC QEMU
Here we compile qt5 on board
Collapsecompile qt5 |
download qt5 source code by git (ignore) mkdir qt5-build cd qt5-build make make install (rsync to SD) |
We suggest to compile the qt5 with scrips
Notes: About the flags parameter in configure of Qt5. -qpa should be set as wayland or wayland-egl. We didn't support xcomposite-egl option
apt-get install qt5-default qtwayland5
make make install (rsync to SD) |
We suggest to compile the qt5 with scrips
Notes: About the flags parameter in configure of Qt5. -qpa should be set as wayland or wayland-egl. We didn't support xcomposite-egl option
apt-get install qt5-default qtwayland5
Notes: The above installation commands can only run part of Qt functions. If you need more functions, you need to continue installing Qt related packages.
exit
./ch-mount.sh -u root/
sudo tar cjf rootfs.tar.bz2 root .
Prepare a SD card with ext4 partition: SD Card Loading and Booting
extract ubuntu rootfs package to SD card
sudo tar -xvf rootfs.tar.gz -C /media/xxx/rootfs
Only root user can launch weston service, please switch to root user in advance
Please connect a USB mouse before starting weston
insmod mali_kbase.ko
export XDG_RUNTIME_DIR=/usr/lib/
export RUNLEVEL=3
weston --tty 1 &
Run glmark2 test
glmark2-es2-wayland --fullscreen
|
|
---|---|
|
login as root and insmod drivers |
insmod /home/xxx/vlp_deploy/modules/mali_kbase.ko insmod /home/xxx/vlp_deploy/modules/mmngr.ko insmod /home/xxx/vlp_deploy/modules/mmngrbuf.ko insmod /home/xxx/vlp_deploy/modules/uvcs_drv.ko insmod /home/xxx/vlp_deploy/modules/vspm.ko insmod /home/xxx/vlp_deploy/modules/vspm_if.ko |
Specify gstreamer location |
export GST_PLUGIN_SCANNER=/usr/lib/aarch64-linux-gnu/gstreamer-1.0/gst-plugin-scanner export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0 |
Launch weston |
weston –tty 1 & |
Play Video |
gst-launch-1.0 filesrc location=/root/video/sintel_trailer-720p.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! waylandsink
gst-launch-1.0 filesrc location=/root/video/sintel_trailer-720p.mp4 ! qtdemux name=d d. ! queue ! h264parse ! omxh264dec ! waylandsink d. ! queue ! faad ! alsasink device=plughw:0,0 |
Start Weston Start Weston desktop
export QT_QPA_PLATFORM=wayland
export QT_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/plugins/
Then run the Qt example in /usr/share/qt5/examplesNotes: The above installation commands can only run part of Qt functions. If you need more functions, you need to continue installing Qt related packages.
This section introduce how to develop Qt application on PC.
bitbake core-image-qt -c populate_sdk
The generated installation file is located at:
build/tmp/deploy/sdk/poky-glibc-x86_64-core-image-qtaarch64-smarc-rzg2l-toolchain-3.1.14.sh
Install this SDK to PC, default folder is /opt/poky/3.1.14
setup SDK runtime environment
source /opt/poky/3.1.14/environment-setup-aarch64-poky-linux
Add Device | |
---|---|
Add new Kit | |
Add Qt version | |
Add compiler | |
Add debuggers | |
Select kit to build Qt project | |
example to run qt calculator project |
Table of Contents |
---|