Skip to content

Commit

Permalink
cpio: show all the rootfs found
Browse files Browse the repository at this point in the history
  • Loading branch information
ader1990 committed Sep 18, 2024
1 parent 17099cd commit 0d9b839
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions build_library/extract-initramfs-from-vmlinuz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ perform_round() {
for rnd in "${round_prefix}"*; do
if [[ $(file --brief "${rnd}") =~ 'cpio archive' ]]; then
mkdir -p "${out}/rootfs-${ROOTFS_IDX}"
while cpio --quiet --extract --make-directories --directory="${out}/rootfs-${ROOTFS_IDX}" --nonmatching 'dev/*'; do
ROOTFS_IDX=$(( ROOTFS_IDX + 1 ))
mkdir -p "${out}/rootfs-${ROOTFS_IDX}"
done <${rnd}
rmdir "${out}/rootfs-${ROOTFS_IDX}"
# 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 ))
fi
done
}
Expand Down

0 comments on commit 0d9b839

Please sign in to comment.