diff mbox series

[isar-cip-core,2/3] fix: add squashfs hook to enforce load of module

Message ID 20221012100641.2986740-3-felix.moessbauer@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Simplify integration of swupdate into downstream layers | expand

Commit Message

MOESSBAUER, Felix Oct. 12, 2022, 10:06 a.m. UTC
This patch fixes issues when using a stock debian kernel, as this kernel
has no compiled-in support for sqashfs.
By explicitly adding the module to the initramfs we ensure that it is
available.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 kas/opt/ebg-swu.yml                           |  2 +-
 .../files/squashfs.hook                       | 25 +++++++++++++++++++
 .../initramfs-squashfs-hook_0.1.bb            | 24 ++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 recipes-initramfs/initramfs-squashfs-hook/files/squashfs.hook
 create mode 100644 recipes-initramfs/initramfs-squashfs-hook/initramfs-squashfs-hook_0.1.bb
diff mbox series

Patch

diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml
index ce37c36..914c743 100644
--- a/kas/opt/ebg-swu.yml
+++ b/kas/opt/ebg-swu.yml
@@ -22,7 +22,7 @@  local_conf_header:
   ebg_swu_image_options: |
     CIP_IMAGE_OPTIONS_append = " efibootguard.inc image-uuid.inc"
   initramfs: |
-    INITRAMFS_INSTALL_append = " initramfs-abrootfs-hook"
+    INITRAMFS_INSTALL_append = " initramfs-abrootfs-hook initramfs-squashfs-hook"
   firmware-binaries: |
     # Add ovmf binaries for qemu
     IMAGER_BUILD_DEPS_append_qemu-amd64 += "ovmf-binaries"
diff --git a/recipes-initramfs/initramfs-squashfs-hook/files/squashfs.hook b/recipes-initramfs/initramfs-squashfs-hook/files/squashfs.hook
new file mode 100644
index 0000000..0b9b208
--- /dev/null
+++ b/recipes-initramfs/initramfs-squashfs-hook/files/squashfs.hook
@@ -0,0 +1,25 @@ 
+#!/bin/sh
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2022
+#
+# Authors:
+#  Felix Moessbauer <felix.moessbauer@siemens.com>
+#
+
+PREREQ=""
+prereqs()
+{
+    echo "$PREREQ"
+}
+case $1 in
+prereqs)
+    prereqs
+    exit 0
+    ;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+manual_add_modules squashfs
diff --git a/recipes-initramfs/initramfs-squashfs-hook/initramfs-squashfs-hook_0.1.bb b/recipes-initramfs/initramfs-squashfs-hook/initramfs-squashfs-hook_0.1.bb
new file mode 100644
index 0000000..332278f
--- /dev/null
+++ b/recipes-initramfs/initramfs-squashfs-hook/initramfs-squashfs-hook_0.1.bb
@@ -0,0 +1,24 @@ 
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2022
+#
+# Authors:
+#  Felix Moessbauer <felix.moessbauer@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+SRC_URI += "file://squashfs.hook"
+
+DEBIAN_DEPENDS = "initramfs-tools"
+
+do_install[cleandirs] += " \
+    ${D}/usr/share/initramfs-tools/hooks"
+
+do_install() {
+    install -m 0755 "${WORKDIR}/squashfs.hook" \
+        "${D}/usr/share/initramfs-tools/hooks/squashfs"
+}