From 4f55b9e6951b69e20c6f56ecc83d7719fe1f581e Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Mon, 16 Dec 2024 18:04:00 +0300 Subject: [PATCH] initial ventoy thingies --- hooks/4-booster-setup.chroot | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hooks/4-booster-setup.chroot b/hooks/4-booster-setup.chroot index 4220abf..f9066be 100755 --- a/hooks/4-booster-setup.chroot +++ b/hooks/4-booster-setup.chroot @@ -13,17 +13,35 @@ set -e busybox mount -n -t proc proc /proc -busybox cat /proc/cmdline | busybox grep 'boot=live booster.loadcdrom' || exit 0 +busybox cat /proc/cmdline | busybox grep 'boot=live' || exit 0 +busybox echo '[PikaOS Booster Live Hook]: boot=live detected in kernel cmdline, running LiveISO hooks...' ### Config -MEDIUM_LABEL="PikaOS 4" -#TMPFS_SIZE="3G" +busybox echo '[PikaOS Booster Live Hook]: Searching for Live medium...' +LIVE_MEDIA="$(busybox findfs LABEL="PikaOS 4" | busybox head -n1)" + +if [ -z "$LIVE_MEDIA" ] +then + busybox echo '[PikaOS Booster Live Hook]: Live medium could not be found among standard blocks.' + busybox echo '[PikaOS Booster Live Hook]: Attempting Ventoy mapping hook.' + /ventoy/busybox/sh /ventoy/hook/debian/disk_mount_hook.sh + if [ -f "/dev/mapper/ventoy" ] + then + busybox echo '[PikaOS Booster Live Hook]: Live medium found on /dev/mapper/ventoy !' + LIVE_MEDIA='/dev/mapper/ventoy' + else + busybox echo '[PikaOS Booster Live Hook]: Error: Live medium could not be found!' + exit 32 + fi +else + busybox echo "[PikaOS Booster Live Hook]: Live medium found on $LIVE_MEDIA !" +fi ### Create mounting dirs busybox mkdir -p /mnt/medium /mnt/filesystem /mnt/overlay /booster.root ### Mount live medium -busybox mount -o ro "$(busybox findfs LABEL="$MEDIUM_LABEL" | busybox head -n1)" /mnt/medium +busybox mount -o ro $LIVE_MEDIA /mnt/medium ### Create loop from squashfs