archiso hook: support archisolabel= fallback for syslinux boots
Syslinux passes archisolabel= not archisosearchuuid= (UUID is only in systemd-boot entries). Add blkid label lookup as fallback so both boot paths work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
9159626cff
commit
685b725dbb
1 file changed
+9
-4
@@ -2,27 +2,32 @@
|
||||
|
||||
archiso_mount_handler() {
|
||||
local _new_root="$1"
|
||||
local _uuid _basedir _dev _img
|
||||
local _uuid _label _basedir _dev _img
|
||||
|
||||
_uuid="$(getarg archisosearchuuid=)"
|
||||
_label="$(getarg archisolabel=)"
|
||||
_basedir="$(getarg archisobasedir=)"
|
||||
: "${_basedir:=arch}"
|
||||
|
||||
if [ -z "${_uuid}" ]; then
|
||||
echo "archiso: archisosearchuuid not set in kernel cmdline"
|
||||
if [ -z "${_uuid}" ] && [ -z "${_label}" ]; then
|
||||
echo "archiso: neither archisosearchuuid nor archisolabel set in kernel cmdline"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local _waited=0
|
||||
while [ "${_waited}" -lt 30 ]; do
|
||||
if [ -n "${_uuid}" ]; then
|
||||
_dev="$(blkid -l -o device -t UUID="${_uuid}" 2>/dev/null)"
|
||||
else
|
||||
_dev="$(blkid -l -o device -t LABEL="${_label}" 2>/dev/null)"
|
||||
fi
|
||||
[ -n "${_dev}" ] && break
|
||||
sleep 1
|
||||
_waited=$(( _waited + 1 ))
|
||||
done
|
||||
|
||||
if [ -z "${_dev}" ]; then
|
||||
echo "archiso: could not find boot medium with UUID=${_uuid}"
|
||||
echo "archiso: could not find boot medium (uuid=${_uuid} label=${_label})"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user