Compare commits
No commits in common. "d30bc61c0e491c4f76fbef78d0b8d592079da873" and "8ea64ee1a4891c4b4d176dbcd246ed319a246423" have entirely different histories.
d30bc61c0e
...
8ea64ee1a4
|
@ -1,27 +1 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/target/etc/sudoers.d/wheel_as_sudo_group.
|
||||||
mkdir -p /mnt/target/opt/void-usb
|
mkdir -p /mnt/target/opt/void-usb
|
||||||
chmod 755 /mnt/target/opt/void-usb
|
chmod 755 /mnt/target/opt/void-usb
|
||||||
|
|
||||||
echo "UUID=$(blkid --output value --match-tag UUID $TARGET_PART_BIG)" > /mnt/target/opt/void-usb/container
|
echo "UUID=$(blkid --output value --match-tag UUID $TARGET_PART_BIG) /container f2fs defaults,rw,nodev,nosuid 0 1" > /mnt/target/opt/void-usb/initramfs-fstab
|
||||||
|
|
||||||
echo '# Void USB dracut configuration
|
echo '# Void USB dracut configuration
|
||||||
|
|
||||||
|
@ -196,7 +196,8 @@ hostonly="no"
|
||||||
compress="xz"
|
compress="xz"
|
||||||
|
|
||||||
add_dracutmodules+=" void-usb "
|
add_dracutmodules+=" void-usb "
|
||||||
omit_dracutmodules+=" nvdimm resume "' > /mnt/target/etc/dracut.conf.d/99-void-usb.conf
|
omit_dracutmodules+=" nvdimm resume "
|
||||||
|
add_fstab+=" /opt/void-usb/initramfs-fstab "' > /mnt/target/etc/dracut.conf.d/99-void-usb.conf
|
||||||
|
|
||||||
#TODO: mount /container
|
#TODO: mount /container
|
||||||
mkdir -p /mnt/target/lib/dracut/modules.d/90void-usb
|
mkdir -p /mnt/target/lib/dracut/modules.d/90void-usb
|
||||||
|
|
|
@ -4,7 +4,7 @@ OS_NAME="Void Linux USB"
|
||||||
GRUB_PREFIX="/boot/efi/LOADER/grub"
|
GRUB_PREFIX="/boot/efi/LOADER/grub"
|
||||||
CFG_CUSTOM_BEFORE="custom_before.cfg"
|
CFG_CUSTOM_BEFORE="custom_before.cfg"
|
||||||
CFG_CUSTOM_AFTER="custom_after.cfg"
|
CFG_CUSTOM_AFTER="custom_after.cfg"
|
||||||
LINUX_CMDLINE="root=/dev/loop0 ro void-usb-container=$(cat /opt/void-usb/container)"
|
LINUX_CMDLINE="root=/dev/loop0 ro"
|
||||||
|
|
||||||
DEFAULT_LINUX=/boot/vmlinu?
|
DEFAULT_LINUX=/boot/vmlinu?
|
||||||
if [ ! -f "$DEFAULT_LINUX" ]; then
|
if [ ! -f "$DEFAULT_LINUX" ]; then
|
||||||
|
@ -79,7 +79,7 @@ fi
|
||||||
|
|
||||||
menuentry '$OS_NAME' {
|
menuentry '$OS_NAME' {
|
||||||
echo 'Loading Linux...'
|
echo 'Loading Linux...'
|
||||||
linux /$DEFAULT_LINUX $LINUX_CMDLINE
|
linux /$DEFAULT_LINUX
|
||||||
echo 'Loading initial ramdisk...'
|
echo 'Loading initial ramdisk...'
|
||||||
initrd /$DEFAULT_INITRAMFS
|
initrd /$DEFAULT_INITRAMFS
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue