#!/bin/bash whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Welcome screen" --msgbox "Welcome to Koffe, the offline arch installer, with your permission we'll get started :)" 0 0 echo "Unpacking linux and the other stuff:" echo '' > /etc/pacman.conf echo '[options]' >> /etc/pacman.conf echo 'Architecture = auto' >> /etc/pacman.conf echo 'SigLevel = Never' >> /etc/pacman.conf echo 'LocalFileSigLevel = Never' >> /etc/pacman.conf echo '[koffe]' >> /etc/pacman.conf echo 'Server = file:///root/pkg' >> /etc/pacman.conf pacman -Sy whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "CFdisk" --msgbox "So, we need to partition the disk. I'll launch cfdisk for you in just a sec, just choose the disk to partition" 0 0 lsblk -r | grep disk | cut -f 1 -d ' ' > drvs sed -e 's/$/ disk/' -i drvs declare -a disks disks=(`cat drvs`) drv=$(whiptail --title "Select drive to partition" --menu "Select drive to partition" 16 78 10 "${disks[@]}" 3>&1 1>&2 2>&3 3>&-) cfdisk /dev/$drv lsblk -r | grep part | cut -f 1 -d ' ' > drvs sed -e 's/$/ part/' -i drvs declare -a parts parts=(`cat drvs`) ppart=$(whiptail --title "Select the partiton to install linux to:" --menu "Select the partiton to install linux to (this will wipe the partition):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) mkfs.ext4 /dev/$ppart mount /dev/$ppart /mnt echo no disk >> drvs parts=(`cat drvs`) pswap=$(whiptail --title "Select the partiton to install swap to:" --menu "Select the partiton to install swap to (no disk if none):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) mkswap /dev/$pswap swapon /dev/$pswap pefi=$(whiptail --title "Select the partiton to install EFI to:" --menu "Select the partiton to install EFI to (no disk if you have legacy bios):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) mkdir /mnt/boot mkfs.fat -F32 /dev/$pefi mount /dev/$pefi /mnt/boot/ extraparts=$(whiptail --inputbox "If you want to mount any other partition manually, enter the commands here like this: command 1 ; command 2 ; command 3" 0 0 0 3>&1 1>&2 2>&3 3>&-) echo $extraparts > coms bash coms whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Initial setup ready" --msgbox "Well, that was it for the initial setup, now press ok, grab a cup of coffee and wait for linux to install. Be sure to stick around for the post-install configurations tho." 0 0 #if one package errors out for whatever reason the whole pacstrap fails so i removed this implementation #pacstrap /mnt - < install.list for pac in $(cat install.list) do pacstrap /mnt $pac done genfstab -U /mnt >> /mnt/etc/fstab cp pi.is /mnt/root/ echo 'bash /root/pi.is' > /mnt/root/.bashrc echo 'echo "" > /root/.bashrc' >> /mnt/root/.bashrc arch-chroot /mnt umount -a ersp=$(whiptail --title "Installation Finished" --menu "Installation Finished. Do you want to exit to terminal OR poweroff and boot into arch?" 19 74 10 "exit" "and enter a terminal" "poweroff" "and boot into arch" 3>&1 1>&2 2>&3 3>&-) $ersp