Merge pull request #2766 from flatcar/ader1990/fix-rootfs-6kernel-10

cpio: do not fail on ghost rootfs
This commit is contained in:
James Le Cuirot 2025-03-28 11:17:37 +00:00 committed by GitHub
commit ad497156dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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