3.2 Adjustments to the Project specific for my case (cont.)
3.2 Reducing RootFS
In some cases root filesystem has to be considerably smaller than the one that 'avnet-image-minimal' produces. I chose to add my own Yocto layer 'meta-u96v2-experiment' to avoid fixing Avnet recipes. The new layer includes only one recipe, it designed to build image 'u96v2exp-image-core'.
What is in the recipe.
First, I made an image to inherit from class 'core-image', it means that it will not include packages added by PetaLinux and Avnet layers.
Second, the following features, that are useful for my specific setting, are not set by default in 'core-image':
serial-autologin-root (login 'root' with empty password on the serial console)
debug-tweaks that enable:
empty-root-password
allow-empty-password
allow-root-login
post-install-logging
I added the both features to IMAGE_FEATURES.
Reasoning to derive from 'image-core'. Normally, it's possible to remove packages added by PetaLinux and Avnet layers with:
IMAGE_INSTALL:remove:zynqmp = [list of packages to remove]
Deriving from 'image-core' gives a "bare" image where we can add packages into when needed, instead of removing packages that we don't need.
Now, how to make the layer work.
3.2.1 Step 1. Adding the layer
Copy the layer directory 'meta-u96v2-experiment' to a suitable location, I keep it in 'u96v2_sbc_base_2023_2/project-spec'.
In build shell, go to your working directory and run the command:
$ petalinux-config -p u96v2_sbc_base_2023_2 --get-hw-description=u96v2_sbc_base_2023_2/hardware/u96v2_sbc_base_2023_2
to get ncurses-based menu, then choose
Yocto Settings ---> User Layers,
then, in the empty line named "user layer 1" type:
${PROOT}/[path to the new layer directory]
For my case, it's:
${PROOT}/project-spec/meta-u96v2-experiment
Done. Save. Exit.
3.2.2 Step 2. Users
You can modify user(s) the following way. Run the command:
$ petalinux-config -p u96v2_sbc_base_2023_2 -c rootfs
When you have got the ncurses-based menu, select "PetaLinux RootFS Settings". There, you can find lines to modify users, groups and sudoers.
Done. Save. Exit.
3.3 Reducing kernel
You can run configuration utility to configure Linux kernel:
$ petalinux-config -p u96v2_sbc_base_2023_2 -c kernel
The well-known ncurses-based menu will pop-up.
Alternatively, you can use the build utility:
$ petalinux-build -p u96v2_sbc_base_2023_2 -c linux-xlnx -x menuconfig
Last updated