[neon/neon/livecd-rootfs/Neon/release] live-build/ubuntu-cpc/hooks.d/base: riscv: reduce initrd size for Nezha and LicheeRV boards

Heinrich Schuchardt null at kde.org
Mon Nov 28 10:16:27 GMT 2022


Git commit 0016cada169e0f88b4912bd2bf3e788ae47a8b2f by Heinrich Schuchardt.
Committed on 17/11/2022 at 10:21.
Pushed by jriddell into branch 'Neon/release'.

riscv: reduce initrd size for Nezha and LicheeRV boards

The Nezha and the LicheeRV boards do not have enough memory for an initrd
with most modules. Therefore the number of included modules has to be
reduced.

Create file /etc/initramfs-tools/conf.d/modules_list.conf
to set MODULES=list.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>

M  +5    -0    live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
A  +6    -0    live-build/ubuntu-cpc/hooks.d/base/initramfs-tools/modules_list.conf

https://invent.kde.org/neon/neon/livecd-rootfs/commit/0016cada169e0f88b4912bd2bf3e788ae47a8b2f

diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
index 5ff8fa33..6ba378ea 100755
--- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
+++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
@@ -267,6 +267,11 @@ install_grub() {
                         chroot mountpoint rm -f /boot/boot.scr
                         ;;
                     "nezha"|"licheerv")
+                        local my_d=$(dirname $(readlink -f ${0}))
+                        echo "Reducing initramfs size for ${SUBARCH} board"
+                        mkdir -p mountpoint/etc/initramfs-tools/conf.d/
+                        cp ${my_d}/initramfs-tools/modules_list.conf mountpoint/etc/initramfs-tools/conf.d/
+                        chroot mountpoint update-initramfs -c -v -k all
                         echo "Installing U-Boot for ${SUBARCH} board"
                         # flash-kernel is needed to install the dtb for update-grub: it uses the
                         # /proc/device-tree/model value to pick the correct dtb and as we are in a chroot,
diff --git a/live-build/ubuntu-cpc/hooks.d/base/initramfs-tools/modules_list.conf b/live-build/ubuntu-cpc/hooks.d/base/initramfs-tools/modules_list.conf
new file mode 100644
index 00000000..99cb474f
--- /dev/null
+++ b/live-build/ubuntu-cpc/hooks.d/base/initramfs-tools/modules_list.conf
@@ -0,0 +1,6 @@
+# The Nezha and the LicheeRV boards do not have enough memory for an initrd with
+# most modules. Therefore the number of included modules has to be reduced.
+#
+# If further modules are needed, add them to /etc/initramfs-tools/modules.
+
+MODULES=list



More information about the Neon-commits mailing list