Offline archlinux installer ISO creator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
koffe/koffe.is

47 lines
2.8 KiB

#!/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
repo-add /root/pkg/koffe.db.tar.gz /root/pkg/*
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 | 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 | grep part | cut -f 1 -d ' ' | cut -c 3- > 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
#to implement extras file
pacstrap /mnt - < install.list
cp pi.is /mnt/root/
echo 'bash /root/pi.is' > /mnt/root/.bashrc
echo 'echo "" > /root/.bashrc' >> /mnt/root/.bashrc
arch-chroot /mnt
whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Goodbye screen" --msgbox "Well, that was everything. I'll reboot the system for you" 0 0
reboot