aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2022-07-13 19:37:57 +0200
committer Eric Hameleers <alien@slackware.com>2022-07-13 19:37:57 +0200
commit20af360dc55c06a4881b85af7cc5495e0a3b07f5 (patch)
tree1ae89b5faed1d55b8785734d0c25519718ce7bf5
parent499e66ccc7a2605d824aff0e25a089a2d43ed498 (diff)
downloadliveslak-20af360dc55c06a4881b85af7cc5495e0a3b07f5.tar.gz
liveslak-20af360dc55c06a4881b85af7cc5495e0a3b07f5.tar.xz
liveinit: add support for ISO boot under Ventoy USB boot manager
-rw-r--r--liveinit.tpl23
1 files changed, 21 insertions, 2 deletions
diff --git a/liveinit.tpl b/liveinit.tpl
index c93af00..a5a7e9c 100644
--- a/liveinit.tpl
+++ b/liveinit.tpl
@@ -702,6 +702,15 @@ if [ "$RESCUE" = "" ]; then
VIRGIN=1
elif [ -z "$LIVEMEDIA" ]; then
# LIVEMEDIA not specified on the boot commandline using "livemedia="
+ # Note:
+ # If we boot an ISO via Ventoy, this creates a device-mapped file
+ # '/dev/mapper/ventoy' which liveslak uses to mount that ISO,
+ # but specifying '-t iso9660' will fail to mount it.
+ # Omitting the '-t iso9660' makes the mount succceed.
+ if [ -e /dev/mapper/ventoy ]; then
+ echo "${MARKER}: Ventoy ISO boot detected..."
+ fi
+ # Start digging:
# Filter out the block devices, only look at partitions at first:
# The blkid function in busybox behaves differently than the regular blkid!
# It will return all devices with filesystems and list LABEL UUID and TYPE.
@@ -720,14 +729,24 @@ if [ "$RESCUE" = "" ]; then
# We found a block device with the correct label (non-UEFI media).
# Determine filesystem type ('iso9660' means we found a CDROM/DVD)
LIVEFS=$(blkid $LIVEMEDIA |rev |cut -d'"' -f2 |rev)
- mount -t $LIVEFS -o ro $LIVEMEDIA /mnt/media
+ [ "$LIVEFS" = "swap" ] && continue
+ if [ -e /dev/mapper/ventoy ]; then
+ mount -o ro $LIVEMEDIA /mnt/media
+ else
+ mount -t $LIVEFS -o ro $LIVEMEDIA /mnt/media
+ fi
else
# Bummer.. label not found; the ISO was extracted to a different device.
# Separate partitions from block devices, look at partitions first:
for SLDEVICE in $(ret_partition $(blkid |cut -d: -f1)) $(ret_blockdev $(blkid |cut -d: -f1)) ; do
# We rely on the fact that busybox blkid puts TYPE"..." at the end:
SLFS=$(blkid $SLDEVICE |rev |cut -d'"' -f2 |rev)
- mount -t $SLFS -o ro $SLDEVICE /mnt/media
+ [ "$SLFS" = "swap" ] && continue
+ if [ -e /dev/mapper/ventoy ]; then
+ mount -o ro $SLDEVICE /mnt/media
+ else
+ mount -t $SLFS -o ro $SLDEVICE /mnt/media
+ fi
if [ -d /mnt/media/${LIVEMAIN} ]; then
# Found our media!
LIVEALL=$SLDEVICE