├── data ├── lang │ ├── keyboard │ │ ├── other │ │ ├── belgian │ │ ├── dutch │ │ ├── finnish │ │ ├── italian │ │ ├── polish │ │ ├── russian │ │ ├── spanish │ │ ├── swedish │ │ ├── turkish │ │ ├── us │ │ ├── french │ │ └── german │ └── locale │ │ ├── english │ │ ├── german │ │ ├── italian │ │ ├── polish │ │ ├── russian │ │ ├── spanish │ │ ├── finnish │ │ └── french └── packages │ ├── extra │ └── system ├── .gitignore ├── chroot ├── cacheclean.sh ├── publish.sh ├── clean.sh ├── swap.sh ├── chroot.sh └── drivers.sh ├── justfile ├── init └── init.sh ├── bootloader ├── config.sh ├── timeout.sh ├── install.sh └── efi.sh ├── disk ├── trim.sh ├── mount.sh └── disk.sh ├── questions.txt ├── user ├── flatpak.sh ├── shell.sh ├── modify.sh ├── appearance.sh └── user.sh ├── localinstall.sh ├── desktop └── lightdm.sh ├── lang ├── apply.sh ├── locale.sh ├── timezone.sh └── xorg.sh ├── topask.sh ├── postinstall.sh ├── iroot.sh ├── calamares.sh ├── manjaro.sh ├── instantos ├── version.sh └── install.sh ├── network └── network.sh ├── depend ├── system.sh ├── extras.sh ├── mirrors.sh └── depend.sh ├── manjaro └── shellprocess.conf ├── pacstrap └── pacstrap.sh ├── utils.sh ├── moduleutils.sh ├── systeminstall.sh ├── topinstall.sh ├── ask.sh ├── CONTRIBUTING.md ├── installutils.sh ├── README.md ├── askloop.sh ├── archinstall.sh ├── LICENSE └── askutils.sh /data/lang/keyboard/other: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/lang/keyboard/belgian: -------------------------------------------------------------------------------- 1 | 2 | be -------------------------------------------------------------------------------- /data/lang/keyboard/dutch: -------------------------------------------------------------------------------- 1 | 2 | nl -------------------------------------------------------------------------------- /data/lang/keyboard/finnish: -------------------------------------------------------------------------------- 1 | 2 | fi -------------------------------------------------------------------------------- /data/lang/keyboard/italian: -------------------------------------------------------------------------------- 1 | 2 | it -------------------------------------------------------------------------------- /data/lang/keyboard/polish: -------------------------------------------------------------------------------- 1 | 2 | pl -------------------------------------------------------------------------------- /data/lang/keyboard/russian: -------------------------------------------------------------------------------- 1 | 2 | ru -------------------------------------------------------------------------------- /data/lang/keyboard/spanish: -------------------------------------------------------------------------------- 1 | 2 | es -------------------------------------------------------------------------------- /data/lang/keyboard/swedish: -------------------------------------------------------------------------------- 1 | 2 | sv -------------------------------------------------------------------------------- /data/lang/keyboard/turkish: -------------------------------------------------------------------------------- 1 | 2 | tr -------------------------------------------------------------------------------- /data/lang/keyboard/us: -------------------------------------------------------------------------------- 1 | us 2 | us -------------------------------------------------------------------------------- /data/lang/keyboard/french: -------------------------------------------------------------------------------- 1 | fr-latin1 2 | fr -------------------------------------------------------------------------------- /data/lang/keyboard/german: -------------------------------------------------------------------------------- 1 | de-latin1 2 | de -------------------------------------------------------------------------------- /data/lang/locale/english: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | keylayout 2 | config 3 | tags 4 | .nvimlog 5 | -------------------------------------------------------------------------------- /data/lang/locale/german: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | de_DE.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/italian: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | it_IT.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/polish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | pl_PL.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/russian: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | ru_RU.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/spanish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | es_ES.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/finnish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | fi_FI.UTF-8 UTF-8 3 | -------------------------------------------------------------------------------- /data/lang/locale/french: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | fr_FR.UTF-8 UTF-8 3 | -------------------------------------------------------------------------------- /chroot/cacheclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "cleaning pacman cache" 4 | command -v paccache && paccache -rk 0 5 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | default: 2 | @just --choose 3 | 4 | format: 5 | @find . -name "*.sh" -exec shfmt -w -i 4 -ci {} \; 6 | 7 | -------------------------------------------------------------------------------- /init/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ensure system time is correct 4 | 5 | echo "configuring time" 6 | if command -v timedatectl; then 7 | timedatectl set-ntp true 8 | fi 9 | -------------------------------------------------------------------------------- /data/packages/extra: -------------------------------------------------------------------------------- 1 | firefox 2 | udiskie 3 | gxkb 4 | gedit 5 | ttf-liberation 6 | xterm 7 | unzip 8 | engrampa 9 | unrar 10 | p7zip 11 | noto-fonts-emoji 12 | cups 13 | system-config-printer 14 | gnome-font-viewer 15 | noto-fonts 16 | -------------------------------------------------------------------------------- /bootloader/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if iroot nobootloader; then 4 | echo "skipping grub configuration" 5 | exit 6 | fi 7 | 8 | # update grub to detect operating systems and apply the instantOS theme 9 | grub-mkconfig -o /boot/grub/grub.cfg 10 | -------------------------------------------------------------------------------- /bootloader/timeout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sets default grub timeout to 2 4 | 5 | sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=2/g' /etc/default/grub 6 | echo 'GRUB_DISABLE_OS_PROBER=false' | tee -a /etc/default/grub 7 | update-grub 8 | 9 | grub-update 10 | -------------------------------------------------------------------------------- /disk/trim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # enables trim if the root disk supports it 4 | 5 | 6 | 7 | DISK="$(iroot disk)" 8 | 9 | if hdparm -I "$DISK" | grep -i trim | grep -iq supported; then 10 | echo 'enabling trim' 11 | systemctl enable fstrim.timer 12 | fi 13 | -------------------------------------------------------------------------------- /questions.txt: -------------------------------------------------------------------------------- 1 | layout:Keyboard Layout 2 | locale:Application Language 3 | vm:VM settings 4 | region:Region 5 | mirrors:Mirror Location 6 | askpartitioning:Disk settings 7 | drivers:Graphics Drivers 8 | user:User account 9 | hostname:Hostname 10 | advanced:Advanced settings 11 | -------------------------------------------------------------------------------- /chroot/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # make some iroot settings accessible by normal users 4 | 5 | mkdir /etc/iroot 6 | 7 | cp /root/instantARCH/config/* /etc/iroot/ 8 | chmod 755 /etc/iroot/* 9 | rm /etc/iroot/password 10 | 11 | echo "finished setting up config permissions" 12 | -------------------------------------------------------------------------------- /user/flatpak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # add flathub remote 4 | 5 | USERNAME="$(iroot user)" 6 | if command -v flatpak; then 7 | echo "enabling flathub remote" 8 | sudo -u "$USERNAME" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 9 | fi 10 | -------------------------------------------------------------------------------- /bootloader/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs grub on legacy boot systems 4 | # runs from outside the installation 5 | 6 | if iroot nobootloader; then 7 | echo "skipping grub install" 8 | exit 9 | fi 10 | 11 | echo "installing grub for legacy bios" 12 | DISK="$(iroot grubdisk)" 13 | 14 | grub-install "${DISK}" 15 | -------------------------------------------------------------------------------- /localinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /root/instantARCH/installutils.sh 4 | 5 | escript depend/mirrors "configuring mirrors" 6 | escript init/init "configuring time" 7 | escript disk/disk "partitioning disk" 8 | escript disk/mount "mounting partitions" 9 | escript pacstrap/pacstrap "installing base packages" 10 | sleep 0.5 11 | -------------------------------------------------------------------------------- /desktop/lightdm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this is run upon the first boot 4 | # for some reason lightdm doesn't get enabled sucessfully during installation 5 | 6 | if command -v lightdm; then 7 | echo "enabling lightdm" 8 | sudo systemctl enable --now lightdm 9 | else 10 | echo "lightdm not found" 11 | exit 1 12 | fi 13 | -------------------------------------------------------------------------------- /lang/apply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply locale settings 4 | 5 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 6 | 7 | SETLOCALE="$(grep '.' "$INSTANTARCH"/data/lang/locale/"$(iroot locale)" | tail -1 | grep -o '^[^ ]*')" 8 | 9 | echo "setting localectl locale to $SETLOCALE" 10 | localectl set-locale LANG="$SETLOCALE" 11 | 12 | echo "finished applying locale" 13 | -------------------------------------------------------------------------------- /user/shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # install instantSHELL and plugins 3 | 4 | echo "setting up user shell" 5 | USERNAME="$(iroot user)" 6 | [ -z "$USERNAME" ] && exit 7 | [ -e /home/"$USERNAME" ] || exit 8 | command -v instantshell || exit 9 | chown -R "$USERNAME" /home/* 10 | sudo -u "$USERNAME" instantshell install 11 | chown -R "$USERNAME" /home/* 12 | 13 | echo "finished setting up user shell" 14 | -------------------------------------------------------------------------------- /topask.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # all actions requiring user input for the installer 4 | # on top of an existing arch base 5 | 6 | source <(curl -Ls 'https://raw.githubusercontent.com/paperbenni/bash/master/import.sh') 7 | pb dialog 8 | 9 | source /root/instantARCH/askutils.sh 10 | 11 | asklayout 12 | askregion 13 | asklocale 14 | askdrivers 15 | 16 | if ! ls /home/ | grep -q ..; then 17 | askuser 18 | fi 19 | -------------------------------------------------------------------------------- /user/modify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # modify existing users to work with instantOS 4 | 5 | echo "adding groups" 6 | groupadd video &>/dev/null 7 | groupadd wheel &>/dev/null 8 | groupadd docker &>/dev/null 9 | 10 | REALUSERS="$(ls /home/ | grep -v '+')" 11 | 12 | for i in $REALUSERS; do 13 | echo "processing user $i" 14 | usermod -a -G wheel "$i" 15 | usermod -a -G video "$i" 16 | usermod -a -G docker "$i" 17 | done 18 | -------------------------------------------------------------------------------- /lang/locale.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # read out user selected locale 4 | # generate it 5 | 6 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 7 | 8 | # clear previous locale settings 9 | 10 | sed -i 's/^[^#].*//g' /etc/locale.gen 11 | cat "$INSTANTARCH"/data/lang/locale/"$(iroot locale)" >>/etc/locale.gen 12 | 13 | echo " 14 | # modified by instantARCH 15 | 16 | " >>/etc/locale.gen 17 | sleep 0.3 18 | echo "generating locales" 19 | locale-gen 20 | -------------------------------------------------------------------------------- /chroot/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # clean up installation leftovers 4 | 5 | echo "cleaning installation leftovers" 6 | 7 | if iroot hasnvidia || sudo lshw -C display | grep -i '^ *vendor' | grep -qi intel; then 8 | echo "clearing unneeded vulkan drivers" 9 | if pacman -Q amdvlk; then 10 | pacman -R --noconfirm amdvlk 11 | fi 12 | 13 | if pacman -Q lib32-amdvlk; then 14 | pacman -R --noconfirm lib32-amdvlk 15 | fi 16 | 17 | fi 18 | -------------------------------------------------------------------------------- /user/appearance.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply default theme 4 | 5 | echo "setting up default theme" 6 | 7 | # checking all requirements are there 8 | USERNAME="$(iroot user)" 9 | [ -z "$USERNAME" ] && exit 10 | [ -e /home/"$USERNAME" ] || exit 11 | command -v instantthemes || command -v imosid || exit 12 | chown -R "$USERNAME" /home/* 13 | 14 | sudo -u "$USERNAME" instantthemes apply instantos 15 | 16 | chown -R "$USERNAME" /home/* 17 | 18 | echo "finished setting up default themes" 19 | -------------------------------------------------------------------------------- /lang/timezone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # symlink timezone from user selected region 4 | 5 | cd /usr/share/zoneinfo 6 | 7 | if iroot noregion; then 8 | echo "region is getting skipped" 9 | exit 10 | fi 11 | 12 | if ! iroot timezone; then 13 | echo "setting region failed" 14 | exit 15 | fi 16 | 17 | REGION="$(iroot timezone)" 18 | 19 | ln -sf /usr/share/zoneinfo/$REGION /etc/localtime 20 | timedatectl set-timezone "$REGION" 21 | timedatectl set-ntp true 22 | 23 | hwclock --systohc 24 | 25 | echo "set timezone to $REGION" 26 | -------------------------------------------------------------------------------- /postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is run as root by instantautostart 4 | # on the actual installation after the first reboot 5 | 6 | cd /root/instantARCH || exit 1 7 | 8 | bash ./lang/xorg.sh 9 | sleep 0.5 10 | bash ./lang/locale.sh 11 | bash ./lang/apply.sh 12 | bash ./desktop/lightdm.sh 13 | 14 | # restore selected mirrorlist 15 | if [ -e "$IROOT"/mirrorlistbackup ] && grep -i "server" "$IROOT"/mirrorlistbackup; then 16 | echo "restoring mirrorlist" 17 | cat "$IROOT"/mirrorlistbackup >/etc/pacman.d/mirrorlist 18 | fi 19 | 20 | echo "instantARCH postinstall finished" 21 | -------------------------------------------------------------------------------- /lang/xorg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply user keymap 4 | 5 | KEYLANG=$(iroot keyboard) 6 | 7 | NEWXORG="$(tail -1 /root/instantARCH/data/lang/keyboard/"$KEYLANG")" 8 | 9 | if ! iroot otherkey; then 10 | NEWKEYMAP="$(head -1 /root/instantARCH/data/lang/keyboard/"$KEYLANG")" 11 | fi 12 | 13 | echo "setting xorg keymap to $NEWXORG" 14 | 15 | if pgrep Xorg; then 16 | setxkbmap -layout "$NEWXORG" 17 | fi 18 | 19 | localectl --no-convert set-x11-keymap "$NEWXORG" 20 | if [ -n "$NEWKEYMAP" ]; then 21 | echo "setting global keymap to $NEWKEYMAP" 22 | # set tty keymap 23 | localectl --no-convert set-keymap "$NEWKEYMAP" 24 | fi 25 | -------------------------------------------------------------------------------- /iroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # utility to manage installer variables 4 | 5 | IROOT="${IROOT:-/root/instantARCH/config}" 6 | 7 | [ -e "$IROOT" ] || mkdir -p "$IROOT" 8 | 9 | if [ -z "$1" ]; then 10 | echo "usage: 11 | set value: iroot field value 12 | get value: iroot field 13 | remove/stdin: iroot r/i field" 14 | exit 15 | fi 16 | 17 | if [ "$1" = "i" ]; then 18 | cat /dev/stdin >"$IROOT/$2" 19 | elif [ "$1" = "r" ]; then 20 | [ -e "$IROOT/$2" ] && rm "$IROOT/$2" 21 | elif [ -n "$2" ]; then 22 | echo "$2" >"$IROOT/$1" 23 | else 24 | if [ -e "$IROOT/$1" ]; then 25 | cat "$IROOT/$1" 26 | else 27 | exit 1 28 | fi 29 | fi 30 | -------------------------------------------------------------------------------- /calamares.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # modify the calamares install of a manjaro session 4 | # to install instantOS manjaro edition 5 | 6 | if ! command -v calamares_polkit; then 7 | echo "please run this on a manjaro live session" 8 | exit 9 | fi 10 | 11 | sudo sed -i 's/postcfg/postcfg\n - shellprocess/g' \ 12 | /etc/calamares/settings.conf 13 | 14 | curl -s 'https://raw.githubusercontent.com/instantOS/instantARCH/main/manjaro/shellprocess.conf' | 15 | sudo tee /etc/calamares/modules/shellprocess.conf 16 | 17 | curl -s 'https://raw.githubusercontent.com/instantOS/instantARCH/main/calamares.sh' | sudo tee /usr/bin/instantcalamares 18 | sudo chmod +x /usr/bin/instantcalamares 19 | -------------------------------------------------------------------------------- /bootloader/efi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs grub on uefi systems 4 | # runs from inside the installation 5 | # unlike the legacy bios grub script 6 | 7 | source /root/instantARCH/moduleutils.sh 8 | 9 | if iroot nobootloader; then 10 | echo "skipping bootloader install" 11 | exit 12 | fi 13 | 14 | mkdir /efi 15 | echo 'trying to mount '"$(iroot partefi)" 16 | mount "$(iroot partefi)" /efi || exit 1 17 | 18 | pacloop efibootmgr grub 19 | 20 | if ! grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB; then 21 | umount /efi || exit 1 22 | mkfs.fat -F32 "$(iroot partefi)" || exit 1 23 | mount "$(iroot partefi)" /efi || exit 1 24 | grub-install --efi-directory=/efi || exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /data/packages/system: -------------------------------------------------------------------------------- 1 | sudo 2 | lightdm 3 | bash 4 | zsh 5 | xterm 6 | hdparm 7 | pipewire 8 | pipewire-pulse 9 | pipewire-jack 10 | wireplumber 11 | granite 12 | alsa-utils 13 | usbutils 14 | lightdm-gtk-greeter 15 | noto-fonts 16 | otf-ipafont 17 | wqy-microhei 18 | inetutils 19 | xdg-desktop-portal-gtk 20 | xorg-xinit 21 | lshw 22 | gxkb 23 | ntfs-3g 24 | pamixer 25 | gedit 26 | ttf-liberation 27 | mpv 28 | bc 29 | gvfs-mtp 30 | exfat-utils 31 | unzip 32 | fastfetch 33 | lsb-release 34 | engrampa 35 | unrar 36 | sushi 37 | nano 38 | exa 39 | bat 40 | p7zip 41 | xdg-user-dirs-gtk 42 | noto-fonts-emoji 43 | xf86-input-evdev 44 | xf86-input-synaptics 45 | accountsservice 46 | cups 47 | samba 48 | gvfs-smb 49 | system-config-printer 50 | gnome-font-viewer 51 | trash-cli 52 | fd 53 | grub 54 | 55 | -------------------------------------------------------------------------------- /manjaro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###################################### 4 | ## an instantOS install script ## 5 | ## using calamares as a wrapper ## 6 | ## currently not actively developed ## 7 | ###################################### 8 | 9 | echo "installing instantOS manjaro edition" 10 | 11 | cd /root || exit 1 12 | [ -e instantARCH ] && rm -rf instantARCH 13 | git clone --depth=1 https://github.com/instantos/instantARCH.git 14 | cd instantARCH || exit 1 15 | chmod +x ./*.sh 16 | chmod 755 ./*/*.sh 17 | 18 | ./depend/depend.sh 19 | ./init/init.sh 20 | 21 | pacman -S --noconfirm --needed base \ 22 | linux linux-headers \ 23 | linux-lts linux-lts-headers \ 24 | linux-firmware 25 | 26 | ./depend/system.sh 27 | ./user/modify.sh 28 | ./instantos/install.sh 29 | 30 | echo "done installing instantOS" 31 | -------------------------------------------------------------------------------- /user/user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # create user account 4 | # make user default lightdm user 5 | # add user to required groups 6 | 7 | NEWUSER="$(iroot user)" 8 | NEWPASS="$(iroot password)" 9 | 10 | groupadd video &>/dev/null 11 | groupadd wheel &>/dev/null 12 | groupadd docker &>/dev/null 13 | groupadd dav_group &>/dev/null 14 | groupadd plocate &>/dev/null 15 | 16 | useradd -m "$NEWUSER" -s /usr/bin/zsh -G wheel,docker,video,dav_group,plocate 17 | echo "root:$NEWPASS" | chpasswd 18 | echo "$NEWUSER:$NEWPASS" | chpasswd 19 | 20 | groupadd -r autologin 21 | gpasswd -a "$NEWUSER" autologin 22 | 23 | echo -ne "$NEWPASS\n$NEWPASS\n" | smbpasswd -a -s "$NEWUSER" 24 | 25 | # enable autologin 26 | if ! iroot noautologin; then 27 | sed -i "s/^\[Seat:\*\]/[Seat:*]\nautologin-user=$NEWUSER/g" /etc/lightdm/lightdm.conf 28 | fi 29 | -------------------------------------------------------------------------------- /disk/mount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # mounts all partitions to to the installation medium 4 | 5 | # mountpart partname mountpoint 6 | mountpart() { 7 | if iroot "part$1"; then 8 | TMPPART="$(iroot "part$1")" 9 | echo "mounting $TMPPART to $2" 10 | 11 | if ! [ -e "$2" ]; then 12 | echo "creating mount point $2" 13 | mkdir -p "$2" 14 | fi 15 | 16 | mount "$TMPPART" "$2" 17 | else 18 | echo "using default partition for $2" 19 | fi 20 | } 21 | 22 | # todo: optional efi 23 | mountpart efi /efi 24 | 25 | mountpart root /mnt 26 | # home is optional 27 | mkdir /mnt/home 28 | mountpart home /mnt/home 29 | sleep 2 30 | 31 | if iroot partswap; then 32 | echo "activating swap" 33 | swapon "$(iroot partswap)" 34 | fi 35 | 36 | if ! mount | grep -q '/mnt'; then 37 | echo "mount failed" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /instantos/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # record version info for upgrading purposes 4 | 5 | echo "getting installation information" 6 | INSTANTOSVERSION=8 7 | export INSTANTOSVERSION 8 | 9 | mkdir -p /etc/instantos 10 | cd /etc/instantos/ || exit 1 11 | 12 | echo "$INSTANTOSVERSION" >version 13 | 14 | if iroot liveversion; then 15 | LIVEVERSION="$(iroot liveversion)" 16 | echo "detected instllation iso version $LIVEVERSION" 17 | else 18 | echo 'old installation iso used, unversioned' 19 | fi 20 | 21 | { 22 | echo "DATE=$(date '+%Y%m%d%H%M')" 23 | if [ -n "$LIVEVERSION" ]; then 24 | echo "ISOVERSION=$LIVEVERSION" 25 | fi 26 | echo "VERSION=$INSTANTOSVERSION" 27 | INSTANTARCHVERSION="$(iroot instantarchversion)" 28 | if [ -n "$LIVEVERSION" ]; then 29 | echo "INSTANTARCHVERSION=$INSTANTARCHVERSION" 30 | fi 31 | } >/etc/instantos/installinfo 32 | 33 | echo "finished getting installation information" 34 | -------------------------------------------------------------------------------- /network/network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # change hostname and 4 | # follow arch install guide for hosts 5 | 6 | NEWHOSTNAME=$(iroot hostname) 7 | 8 | # default hostname 9 | if [ -z "$NEWHOSTNAME" ]; then 10 | NEWHOSTNAME="instantos" 11 | fi 12 | 13 | echo "$NEWHOSTNAME" >/etc/hostname 14 | 15 | echo "127.0.0.1 localhost" >/etc/hosts 16 | { 17 | echo "::1 localhost" 18 | echo "127.0.1.1 $NEWHOSTNAME.localdomain $NEWHOSTNAME" 19 | echo ' 20 | # modified by instantARCH' 21 | 22 | } >>/etc/hosts 23 | curl -s 'https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD' >/tmp/sambaconfigexample 24 | if grep -q 'example' /tmp/sambaconfigexample; then 25 | echo "installing samba example config" 26 | mkdir /etc/samba 27 | cat /tmp/sambaconfigexample >smb.conf 28 | fi 29 | pacman -S --noconfirm --needed networkmanager 30 | 31 | hostnamectl set-hostname "$NEWHOSTNAME" 32 | systemctl enable NetworkManager 33 | systemctl enable sshd 34 | -------------------------------------------------------------------------------- /chroot/swap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # create swap 4 | 5 | if [ -e /opt/topinstall ] || grep -iq manjaro /etc/os-release; then 6 | echo "topinstall detected, not setting up swap" 7 | exit 8 | fi 9 | 10 | getswapfilesize() { 11 | SIZE="$(free -g | awk '/^Mem:/ {print int(($2 + 1) / 2)}')" 12 | if [ "$SIZE" -lt 1 ]; then 13 | echo "1" 14 | else 15 | echo "$SIZE" 16 | fi 17 | } 18 | 19 | genswapfile() { 20 | dd if=/dev/zero of=/swapfile bs=1M count="$(getswapfilesize)k" status=progress 21 | chmod 600 /swapfile 22 | mkswap /swapfile 23 | swapon /swapfile 24 | 25 | echo '/swapfile none swap defaults 0 0' >>/etc/fstab 26 | } 27 | 28 | if ! iroot swapmethod; then 29 | # needed to get internet to work 30 | gensystemdswap 31 | exit 32 | fi 33 | 34 | case $(iroot swapmethod) in 35 | swapfile) 36 | genswapfile 37 | ;; 38 | none) 39 | exit 40 | ;; 41 | *) 42 | genswapfile 43 | ;; 44 | esac 45 | -------------------------------------------------------------------------------- /depend/system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs basic dependencies not specific to instantOS 4 | 5 | source /root/instantARCH/moduleutils.sh 6 | 7 | echo "installing additional system software" 8 | 9 | pacman -Sy --noconfirm 10 | 11 | while ! pacman -S xorg --noconfirm --needed; do 12 | dialog --msgbox "package installation failed \nplease reconnect to internet" 700 700 13 | iroot automirror && command -v reflector && 14 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 15 | 16 | done 17 | 18 | pacloop $(cat "$INSTANTARCH"/data/packages/system) 19 | 20 | 21 | 22 | # auto install processor microcode 23 | if uname -m | grep '^x'; then 24 | echo "installing microcode" 25 | if lscpu | grep -i 'name' | grep -i 'amd'; then 26 | echo "installing AMD microcode" 27 | pacloop amd-ucode 28 | elif lscpu | grep -i 'name' | grep -i 'intel'; then 29 | echo "installing Intel microcode" 30 | pacloop intel-ucode 31 | fi 32 | fi 33 | -------------------------------------------------------------------------------- /depend/extras.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs extra third party applications 4 | 5 | source /root/instantARCH/moduleutils.sh 6 | pacman -Sy --noconfirm 7 | 8 | pacloop lshw 9 | HWINFO=:$(lshw) 10 | if grep -q 'dvd' <<<"$HWINFO" || grep -q 'cdrom' <<<"$HWINFO"; then 11 | echo "fixing dvd playback" 12 | pacloop libdvdread libdvdcss libdvdnav 13 | fi 14 | 15 | # virtualbox guest additions 16 | if iroot guestadditions; then 17 | echo "installing virtualbox guest addidions" 18 | pacman -S --noconfirm --needed virtualbox-guest-dkms 19 | touch /opt/instantos/guestadditions 20 | fi 21 | 22 | # optional user defined packages 23 | if iroot packages &>/dev/null; then 24 | echo "installing extra packages" 25 | iroot packages | pacman -S --noconfirm --needed - 26 | fi 27 | 28 | while ! pacman -S --noconfirm firefox neovim-qt; do 29 | sleep 10 30 | command -v reflector && 31 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist && 32 | pacman -Sy --noconfirm 33 | 34 | done 35 | -------------------------------------------------------------------------------- /instantos/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install all instantOS software 4 | # and apply instantOS specific changes and workarounds 5 | source /root/instantARCH/moduleutils.sh 6 | 7 | cd || exit 1 8 | 9 | [ -e instantOS ] && rm -rf instantOS 10 | 11 | while ! git clone --depth 1 https://github.com/instantOS/instantOS; do 12 | imenu -m "pull failed, please connect to the internet" 13 | done 14 | 15 | cd instantOS || exit 1 16 | 17 | # install pacman repos 18 | bash repo.sh 19 | pacman -Sy --noconfirm 20 | 21 | pacloop instantos instantdepend 22 | 23 | echo "installing pamac" 24 | sudo pacman -S pamac-all --noconfirm 25 | sed -i 's/#EnableAUR/EnableAUR/g' /etc/pamac.conf 26 | sed -i 's/#CheckAURUpdates/CheckAURUpdates/g' /etc/pamac.conf 27 | echo 'EnableFlatpak' >>/etc/pamac.conf 28 | 29 | cd ~/instantOS || exit 1 30 | 31 | if iroot noplymouth; then 32 | touch /opt/instantos/noplymouth 33 | fi 34 | 35 | bash rootinstall.sh 36 | 37 | # change greeter appearance 38 | [ -e /etc/lightdm ] || mkdir -p /etc/lightdm 39 | cat /usr/share/instantdotfiles/rootconfig/lightdm-gtk-greeter.conf >/etc/lightdm/lightdm-gtk-greeter.conf 40 | 41 | if ! iroot nobootloader; then 42 | # custom grub theme 43 | sed -i 's~^#GRUB_THEME.*~GRUB_THEME=/usr/share/grub/themes/instantos/theme.txt~g' /etc/default/grub 44 | update-grub 45 | fi 46 | 47 | echo "setting up trigger for first boot" 48 | systemctl enable instantpostinstall 49 | -------------------------------------------------------------------------------- /disk/disk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IROOT="/root/instantARCH/config" 4 | 5 | if ! iroot manualpartitioning; then 6 | # automatic disk partitioning 7 | 8 | DISK="$(iroot disk)" 9 | 10 | if efibootmgr; then 11 | echo "efi system" 12 | echo "label: dos 13 | start= 4096, size= 614400, type=ef 14 | start=618496, type=83, bootable" | sfdisk "${DISK}" 15 | 16 | DISK1="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)" 17 | DISK2="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | tail -1)" 18 | 19 | mkfs.fat -F32 "$DISK1" 20 | mkfs.ext4 -F "$DISK2" 21 | 22 | echo "$DISK1" | iroot i partefi 23 | echo "$DISK2" | iroot i partroot 24 | 25 | else 26 | echo "legacy bios" 27 | echo "label: dos 28 | type=83, bootable" | sfdisk "${DISK}" 29 | DISK1="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)" 30 | 31 | mkfs.ext4 -F "$DISK1" 32 | echo "$DISK1" | iroot i partroot 33 | 34 | fi 35 | else 36 | 37 | echo "doing manual partitioning" 38 | if iroot parthome && iroot erasehome; then 39 | echo "creating ext4 file system for home in $(iroot parthome)" 40 | mkfs.ext4 -F "$(cat $IROOT/parthome)" 41 | fi 42 | 43 | if iroot partswap; then 44 | echo "creating swap" 45 | mkswap "$(iroot partswap)" 46 | fi 47 | 48 | mkfs.ext4 -F "$(iroot partroot)" 49 | 50 | fi 51 | -------------------------------------------------------------------------------- /manjaro/shellprocess.conf: -------------------------------------------------------------------------------- 1 | # Configuration for the shell process job. 2 | # 3 | # Executes a list of commands found under the key *script*. 4 | # If the top-level key *dontChroot* is true, then the commands 5 | # are executed in the context of the live system, otherwise 6 | # in the context of the target system. In all of the commands, 7 | # the following substitutions will take place: 8 | # - `@@ROOT@@` is replaced by the root mount point of the **target** 9 | # system from the point of view of the command (for chrooted 10 | # commands, that will be */*). 11 | # - `@@USER@@` is replaced by the username, set on the user page. 12 | # 13 | # The (global) timeout for the command list can be set with 14 | # the *timeout* key. The value is a time in seconds, default 15 | # is 10 seconds if not set. 16 | # 17 | # If a command starts with "-" (a single minus sign), then the 18 | # return value of the command following the - is ignored; otherwise, 19 | # a failing command will abort the installation. This is much like 20 | # make's use of - in a command. 21 | # 22 | # The value of *script* may be: 23 | # - a single string; this is one command that is executed. 24 | # - a list of strings; these are executed one at a time, by 25 | # separate shells (/bin/sh -c is invoked for each command). 26 | # - an object, specifying a key *command* and (optionally) 27 | # a key *timeout* to set the timeout for this specific 28 | # command differently from the global setting. 29 | 30 | --- 31 | dontChroot: false 32 | timeout: 100000 33 | script: 34 | - command: "/usr/bin/instantcalamares" 35 | -------------------------------------------------------------------------------- /pacstrap/pacstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install base system to target root partition 4 | 5 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 6 | source "$INSTANTARCH"/moduleutils.sh 7 | 8 | if ! mount | grep '/mnt'; then 9 | echo "mount failed" 10 | exit 1 11 | fi 12 | 13 | pacman -Sy --noconfirm 14 | # needed to get pacstrap working on isos with expired keys 15 | pacloop archlinux-keyring 16 | 17 | # kernel selection 18 | if iroot kernel; then 19 | KERNEL="$(iroot kernel)" 20 | else 21 | # fallback to linux-lts 22 | KERNEL="linux-lts" 23 | fi 24 | 25 | # we're on arch 26 | if command -v pacstrap; then 27 | pacstraploop base 28 | pacstraploop ${KERNEL} 29 | pacstraploop ${KERNEL}-headers 30 | pacstraploop linux-firmware 31 | pacstraploop reflector 32 | else 33 | # manjaro probably 34 | pacstraploop base 35 | pacstraploop ${KERNEL} 36 | pacstraploop ${KERNEL}-headers 37 | pacstraploop linux-firmware 38 | fi 39 | 40 | # Some arch based distros have the command renamed to fstabgen 41 | if command -v genfstab; then 42 | genfstab -U /mnt >>/mnt/etc/fstab 43 | else 44 | fstabgen -U /mnt >>/mnt/etc/fstab 45 | fi 46 | 47 | cd /root || exit 1 48 | 49 | cp -r ./instantARCH /mnt/root/instantARCH 50 | 51 | # record installer iso version on installed system 52 | if [ -e /etc/instantos/liveversion ]; then 53 | cat /etc/instantos/liveversion >/mnt/root/instantARCH/config/liveversion 54 | else 55 | echo 'old iso used, unversioned' 56 | fi 57 | 58 | { 59 | cat /etc/pacman.d/mirrorlist 60 | echo '' 61 | echo '# modified by instantARCH' 62 | } >/mnt/etc/pacman.d/mirrorlist 63 | -------------------------------------------------------------------------------- /chroot/chroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # enable all sorts of configuration concerning login, lightdm, networking and grub 4 | 5 | # enable lightdm greeter 6 | if grep -q 'greeter-session' /etc/lightdm/lightdm.conf; then 7 | LASTSESSION="$(grep 'greeter-session' /etc/lightdm/lightdm.conf | tail -1)" 8 | sed -i "s/$LASTSESSION/greeter-session=lightdm-gtk-greeter/g" /etc/lightdm/lightdm.conf 9 | else 10 | sed -i 's/^\[Seat:\*\]/\[Seat:\*\]\ngreeter-session=lightdm-gtk-greeter/g' /etc/lightdm/lightdm.conf 11 | fi 12 | 13 | # set up instantwm as a default user session 14 | if grep -q '^user-session.*' /etc/lightdm/lightdm.conf; then 15 | echo "adjusting user session" 16 | sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf 17 | fi 18 | 19 | # fix gui not showing up 20 | sed -i 's/^#logind-check-graphical=.*/logind-check-graphical=true/' /etc/lightdm/lightdm.conf 21 | 22 | echo ' 23 | # modified by instantARCH' >>/etc/lightdm/lightdm.conf 24 | 25 | sed -i 's/# %wheel/%wheel/g' /etc/sudoers 26 | sed -i '/wheel.*NOPASSWD/s/^/# /g' /etc/sudoers 27 | 28 | echo 'Defaults env_reset,pwfeedback' >>/etc/sudoers 29 | 30 | systemctl enable lightdm 31 | systemctl enable NetworkManager 32 | 33 | if ! iroot nobootloader; then 34 | if ! command -v update-grub &>/dev/null; then 35 | # can't include this in package 36 | echo '#! /bin/sh 37 | grub-mkconfig -o /boot/grub/grub.cfg' >/usr/bin/update-grub 38 | chmod 755 /usr/bin/update-grub 39 | fi 40 | 41 | fi 42 | 43 | # indicator file 44 | if iroot kvm; then 45 | [ -e /opt/instantos ] || mkdir -p /opt/instantos 46 | echo "kvm" >/opt/instantos/kvm 47 | fi 48 | -------------------------------------------------------------------------------- /depend/mirrors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # fetch up to date mirrorlist of selected country 4 | # and optionally sort them 5 | # auto detect all mirrors if no country is selected 6 | 7 | if ! iroot askmirrors; then 8 | echo "skipping mirrors" 9 | exit 10 | fi 11 | 12 | echo "fetching mirrors" 13 | 14 | if ! iroot automirrors; then 15 | COUNTRYCODE="$(iroot countrycode)" 16 | echo "fetching mirrors for $COUNTRYCODE" 17 | 18 | curl -s "https://archlinux.org/mirrorlist/?country=$COUNTRYCODE&protocol=http&protocol=https&ip_version=4&use_mirror_status=on" | 19 | grep -iE '(Server|generated)' | 20 | sed 's/^#Server /Server /g' >/tmp/mirrorlist 21 | 22 | cat /etc/pacman.d/mirrorlist >/tmp/oldmirrorlist 23 | 24 | if iroot sortmirrors; then 25 | head -20 /tmp/mirrorlist >/tmp/mirrorlist2 26 | rankmirrors -n 6 /tmp/mirrorlist2 >/tmp/topmirrors 27 | cat /tmp/topmirrors 28 | sleep 0.1 29 | cat /tmp/topmirrors >/etc/pacman.d/mirrorlist 30 | sleep 2 31 | clear 32 | else 33 | echo "" >/etc/pacman.d/mirrorlist 34 | fi 35 | 36 | cat /tmp/mirrorlist >>/etc/pacman.d/mirrorlist 37 | cat /tmp/oldmirrorlist >>/etc/pacman.d/mirrorlist 38 | mkdir /root/instantARCH/backup 39 | cat /etc/pacman.d/mirrorlist >/root/instantARCH/backup/mirrorlist 40 | else 41 | echo "ranking mirrors" 42 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 43 | fi 44 | 45 | cat /etc/pacman.d/mirrorlist >"$IROOT"/mirrorlistbackup 46 | grep '^[#S]' "$IROOT"/mirrorlistbackup >/etc/pacman.d/mirrorlist 47 | cat /etc/pacman.d/mirrorlist >"$IROOT"/mirrorlistbackup 48 | -------------------------------------------------------------------------------- /utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # general utils used by multiple parts of instantARCH 4 | updaterepos() { 5 | pacman -Sy --noconfirm || return 1 6 | if [ -z "$UPDATEDKEYRING" ]; then 7 | pacman -S archlinux-keyring --noconfirm || exit 1 8 | pacman-key --populate || exit 1 9 | export UPDATEDKEYRING="true" 10 | fi 11 | if pacman -Si bash 2>&1 | grep -iq 'unrecognized archive'; then 12 | echo 'getting new mirrorlist' 13 | curl -s 'https://archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4&use_mirror_status=on' | sed 's/^#//g' >/etc/pacman.d/mirrorlist 14 | rm /var/lib/pacman/sync/* 15 | pacman -Sy --noconfirm || return 1 16 | if pacman -Si bash 2>&1 | grep -iq 'unrecognized archive'; then 17 | echo 'still problems, shuffling mirrorlist' 18 | curl -s 'https://archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4&use_mirror_status=on' | sed 's/^#//g' | shuf >/etc/pacman.d/mirrorlist 19 | rm /var/lib/pacman/sync/* 20 | fi 21 | pacman -Sy --noconfirm || return 1 22 | fi 23 | } 24 | 25 | # check if installation is run from an instantOS gui session or 26 | # other desktop or tty 27 | # all instantMENU specific features are turned off without guimode 28 | checkguimode() { 29 | if [ -e /usr/share/liveutils ] && ! [ -e /tmp/nogui ] && [ -z "$CLIMODE" ]; then 30 | echo "GUI Mode active" 31 | export GUIMODE="True" 32 | GUIMODE="True" 33 | fi 34 | } 35 | 36 | guimode() { 37 | if [ -e /opt/noguimode ]; then 38 | return 1 39 | fi 40 | 41 | if [ -n "$GUIMODE" ]; then 42 | return 0 43 | else 44 | return 1 45 | fi 46 | } 47 | 48 | export IMPORTEDUTILS="true" 49 | -------------------------------------------------------------------------------- /moduleutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # utilities that are supposed to be imported into a mudule before running it 4 | 5 | export IROOT="${IROOT:-/root/instantARCH/config}" 6 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 7 | 8 | source /root/instantARCH/utils.sh 9 | 10 | # install pacman packages and try a few things to fix pacman without user input 11 | # if installation fails 12 | pacloop() { 13 | while ! pacman -S --noconfirm --needed $@; do 14 | echo 'Package installation failed 15 | Please ensure you are connected to the internet' | imenu -M 16 | if { 17 | ! [ -e /root/instantARCH/refreshedkeyring ] || [ -z "$REFRESHEDKEYRING" ] 18 | } && ! [ "$1" = "archlinux-keyring" ]; then 19 | pacman -Sy archlinux-keyring --noconfirm 20 | export REFRESHEDKEYRING="true" 21 | mkdir /root/instantARCH 22 | touch /root/instantARCH/refreshedkeyring 23 | continue 24 | fi 25 | 26 | if command -v reflector; then 27 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 28 | else 29 | pacman-mirrors --geoip 30 | fi 31 | updaterepos 32 | echo "retrying package installation in 4 seconds" 33 | sleep 4 34 | done 35 | } 36 | 37 | # pacstrap wrapper to accomodate different arch based systems and install isos 38 | pacstraploop() { 39 | 40 | PACSTRAP_ARGLIST=() 41 | 42 | # use host package cache if installation disk is an instantOS iso 43 | # TODO function to better check if we are on an instantOS iso 44 | if [ -e /usr/share/liveutils ]; then 45 | PACSTRAP_ARGLIST+=("-c") 46 | fi 47 | 48 | while ! { 49 | if command -v pacstrap &>/dev/null; then 50 | pacstrap "${PACSTRAP_ARGLIST[@]}" /mnt $@ 51 | else 52 | basestrap "${PACSTRAP_ARGLIST[@]}" /mnt $@ 53 | fi 54 | }; do 55 | imenu -m "package installation failed. ensure you are connected to the internet" 56 | sleep 2 57 | done 58 | # clean up cache so ramfs doesn't fill up 59 | yes | pacman -Scc 60 | } 61 | -------------------------------------------------------------------------------- /systeminstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installation steps after the base system has been installed 4 | 5 | source /root/instantARCH/installutils.sh || exit 1 6 | 7 | # running twice is necessary 8 | chrootscript "depend/depend" "preparing installer packages" 9 | chrootscript "depend/depend" "preparing installer packages" 10 | 11 | 12 | chrootscript "depend/system" "installing dependencies" 13 | chrootscript "chroot/chroot" "configuring system" 14 | chrootscript "chroot/drivers" "installing drivers" 15 | chrootscript "depend/extras" "installing extras" 16 | chrootscript "lang/timezone" "setting time" 17 | chrootscript "chroot/publish" "setting config permissions" 18 | chrootscript "disk/trim" "checking for trim support" 19 | 20 | # grub: install package, install, generate config 21 | if ! iroot nobootloader; then 22 | if efibootmgr; then 23 | chrootscript "bootloader/efi" "installing bootloader" 24 | else 25 | chrootscript "bootloader/install" "installing bootloader" 26 | fi 27 | fi 28 | 29 | chrootscript "network/network" "setting up networkmanager" && 30 | chrootscript "user/user" "setting up user" && 31 | chrootscript "bootloader/config" "configuring bootloader" 32 | 33 | touch /opt/noerror 34 | [ -e /opt/noerror ] && rm /opt/noerror 35 | 36 | # make instantOS packages optional 37 | if ! iroot onlyarch && 38 | ! [ -e /opt/onlyarch ]; then 39 | 40 | # important stuff 41 | chrootscript "instantos/install" "configuring instantOS, this will take a while" 42 | chrootscript "instantos/version" "collecting version info" 43 | chrootscript "user/shell" "setting up instantshell zsh configuration" 44 | chrootscript "user/appearance" "setting up default themes" 45 | chrootscript "user/flatpak" "setting up flatpak" 46 | 47 | if grep -iq 'manjaro' /etc/os-release; then 48 | echo "manjaro extra steps" 49 | chrootscript "chroot/chroot" "extra steps for manjaro" 50 | fi 51 | fi 52 | 53 | chrootscript "lang/locale" "setting locale" 54 | 55 | chrootscript "chroot/clean" "cleaning pacman cache" 56 | chrootscript "chroot/cacheclean" "cleaning pacman cache" 57 | 58 | # mark installation as susccessful 59 | touch /opt/installsuccess 60 | -------------------------------------------------------------------------------- /topinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install instantOS on top of an existing system 4 | # this is currently not stable, tested or supported 5 | # do not use (please) 6 | 7 | # print logo 8 | echo "" 9 | echo "" 10 | curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/main/ascii.txt' | sed 's/^/ /g' 11 | echo "" 12 | echo "" 13 | 14 | if ! whoami | grep -iq '^root'; then 15 | echo "please run this as root" 16 | exit 17 | fi 18 | 19 | if ! command -v imenu; then 20 | curl -s https://raw.githubusercontent.com/instantOS/imenu/main/imenu.sh >/usr/local/bin/imenu 21 | chmod 755 /usr/local/bin/imenu 22 | fi 23 | 24 | touch /tmp/climenu 25 | 26 | # only runs on arch based distros 27 | if ! grep -Eiq '(arch|manjaro)' /etc/os-release; then 28 | echo "system does not appear to be arch based. 29 | instantARCH only works on arch based systems like Arch and Manjaro 30 | are you sure you want to run this?" | imenu -C || { 31 | imenu -m "installation canceled" 32 | exit 33 | } 34 | fi 35 | 36 | touch /opt/topinstall 37 | 38 | pacman -Sy --noconfirm 39 | 40 | # todo: askmirrors 41 | 42 | pacman -S git --noconfirm --needed 43 | 44 | cd /root 45 | [ -e instantARCH ] && rm -rf instantARCH 46 | git clone --depth=1 https://github.com/instantos/instantARCH.git 47 | cd instantARCH 48 | 49 | chmod +x *.sh 50 | chmod 755 ./*/*.sh 51 | 52 | mkdir config 53 | 54 | ./depend/depend.sh 55 | 56 | # do all actions requiring user input first 57 | ./topask.sh 58 | 59 | if ! command -v mhwd && iroot automirror; then 60 | pacman -S reflector --noconfirm --needed 61 | echo "selecting fastest mirror" 62 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 63 | pacman -Sy --noconfirm 64 | fi 65 | 66 | ./init/init.sh 67 | 68 | pacman -S --noconfirm --needed base \ 69 | linux linux-headers \ 70 | linux-lts linux-lts-headers \ 71 | linux-firmware 72 | 73 | ./depend/system.sh 74 | ./chroot/chroot.sh 75 | ./chroot/drivers.sh 76 | ./network/network.sh 77 | ./bootloader/config.sh 78 | 79 | if ! ls /home/ | grep -q ..; then 80 | ./user/modify.sh 81 | else 82 | ./user/user.sh 83 | fi 84 | 85 | ./user/shell.sh 86 | 87 | ./lang/timezone.sh 88 | ./lang/locale.sh 89 | ./lang/xorg.sh 90 | ./instantos/install.sh 91 | 92 | echo "finished installing instantOS" 93 | imenu -c "a reboot is required. reboot now?" && touch /tmp/instantosreboot 94 | rm /tmp/climenu 95 | 96 | [ -e /usr/local/bin/imenu ] && rm /usr/local/bin/imenu 97 | [ -e /tmp/instantosreboot ] && reboot 98 | -------------------------------------------------------------------------------- /ask.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 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 $INSTANTARCH/config 7 | # and read out during installation 8 | # results also get copied to the target root partition 9 | 10 | mkdir -p "$INSTANTARCH"/config &>/dev/null 11 | mkdir config &>/dev/null 12 | 13 | source <(curl -Ls 'https://raw.githubusercontent.com/paperbenni/bash/master/import.sh') 14 | pb dialog 15 | 16 | source /root/instantARCH/utils.sh 17 | source /root/instantARCH/askutils.sh 18 | 19 | checkguimode 20 | 21 | # switch imenu to using fzf and dialog 22 | if ! guimode; then 23 | touch /tmp/climenu 24 | imenu -m "Welcome to the instantOS installer" 25 | else 26 | NEXTCHOICE="$(echo '>>h  Welcome to the instantOS installer 27 | :g Next 28 | :r ﰸCancel' | instantmenu -q 'select using the mouse, keywords and arrow keys' -i -l 209 -h -1 -bw 8 -a 60 -w -1 -c)" 29 | 30 | if grep -iq 'cancel' <<<"$NEXTCHOICE"; then 31 | echo "canceling installation" 32 | mkdir /opt/instantos 33 | touch /opt/instantos/installcanceled 34 | touch /opt/instantos/statuscanceled 35 | exit 1 36 | fi 37 | if iroot installtest; then 38 | imenu -m "WARNING: you're running a test version of the installer 39 | branch: $TESTBRANCH 40 | pacman repo: ${CUSTOMINSTANTREPO:-default}" 41 | fi 42 | 43 | if [ -n "$INSTANTARCHTESTING" ]; then 44 | if imenu -c 'enable debug mode?'; then 45 | echo 'enabling debug mode' 46 | touch /tmp/installdebug 47 | export INSTALLDEBUG='true' 48 | fi 49 | fi 50 | 51 | fi 52 | 53 | /root/instantARCH/askloop.sh || { 54 | imenu -m "installation was canceled" 55 | iroot cancelinstall 1 56 | exit 0 57 | } 58 | 59 | if ! iroot confirm; then 60 | if ! iroot cancelinstall; then 61 | imenu -m 'there was an error, installation will not continue' 62 | # TODO offer uploading logs 63 | fi 64 | exit 1 65 | fi 66 | 67 | if guimode; then 68 | imenu -M <<<'The installation will now begin. 69 | This could take a while. 70 | You can check install progress and logs 71 | by clicking on "2" in the top left. 72 | Keep the machine powered and connected to the internet. 73 | When installation is finished the machine will automatically reboot' 74 | else 75 | imenu -M <<<'The installation will now begin. 76 | This could take a while. 77 | Keep the machine powered and connected to the internet. 78 | When installation is finished the machine will automatically reboot' 79 | fi 80 | -------------------------------------------------------------------------------- /chroot/drivers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # auto detect graphics card and install drivers accordingly 3 | # if the system uses nvidia, read out the user choice 4 | 5 | echo "installing video drivers" 6 | 7 | source /root/instantARCH/moduleutils.sh 8 | 9 | # works differently on manjaro 10 | if ! grep -iq '^name.*arch' /etc/os-release; then 11 | exit 12 | fi 13 | 14 | if iroot isvm; then 15 | echo "installing virtual machine drivers" 16 | if iroot kvm; then 17 | echo "installing QEMU drivers" 18 | pacloop xorg-drivers 19 | else 20 | if iroot vmware || lspci | grep -i vmware; then 21 | pacloop open-vm-tools 22 | sudo systemctl enable vmtoolsd.service 23 | fi 24 | pacloop mesa xf86-video-vmware 25 | fi 26 | else 27 | ## NVIDIA 28 | if lspci | grep -i vga | grep -i nvidia; then 29 | pacman -S --noconfirm dkms 30 | # user chooses open source, proprietary or no driver 31 | if iroot graphics; then 32 | DRIVERFILE="$IROOT/graphics" 33 | if grep -iq "nodriver" "$DRIVERFILE"; then 34 | exit 35 | elif grep -iq "dkms" "$DRIVERFILE"; then 36 | pacloop nvidia-dkms nvidia-utils 37 | 38 | if ! uname -m | grep -q '^i'; then 39 | pacloop lib32-nvidia-utils 40 | fi 41 | elif grep -iq "nvidia" "$DRIVERFILE"; then 42 | pacloop nvidia nvidia-utils nvidia-lts 43 | if ! uname -m | grep -q '^i'; then 44 | pacloop lib32-nvidia-utils 45 | fi 46 | elif grep -iq "open" "$DRIVERFILE"; then 47 | pacloop mesa xf86-video-nouveau 48 | fi 49 | 50 | if iroot graphics | grep -iEq '(|dkms)'; then 51 | echo "installing nvidia-settings" 52 | pacloop nvidia-settings 53 | fi 54 | else 55 | echo "defaulting to open source driver" 56 | pacloop mesa xf86-video-nouveau 57 | fi 58 | pacloop vulkan-icd-loader 59 | pacloop lib32-vulkan-icd-loader 60 | ## Intel 61 | elif lspci | grep -i vga | grep -i intel; then 62 | echo "intel integrated detected" 63 | pacloop mesa xf86-video-intel 64 | else 65 | echo "other graphics detected" 66 | pacloop mesa xorg-drivers 67 | fi 68 | fi 69 | 70 | # 32 bit mesa 71 | if ! uname -m | grep -q '^i'; then 72 | pacloop lib32-mesa 73 | fi 74 | 75 | if lspci | grep -i marvell; then 76 | echo "installing firmware needed for marvell wifi" 77 | pacloop linux-firmware-marvell 78 | fi 79 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to instantARCH 2 | 3 | Before implementing a feature make sure the feature is actually wanted. 4 | You can do this by discussing it on our Discord or any of the other methods mentioned on the 5 | [support site](https://instantos.github.io/instantos.github.io/support) 6 | 7 | Any change to instantARCH should meet the following requirements. 8 | 9 | It should be available in both the CLI and the GUI version. 10 | A good starting point for that is the imenu script which creates menus that adapt to running in either GUI or CLI mode. 11 | 12 | It should keep the installer usable for people with little technical knowledge. 13 | instantARCH is meant to provide a similar experience to installers Calamares or Ubuntu's Ubiquity installer. 14 | Any features that require more technical skill to understand and use should not require mandatory user input during installation. 15 | Anything like that is an unavoidable obstacle for casual users. 16 | That said, any addition to instantARCH is more than welcome, all that means is that complex functionality should be put in an "advanced options" menu of some sort. 17 | 18 | Anything requiring user input should be asked before installation. 19 | This works by putting it in the ask.sh script and saving the result with the iroot utility. 20 | and later reading it out during installation. 21 | You should be able to answer all questions before installation and then letting the computer sit for a while. 22 | There's nothing more frustrating than letting your computer with german internet sit for an entire night to discover that it stopped at some confirmation prompt you didn't anticipate. 23 | 24 | ## Stability 25 | 26 | Because instantARCH is the onboarding process for instantOS, breaking it makes 27 | the entire rest inaccessible for new or reinstalling users, so it is crucial to 28 | keep uptime as high as possible. Before contributing any changes in 29 | functionality or architecture make sure you did at least one test installation 30 | to check that it doesn't prevent installing instantOS from working. If that is 31 | not possible for you or the feature might require some more testing, PR to the 32 | testing branch instead of main. The testing branch will not be distributed to 33 | the iso automatically and is safe to break as it is opt-in through the 34 | development tools. 35 | 36 | ## Getting started with instantARCH development 37 | 38 | instantARCH uses different modules for different stages of the installation. 39 | This allows for reordering them and potentially reusing them or making some of them optional (like the uefi grub module) 40 | The central installer script asks all questions using ask.sh first and then saves the answers using the iroot utility. 41 | Then it calls all the modules that read out the answers during installation. 42 | It is important to distinguish between escript modules that run in the installation medium and chrootscript modules 43 | that get executed inside the (unfinished) installation. 44 | -------------------------------------------------------------------------------- /depend/depend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this installs dependencies needed for the installer 4 | # like fzf for menus 5 | 6 | source /root/instantARCH/moduleutils.sh 7 | 8 | if [ -e /opt/instantos/buildmedium ]; then 9 | echo "skipping dependencies" 10 | exit 11 | fi 12 | 13 | echo "downloading installer dependencies" 14 | 15 | setinfo() { 16 | if [ -e /usr/share/liveutils ]; then 17 | pkill instantmenu 18 | fi 19 | echo "$@" >/opt/instantprogress 20 | echo "$@" 21 | } 22 | 23 | setinfo "downloading installer dependencies" 24 | 25 | # mark install as non-topinstall 26 | mkdir -p /opt/instantos 27 | touch /opt/instantos/realinstall 28 | 29 | # enable multilib 30 | # do it before updating mirrors 31 | if uname -m | grep -q '^i' || 32 | grep -qi '^\[multilib' /etc/pacman.conf || 33 | grep -qi 'manjaro' /etc/os-release; then 34 | echo "not enabling multilib" 35 | else 36 | echo "enabling multilib" 37 | echo "[multilib]" >>/etc/pacman.conf 38 | echo "Include = /etc/pacman.d/mirrorlist" >>/etc/pacman.conf 39 | fi 40 | 41 | updaterepos 42 | 43 | # install reflector for automirror 44 | if ! grep -i 'manjaro' /etc/os-release; then 45 | pacloop reflector 46 | fi 47 | 48 | checkpackage() { 49 | if command -v "$1" || pacman -Qi "$1" &>/dev/null; then 50 | echo "$1 is installed" 51 | else 52 | if [ -z "$CHECKPACKAGEKEYRING" ]; then 53 | pacman -Sy 54 | pacman -S archlinux-keyring --noconfirm || exit 1 55 | export CHECKPACKAGEKEYRING="true" 56 | fi 57 | pacloop "$1" 58 | fi 59 | } 60 | 61 | installdepends() { 62 | 63 | if ! [ -e /usr/share/liveutils ]; then 64 | pacloop fzf \ 65 | gum \ 66 | expect \ 67 | git \ 68 | os-prober \ 69 | dialog \ 70 | imvirt \ 71 | lshw \ 72 | bash \ 73 | pacman-contrib \ 74 | curl 75 | 76 | else 77 | echo "installing without upgrading" 78 | 79 | checkpackage gum || return 1 80 | checkpackage fzf || return 1 81 | checkpackage expect || return 1 82 | checkpackage git || return 1 83 | checkpackage os-prober || return 1 84 | checkpackage dialog || return 1 85 | checkpackage imvirt || return 1 86 | checkpackage lshw || return 1 87 | checkpackage bash || return 1 88 | checkpackage pacman-contrib || return 1 89 | checkpackage curl || return 1 90 | fi 91 | } 92 | 93 | pacman -Sy 94 | installdepends || exit 1 95 | 96 | # upgrade instantmenu 97 | if command -v instantmenu; then 98 | pacloop instantmenu 99 | fi 100 | 101 | if [ -e /usr/share/liveutils ]; then 102 | pkill instantmenu 103 | fi 104 | 105 | # installer variables utility 106 | cat /root/instantARCH/iroot.sh >/usr/bin/iroot 107 | chmod 755 /usr/bin/iroot 108 | -------------------------------------------------------------------------------- /installutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # functions used for the actual installation 4 | 5 | # reset working dir 6 | rcd() { 7 | cd /root/instantARCH 8 | } 9 | 10 | # this gets executed if a module fails 11 | # it marks the installation as failed 12 | serror() { 13 | # touching noerror skips error checking for one check 14 | if [ -e /opt/noerror ]; then 15 | echo "skipping error" 16 | rm /opt/noerror 17 | else 18 | # indicator file 19 | touch /opt/installfailed 20 | echo "script failed" 21 | exit 1 22 | fi 23 | } 24 | 25 | # this sets the status message 26 | # displayed at the bottom of the screen when using the GUI installer 27 | setinfo() { 28 | if [ -e /usr/share/liveutils ]; then 29 | pkill instantmenu 30 | fi 31 | echo "$@" >/opt/instantprogress 32 | echo "$@" 33 | } 34 | 35 | testecho() { 36 | if [ -n "$INSTANTARCHTESTING" ]; then 37 | echo "test-message:" "$@" 38 | notify-send "$@" 39 | fi 40 | } 41 | 42 | isdebug() { 43 | if { 44 | [ -n "$INSTALLDEBUG" ] || [ -e /tmp/installdebug ] 45 | }; then 46 | echo 'debugging mode is enabled' 47 | return 0 48 | else 49 | return 1 50 | fi 51 | } 52 | 53 | # run a script inside the installation medium 54 | escript() { 55 | STARTDURATION="$SECONDS" 56 | setinfo "${2:-info}" 57 | rcd 58 | testecho "running native script $1" 59 | ./"$1".sh || serror 60 | echo "$1" >>/tmp/instantprogress 61 | debugmenu "$1" 62 | } 63 | 64 | # scripts executed in installed environment 65 | chrootscript() { 66 | STARTDURATION="$SECONDS" 67 | setinfo "${2:-info}" 68 | # check if chroot environment is working 69 | if ! mount | grep -q '/mnt'; then 70 | echo "mount failed" 71 | exit 1 72 | fi 73 | 74 | rcd 75 | 76 | testecho "running chroot script $1" 77 | 78 | arch-chroot /mnt "/root/instantARCH/${1}.sh" || serror 79 | 80 | echo "chroot: $1" >>/tmp/instantprogress 81 | 82 | debugmenu "$1" 83 | } 84 | 85 | # allows pausing the installer after each step 86 | debugmenu() { 87 | { 88 | [ -n "$INSTALLDEBUG" ] || [ -e /tmp/installdebug ] 89 | } || return 0 90 | DURATION="$((SECONDS - STARTDURATION))" 91 | DEBUGCHOICE="$( 92 | { 93 | echo "> ran task $1" 94 | echo "> took $DURATION seconds" 95 | echo ":ypause" 96 | echo ":rcancel" 97 | echo ":gcontinue" 98 | } | imenu -l "debug menu" 99 | )" 100 | case "$DEBUGCHOICE" in 101 | *pause) 102 | echo 'pausing installation' 103 | touch /tmp/installpause 104 | echo 'installation paused, waiting for removal of /tmp/installpause' 105 | while [ -e /tmp/installpause ]; do 106 | sleep 10 107 | done 108 | ;; 109 | *cancel) 110 | echo 'quitting installation' 111 | echo 'TODO: implement' 112 | ;; 113 | *continue) 114 | echo "continuing installation" 115 | ;; 116 | esac 117 | STARTDURATION=0 118 | 119 | } 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |

