Linux System Customization

Applicability

  • Ubuntu18.04 For other versions of Ubuntu, this can be used as a reference.

1.Modifying the rootfs Partition

If a larger rootfs partition is needed, other partitions must be deleted to free up space, such as the userdata partition space.

1.1.Viewing the Entire eMMC Partition Situation

fdisk -l /dev/mmcblk0

../_images/ubuntu_custom_rootfs_1.png

1.2.Unmounting the Mounted Partitions userdata and oem

umount /userdata
umount /oem

1.3.Deleting userdata and oem Partitions

fdisk /dev/mmcblk0

../_images/ubuntu_custom_rootfs_2.png

Enter the ‘wq’ command to delete the partition

../_images/ubuntu_custom_rootfs_3.png

1.4.Adjusting the Size of the rootfs Partition

parted /dev/mmcblk0

../_images/ubuntu_custom_rootfs_4.png

Parted partition

../_images/ubuntu_custom_rootfs_5.png

15G  corresponds to 29360128 sectors

Adjusting the size of rootfs

../_images/ubuntu_custom_rootfs_6.png

Exit

../_images/ubuntu_custom_rootfs_7.png

1.5.Activating the rootfs Partition

resize2fs /dev/mmcblk0p6

../_images/ubuntu_custom_rootfs_8.png

rootfs adjustment completed

2.Enabling systemd in buildroot

2.1.Clearing the Cache

First, clear the cache generated by previous buildroot compilations (note: clearing the cache will result in longer compilation times), as follows:

../_images/ubuntu_custom_buildroot_systemd1.png

2.2.Selecting Configuration

Select the Neardi development board configuration, as follows choose BoardConfig-rk3588-neardi-linux-lc160.mk

../_images/ubuntu_custom_buildroot_systemd2.png

2.3.Configuring systemd

Enter the buildroot directory (cd buildroot), execute the ARCH=arm64 make menuconfigcommand, inToolChain–>select glibc,as follows:

../_images/ubuntu_custom_buildroot_systemd3.png

Then select System Configuration->Init system->systemd, as follows:

../_images/ubuntu_custom_buildroot_systemd4.png

Afterward, save and exit.

2.4.Saving the Configuration

ARCH=arm64 make savedefconfig

2.5.Checking if the Configuration is Effective

../_images/ubuntu_custom_buildroot_systemd5.png

The above image shows systemd saved to the SDK configuration file: buildroot/configs/rockchip_rk3588_defconfig

2.6.Compiling the Firmware

./build.sh

After successful compilation, the following files are generated:

../_images/ubuntu_custom_buildroot_systemd6.png

Use the rockchip download tool to burn the update.img to the development board.

2.7.Verifying if systemd is Working

../_images/ubuntu_custom_buildroot_systemd7.png

The above image shows systemd running successfully.