Skip to content

initramfs: add initial emlinux-initramfs-base recipe#626

Closed
hiromotai7 wants to merge 1 commit into
miraclelinux:emlinux3from
hiromotai7:add-initramfs
Closed

initramfs: add initial emlinux-initramfs-base recipe#626
hiromotai7 wants to merge 1 commit into
miraclelinux:emlinux3from
hiromotai7:add-initramfs

Conversation

@hiromotai7
Copy link
Copy Markdown

@hiromotai7 hiromotai7 commented Apr 10, 2026

Purpose

Added a new INITRD recipe.

Test

Comfirmed the following:

  1. An initrd.img is generated by using the emlinux-initramfs-base recipe when IMAGE_INITRD is defined in local.conf.
  2. no differences between the file list inside the generated initrd.img and of the original initrd.img.

Test results

1. Confirming initrd.img creation

Add the following line to local.conf.

MACHINE = "qemu-arm64"
TMPDIR .= "-${DISTRO}"
IMAGE_INITRD = "emlinux-initramfs-base"

Run bitbake emlinux-image-base twice:

  1. DISTRO = "emlinux-bookworm" in conf/local.conf
  2. DISTRO = "emlinux-trixie" in conf/local.conf

confirmed that the initrd.img was generated and that it uses the name of the INITRD recipe.

  • ${INITRD_RECIPE_NAME}-${DISTRO}-${MACHINE}-initrd.img
$ (cd tmp-emlinux-bookworm/deploy/images/qemu-amd64; ls *.img)
emlinux-initramfs-base-emlinux-bookworm-qemu-amd64-initrd.img
$ (cd tmp-emlinux-trixie/deploy/images/qemu-amd64; ls *.img)
emlinux-initramfs-base-emlinux-trixie-qemu-amd64-initrd.img

2. Compare the file list inside initrd.img

The original produces 2 initrd files.

  1. emlinux-image-base-emlinux-bookworm-qemu-arm64-initrd.img
  2. emlinux-image-base-emlinux-trixie-qemu-arm64-initrd.img

Compared them respectively.

emlinux-bookworm

Ran the following commands for comparison.
No differences found.

$ diff -u \
  <(cd     emlinux-image-base-emlinux-bookworm-qemu-arm64-initrd; find . | sort)
  <(cd emlinux-initramfs-base-emlinux-bookworm-qemu-arm64-initrd; find . | sort)
$ 

emlinux-trixie

Ran the following commands for comparison.
No differences found.

$ diff -u \
  <(cd     emlinux-image-base-emlinux-trixie-qemu-arm64-initrd; find . | sort)
  <(cd emlinux-initramfs-base-emlinux-trixie-qemu-arm64-initrd; find . | sort)
--- /dev/fd/63	2026-04-10 20:21:04.691966357 +0900
+++ /dev/fd/62	2026-04-10 20:21:04.691966357 +0900
@@ -91,6 +91,7 @@
 ./usr/lib/aarch64-linux-gnu/libcrypt.so.1
 ./usr/lib/aarch64-linux-gnu/libcrypt.so.1.1.0
 ./usr/lib/aarch64-linux-gnu/libc.so.6
+./usr/lib/aarch64-linux-gnu/libdevmapper.so.1.02.1
 ./usr/lib/aarch64-linux-gnu/libkmod.so.2
 ./usr/lib/aarch64-linux-gnu/libkmod.so.2.5.1
 ./usr/lib/aarch64-linux-gnu/libmount.so.1
@@ -103,6 +104,8 @@
 ./usr/lib/aarch64-linux-gnu/libseccomp.so.2
 ./usr/lib/aarch64-linux-gnu/libseccomp.so.2.6.0
 ./usr/lib/aarch64-linux-gnu/libselinux.so.1
+./usr/lib/aarch64-linux-gnu/libudev.so.1
+./usr/lib/aarch64-linux-gnu/libudev.so.1.7.10
 ./usr/lib/aarch64-linux-gnu/libz.so.1
 ./usr/lib/aarch64-linux-gnu/libz.so.1.3.1
 ./usr/lib/aarch64-linux-gnu/libzstd.so.1
@@ -232,15 +235,19 @@
 ./usr/lib/udev/rules.d
 ./usr/lib/udev/rules.d/50-firmware.rules
 ./usr/lib/udev/rules.d/50-udev-default.rules
+./usr/lib/udev/rules.d/55-dm.rules
 ./usr/lib/udev/rules.d/60-block.rules
+./usr/lib/udev/rules.d/60-persistent-storage-dm.rules
 ./usr/lib/udev/rules.d/60-persistent-storage.rules
 ./usr/lib/udev/rules.d/71-seat.rules
 ./usr/lib/udev/rules.d/73-special-net-names.rules
 ./usr/lib/udev/rules.d/75-net-description.rules
 ./usr/lib/udev/rules.d/80-drivers.rules
 ./usr/lib/udev/rules.d/80-net-setup-link.rules
+./usr/lib/udev/rules.d/95-dm-notify.rules
 ./usr/lib/udev/scsi_id
 ./usr/sbin
 ./usr/sbin/blkid
+./usr/sbin/dmsetup
 ./usr/sbin/modprobe
 ./usr/sbin/rmmod
$ 

Since the differences are identical to those in the two original files as below and no files were missing, I consider this to be acceptable.

  1. emlinux-image-base-emlinux-bookworm-qemu-arm64-initrd.img
  2. emlinux-image-base-emlinux-trixie-qemu-arm64-initrd.img

Introduce the emlinux-initramfs-base recipe for the first time.
Confirmed it contains the same files as the original initrd.

Signed-off-by: Hirotaka Motai <hirotaka.motai@miraclelinux.com>
@hiromotai7 hiromotai7 marked this pull request as ready for review April 10, 2026 11:24
@hiromotai7 hiromotai7 requested a review from masami256 April 10, 2026 11:25
@hiromotai7 hiromotai7 mentioned this pull request Apr 10, 2026
# Debian packages that should be install into the system for building the
# initramfs.
INITRAMFS_PREINSTALL += " \
dmsetup \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need dmsetup by default?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because dmsetup was included in the emlinux-bookworm initramfs by default, However, these packages were not present in the emlinux-trixie initramfs.

Since verified filesystem is becoming more common in embedded systems for security, I think we should keep them in unless there's a specific reason not to.

@masami256
Copy link
Copy Markdown
Contributor

@hiromotai7 The *.img file name is changed from emlinux3 branch

build@0ffcf73155cf:~/work/build$ find tmp-orig/deploy/images/ -name "*.img"
tmp-orig/deploy/images/qemu-amd64/emlinux-image-base-emlinux-bookworm-qemu-amd64-initrd.img
tmp-orig/deploy/images/qemu-arm64/emlinux-image-base-emlinux-bookworm-qemu-arm64-initrd.img
build@0ffcf73155cf:~/work/build$ find tmp/deploy/images/ -name "*.img"
tmp/deploy/images/qemu-amd64/emlinux-initramfs-base-emlinux-bookworm-qemu-amd64-initrd.img
tmp/deploy/images/qemu-arm64/emlinux-initramfs-base-emlinux-bookworm-qemu-arm64-initrd.img

note:

'*.img' files in tmp-orig directory were built with head of emlinux3 branch.
'*.img' files in tmp directory were built with this pr's commit.

@hiromotai7
Copy link
Copy Markdown
Author

Sorry. I have not verified the boot on Raspberry PI or Generic-x86_64 with new initramfs yet.
I will submit the MR again after confimrming those as well.

@hiromotai7 hiromotai7 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants