From 3cfd6969359f586b616fec62d2d331e20883a344 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Tue, 1 Aug 2023 12:06:45 +0200 Subject: [PATCH] add initramfs recipe --- conf/layer.conf | 4 +-- .../images/core-image-minimal.bbappend | 2 +- recipes-core/images/core-image-recovery.bb | 33 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 recipes-core/images/core-image-recovery.bb diff --git a/conf/layer.conf b/conf/layer.conf index 0d077d5..dc3f309 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -14,7 +14,7 @@ LAYERSERIES_COMPAT_meta-rpi-diya = "mickledore" PACKAGE_CLASSES = "package_ipk" -INITRAMFS_IMAGE="core-image-tiny-initramfs" +INITRAMFS_IMAGE="core-image-recovery" INITRAMFS_IMAGE_BUNDLE="0" INHERIT += "rm_work" @@ -41,7 +41,7 @@ ENABLE_DWC2_PERIPHERAL = "1" ENABLE_DWC2_HOST = "1" ENABLE_USB_U_BOOT = "0" -ENABLE_UART = "1" +ENABLE_UART = "0" DISABLE_SPLASH = "1" VIDEO_CAMERA = "1" diff --git a/recipes-core/images/core-image-minimal.bbappend b/recipes-core/images/core-image-minimal.bbappend index e5a9ed1..aa6c6b2 100644 --- a/recipes-core/images/core-image-minimal.bbappend +++ b/recipes-core/images/core-image-minimal.bbappend @@ -12,7 +12,7 @@ EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE diya; \ usermod -a -G avahi diya; \ usermod -a -G sudo diya \ " -IMAGE_BOOT_FILES:append = "fs_resize core-image-tiny-initramfs-${MACHINE}.cpio.gz " +IMAGE_BOOT_FILES:append = "fs_resize core-image-recovery-${MACHINE}.cpio.gz " IMAGE_INSTALL:append = "libcurl \ libdrm \ diff --git a/recipes-core/images/core-image-recovery.bb b/recipes-core/images/core-image-recovery.bb new file mode 100644 index 0000000..cb95a4d --- /dev/null +++ b/recipes-core/images/core-image-recovery.bb @@ -0,0 +1,33 @@ + +DESCRIPTION = "Recovery initramfs image." + + +PACKAGE_INSTALL = "busybox ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "${MLPREFIX}core-image-recovery" +IMAGE_NAME_SUFFIX ?= "" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +# Use the same restriction as initramfs-module-install +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' + + +python tinyinitrd () { + # Modify our init file so the user knows we drop to shell prompt on purpose + newinit = "/bin/busybox sh init" + with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init: + init.write(newinit) +} + +IMAGE_PREPROCESS_COMMAND += "tinyinitrd;" \ No newline at end of file