3 # This is the interactive part of the installer
4 # Everything requiring user input is asked first,
5 # NO INSTALLATION IS DONE IN THIS SCRIPT
6 # Results get saved in /root/instantARCH/config
7 # and read out during installation
8 # results also get copied to the target root partition
10 mkdir /root/instantARCH/config
13 source <(curl -Ls git.io/paperbash)
16 source /root/instantARCH/askutils.sh
18 if [ -e /usr/share/liveutils ]; then
19 echo "GUI Mode active"
24 # switch imenu to fzf and dialog
27 imenu -m "Welcome to the instantOS installer"
29 NEXTCHOICE="$(echo '>>h Welcome to the instantOS installer
31 :r ﰸCancel' | instantmenu -q 'select using the mouse, keywords arrow keys' -i -l 209 -h -1 -bw 8 -a 60 -w -1 -c)"
32 if grep -iq cancel <<<"$NEXTCHOICE"; then
34 touch /opt/instantos/installcanceled
39 # go back to the beginning if user isn't happy with settings
40 # this loop wraps the rest of the installer
41 while ! iroot confirm; do
43 # warning message for artix
46 # ask for keyboard layout
48 if head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then
49 loadkeys $(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
51 guimode && setxkbmap -layout $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
55 # artix and manjaro mirrors work differently
56 if command -v pacstrap; then
63 while [ -z "$DISK" ]; do
65 DISK=$(fdisk -l | grep -i '^Disk /.*:' | sed -e "\$aother (experimental)" | imenu -l "select disk> ")
66 if ! grep -q '^other' <<<"$DISK"; then
67 if ! echo "Install on $DISK ?
68 this will delete all existing data" | imenu -C; then
72 chmod +x /root/instantARCH/askdisk.sh
73 /root/instantARCH/askdisk.sh
74 if [ -e /tmp/loopaskdisk ]; then
81 if ! grep -q '^other' <<<"$DISK"; then
83 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i disk
86 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i grubdisk
90 # choice between multiple nvidia drivers
91 if ! grep -iq manjaro /etc/os-release; then
95 # create user and add to groups
98 while [ -z "$NEWHOSTNAME" ]; do
99 NEWHOSTNAME=$(imenu -i "enter name of this computer")
102 iroot hostname "$NEWHOSTNAME"
104 if imenu -c -i "edit advanced settings? (use only if you know what you're doing)"; then
105 /root/instantARCH/askadvanced.sh
109 SUMMARY="Installation Summary:"
111 addsum "Username" "user"
112 addsum "Locale" "locale"
113 addsum "Region" "region"
114 addsum "Nearest City" "city"
115 addsum "Keyboard layout" "keyboard"
116 addsum "Target install drive" "disk"
117 addsum "Hostname" "hostname"
128 Should installation proceed with these parameters?"
130 if imenu -C <<<"$SUMMARY"; then
146 imenu -M <<<"The installation will now begin.
147 This could take a while.
148 Keep the machine powered and connected to the internet.
149 After the installation, the machine will automatically reboot"