Skip to content

Commit c247eff

Browse files
committed
Fix overlayfs test: use unmkinitramfs for multi-archive initrd
The verify step was extracting only the first cpio archive from initrd.img. mkinitramfs produces a concatenation of an uncompressed early-microcode cpio followed by the compressed main archive; file(1) identifies the leading bytes as "ASCII cpio archive", so the test fell into the plain `cpio -idm` branch and unpacked only the ~217 KB microcode portion, missing the overlayroot scripts in the compressed remainder. Replace the format detection with unmkinitramfs (initramfs-tools-core), which handles concatenated and arbitrarily compressed initrd images.
1 parent 1df1db2 commit c247eff

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/test-overlayfs.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ jobs:
3232
run: |
3333
set -euxo pipefail
3434
sudo apt-get update
35-
sudo apt-get install -y cpio zstd file
35+
# unmkinitramfs (from initramfs-tools-core) handles the
36+
# early-microcode + main archive concatenation produced by
37+
# mkinitramfs, which a plain cpio/zstd/gunzip cannot.
38+
sudo apt-get install -y file initramfs-tools-core
3639
3740
IMAGE="${{ steps.build_image.outputs.image }}"
3841
LOOP=$(sudo losetup --find --show --partscan "$IMAGE")
@@ -58,15 +61,9 @@ jobs:
5861
sudo cp "$BOOT_MNT/initrd.img" "$WORK/initrd.img"
5962
cd "$WORK"
6063
sudo file initrd.img
61-
if sudo file initrd.img | grep -qi zstd; then
62-
sudo zstd -dc initrd.img | sudo cpio -idm
63-
elif sudo file initrd.img | grep -qi gzip; then
64-
sudo gunzip -c initrd.img | sudo cpio -idm
65-
else
66-
sudo cpio -idm < initrd.img
67-
fi
64+
sudo unmkinitramfs initrd.img extracted
6865
# overlayroot ships init scripts under /scripts/*overlayroot*
69-
sudo find . -path '*overlayroot*' | tee /tmp/overlayroot_files
66+
sudo find extracted -path '*overlayroot*' | tee /tmp/overlayroot_files
7067
test -s /tmp/overlayroot_files
7168
7269
cd /

0 commit comments

Comments
 (0)