dracut modules: implement squashfs-img script

master
BodgeMaster 2023-06-28 14:05:23 +02:00
parent 22e3ede566
commit d30bc61c0e
1 changed files with 26 additions and 0 deletions

View File

@ -1 +1,27 @@
#!/bin/bash
type getarg > /dev/null 2>&1 || source /lib/dracut-lib.sh
[ ! -d /sysroot/container ] && mkdir -p /sysroot/container
CONTAINER="$(getarg void-usb-container)"
case "$CONTAINER" in
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
CONTAINER="$(label_uuid_to_dev "$CONTAINER")"
;;
/dev/*)
true
;;
*)
echo -e "Invalid value for 'void-usb-container' kernel command line parameter!\nDropping into emergency shell."
emergency_shell
esac
mount -t f2fs -o nodev,nosuid "$CONTAINER" /sysroot/container
if [ -f /sysroot/container/squashfs.img ]; then
losetup -r -f /sysroot/container/squashfs.img
else
echo "Failed to find squashfs image. Dropping into an emergency shell. Good luck!"
emergency_shell
fi