systemd increases boot.img size by ~2 MB, giving too large boot.img
Describe your issue
What's the expected behaviour?
pmbootstrap init
with phosh (or gnome, gnome-mobile, plasma-desktop, plasma-mobile, sxmo-de-dwm, sxmo-de-sway) and then default settings should create a working image.
What's the current behaviour?
phosh (or gnome, gnome-mobile, plasma-desktop, plasma-mobile, sxmo-de-dwm, sxmo-de-sway) selects systemd per default, which increases boot.img size by about 2 MB, which gives a too large boot.img on some devices (i.e. pmbootstrap flasher flash_kernel
fails.
How to reproduce your issue?
pmbootstrap init
and choose for example any exynos4 devices (samsung-m0 in my tests), and choose phosh for UI and then default settings. systemd is enabled per default for phosh.
What device are you using?
Issue applies to all devices that support phosh (and other UIs that enable systemd per default), and that has a small boot partition (around < 10 MB). One example is samsung-m0.
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
v24.12
-
v24.06
(supported until 2025-01-23) -
I confirm that the issue still is present after running sudo apk upgrade -a
On what environment did you encounter the issue?
Environments
-
GNOME Shell on Mobile -
Phosh -
Plasma Mobile -
Sxmo (Wayland/Sway) Please post the output of sxmo_version.sh
-
Other: Please fill out
Which init system are you using?
-
OpenRC -
systemd
How did you get postmarketOS image?
-
from https://images.postmarketos.org -
I built it using pmbootstrap -
It was preinstalled on my device
What's the build date of the image? (in yyyy-mm-dd format)
Additional information
Difference comes from lib dir in initfs:
7.7M boot-m0-wo-systemd.img
9.6M boot-m0-w-systemd.img
4.7M initfs-extracted-m0-wo-systemd
7.8M initfs-extracted-m0-w-systemd
14M initfs-extra-extracted-m0-wo-systemd
14M initfs-extra-extracted-m0-w-systemd
where most of the difference comes from libcrypto.so.3, which is not present without systemd:
$ find initfs-extracted-m0-w*/usr/lib/ -type f -exec du -h {} +
40K initfs-extracted-m0-wo-systemd/usr/lib/libgcc_s.so.1
4.0K initfs-extracted-m0-wo-systemd/usr/lib/os-release
28K initfs-extracted-m0-wo-systemd/usr/lib/libeconf.so.0.6.2
236K initfs-extracted-m0-wo-systemd/usr/lib/libdevmapper.so.1.02
152K initfs-extracted-m0-wo-systemd/usr/lib/libblkid.so.1.1.0
40K initfs-extracted-m0-w-systemd/usr/lib/libgcc_s.so.1
4.0K initfs-extracted-m0-w-systemd/usr/lib/os-release
60K initfs-extracted-m0-w-systemd/usr/lib/libkmod.so.2.5.0
28K initfs-extracted-m0-w-systemd/usr/lib/libeconf.so.0.6.2
236K initfs-extracted-m0-w-systemd/usr/lib/libdevmapper.so.1.02
484K initfs-extracted-m0-w-systemd/usr/lib/libzstd.so.1.5.6
2.4M initfs-extracted-m0-w-systemd/usr/lib/libcrypto.so.3
152K initfs-extracted-m0-w-systemd/usr/lib/liblzma.so.5.6.4
152K initfs-extracted-m0-w-systemd/usr/lib/libblkid.so.1.1.0
64K initfs-extracted-m0-w-systemd/usr/lib/libz.so.1.3.1
Size increase was figured out in postmarketos-devel by @craftyguy and @sicelo. libkmod depends on libzstd, libz, liblzma and libcrypto, and is hence responsible for the size increase. libkmod in turn is pulled in by systemd: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/extra-repos/systemd/postmarketos-base-systemd/rootfs-usr-share-mkinitfs-files-01-initramfs-base-systemd.files