OSDN Git Service

Merge branch 'master' of https://github.com/instantos/instantARCH
[instantos/instantARCH.git] / archinstall.sh
index 585a42c..3ec5c11 100755 (executable)
@@ -47,9 +47,11 @@ setinfo() {
     echo "$@"
 }
 
-echo "import time; time.sleep(10009)" | python &
-sleep 2
-pkill python3
+if command -v python; then
+    echo "import time; time.sleep(10009)" | python &
+    sleep 2
+    pkill python3
+fi
 
 # sort mirrors
 pacman -Sy --noconfirm
@@ -59,10 +61,36 @@ cd /root
 [ -e instantARCH ] && rm -rf instantARCH
 git clone --depth=1 https://github.com/instantos/instantARCH.git
 cd instantARCH
+
+# use alternative versions of the installer
+if [ -n "$1" ]; then
+    case "$1" in
+    "test")
+        echo "switching to testing branch"
+        git checkout -b testing
+        ;;
+    "manual")
+        if ! [ -e /root/manualarch ]; then
+            echo "no manual instantARCH version found. Please clone it to /root/manualarch"
+            sleep 5
+            echo "exiting"
+            exit
+        fi
+        rm -rf ./*
+        cp -r /root/manualarch/* .
+        ;;
+    *)
+        echo "running normal installer version"
+        ;;
+    esac
+
+fi
 chmod +x *.sh
 chmod +x */*.sh
 
 ./depend/depend.sh
+./artix/preinstall.sh
+
 cd /root/instantARCH
 
 ./ask.sh || {
@@ -86,9 +114,11 @@ sleep 2
 
 # ask to reboot, upload error data if install failed
 if ! [ -e /opt/installfailed ] || ! [ -e /opt/installsuccess ]; then
-    notify-send "rebooting"
-    sleep 2
-    reboot
+    if command -v installapplet; then
+        notify-send "rebooting"
+        sleep 2
+        reboot
+    fi
 else
 
     echo "installaion failed"