Explorar o código

dracut/autoinstaller: fix kcl parsing

regression caused by fce4ed64209cd384a9276c3b464b8337bddbb4b6
classabbyamp %!s(int64=2) %!d(string=hai) anos
pai
achega
b5e8502717
Modificáronse 1 ficheiros con 10 adicións e 18 borrados
  1. 10 18
      dracut/autoinstaller/install.sh

+ 10 - 18
dracut/autoinstaller/install.sh

@@ -1,18 +1,6 @@
 #!/bin/sh
 
-set -e
-
-# These are for all you erroring dracuts out there
-VAI_getarg() {
-	set +e
-	getarg "$@"
-	set -e
-}
-VAI_getargbool() {
-	set +e
-	getargbool "$@"
-	set -e
-}
+type getargbool >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # These functions pulled from void's excellent mklive.sh
 VAI_info_msg() {
@@ -224,10 +212,13 @@ VAI_configure_autoinstall() {
     esac
 
     # --------------- Pull config URL out of kernel cmdline -------------------------
-    if VAI_getargbool 0 autourl ; then
-        xbps-uhelper fetch "$(VAI_getarg autourl)>/etc/autoinstall.cfg"
+    set +e
+    if getargbool 0 autourl ; then
+        set -e
+        xbps-uhelper fetch "$(getarg autourl)>/etc/autoinstall.cfg"
 
     else
+        set -e
         mv /etc/autoinstall.default /etc/autoinstall.cfg
     fi
 
@@ -300,9 +291,10 @@ VAI_main() {
 }
 
 # If we are using the autoinstaller, launch it
-if VAI_getargbool 0 auto  ; then
+if getargbool 0 auto  ; then
+    set -e
     VAI_main
+    # Very important to release this before returning to dracut code
+    set +e
 fi
 
-# Very important to release this before returning to dracut code
-set +e