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 # warning message for artix
38 # ask for keyboard layout
40 if head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then
41 loadkeys $(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
43 guimode && setxkbmap -layout $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
47 # artix and manjaro mirrors work differently
48 if command -v pacstrap; then
55 while [ -z "$DISK" ]; do
57 DISK=$(fdisk -l | grep -i '^Disk /.*:' | sed -e "\$aother (experimental)" | imenu -l "select disk> ")
58 if ! grep -q '^other' <<<"$DISK"; then
59 if ! echo "Install on $DISK ?
60 this will delete all existing data" | imenu -C; then
64 chmod +x /root/instantARCH/askdisk.sh
65 /root/instantARCH/askdisk.sh
66 if [ -e /tmp/loopaskdisk ]; then
73 if ! grep -q '^other' <<<"$DISK"; then
75 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i disk
78 echo "$DISK" | grep -o '/dev/[^:]*' | iroot i grubdisk
82 # choice between multiple nvidia drivers
83 if ! grep -iq manjaro /etc/os-release; then
87 # create user and add to groups
90 while [ -z "$NEWHOSTNAME" ]; do
91 NEWHOSTNAME=$(imenu -i "enter name of this computer")
94 iroot hostname "$NEWHOSTNAME"
96 if imenu -c "edit advanced settings? (use only if you know what you're doing)"; then
97 /root/instantARCH/askadvanced.sh
101 SUMMARY="Installation Summary:"
103 addsum "Username" "user"
104 addsum "Locale" "locale"
105 addsum "Region" "region"
106 addsum "Nearest City" "city"
107 addsum "Keyboard layout" "keyboard"
108 addsum "Target install drive" "disk"
109 addsum "Hostname" "hostname"
120 Should installation proceed with these parameters?"
122 if imenu -C <<<"$SUMMARY"; then
138 imenu -M <<<"The installation will now begin.
139 This could take a while.
140 Keep the machine powered and connected to the internet.
141 After the installation, the machine will automatically reboot"