always unpack initrd to relative paths

If cpio archive contains absolute filenames, files are unpacked
relative to host root '/', not 'ramdisk' directory.
If abootimg-unpack-initrd is run as root, that could break host system
and make it unbootable by overwriting important system files.
This commit is contained in:
Andrey Skvortsov 2020-03-27 11:40:21 +03:00
parent 7e127fee6a
commit 3e58173287

View File

@ -16,5 +16,5 @@ fi
mkdir -p $ramdisk mkdir -p $ramdisk
zcat $initrd | ( cd $ramdisk; cpio -i ) zcat $initrd | ( cd $ramdisk; cpio -i --no-absolute-filenames)