archiso hook: replace getarg with direct /proc/cmdline parsing
getarg's trailing-= convention varies by mkinitcpio version and was returning empty even when archisosearchuuid was present in cmdline. Parse /proc/cmdline directly in ash — no external tools, no version sensitivity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
685b725dbb
commit
5de7cfec78
1 file changed
+9
-5
@@ -2,15 +2,19 @@
|
||||
|
||||
archiso_mount_handler() {
|
||||
local _new_root="$1"
|
||||
local _uuid _label _basedir _dev _img
|
||||
local _uuid _label _basedir _dev _img _param
|
||||
|
||||
_uuid="$(getarg archisosearchuuid=)"
|
||||
_label="$(getarg archisolabel=)"
|
||||
_basedir="$(getarg archisobasedir=)"
|
||||
for _param in $(cat /proc/cmdline); do
|
||||
case "$_param" in
|
||||
archisosearchuuid=*) _uuid="${_param#archisosearchuuid=}" ;;
|
||||
archisolabel=*) _label="${_param#archisolabel=}" ;;
|
||||
archisobasedir=*) _basedir="${_param#archisobasedir=}" ;;
|
||||
esac
|
||||
done
|
||||
: "${_basedir:=arch}"
|
||||
|
||||
if [ -z "${_uuid}" ] && [ -z "${_label}" ]; then
|
||||
echo "archiso: neither archisosearchuuid nor archisolabel set in kernel cmdline"
|
||||
echo "archiso: neither archisosearchuuid nor archisolabel in kernel cmdline"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user