protozoaire <
jpmo...@gmail.com> wrote:
>initrd.img is (normally?) a gzip compressed cpio archive, known by
> $ file (PathtTo)/initrd.img
>Example to extract all files/dirs tree in current dir:
> $ gunzip -cd (PathTo)/initrd.img> | cpio -i -d -m -H newc
>--no-absolute-filenames
Insert the USB stick. OK, it's the 3.5G partition, /dev/sdb1 here. initrd is
XZ compressed. bsdtar extracts anything! 'setup' is there. You can even try
to run it from the extracted setup system via chroot. (Won't work correctly
there, of course.)
root@acer:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
|-sda1 8:1 0 931.5G 0 part /
`-sda2 8:2 0 1007K 0 part
sdb 8:16 1 28.6G 0 disk
|-sdb1 8:17 1 3.5G 0 part
`-sdb2 8:18 1 1.4M 0 part
sr0 11:0 1 1024M 0 rom
root@acer:~ # mount -o ro /dev/sdb1 /mnt/memory
root@acer:~ # file /mnt/memory/isolinux/initrd.img
/mnt/memory/isolinux/initrd.img: XZ compressed data, checksum CRC32
root@acer:~ # TMPDIR=$(mktemp -d)
root@acer:~ # cd $TMPDIR
root@acer:/tmp/tmp.Pr2IHKp8O9 # bsdtar xf /mnt/memory/isolinux/initrd.img
root@acer:/tmp/tmp.Pr2IHKp8O9 # ls -l usr/lib/setup/setup
-rwxr-xr-x 1 root root 17982 2022-02-02 10:20 usr/lib/setup/setup
root@acer:/tmp/tmp.Pr2IHKp8O9 # chroot $TMPDIR /usr/lib/setup/setup