Skip to content

Commit ad49715

Browse files
authored
Merge pull request #2766 from flatcar/ader1990/fix-rootfs-6kernel-10
cpio: do not fail on ghost rootfs
2 parents 3991fbf + 0a8267f commit ad49715

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

build_library/extract-initramfs-from-vmlinuz.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ perform_round() {
8181
for rnd in "${round_prefix}"*; do
8282
if [[ $(file --brief "${rnd}") =~ 'cpio archive' ]]; then
8383
mkdir -p "${out}/rootfs-${ROOTFS_IDX}"
84-
while cpio --quiet --extract --make-directories --directory="${out}/rootfs-${ROOTFS_IDX}" --nonmatching 'dev/*'; do
85-
ROOTFS_IDX=$(( ROOTFS_IDX + 1 ))
86-
mkdir -p "${out}/rootfs-${ROOTFS_IDX}"
87-
done <${rnd}
88-
rmdir "${out}/rootfs-${ROOTFS_IDX}"
84+
# On Linux 6.10, the first rootfs is an extra ghost rootfs of 336K, that has a corrupted CPIO
85+
cpio --quiet --extract --make-directories --directory="${out}/rootfs-${ROOTFS_IDX}" --nonmatching 'dev/*' < $rnd || true
86+
ROOTFS_IDX=$(( ROOTFS_IDX + 1 ))
8987
fi
9088
done
9189
}

0 commit comments

Comments
 (0)