Building The Root Filesystem - Cherry PUMA SOM-RK3399-Q7 User Manual

Powerful system-on-module for versatile applications featuring the rockchip rk3399 application processor
Hide thumbs Also See for PUMA SOM-RK3399-Q7:
Table of Contents

Advertisement

• The device tree: arch/arm64/boot/dts/rockchip/rk3399-puma.dtb
• The kernel image: arch/arm64/boot/Image

4.8 Building the root filesystem

A filesystem can be created using Debootstrap, specifying arm64 as architecture in the command line.
Supposing the target dir is called rk3399-rootfs and the chosen distribution is Debian 9 "Stretch" (recom-
mended):
export targetdir=/opt/rk3399-rootfs
sudo mkdir -p $targetdir
sudo debootstrap --arch=arm64 --foreign stretch $targetdir http://deb.debian.org/debian/
Next, copy the qemu-arm-static binary into the right place for the binfmt packages to find it and copy the re-
solv.conf file from the host system:
sudo cp /usr/bin/qemu-aarch64-static $targetdir/usr/bin/
sudo cp /etc/resolv.conf $targetdir/etc
This will provide a very basic arm64 rootfs in the targetdir. For the next stages, we chroot to the target dir:
sudo chroot $targetdir
Second stage of debootstrap inside the new root dir:
/debootstrap/debootstrap --second-stage
Set up the apt package sources:
cat
<<
EOT
>
/etc/apt/sources.list
deb http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb
http://security.debian.org/
EOT
We can now pull the latest apt database from the Debian mirrors and install locales:
apt update
apt install locales
echo
"en_US.UTF-8 UTF-8"
locale-gen
Install any additional packages inside the chroot. An ssh server and sudo are recommended:
apt install openssh-server sudo
Set the root password for logging in via serial console:
passwd
To log in over ssh, create another user besides root (root login over ssh is not permitted by default):
adduser user
Add the new user to the sudo group so you can switch to root privileges if needed:
adduser user sudo
Set up a basic network configuration file with DHCP via eth0 and enable automatic DNS configuration through
systemd-resolved:
v1.6
Page 22
stretch/updates main contrib non-free
>
/etc/locale.gen

Advertisement

Table of Contents
loading

Table of Contents