OSDN Git Service

add graphics fix, swap and confirm dialog
authorpaperbenni <paperbenni@gmail.com>
Fri, 8 May 2020 13:16:05 +0000 (15:16 +0200)
committerpaperbenni <paperbenni@gmail.com>
Fri, 8 May 2020 13:16:05 +0000 (15:16 +0200)
ask.sh
chroot/chroot.sh
depend/system.sh

diff --git a/ask.sh b/ask.sh
index 9b78472..5d43051 100755 (executable)
--- a/ask.sh
+++ b/ask.sh
@@ -8,60 +8,84 @@ pb dialog
 
 messagebox "welcome to instantARCH, the easy arch installer"
 
-cd /root/instantARCH/data/lang/keyboard
-while [ -z "$NEWKEY" ]; do
-    NEWKEY="$(ls | fzf --prompt 'Select keyboard layout> ')"
-done
+# go back to the beginning if user isn't happy with settings
+while ! [ -e /root/instantARCH/config/confirm ]; do
+    cd /root/instantARCH/data/lang/keyboard
+    while [ -z "$NEWKEY" ]; do
+        NEWKEY="$(ls | fzf --prompt 'Select keyboard layout> ')"
+    done
 
-echo "$NEWKEY" >/root/instantARCH/config/keyboard
+    echo "$NEWKEY" >/root/instantARCH/config/keyboard
 
-loadkeys $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
+    loadkeys $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
 
-cd ../locale
-while [ -z "$NEWLOCALE" ]; do
-    NEWLOCALE="$(ls | fzf --prompt 'Select language> ')"
-done
-echo "$NEWLOCALE" >/root/instantARCH/config/locale
+    cd ../locale
+    while [ -z "$NEWLOCALE" ]; do
+        NEWLOCALE="$(ls | fzf --prompt 'Select language> ')"
+    done
+    echo "$NEWLOCALE" >/root/instantARCH/config/locale
 
-cd /usr/share/zoneinfo
+    cd /usr/share/zoneinfo
 
-while [ -z "$REGION" ]; do
-    REGION=$(ls | fzf --prompt "select region> ")
-done
+    while [ -z "$REGION" ]; do
+        REGION=$(ls | fzf --prompt "select region> ")
+    done
+
+    if [ -d "$REGION" ]; then
+        cd "$REGION"
+        while [ -z "$CITY" ]; do
+            CITY=$(ls | fzf --prompt "select the City nearest to you> ")
+        done
+    fi
 
-if [ -d "$REGION" ]; then
-    cd "$REGION"
-    while [ -z "$CITY" ]; do
-        CITY=$(ls | fzf --prompt "select the City nearest to you> ")
+    echo "$REGION" >/root/instantARCH/config/region
+    [ -n "$CITY" ] echo "$CITY" >/root/instantARCH/config/city
+
+    while [ -z "$DISK" ]; do
+        DISK=$(fdisk -l | grep -i '^Disk /.*:' | fzf --prompt "select disk> ")
+        if ! confirm "Install on $DISK ?\n this will delete all existing data"; then
+            unset DISK
+        fi
     done
-fi
 
-echo "$REGION" >/root/instantARCH/config/region
-[ -n "$CITY" ] echo "$CITY" >/root/instantARCH/config/city
+    echo "$DISK" | grep -o '/dev/[^:]*' >/root/instantARCH/config/disk
 
-while [ -z "$DISK" ]; do
-    DISK=$(fdisk -l | grep -i '^Disk /.*:' | fzf --prompt "select disk> ")
-    if ! confirm "Install on $DISK ?\n this will delete all existing data"; then
-        unset DISK
-    fi
-done
+    NEWUSER="$(textbox 'set username')"
 
-echo "$DISK" | grep -o '/dev/[^:]*' >/root/instantARCH/config/disk
+    while ! [ "$NEWPASS" = "$NEWPASS2" ] || [ -z "$NEWPASS" ]; do
+        NEWPASS="$(passwordbox 'set password')"
+        NEWPASS2="$(passwordbox 'confirm password')"
+    done
 
-NEWUSER="$(textbox 'set username')"
+    echo "$NEWUSER" >/root/instantARCH/config/user
+    echo "$NEWPASS" >/root/instantARCH/config/password
 
-while ! [ "$NEWPASS" = "$NEWPASS2" ] || [ -z "$NEWPASS" ]; do
-    NEWPASS="$(passwordbox 'set password')"
-    NEWPASS2="$(passwordbox 'confirm password')"
-done
+    while [ -z "$NEWHOSTNAME" ]; do
+        NEWHOSTNAME=$(textbox "enter name of this computer")
+    done
 
-echo "$NEWUSER" >/root/instantARCH/config/user
-echo "$NEWPASS" >/root/instantARCH/config/password
+    echo "$NEWHOSTNAME" >/root/instantARCH/config/hostname
 
-while [ -z "$NEWHOSTNAME" ]; do
-    NEWHOSTNAME=$(textbox "enter name of this computer")
-done
+    SUMMARY="Installation Summary:"
 
-echo "$NEWHOSTNAME" >/root/instantARCH/config/hostname
+    addsum() {
+        SUMMARY="$SUMMARY
+        $1: $(cat /root/instantARCH/config/$2)"
+    }
+
+    addsum "Username" "user"
+    addsum "Locale" "locale"
+    addsum "Region" "region"
+    addsum "Nearest City" "city"
+    addsum "Keyboard layout" "keyboard"
+    addsum "Target install drive" "disk"
+    addsum "Hostname" "hostname"
+    SUMMARY="$SUMMARY
+Should installation proceed with the following parameters?"
+
+    if confirm "$SUMMARY"; then
+        touch /root/instantARCH/config/confirm
+    fi
+done
 
-messagebox "arch linux will now install. this could take a while. "
+messagebox "The installation will now begin. this could take a while. "
index 7544b86..059dea2 100755 (executable)
@@ -8,8 +8,15 @@ else
     sed -i 's/^\[Seat:\*\]/\[Seat:\*\]\ngreeter-session=lightdm-gtk-greeter/g' /etc/lightdm.conf
 fi
 
+# fix gui not showing up
+sed -i 's/^#logind-check-graphical=.*/logind-check-graphical=true/' /etc/lightdm.conf
+
 # needed to get internet to work
 systemctl enable lightdm
 systemctl enable NetworkManager
 
+# enable swap
+systemctl enable systemd-swap
+sed -i 's/^swapfc_enabled=.*/swapfc_enabled=1/' /etc/systemd/swap.conf
+
 sed -i 's/# %wheel/%wheel/g' /etc/sudoers
index f63430e..33f4d22 100755 (executable)
@@ -16,6 +16,7 @@ while ! pacman -S --noconfirm --needed \
     vim \
     openbox \
     xterm \
+    systemd-swap \
     lightdm-gtk-greeter \
     grub; do
     dialog --msgbox "package installation failed \nplease reconnect to internet" 700 700