instantARCH

3 |

A user friendly minimal installer for instantOS

4 | 5 |

6 | 7 | Codacy Badge 8 | Discord 9 | Maintenance 10 |

11 |
12 | 13 | 14 | instantARCH is a super lightweight quick & easy to use installer for instantOS. 15 | 16 |

17 | 18 |

19 | 20 | ## Features 21 | 22 | - Ask all user input before installation 23 | - Graphical and command line interface 24 | - Lightweight 25 | - Easy to use 26 | - Netinstall that stays pretty close to Arch 27 | 28 | ## Usage 29 | 30 | instantARCH is preinstalled on all instantOS iso files (duh) and can be launched through the welcome app or the widget in the top right. 31 | It can also be run as a command line application on a vanilla arch live disk. 32 | ```sh 33 | bash <(curl -L instantos.io/install) 34 | ``` 35 | 36 | ## Comparison with other installers 37 | 38 | Why did instantOS go for a custom installer instead of just using what's out 39 | there? To be clear, all of the installers below are fine pieces of software 40 | and I do not want to talk anyone out of using them. This comparison just 41 | lists the reasons why they aren't used by instantOS and the advantages that 42 | instantARCH has over them that make it fit for the project. 43 | 44 | ### Architect 45 | 46 | Architect might seem similar at first glance but you quickly realize that it is 47 | made for people who would have been capable of installing arch the arch way 48 | anyway. The level of knowledge required is almost the same and has the same 49 | room for error. It has the possibility of executing a step twice, erasing the 50 | progress of other steps and you can absolutely end up with a non-bootable 51 | system. All of these things would be pretty big flaws for a normal setup wizard 52 | (which architect is not trying to be which makes it unfit for instantOS). 53 | 54 | ### Calamares 55 | 56 | Calamares is probably the project closest to being fit for instantOS. The user 57 | experience is clear and straight forward, all user input is asked for 58 | **before** the installation and it can well be used even by people without a 59 | lot of experience. It is still not used over instantARCH for several reasons: 60 | The hardware requirements are above those of the OS itself meaning it would 61 | prevent installation on machines that are well capable of running the OS. It 62 | is also far more complex under the hood, meaning extending it with more 63 | functionality would be a substantial amount of work. Finally only amd64 is 64 | officially supported, porting instantOS to other architectures (which is 65 | planned) would mean leaving the official support of Calamares developers. 66 | 67 | -------------------------------------------------------------------------------- /askloop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # insteractive loop for ask.sh 4 | # allows going back, cancelling the installation etc 5 | 6 | source <(curl -Ls 'https://raw.githubusercontent.com/paperbenni/bash/master/import.sh') 7 | pb dialog 8 | 9 | command -v backpush || source /root/instantARCH/askutils.sh 10 | source /root/instantARCH/utils.sh 11 | 12 | # enable choosing nothing to go back 13 | export IMENUACCEPTEMPTY="true" 14 | 15 | # TODO make questions activate this when canceled 16 | backmenu() { 17 | if ! [ -e /tmp/climenu ]; then 18 | BACKCHOICE="$(echo ':g Continue installation 19 | :b Back 20 | :r ﰸCancel installation' | instantmenu -q 'back menu' -i -l 209 -h -1 -bw 8 -a 20 -w -1 -c)" 21 | 22 | else 23 | BACKCHOICE="$(echo 'Continue installation 24 | Back 25 | Cancel installation' | imenu -l)" 26 | 27 | fi 28 | 29 | case $BACKCHOICE in 30 | *Back) 31 | backpop 32 | return 0 33 | ;; 34 | *Cancel*) 35 | unset IMENUACCEPTEMPTY 36 | if imenu -c "are you sure you want to cancel the installation?"; then 37 | iroot cancelinstall 1 38 | exit 39 | fi 40 | export IMENUACCEPTEMPTY="true" 41 | ;; 42 | *) 43 | echo "continuing installation" 44 | return 0 45 | ;; 46 | esac 47 | 48 | } 49 | 50 | # starting point 51 | export ASKTASK="" 52 | 53 | installerror() { 54 | imenu -m "there has been an error in the installer" 55 | } 56 | 57 | # ask the "next" question based on the ASKTASK value 58 | askquestion() { 59 | echo "asking question $ASKTASK" 60 | case "$ASKTASK" in 61 | ## localisation questions 62 | layout) 63 | asklayout || installerror 64 | ;; 65 | locale) 66 | asklocale || installerror 67 | ;; 68 | mirrors) 69 | askmirrors 70 | ;; 71 | region) 72 | askregion 73 | ;; 74 | drivers) 75 | askdrivers 76 | ;; 77 | vm) 78 | askvm 79 | ;; 80 | ## disk questions 81 | installdisk) 82 | askinstalldisk 83 | ;; 84 | partitioning) 85 | askpartitioning 86 | ;; 87 | editparts) 88 | askeditparts 89 | ;; 90 | root) 91 | askroot 92 | ;; 93 | home) 94 | askhome 95 | ;; 96 | grub) 97 | askgrub 98 | ;; 99 | swap) 100 | askswap 101 | ;; 102 | partswap) 103 | askpartswap 104 | ;; 105 | ## naming/account questions 106 | user) 107 | askuser 108 | ;; 109 | hostname) 110 | askhostname 111 | ;; 112 | ## Advanced options 113 | advanced) 114 | askadvanced 115 | ;; 116 | plymouth) 117 | askplymouth 118 | ;; 119 | autologin) 120 | askautologin 121 | ;; 122 | swapfile) 123 | askswapfile 124 | ;; 125 | kernel) 126 | askkernel 127 | ;; 128 | packages) 129 | askpackages 130 | ;; 131 | logs) 132 | asklogs 133 | ;; 134 | keyboardvariant) 135 | askkeyboardvariant 136 | ;; 137 | confirm) 138 | confirmask 139 | ;; 140 | *) 141 | echo "error: unknown question" 142 | exit 1 143 | ;; 144 | esac 145 | 146 | } 147 | 148 | askloop() { 149 | while [ -z "$ASKCONFIRM" ]; do 150 | [ -z "$ASKTASK" ] && ASKTASK='layout' 151 | askquestion 152 | done 153 | echo "confirmed selection" 154 | } 155 | 156 | if [ -z "$LOOPDEBUG" ]; then 157 | askloop 158 | else 159 | echo "debugging loop" 160 | fi 161 | -------------------------------------------------------------------------------- /archinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################## 4 | ## The official installer for instantOS ## 5 | ############################################## 6 | 7 | # Main startup script 8 | if [ "$1" = "test" ]; then 9 | echo "using testing branch" 10 | export TESTBRANCH="${2:-testing}" 11 | 12 | if [ -n "$3" ]; then 13 | export CUSTOMINSTANTREPO="$3" 14 | fi 15 | echo "using installer branch $TESTBRANCH" 16 | fi 17 | 18 | USEBRANCH="${TESTBRANCH:-main}" 19 | GITHUBRAW='https://raw.githubusercontent.com/instantos' 20 | 21 | # TODO: why is this here? 22 | if [ -e /root/instantARCH/moduleutils.sh ]; then 23 | source /root/instantARCH/moduleutils.sh 24 | fi 25 | 26 | if ! whoami | grep -iq '^root'; then 27 | echo "not running as root, switching" 28 | curl -s "$GITHUBRAW/instantARCH/$USEBRANCH/archinstall.sh" | sudo bash 29 | exit 30 | fi 31 | 32 | # import general utils 33 | source <(curl -Ls "$GITHUBRAW/instantARCH/$USEBRANCH/utils.sh") 34 | 35 | command -v updaterepos &>/dev/null || { 36 | echo "failed to import utils, github might be down" 37 | exit 1 38 | } 39 | 40 | if [ -e /usr/share/liveutils ]; then 41 | pgrep instantmenu || echo "preparing installation 42 | OK" | instantmenu -c -bw 4 -l 2 & 43 | else 44 | # print logo 45 | echo "" 46 | echo "" 47 | curl -s "$GITHUBRAW/instantLOGO/$USEBRANCH/ascii.txt" | sed 's/^/ /g' 48 | echo "" 49 | echo "" 50 | fi 51 | 52 | # this is duplicate code but getting rid of it would require much more code 53 | 54 | # prevent multiple instances from being launched 55 | if [ -e /tmp/instantarchpid ]; then 56 | echo "pidfile found" 57 | if kill -0 "$(cat /tmp/instantarchpid)"; then 58 | notify-send "installer already running, please do not start multiple instances" 59 | exit 1 60 | fi 61 | else 62 | echo "$$" >/tmp/instantarchpid 63 | fi 64 | 65 | if ! command -v imenu; then 66 | touch /tmp/removeimenu 67 | fi 68 | 69 | if [ -e /etc/instantos/liveversion ]; then 70 | export LIVEVERSION="$(cat /etc/instantos/liveversion)" 71 | fi 72 | 73 | # Old isos have this repo, but it was taken offline, so remove 74 | # it from pacman conf 75 | if [ "$LIVEVERSION" -lt 8 ] || [ -z "$LIVEVERSION" ]; then 76 | if grep -q '^\[community\]' /etc/pacman.conf; then 77 | echo "old iso detected, removing community repo" 78 | # Use sed to remove the lines only if they appear consecutively 79 | sed -i '/^\[extra\]$/{ 80 | N 81 | /^\[community\]\nInclude = \/etc\/pacman.d\/mirrorlist$/d 82 | }' /etc/pacman.conf 83 | fi 84 | fi 85 | 86 | command -v tzupdate && ! pgrep tzupdate && sudo tzupdate & 87 | 88 | # updated mirrorlist 89 | echo "updating mirrorlist" 90 | curl -s "$GITHUBRAW"/instantOS/main/repo.sh | bash 91 | 92 | # download imenu 93 | curl -s "$GITHUBRAW"/imenu/main/imenu.sh >/usr/bin/imenu 94 | chmod 755 /usr/bin/imenu 95 | 96 | while ! command -v imenu; do 97 | echo "installing imenu" 98 | curl -s "$GITHUBRAW"/imenu/main/imenu.sh >/usr/bin/imenu 99 | chmod 755 /usr/bin/imenu 100 | done 101 | 102 | setinfo() { 103 | if [ -e /usr/share/liveutils ]; then 104 | pkill instantmenu 105 | fi 106 | echo "$@" >/opt/instantprogress 107 | echo "$@" 108 | } 109 | 110 | if command -v python; then 111 | echo "import time; time.sleep(10009)" | python & 112 | sleep 2 113 | pkill python3 114 | fi 115 | 116 | if ! command -v git; then 117 | while [ -z "$CONTINUEINSTALLATION" ]; do 118 | if ! updaterepos || ! yes | pacman -S git --needed; then 119 | yes | pacman -Scc 120 | updaterepos 121 | else 122 | export CONTINUEINSTALLATION="true" 123 | fi 124 | done 125 | fi 126 | 127 | # ensure git is working 128 | if ! git --version; then 129 | if git --version 2>&1 | grep -i glibc; then 130 | echo "upgrading glibc" 131 | pacman -Sy glibc --noconfirm || exit 1 132 | fi 133 | if ! git --version; then 134 | echo "git is not working on your system." 135 | echo "installing instantOS requires git to be installed and working" 136 | exit 1 137 | fi 138 | fi 139 | 140 | cd /root || exit 1 141 | 142 | if [ -e instantARCH ]; then 143 | echo "removing previous instantARCH data" 144 | rm -rf instantARCH 145 | fi 146 | 147 | if [ -n "$TESTBRANCH" ]; then 148 | if [ -n "$3" ]; then 149 | export CUSTOMINSTANTREPO="$3" 150 | fi 151 | 152 | echo "using installer branch $TESTBRANCH" 153 | git clone --single-branch --branch "$TESTBRANCH" --depth=1 https://github.com/instantos/instantARCH.git 154 | export INSTANTARCHTESTING="true" 155 | else 156 | git clone --depth=1 https://github.com/instantos/instantARCH.git 157 | fi 158 | 159 | cd instantARCH || exit 1 160 | 161 | mkdir config &>/dev/null 162 | git rev-parse HEAD >config/instantarchversion 163 | 164 | # use alternative versions of the installer 165 | if [ -n "$1" ]; then 166 | case "$1" in 167 | "manual") 168 | if ! [ -e /root/manualarch ]; then 169 | echo "no manual instantARCH version found. Please clone it to /root/manualarch" 170 | sleep 5 171 | echo "exiting" 172 | exit 173 | fi 174 | rm -rf ./* 175 | cp -r /root/manualarch/* . 176 | export INSTANTARCHMANUAL="true" 177 | ;; 178 | *) 179 | echo "running normal installer version" 180 | ;; 181 | esac 182 | 183 | fi 184 | 185 | chmod +x ./*.sh 186 | chmod +x ./*/*.sh 187 | 188 | isdebug() { 189 | if { 190 | [ -n "$INSTALLDEBUG" ] || [ -e /tmp/installdebug ] 191 | }; then 192 | echo 'debugging mode is enabled' 193 | return 0 194 | else 195 | return 1 196 | fi 197 | } 198 | 199 | if isdebug; then 200 | echo 'debugging mode enabled' 201 | if [ -e /tmp/debugname ]; then 202 | echo "debugging name: $(cat /tmp/installdebug)" 203 | 204 | fi 205 | fi 206 | 207 | ./depend/depend.sh 208 | 209 | checkguimode 210 | 211 | if guimode; then 212 | # ensure instantmenu is working 213 | if ! instantmenu -v; then 214 | if instantmenu -v 2>&1 | grep -i glibc; then 215 | echo "upgrading glibc" 216 | pacman -Sy 217 | pacman -S archlinux-keyring --noconfirm || exit 1 218 | pacman -S glibc --noconfirm || exit 1 219 | fi 220 | if ! instantmenu -v; then 221 | echo "instantmenu is not working on your system." 222 | echo "installing instantOS requires instantmenu to be installed and working" 223 | exit 1 224 | fi 225 | fi 226 | fi 227 | 228 | if [ -n "$INSTANTARCHTESTING" ]; then 229 | echo "install config" 230 | iroot installtest 1 231 | fi 232 | 233 | [ -e /usr/share/liveutils ] && pkill instantmenu 234 | 235 | cd /root/instantARCH || exit 236 | 237 | ./ask.sh || { 238 | if ! [ -e /opt/instantos/installcanceled ] && ! iroot cancelinstall; then 239 | imenu -m "ask failed" 240 | echo "ask failed" && exit 241 | else 242 | rm /opt/instantos/installcanceled 243 | # clear up installation data 244 | 245 | rm -rf /root/instantARCH 246 | pkill instantosinstall 247 | sleep 1 248 | pkill -f instantosinstall 249 | 250 | pkill instantosinstaller 251 | sleep 1 252 | pkill -f instantosinstaller 253 | exit 254 | fi 255 | } 256 | 257 | if ! iroot confirm; then 258 | echo "no confirmation found, installation cancelled" 259 | exit 260 | fi 261 | 262 | unset IMENUACCEPTEMPTY 263 | 264 | chmod +x ./*.sh 265 | chmod +x ./**/*.sh 266 | 267 | # pacstrap base system 268 | echo "local install" 269 | ./localinstall.sh 2>&1 | tee /opt/localinstall && 270 | echo "system install" && 271 | ./systeminstall.sh 2>&1 | tee /opt/systeminstall # install rest of the system 272 | 273 | pkill imenu 274 | pkill instantmenu 275 | sudo pkill imenu 276 | sudo pkill instantmenu 277 | sleep 2 278 | 279 | instantsnips() { 280 | [ -e "$1" ] || return 1 281 | 282 | if [ -z "$SNIPSKEY" ] || [[ ! -r "$SNIPSKEY" ]]; then 283 | unset SNIPSKEY 284 | unset SNIPSKEYFOLDER 285 | SNIPSKEYFOLDER="$(mktemp -d)" 286 | base64 -d <<<'/Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4AGOAQ1dABbpDIikhHudTGD3+5zFub38JXQZEnEg3g30 287 | N+v4wl4gsx6f3pKd2DMaGjTB2an9B+6e/+hgkH/chhA+DI8E1tf1sqsbrO22EyFYko0bjE0Kr+x1 288 | vDYWQChckwraDXVrXlEC6SRB6qSQ8skq/23yGM+ZZ+PUMyl84THKeXWtfsgMs20LYBkZ8jJsz6ZR 289 | k9xVzy495/6+ono9qM2id69/ueIfeTG2QtxQXR7MXfZocbv0u6lhevZDlaXCTPjaQETjmES82ygd 290 | vQFxJRNOkECWgDY2UTWyLO9wCSEEaR7A8ZoezRSvWxU5ZCcyKP6gO8TLOr5l8sBjcGZPGyjOvu8E 291 | VFcFC5azSj2plGBBuAAAAAAAAAhSXmSEC6L9AAGpAo8DAACv3/owscRn+wIAAAAABFla' | xz -d >"$SNIPSKEYFOLDER/snips_key" 292 | SNIPSKEY="$SNIPSKEYFOLDER/snips_key" 293 | chmod 600 "$SNIPSKEY" 294 | fi 295 | 296 | echo "uploading $1 to snips.sh" 297 | ssh -i "$SNIPSKEY" -o StrictHostKeyChecking=no instantos@snips.sh 298 | 299 | } 300 | 301 | uploadlogs() { 302 | echo "uploading installation log" 303 | cat /opt/localinstall >/opt/install.log 304 | 305 | if [ -e /opt/systeminstall ]; then 306 | cat /opt/systeminstall >>/opt/install.log 307 | fi 308 | 309 | cd /opt || exit 310 | 311 | instantsnips 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /askutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /root/instantARCH/utils.sh 4 | 5 | # User questions are seperated into functions to be reused in alternative installers 6 | # like topinstall.sh 7 | 8 | # check if the install session is GUI or cli 9 | 10 | if [ -z "$INSTANTARCH" ]; then 11 | echo "defaulting instantarch location to /root/instantARCH" 12 | INSTANTARCH="/root/instantARCH" 13 | fi 14 | 15 | shopt -s expand_aliases 16 | alias goback='backmenu && return' 17 | alias checkback='IMENUEXIT="$?" && [ "$IMENUEXIT" = 2 ] && backmenu && return' 18 | 19 | IMENUEXIT=0 20 | 21 | BACKSTACK="" 22 | 23 | # add element to back stack 24 | backpush() { 25 | BACKSTACK="$BACKSTACK 26 | $1" 27 | } 28 | 29 | # pop element from back stack 30 | backpop() { 31 | ASKTASK="$(tail -1 <<<"$BACKSTACK")" 32 | echo "going back to $ASKTASK" 33 | BACKSTACK="$(sed '$d' <<<"$BACKSTACK")" 34 | } 35 | 36 | # add installation info to summary 37 | addsum() { 38 | SUMMARY="$SUMMARY 39 | $1: $(iroot "$2")" 40 | } 41 | 42 | # set status wallpaper 43 | wallstatus() { 44 | if [ -n "$INSTANTARCHWALL" ]; then 45 | if [ "$INSTANTARCHWALL" = "$1" ]; then 46 | return 47 | fi 48 | fi 49 | INSTANTARCHWALL="$1" 50 | [ -e /usr/share/liveutils/"$1".jpg ] && guimode && feh --bg-scale /usr/share/liveutils/"$1".jpg & 51 | } 52 | 53 | echoerr() { echo "$@" 1>&2; } 54 | 55 | getisopart() { 56 | mount | grep 'on /run/archiso\(/sfs\)\?/airootfs' | grep -o '^[^ ]*' 57 | } 58 | 59 | getisodevice() { 60 | lsblk -no pkname "$(getisopart)" 61 | } 62 | 63 | getdisks() { 64 | DISKS="$(fdisk -l | grep -i '^Disk /.*:' | sed 's/^Disk //g')" 65 | if [ -z "$IGNOREWARNINGS" ]; then 66 | grep -v "^/dev/$(getisodevice):" <<<"$DISKS" | grep -v "^$(getisopart):" 67 | else 68 | echo "$DISKS" 69 | fi 70 | } 71 | 72 | getpartitions() { 73 | PARTITIONS="$(fdisk -l | grep '^/dev' | sed 's/\*/ b /g')" 74 | if [ -z "$IGNOREWARNINGS" ]; then 75 | grep -v "^$(getisopart) " <<<"$PARTITIONS" 76 | else 77 | echo "$PARTITIONS" 78 | fi 79 | } 80 | 81 | # menu that allows choosing a partition and put it in stdout 82 | # no var 83 | choosepart() { 84 | unset RETURNPART 85 | 86 | RETURNPART="$({ 87 | getpartitions 88 | echo "I already mounted ${2:-the partition}" 89 | } | imenu -l "$1" | grep -o '^[^ ]*')" 90 | 91 | if grep -q 'already' <<<"$RETURNPART"; then 92 | RETURNMOUNT="$(imenu -i 'enter mountpoint')" 93 | if ! [ -e "$RETURNMOUNT" ]; then 94 | imenu -m "$RETURNMOUNT does not exist" 95 | return 1 96 | fi 97 | fi 98 | 99 | # not using a loop to allow going back 100 | [ -z "$RETURNPART" ] && return 1 101 | 102 | if ! [ -e "$RETURNPART" ]; then 103 | imenu -m "$RETURNPART does not exist" &>/dev/null 104 | return 1 105 | fi 106 | 107 | # check if partition is already used as root/home/swap etc 108 | if ls "$IROOT"/part* &>/dev/null; then 109 | for i in "$IROOT"/part*; do 110 | if grep "^$RETURNPART$" "$i"; then 111 | echoerr "partition $RETURNPART already taken" 112 | imenu -m "partition $RETURNPART is already selected as $i" 113 | 114 | while [ -z "$CANCELOPTION" ]; do 115 | CANCELOPTION="$(echo '> alternative options 116 | select another partition 117 | cancel partition selection' | imenu -l ' ')" 118 | done 119 | 120 | if grep -q 'cancel' <<<"$CANCELOPTION"; then 121 | iroot r manualpartitioning 122 | export CANCELPARTITIONING="true" 123 | return 1 124 | fi 125 | fi 126 | done 127 | fi 128 | 129 | echo "$RETURNPART" 130 | } 131 | 132 | 133 | 134 | # ask for keyboard layout 135 | # var: layout 136 | asklayout() { 137 | cd "$INSTANTARCH"/data/lang/keyboard || return 1 138 | wallstatus region 139 | 140 | LAYOUTLIST="$(ls)" 141 | if command -v localectl; then 142 | LAYOUTLIST="$LAYOUTLIST 143 | $(localectl list-x11-keymap-layouts | sed 's/^/- /g')" 144 | fi 145 | 146 | NEWKEY="$(echo "$LAYOUTLIST" | imenu -l 'Select keyboard layout ')" 147 | [ -z "$NEWKEY" ] && goback 148 | 149 | if grep -q '^-' <<<"$NEWKEY"; then 150 | NEWKEY="$(sed 's/- //g' <<<"$NEWKEY")" 151 | iroot otherkey "$NEWKEY" 152 | echo " 153 | $NEWKEY" >"$INSTANTARCH"/data/lang/keyboard/other 154 | fi 155 | 156 | iroot r keyvariant 157 | 158 | if iroot otherkey; then 159 | iroot keyboard other 160 | export NEWKEY="other" 161 | else 162 | iroot keyboard "$NEWKEY" 163 | fi 164 | 165 | if guimode; then 166 | setxkbmap -layout "$(tail -1 "$INSTANTARCH"/data/lang/keyboard/"$NEWKEY")" 167 | else 168 | if ! iroot otherkey && 169 | head -1 "$INSTANTARCH"/data/lang/keyboard/"$NEWKEY" | grep -q '[^ ][^ ]'; then 170 | loadkeys "$(head -1 "$INSTANTARCH"/data/lang/keyboard/"$NEWKEY")" 171 | fi 172 | fi 173 | 174 | backpush layout 175 | export ASKTASK="locale" 176 | } 177 | 178 | # ask for default locale 179 | # var: locale 180 | asklocale() { 181 | wallstatus region 182 | cd "$INSTANTARCH"/data/lang/locale || return 1 183 | # TODO: preselect based on language choice 184 | NEWLOCALE="$(ls | imenu -l 'Select language> ')" 185 | [ -z "$NEWLOCALE" ] && goback 186 | iroot locale "$NEWLOCALE" 187 | 188 | backpush locale 189 | ASKTASK="mirrors" 190 | } 191 | 192 | # ask about which hypervisor is used 193 | # var: vm 194 | askvm() { 195 | export ASKTASK="region" 196 | if imvirt | grep -iq 'physical'; then 197 | echo "system does not appear to be a virtual machine" 198 | [ -n "$MANUALSETTINGS" ] && imenu -m "no virtual machine detected" 199 | return 200 | fi 201 | 202 | imenu -c "is this system a virtual machine?" 203 | checkback 204 | if ! [ "$IMENUEXIT" = 0 ]; then 205 | echo "Are you sure it's not? 206 | giving the wrong answer here might greatly decrease performance. " | imenu -C 207 | checkback 208 | if [ "$IMENUEXIT" = 0 ]; then 209 | iroot isvm 0 210 | return 211 | fi 212 | fi 213 | 214 | iroot isvm 1 215 | 216 | HYPERVISOR="$(echo "virtualbox 217 | kvm/qemu 218 | vmware 219 | other" | imenu -l "which hypervisor is being used?")" 220 | 221 | [ -z "$HYPERVISOR" ] && goback 222 | 223 | case "$HYPERVISOR" in 224 | kvm*) 225 | if grep 'vendor' /proc/cpuinfo | grep -iq 'AMD'; then 226 | echo "WARNING: 227 | kvm/QEMU on AMD is not meant for desktop use and 228 | is lacking some graphics features. 229 | This installation will work, but some features will have to be disabled and 230 | others might not perform well. 231 | It is highly recommended to use Virtualbox instead." | imenu -M 232 | iroot kvm 1 233 | if lshw -c video | grep -iq 'qxl'; then 234 | echo "WARNING: 235 | QXL graphics detected 236 | These may trigger a severe Xorg memory leak on kvm/QEMU on AMD, 237 | leading to degraded video and input performance, 238 | please switch your video card to either virtio or passthrough 239 | until this is fixed" | imenu -M 240 | fi 241 | fi 242 | ;; 243 | vmware) 244 | iroot vmware 1 245 | ;; 246 | virtualbox) 247 | iroot virtualbox 1 248 | imenu -c "would you like to install virtualbox guest additions?" 249 | checkback 250 | if [ "$IMENUEXIT" = 0 ]; then 251 | iroot guestadditions 1 252 | fi 253 | ;; 254 | other) 255 | iroot othervm 1 256 | echo "selecting other" 257 | ;; 258 | esac 259 | backpush vm 260 | 261 | } 262 | 263 | # ask for region 264 | # var: region 265 | askregion() { 266 | wallstatus region 267 | cd /usr/share/zoneinfo || return 1 268 | 269 | TIMEZONE="$( 270 | { 271 | if command -v tzupdate &>/dev/null; then 272 | # suggest auto detected region 273 | CURZONE="$( 274 | realpath /etc/localtime | sed 's~/usr/share/zoneinfo/~~g' | 275 | sed 's/(.*)//g' | sed 's/^ *//g' | sed 's/ *$//g' | sed 's/\//  /g' 276 | )" 277 | if [ -n "$CURZONE" ]; then 278 | echo "auto-detect: $CURZONE" 279 | fi 280 | 281 | fi 282 | find . -type f | sort -u | sed 's/\.\///g' | grep -Eo '.{2,}' | sed 's/\//  /g' 283 | } | imenu -l "Select region " 284 | )" 285 | 286 | [ -z "$TIMEZONE" ] && goback 287 | 288 | # remove markup 289 | TIMEZONE="$( 290 | sed 's/  /\//g' <<<"$TIMEZONE" | sed 's/^.*: *//g' 291 | )" 292 | 293 | if [ -e "./$TIMEZONE" ]; then 294 | iroot timezone "$TIMEZONE" 295 | else 296 | imenu -e "region $TIMEZONE does not exist" 297 | unset TIMEZONE 298 | goback 299 | fi 300 | 301 | backpush region 302 | export ASKTASK="installdisk" 303 | } 304 | 305 | # offer to choose mirror country 306 | # var: mirrors 307 | askmirrors() { 308 | wallstatus region 309 | export ASKTASK="vm" 310 | if command -v pacstrap; then 311 | echo "pacstrap detected" 312 | iroot askmirrors 1 313 | else 314 | echo "non-arch base, not doing mirrors" 315 | return 316 | fi 317 | 318 | MIRRORCODE="$({ 319 | echo 'auto detect mirrors (not recommended for speed)' 320 | curl -s https://archlinux.org/mirrorlist/ | grep 'option value=".."' | sed 's/.*"\(..\)">\(.*\)<.*/\2 - \1/g' 321 | } | imenu -l 'select mirror location' | grep -o '^auto.*\|[A-Z][A-Z]$')" 322 | [ -z "$MIRRORCODE" ] && goback 323 | 324 | if grep -q 'auto detect' <<<"$MIRRORCODE"; then 325 | iroot automirrors 1 326 | MIRRORMODE="$(echo '> manually sorting mirrors may take a long time 327 | use arch ranking score (recommended) 328 | sort all mirrors by speed' | imenu -l 'choose mirror settings')" 329 | [ -z "$MIRRORMODE" ] && unset SELECTEDMIRROR && goback 330 | if grep -q 'speed' <<<"$MIRRORMODE"; then 331 | iroot sortmirrors 1 332 | fi 333 | else 334 | iroot countrycode "$MIRRORCODE" 335 | fi 336 | 337 | backpush mirrors 338 | } 339 | 340 | # choose between disks and manual partitioning 341 | # var: installdisk 342 | askinstalldisk() { 343 | wallstatus partitioning 344 | iroot -r manualpartitioning 345 | if [ -z "$(getdisks)" ]; then 346 | DISKCHOICE="$( 347 | { 348 | echo '> warning: no disk found' 349 | echo '> make sure your hard drive is plugged in and functioning correctly' 350 | echo '> ' 351 | echo 'continue regardless' 352 | echo 'cancel install' 353 | } | imenu -l 'disk error' 354 | )" 355 | 356 | [ -z "$DISKCHOICE" ] && return 357 | case "$DISKCHOICE" in 358 | cancel*) 359 | 360 | unset IMENUACCEPTEMPTY 361 | if imenu -c "are you sure you want to cancel the installation?"; then 362 | iroot cancelinstall 1 363 | exit 364 | fi 365 | export IMENUACCEPTEMPTY="true" 366 | 367 | ;; 368 | *) 369 | echo 'forcing installation to continue' 370 | ;; 371 | esac 372 | 373 | fi 374 | 375 | DISK="$( 376 | { 377 | getdisks 378 | echo 'manual partitioning' 379 | } | imenu -l "select disk> " 380 | )" 381 | 382 | [ -z "$DISK" ] && goback 383 | 384 | if grep -q '^manual partitioning' <<<"$DISK"; then 385 | backpush "installdisk" 386 | export ASKTASK="partitioning" 387 | return 388 | fi 389 | 390 | # use auto partitioning 391 | echo "Install on $DISK ? 392 | this will delete all existing data" | imenu -C 393 | checkback 394 | if ! [ "$IMENUEXIT" = 0 ]; then 395 | unset DISK 396 | return 397 | fi 398 | 399 | DISKNAME="$(grep -o '/dev/[^:]*' <<<"$DISK")" 400 | 401 | # check if disk is valid 402 | if ! [ -e "$DISKNAME" ]; then 403 | imenu -m "$DISKNAME is an invalid disk name" 404 | unset DISK 405 | unset DISKNAME 406 | return 407 | fi 408 | 409 | iroot disk "$DISKNAME" 410 | # no efi partition needed, install on disk 411 | if ! efibootmgr; then 412 | echo "legacy bios detected, installing grub on $DISKNAME" 413 | iroot grubdisk "$DISKNAME" 414 | fi 415 | 416 | backpush installdisk 417 | export ASKTASK="drivers" 418 | } 419 | 420 | ############################################## 421 | ## Beginning of partition related questions ## 422 | ############################################## 423 | 424 | # var: partitioning 425 | askpartitioning() { 426 | wallstatus partitioning 427 | iroot manualpartitioning 1 428 | STARTCHOICE="$(echo 'edit partitions 429 | choose partitions 430 | use auto partitioning' | imenu -l)" 431 | 432 | [ -z "$STARTCHOICE" ] && goback 433 | 434 | case "$STARTCHOICE" in 435 | edit*) 436 | export ASKTASK="editparts" 437 | ;; 438 | choose*) 439 | if [ -z "$(getpartitions)" ]; then 440 | echo 'warning: your disk does not appear to have any partitions. 441 | instantOS requires at least one partition. 442 | If you are unsure what this means it is suggested you use automatic partitioning' | imenu -M 443 | 444 | imenu -c 'warning: installation without any partitions will likely not work. force continuation?' 445 | checkback 446 | if ! [ "$IMENUEXIT" = 0 ]; then 447 | export ASKTASK="root" 448 | else 449 | export ASKTASK="installdisk" 450 | fi 451 | fi 452 | export ASKTASK="root" 453 | ;; 454 | *partitioning) 455 | iroot -r manualpartitioning 456 | export ASKTASK="installdisk" 457 | ;; 458 | esac 459 | 460 | backpush partitioning 461 | } 462 | 463 | # choose root partition for programs etc 464 | # var: root 465 | askroot() { 466 | wallstatus partitioning 467 | PARTROOT="$(choosepart 'choose root partition (required) ')" 468 | if [ -n "$CANCELPARTITIONING" ]; then 469 | export ASKTASK="installdisk" 470 | return 471 | fi 472 | [ -z "$PARTROOT" ] && goback 473 | 474 | [ -z "$PARTROOT" ] && goback 475 | imenu -c "This will erase all data on that partition. Continue?" 476 | checkback 477 | if ! [ "$IMENUEXIT" = 0 ]; then 478 | return 479 | fi 480 | 481 | iroot partroot "$PARTROOT" 482 | 483 | backpush root 484 | ASKTASK="home" 485 | } 486 | 487 | # cfdisk wrapper to modify partition table during installation 488 | # var: editparts 489 | askeditparts() { 490 | wallstatus partitioning 491 | { 492 | echo 'instantOS requires the following paritions: 493 | - a root partition, all data on it will be erased 494 | - an optional home partition. 495 | If not specified, the same partition as root will be used. 496 | Gives you the option to keep existing data on the partition 497 | - an optional swap partition. 498 | If not specified a swap file will be used. 499 | installing a bootloader is optional' 500 | echo '' 501 | if efibootmgr &>/dev/null; then 502 | echo 'uefi system detected, installing a bootloader requires an efi partition' 503 | else 504 | echo 'legacy bios sytem detected, might not support gpt' 505 | fi 506 | 507 | } | imenu -M 508 | 509 | EDITDISK="$(getdisks | imenu -l 'choose disk to edit> ' | grep -o '/dev/[^:]*')" 510 | echo "editing disk $EDITDISK" 511 | 512 | if guimode; then 513 | if command -v st &>/dev/null; then 514 | st -e bash -c "cfdisk $EDITDISK" 515 | elif command -v urxvt &>/dev/null; then 516 | urxvt -e bash -c "cfdisk $EDITDISK" 517 | else 518 | xterm -e bash -c "cfdisk $EDITDISK" 519 | fi 520 | else 521 | cfdisk "$EDITDISK" 522 | fi 523 | 524 | iroot disk "$EDITDISK" 525 | export ASKTASK="root" 526 | } 527 | 528 | # choose home partition, allow using existing content or reformatting 529 | askhome() { 530 | wallstatus partitioning 531 | imenu -c "do you want to use a seperate home partition?" 532 | checkback 533 | if ! [ "$IMENUEXIT" = 0 ]; then 534 | backpush home 535 | export ASKTASK="swap" 536 | return 537 | fi 538 | 539 | HOMEPART="$(choosepart 'choose home partition >')" 540 | if [ -n "$CANCELPARTITIONING" ]; then 541 | export ASKTASK="installdisk" 542 | return 543 | fi 544 | [ -z "$HOMEPART" ] && goback 545 | 546 | case "$(echo 'keep current home data 547 | erase data' | imenu -l)" in 548 | keep*) 549 | echo "keeping data" 550 | imenu -c "overwrite dotfiles? ( warning, disabling this can impact functionality )" 551 | checkback 552 | if ! [ "$IMENUEXIT" = 0 ]; then 553 | iroot keepdotfiles 1 554 | fi 555 | 556 | ;; 557 | erase*) 558 | echo "erasing" 559 | iroot erasehome 1 560 | ;; 561 | esac 562 | 563 | iroot parthome "$HOMEPART" 564 | 565 | backpush home 566 | export ASKTASK="swap" 567 | } 568 | 569 | # choose swap partition or swap file 570 | # var: swap 571 | askswap() { 572 | wallstatus partitioning 573 | CHOICE="$(echo 'use a swap file (default) 574 | use a swap partition' | imenu -l)" 575 | 576 | [ -z "$CHOICE" ] && goback 577 | export ASKTASK="grub" 578 | 579 | case "$CHOICE" in 580 | *"(default)") 581 | echo "using a swap file" 582 | iroot swapmethod "swapfile" 583 | iroot swapfile 1 584 | iroot -r partswap 585 | # TODO 586 | ;; 587 | *partition) 588 | echo "using a swap partition" 589 | export ASKTASK="partswap" 590 | ;; 591 | esac 592 | 593 | } 594 | 595 | askpartswap() { 596 | wallstatus partitioning 597 | PARTSWAP="$(choosepart 'choose swap partition> ')" 598 | if [ -n "$CANCELPARTITIONING" ]; then 599 | export ASKTASK="installdisk" 600 | return 601 | fi 602 | [ -z "$PARTSWAP" ] && goback 603 | 604 | imenu -c "This will erase all data on that partition. It should also be on a fast drive. Continue?" 605 | checkback 606 | if ! [ "$IMENUEXIT" = 0 ]; then 607 | return 608 | fi 609 | 610 | echo "$PARTSWAP will be used as swap" 611 | iroot partswap "$PARTSWAP" 612 | backpush swap 613 | export ASKTASK="grub" 614 | } 615 | 616 | # choose wether to install grub and where to install it 617 | # var: grub 618 | askgrub() { 619 | 620 | while [ -z "$BOOTLOADERCONFIRM" ]; do 621 | imenu -c "install bootloader (grub) ? (recommended)" 622 | checkback 623 | if ! [ "$IMENUEXIT" = 0 ]; then 624 | checkback 625 | imenu -c "are you sure? This could make the system unbootable. " 626 | if [ "$IMENUEXIT" = 0 ]; then 627 | iroot nobootloader 1 628 | export ASKTASK="drivers" 629 | return 630 | else 631 | export ASKTASK="grub" 632 | return 633 | fi 634 | else 635 | BOOTLOADERCONFIRM="true" 636 | fi 637 | done 638 | 639 | if efibootmgr; then 640 | EFIPART="$(choosepart 'select efi partition')" 641 | if [ -n "$CANCELPARTITIONING" ]; then 642 | export ASKTASK="installdisk" 643 | return 644 | fi 645 | 646 | [ -z "$EFIPART" ] && goback 647 | iroot partefi "$EFIPART" 648 | 649 | else 650 | GRUBDISK=$(getdisks | imenu -l "select disk for grub " | grep -o '/dev/[^:]*') 651 | [ -z "$GRUBDISK" ] && goback 652 | echo "grub disk $GRUBDISK" 653 | iroot grubdisk "$GRUBDISK" 654 | fi 655 | 656 | backpush grub 657 | export ASKTASK="drivers" 658 | } 659 | 660 | ######################################## 661 | ## End of partition related questions ## 662 | ######################################## 663 | 664 | # choose between different nvidia drivers 665 | # var: drivers 666 | askdrivers() { 667 | 668 | export ASKTASK="logs" 669 | grep -iq manjaro /etc/os-release && return 670 | if lspci | grep -iq 'nvidia'; then 671 | echo "nvidia card detected" 672 | else 673 | echo "no nvidia card, not asking for drivers" 674 | [ -n "$MANUALSETTINGS" ] && imenu -m "there are no third party drivers needed for your graphics card" 675 | return 676 | fi 677 | 678 | iroot hasnvidia 1 679 | 680 | DRIVERCHOICE="$(echo 'nvidia proprietary (recommended) 681 | nvidia-dkms (try if proprietary does not work) 682 | nouveau open source 683 | install without graphics drivers (not recommended)' | imenu -l 'select graphics drivers')" 684 | [ -z "$DRIVERCHOICE" ] && goback 685 | 686 | if grep -q "without" <<<"$DRIVERCHOICE"; then 687 | echo "are you sure you do not want to install graphics drivers? 688 | This could prevent the system from booting" | imenu -C 689 | checkback 690 | if ! [ "$IMENUEXIT" = 0 ]; then 691 | unset DRIVERCHOICE 692 | fi 693 | fi 694 | 695 | if grep -qi "dkms" <<<"$DRIVERCHOICE"; then 696 | iroot graphics "dkms" 697 | elif grep -qi "nvidia" <<<"$DRIVERCHOICE"; then 698 | iroot graphics "nvidia" 699 | elif grep -qi "open" <<<"$DRIVERCHOICE"; then 700 | iroot graphics "open" 701 | elif [ -z "$DRIVERCHOICE" ]; then 702 | iroot graphics "nodriver" 703 | fi 704 | 705 | backpush drivers 706 | } 707 | 708 | asklogs() { 709 | imenu -c "backup installation logs to snips.sh ? (disabled by default)" 710 | checkback 711 | if [ "$IMENUEXIT" = 0 ]; then 712 | iroot logging 1 713 | else 714 | iroot r logging 715 | fi 716 | backpush logs 717 | export ASKTASK="user" 718 | } 719 | 720 | # ask for user details 721 | # var: user 722 | askuser() { 723 | wallstatus user 724 | NEWUSER="$(imenu -i 'set username')" 725 | [ -z "$NEWUSER" ] && goback 726 | # validate input as a unix name 727 | if ! grep -Eq '^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$' <<<"$NEWUSER"; then 728 | imenu -e "invalid username, usernames must not contain spaces or special symbols and start with a lowercase letter" 729 | return 730 | fi 731 | 732 | NEWPASS="$(imenu -P 'set password')" 733 | [ -z "$NEWPASS" ] && goback 734 | NEWPASS2="$(imenu -P 'confirm password')" 735 | [ -z "$NEWPASS2" ] && goback 736 | if ! [ "$NEWPASS" = "$NEWPASS2" ]; then 737 | echo "the confirmation password doesn't match. 738 | Please enter a new password" | imenu -M 739 | unset NEWPASS2 740 | unset NEWPASS 741 | return 742 | fi 743 | 744 | iroot user "$NEWUSER" 745 | iroot password "$NEWPASS" 746 | 747 | backpush user 748 | export ASKTASK="hostname" 749 | } 750 | 751 | # var: hostname 752 | askhostname() { 753 | 754 | NEWHOSTNAME="$(imenu -i "enter the name of this computer")" 755 | [ -z "$NEWHOSTNAME" ] && goback 756 | if ! grep -q -E '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' <<<"$NEWHOSTNAME"; then 757 | imenu -m "$NEWHOSTNAME is not a valid hostname" 758 | return 759 | fi 760 | 761 | iroot hostname "$NEWHOSTNAME" 762 | 763 | backpush hostname 764 | export ASKTASK="advanced" 765 | } 766 | 767 | ############################################################################################ 768 | ## optional advanced options that allow more experienced users to customize their install ## 769 | ############################################################################################ 770 | 771 | # var: plymouth 772 | askautologin() { 773 | imenu -c "enable autologin ? " 774 | checkback 775 | if [ "$IMENUEXIT" = 0 ]; then 776 | iroot r noautologin 777 | else 778 | iroot noautologin 1 779 | echo "disabling autologin" 780 | fi 781 | export ASKTASK="advanced" 782 | } 783 | 784 | askplymouth() { 785 | echo "editing autologin" 786 | imenu -c "enable plymouth ? " 787 | checkback 788 | if [ "$IMENUEXIT" = 0 ]; then 789 | iroot r noplymouth 790 | else 791 | iroot noplymouth 1 792 | echo "disabling plymouth" 793 | fi 794 | export ASKTASK="advanced" 795 | } 796 | 797 | askswapfile() { 798 | SWAPMETHOD="$(echo 'swapfile 799 | none' | imenu -l 'choose swap method')" 800 | 801 | iroot swapmethod "$SWAPMETHOD" 802 | 803 | export ASKTASK="advanced" 804 | } 805 | 806 | askkernel() { 807 | unset CUSTOMKERNEL 808 | export ASKTASK="advanced" 809 | CUSTOMKERNEL="$(echo 'linux 810 | linux-lts 811 | linux-zen' | imenu -l 'select kernel')" 812 | [ -z "$CUSTOMKERNEL" ] && return 813 | 814 | iroot kernel "$CUSTOMKERNEL" 815 | echo "selected $CUSTOMKERNEL kernel" 816 | 817 | } 818 | 819 | # var: keyboardvariant 820 | askkeyboardvariant() { 821 | unset KEYVARIANT 822 | export ASKTASK="advanced" 823 | KEYVARIANT="$(localectl list-x11-keymap-variants "$(iroot keyboard)" | imenu -l 'select keyboard variant')" 824 | [ -z "$KEYVARIANT" ] && return 825 | iroot keyvariant "$KEYVARIANT" 826 | } 827 | 828 | askpackages() { 829 | PACKAGELIST="$(echo 'libreoffice-fresh 830 | lutris 831 | chromium 832 | code 833 | pcmanfm 834 | obs-studio 835 | krita 836 | gimp 837 | inkscape 838 | audacity 839 | virtualbox' | imenu -b 'select extra packages to install')" 840 | 841 | if [ -z "${PACKAGELIST[0]}" ]; then 842 | echo "No extra packages to install" 843 | return 844 | fi 845 | 846 | if grep 'lutris' <<<"$PACKAGELIST"; then 847 | PACKAGELIST="$PACKAGELIST 848 | wine 849 | vulkan-tools" 850 | fi 851 | 852 | if grep 'virtualbox' <<<"$PACKAGELIST"; then 853 | PACKAGELIST="$PACKAGELIST 854 | virtualbox-host-modules-arch" 855 | fi 856 | 857 | echo "adding extra packages to installation" 858 | iroot packages "$PACKAGELIST" 859 | 860 | export ASKTASK="advanced" 861 | } 862 | 863 | # var: advanced 864 | askadvanced() { 865 | wallstatus advanced 866 | if ! iroot advancedsettings && ! imenu -c -i "edit advanced settings? (use only if you know what you're doing)"; then 867 | backpush advanced 868 | export ASKTASK="confirm" 869 | return 870 | fi 871 | 872 | iroot advancedsettings 1 873 | 874 | CHOICE="$(echo 'autologin 875 | plymouth 876 | kernel 877 | swap 878 | packages 879 | keyboardvariant 880 | OK' | imenu -l 'select option')" 881 | 882 | [ -z "$CHOICE" ] && goback 883 | 884 | if [ "$CHOICE" = "OK" ]; then 885 | echo "confirming advanced settings" 886 | backpush advanced 887 | export ASKTASK="confirm" 888 | return 889 | fi 890 | 891 | unset SWAPCONFIRM 892 | if grep -q swap <<<"$CHOICE"; then 893 | while [ -z "$SWAPCONFIRM" ]; do 894 | askswap 895 | if grep -q 'partswap' <<<"$ASKTASK"; then 896 | askpartswap 897 | if iroot partswap; then 898 | export SWAPCONFIRM="1" 899 | fi 900 | else 901 | export SWAPCONFIRM="1" 902 | fi 903 | done 904 | CHOICE="advanced" 905 | fi 906 | 907 | export ASKTASK="$CHOICE" 908 | } 909 | 910 | ############################### 911 | ## end of question functions ## 912 | ############################### 913 | 914 | questionmenu() { 915 | 916 | while :; do 917 | CHOICE="$( 918 | { 919 | grep -o '[^:]*$' /root/instantARCH/questions.txt 920 | echo OK 921 | } | imenu -l 'edit options' 922 | )" 923 | if [ -z "$CHOICE" ]; then 924 | continue 925 | elif [ "$CHOICE" = "OK" ]; then 926 | return 927 | elif grep -i advanced <<<"$CHOICE"; then 928 | # this goes right back to the end so no need to ask manually 929 | export ASKTASK="advanced" 930 | return 931 | fi 932 | 933 | export ASKTASK="$(grep "$CHOICE" /root/instantARCH/questions.txt | grep -o '^[^:]*')" 934 | export MANUALSETTINGS=true 935 | [ -n "$ASKTASK" ] && askquestion 936 | unset MANUALSETTINGS 937 | export ASKTASK="confirm" 938 | 939 | done 940 | } 941 | 942 | # confirm installation questions 943 | # var: confirm 944 | confirmask() { 945 | 946 | clearsummary() { 947 | unset CITY 948 | unset REGION 949 | unset DISK 950 | unset NEWKEY 951 | unset NEWLOCALE 952 | unset NEWPASS2 953 | unset NEWPASS 954 | unset NEWHOSTNAME 955 | unset NEWUSER 956 | } 957 | 958 | SUMMARY="Installation Summary:" 959 | 960 | addsum "Username" "user" 961 | addsum "Locale" "locale" 962 | addsum "Region" "region" 963 | addsum "Subregion" "city" 964 | 965 | if iroot otherkey; then 966 | addsum "Keyboard layout" "otherkey" 967 | else 968 | addsum "Keyboard layout" "keyboard" 969 | fi 970 | 971 | if iroot manualpartitioning; then 972 | SUMMARY="$SUMMARY 973 | manual partitioning: " 974 | disksum() { 975 | if iroot "part${1}"; then 976 | addsum "$1 partition" "part$1" 977 | fi 978 | } 979 | disksum "root" 980 | disksum "home" 981 | disksum "swap" 982 | disksum "grub" 983 | else 984 | addsum "Target install drive" "disk" 985 | fi 986 | 987 | addsum "Hostname" "hostname" 988 | 989 | if iroot manualpartitioning && iroot nobootloader; then 990 | SUMMARY="$SUMMARY 991 | GRUB: none" 992 | else 993 | if efibootmgr; then 994 | SUMMARY="$SUMMARY 995 | GRUB: UEFI" 996 | else 997 | SUMMARY="$SUMMARY 998 | GRUB: BIOS" 999 | fi 1000 | fi 1001 | 1002 | SUMMARY="$SUMMARY 1003 | Should installation proceed with these parameters?" 1004 | 1005 | echo "installation summary: 1006 | $SUMMARY" 1007 | 1008 | if ! guimode; then 1009 | SUMMARY="$(sed 's/^/> /g' <<<"$SUMMARY") 1010 | > 1011 | continue 1012 | edit options 1013 | restart installation 1014 | cancel installation" 1015 | 1016 | else 1017 | SUMMARY="$(sed 's/^/> /g' <<<"$SUMMARY") 1018 | > 1019 | :gcontinue 1020 | edit options 1021 | :yrestart installation 1022 | :rcancel installation" 1023 | 1024 | fi 1025 | 1026 | CHOICE="$( 1027 | imenu -l "installation summary" <<<"$SUMMARY" | sed 's/^:.//g' 1028 | )" 1029 | 1030 | if [ "$CHOICE" = "continue" ]; then 1031 | clearsummary 1032 | fi 1033 | 1034 | case "$CHOICE" in 1035 | *continue) 1036 | iroot confirm 1 1037 | export ASKCONFIRM="true" 1038 | ;; 1039 | *options) 1040 | echo "editing options" 1041 | questionmenu 1042 | ;; 1043 | "restart installation") 1044 | unset IMENUACCEPTEMPTY 1045 | if imenu -c "are you sure you want to restart the installation from the beginning?"; then 1046 | export ASKTASK="" 1047 | fi 1048 | export IMENUACCEPTEMPTY="true" 1049 | return 1050 | ;; 1051 | "cancel installation") 1052 | unset IMENUACCEPTEMPTY 1053 | if imenu -c "are you sure you want to cancel the installation?"; then 1054 | iroot cancelinstall 1 1055 | exit 1056 | fi 1057 | export IMENUACCEPTEMPTY="true" 1058 | ;; 1059 | esac 1060 | 1061 | } 1062 | --------------------------------------------------------------------------------