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 imenu -m "WARNING: you're running a test version of the installer"
46 # go back to the beginning if user isn't happy with settings
47 # this loop wraps the rest of the installer
48 while ! iroot confirm; do
50 # warning message for artix
53 # ask for keyboard layout
55 if head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then
56 loadkeys "$(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")"
58 guimode && setxkbmap -layout "$(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")"
62 # artix and manjaro mirrors work differently
63 if command -v pacstrap; then
70 while [ -z "$DISK" ]; do
72 DISK=$(fdisk -l | grep -i '^Disk /.*:' | sed -e "\$aother (experimental)" | imenu -l "select disk> ")
73 if ! grep -q '^other' <<<"$DISK"; then
74 if ! echo "Install on $DISK ?
75 this will delete all existing data" | imenu -C; then
79 chmod +x /root/instantARCH/askdisk.sh
80 /root/instantARCH/askdisk.sh
81 if [ -e /tmp/loopaskdisk ]; then
88 if ! grep -q '^other' <<<"$DISK"; then
90 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i disk
93 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i grubdisk
97 # choice between multiple nvidia drivers
98 if ! grep -iq manjaro /etc/os-release; then
102 # create user and add to groups
105 while [ -z "$NEWHOSTNAME" ]; do
106 NEWHOSTNAME=$(imenu -i "enter name of this computer")
109 iroot hostname "$NEWHOSTNAME"
111 if imenu -c -i "edit advanced settings? (use only if you know what you're doing)"; then
112 /root/instantARCH/askadvanced.sh
116 SUMMARY="Installation Summary:"
118 addsum "Username" "user"
119 addsum "Locale" "locale"
120 addsum "Region" "region"
121 addsum "Subregion" "city"
122 addsum "Keyboard layout" "keyboard"
123 addsum "Target install drive" "disk"
124 addsum "Hostname" "hostname"
135 Should installation proceed with these parameters?"
140 if imenu -C <<<"$SUMMARY"; then
156 imenu -M <<<'The installation will now begin.
157 This could take a while.
158 You can check install progress by clicking on "2" in the top right
159 Keep the machine powered and connected to the internet.
160 After the installation, the machine will automatically reboot'