dracut modules: implement squashfs-img script
parent
22e3ede566
commit
d30bc61c0e
|
@ -1 +1,27 @@
|
||||||
#!/bin/bash
|
#!/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
|
||||||
|
|
Loading…
Reference in New Issue