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 ] && ! [ -e /tmp/nogui ]; 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 and arrow keys' -i -l 209 -h -1 -bw 8 -a 60 -w -1 -c)"
33 if grep -iq 'cancel' <<<"$NEXTCHOICE"; then
34 echo "canceling installation"
36 touch /opt/instantos/installcanceled
37 touch /opt/instantos/statuscanceled
42 # go back to the beginning if user isn't happy with settings
43 # this loop wraps the rest of the installer
44 while ! iroot confirm; do
46 # warning message for artix
49 # ask for keyboard layout
51 if head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then
52 loadkeys $(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
54 guimode && setxkbmap -layout $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
58 # artix and manjaro mirrors work differently
59 if command -v pacstrap; then
66 while [ -z "$DISK" ]; do
68 DISK=$(fdisk -l | grep -i '^Disk /.*:' | sed -e "\$aother (experimental)" | imenu -l "select disk> ")
69 if ! grep -q '^other' <<<"$DISK"; then
70 if ! echo "Install on $DISK ?
71 this will delete all existing data" | imenu -C; then
75 chmod +x /root/instantARCH/askdisk.sh
76 /root/instantARCH/askdisk.sh
77 if [ -e /tmp/loopaskdisk ]; then
84 if ! grep -q '^other' <<<"$DISK"; then
86 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i disk
89 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i grubdisk
93 # choice between multiple nvidia drivers
94 if ! grep -iq manjaro /etc/os-release; then
98 # create user and add to groups
101 while [ -z "$NEWHOSTNAME" ]; do
102 NEWHOSTNAME=$(imenu -i "enter name of this computer")
105 iroot hostname "$NEWHOSTNAME"
107 if imenu -c -i "edit advanced settings? (use only if you know what you're doing)"; then
108 /root/instantARCH/askadvanced.sh
112 SUMMARY="Installation Summary:"
114 addsum "Username" "user"
115 addsum "Locale" "locale"
116 addsum "Region" "region"
117 addsum "Nearest City" "city"
118 addsum "Keyboard layout" "keyboard"
119 addsum "Target install drive" "disk"
120 addsum "Hostname" "hostname"
131 Should installation proceed with these parameters?"
133 if imenu -C <<<"$SUMMARY"; then
149 imenu -M <<<"The installation will now begin.
150 This could take a while.
151 Keep the machine powered and connected to the internet.
152 After the installation, the machine will automatically reboot"