diff --git a/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso b/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso index f2f3970..cf1e0f4 100644 --- a/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso +++ b/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso @@ -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 - _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 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