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
+10
-5
@@ -2,27 +2,32 @@
|
|||||||
|
|
||||||
archiso_mount_handler() {
|
archiso_mount_handler() {
|
||||||
local _new_root="$1"
|
local _new_root="$1"
|
||||||
local _uuid _basedir _dev _img
|
local _uuid _label _basedir _dev _img
|
||||||
|
|
||||||
_uuid="$(getarg archisosearchuuid=)"
|
_uuid="$(getarg archisosearchuuid=)"
|
||||||
|
_label="$(getarg archisolabel=)"
|
||||||
_basedir="$(getarg archisobasedir=)"
|
_basedir="$(getarg archisobasedir=)"
|
||||||
: "${_basedir:=arch}"
|
: "${_basedir:=arch}"
|
||||||
|
|
||||||
if [ -z "${_uuid}" ]; then
|
if [ -z "${_uuid}" ] && [ -z "${_label}" ]; then
|
||||||
echo "archiso: archisosearchuuid not set in kernel cmdline"
|
echo "archiso: neither archisosearchuuid nor archisolabel set in kernel cmdline"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local _waited=0
|
local _waited=0
|
||||||
while [ "${_waited}" -lt 30 ]; do
|
while [ "${_waited}" -lt 30 ]; do
|
||||||
_dev="$(blkid -l -o device -t UUID="${_uuid}" 2>/dev/null)"
|
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
|
[ -n "${_dev}" ] && break
|
||||||
sleep 1
|
sleep 1
|
||||||
_waited=$(( _waited + 1 ))
|
_waited=$(( _waited + 1 ))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "${_dev}" ]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user