Setting Up Your Development Environment for Renesas Remi Pi
The development process is based on an Ubuntu system and requires specific hardware, software tools, and resources. Below is what you need to prepare:
1. Development Host Requirements
To build the SDK and work efficiently, your host machine should have:
- CPU: At least a dual-core processor
- Memory: 8 GB or more
- Storage: 100 GB or more
- Platform:
- A PC or server running Linux
- Or a Linux virtual machine (VM)
- Or WSL2 on Windows
2. Operating System
- Recommended: Ubuntu 22.04 (64-bit desktop)
- Other options: Fedora, OpenSUSE, Debian, RHEL, CentOS
3. Required Packages
- Install the basic packages listed in the Remi Pi Linux Software Development Guide.
- Only one package is needed for the initial setup.
By following these steps, you’ll be ready to set up the development environment for the Renesas Remi Pi platform (based on RZ/G processors like the G2L with dual ARM Cortex-A53 cores) and start development and debugging quickly.
Run the following command before start porting Ubuntu:
sudo apt-get update
sudo apt-get install qemu-user-static Porting Ubuntu 22.04 File System
1. What is Ubuntu-base?
- Ubuntu-base is the minimal Ubuntu file system, just a few MB in size, but backed by the full Ubuntu software repository.
- It includes the Debian package manager, making it easy to install additional software via
apt-get. - Ideal for embedded systems because it supports deep customization and stability.
2. Why Use Ubuntu-base?
- Other methods for building embedded file systems include BusyBox, Yocto, and Buildroot.
- Ubuntu stands out for its:
- Powerful package management system
- Strong community support
- Ability to install software easily with
apt-get install
- Supports multiple architectures: ARM, x86, PowerPC, etc.
- This guide focuses on ARM-based systems.
3. Getting the Source Code
You have two options:
- From MYIR’s disk image: Download the zip file from the
04-sourcesfolder. - From Ubuntu official sources: Use
wgetto fetch the source code.
Choose the method that fits your needs before starting the build process.
Download From Ubuntu official sources
Procedure Details
- Download Ubuntu-base
sudo wget https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04-base-arm64.tar.gz - Create a rootfs folder and extract the archive\ (Adjust paths and folder names as needed)
mkdir rootfs tar -xf ubuntu-base-22.04.1-base-arm64.tar.gz -C rootfs/ - Check the extracted folder structure
tree -d -L 1 rootfs
Expected structure:
ubuntu_rootfs ├── bin -> usr/bin ├── boot ├── dev ├── etc ├── home ├── lib -> usr/lib ├── media ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin -> usr/sbin ├── snap ├── srv ├── sys ├── tmp ├── usr └── var
Preparing the chroot Environment
Install the Emulator
cp /usr/bin/qemu-aarch64-static ./rootfs/usr/bin/
If qemu-user-static is not installed:
sudo apt install qemu-user-static
Copy DNS Configuration
cp /etc/resolv.conf ./rootfs/etc/resolv.conf
Creating a Mount Script
- Create the script file and make it executable
vi ch-mount.sh
Add the following content:
#!/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 -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 1st, 2nd or both parameters were missing"
echo ""
echo "1st parameter: -m (mount) OR -u (umount)"
echo "2nd parameter: full path of rootfs directory (with trailing '/')"
echo ""
echo "Example: ch-mount -m /media/sdcard/"
echo ""
echo "1st parameter: ${1}"
echo "2nd parameter: ${2}"
fi
Change permissions:
chmod 777 ch-mount.sh
Mounting the Ubuntu Filesystem
./ch-mount.sh -m ./rootfs/
Expected output:
MOUNTING root@system1:/# ls bin boot dev etc home lib media mnt opt proc root run sbin snap srv sys tmp usr var
After mounting, you can configure the Ubuntu filesystem and install packages.
Basic Package Installation
Run these commands inside the chroot environment:
chmod 777 /tmp
apt update
apt-get install language-pack-zh-hant language-pack-zh-hans
apt install language-pack-en-base
apt install dialog rsyslog
apt install systemd avahi-daemon avahi-utils udhcpc ssh
apt install sudo vim net-tools ethtool ifupdown iputils-ping htop lrzsz gpiod wpasupplicant kmod iw usbutils memtester alsa-utils ufw psmisc
Enable logging:
touch /var/log/rsyslog
chown syslog:adm /var/log/rsyslog
chmod 666 /var/log/rsyslog
systemctl unmask rsyslog
systemctl enable rsyslog
Network and language support:
apt-get install synaptic rfkill network-manager
apt install -y --force-yes --no-install-recommends fonts-wqy-microhei
apt install -y --force-yes --no-install-recommends ttf-wqy-zenhei
Install LXDEDesktop. Audio and Browser
apt-get install xinit lxde
sudo apt install epiphany-browser xine-ui
Create Users
Set root password:
passwd root
Remove root password login:
passwd -d root
Fix sudo permissions:
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
Create user myir:
adduser myir
Update sudoers:
sudo vi /etc/sudoers
Add:
root ALL=(ALL:ALL) ALL myir ALL=(ALL:ALL) ALL
Other Configurations
- Edit
/etc/hostsand/etc/hostname - Modify
/etc/passwdfor_aptuser - Create symlink:
ln -s /lib /lib64
- Configure NIC in
/etc/network/interfaces:
auto eth0 iface eth0 inet dhcp
Unmount and Exit
exit
./ch-mount.sh -u ubuntu-rootfs/
Packaging Ubuntu System
Create ext4 image:
dd if=/dev/zero of=ubuntu22.04.ext4 bs=1M count=3300
mkfs.ext4 ubuntu22.04.ext4
mkdir temp
sudo mount ubuntu22.04.ext4 temp
sudo cp -avrf ubuntu-rootfs/* temp
sudo umount temp
Create SD Boot Image
Extract tools:
tar -xf RemiPiSDUpdate.tar.bz2
cd RemiPiSDUpdate/renesas-sd
Replace ubuntu22.04.ext4 in rootfs/home/root/g2l_images, update Manifest, then run:
cd rzg2bspscripts/imagecreator/
./createimage.sh myir_config.iniSo, finally you will be able to boot into your fresh Ubuntu installation using the LXDE desktop enviroment.
Hope you enjoy this guide.
Happy Modding!
linuxguy