initial ventoy thingies

This commit is contained in:
Ward from fusion-voyager-3 2024-12-16 18:04:00 +03:00
parent d6c162ecb1
commit 4f55b9e695

View File

@ -13,17 +13,35 @@ set -e
busybox mount -n -t proc proc /proc 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 ### Config
MEDIUM_LABEL="PikaOS 4" busybox echo '[PikaOS Booster Live Hook]: Searching for Live medium...'
#TMPFS_SIZE="3G" 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 ### Create mounting dirs
busybox mkdir -p /mnt/medium /mnt/filesystem /mnt/overlay /booster.root busybox mkdir -p /mnt/medium /mnt/filesystem /mnt/overlay /booster.root
### Mount live medium ### 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 ### Create loop from squashfs