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
29 imenu -m "Welcome to the instantOS installer"
31 # go back to the beginning if user isn't happy with settings
32 # this loop wraps the rest of the installer
33 while ! iroot confirm; do
35 # ask for keyboard layout
37 if head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then
38 loadkeys $(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
40 guimode && setxkbmap -layout $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
47 while [ -z "$DISK" ]; do
49 DISK=$(fdisk -l | grep -i '^Disk /.*:' | sed -e "\$aother (experimental)" | imenu -l "select disk> ")
50 if ! grep -q '^other' <<<"$DISK"; then
51 if ! echo "Install on $DISK ?
52 this will delete all existing data" | imenu -C; then
56 chmod +x /root/instantARCH/askdisk.sh
57 /root/instantARCH/askdisk.sh
58 if [ -e /tmp/loopaskdisk ]; then
65 if ! grep -q '^other' <<<"$DISK"; then
67 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i disk
70 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i grubdisk
74 # choice between multiple nvidia drivers
77 # create user and add to groups
80 while [ -z "$NEWHOSTNAME" ]; do
81 NEWHOSTNAME=$(imenu -i "enter name of this computer")
84 iroot hostname "$NEWHOSTNAME"
87 SUMMARY="Installation Summary:"
89 addsum "Username" "user"
90 addsum "Locale" "locale"
91 addsum "Region" "region"
92 addsum "Nearest City" "city"
93 addsum "Keyboard layout" "keyboard"
94 addsum "Target install drive" "disk"
95 addsum "Hostname" "hostname"
106 Should installation proceed with these parameters?"
108 if imenu -C <<<"$SUMMARY"; then
124 imenu -M <<<"The installation will now begin.
125 This could take a while.
126 Keep the machine powered and connected to the internet"