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/pi.is

69 lines
2.7 KiB

systemctl enable NetworkManager
systemctl enable sddm.service
systemctl enable gdm.service
systemctl enable lightdm
whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Finishing setup" --msgbox "Well, linux is installed (kinda), let's go through the final setup and configure it a bit" 0 0
cd /usr/share/zoneinfo
echo */ | tr " " "\n" > ~/reg
sed -e 's/$/ region/' -i ~/reg
declare -a regs
regs=(`cat ~/reg`)
region_vague=$(whiptail --title "Finishing setup" --menu "Let's start with the region, select your region from below" 0 0 0 "${regs[@]}" 3>&1 1>&2 2>&3 3>&-)
echo $region_vague
cd /usr/share/zoneinfo/$region_vague
echo * | tr " " "\n" > ~/reg
sed -e 's/$/ region/' -i ~/reg
declare -a regs
regs=(`cat ~/reg`)
region_close=$(whiptail --title "Finishing setup" --menu "Select your city from below" 0 0 0 "${regs[@]}" 3>&1 1>&2 2>&3 3>&-)
ln -sf /usr/share/zoneinfo/$region_vague/$region_close /etc/localtime
hwclock --systohc
touch /etc/locale.conf
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
rm ~/reg
locale-gen
cd /
myhostname=$(whiptail --inputbox "Now choose a name for your computer" 0 0 4 3>&1 1>&2 2>&3 3>&-)
echo "127.0.0.1 localhost
::1 localhost
127.0.1.1 $myhostname.localdomain $myhostname" > /etc/hosts
echo "$myhostname" > /etc/hostname
archit=$(whiptail --backtitle "Koffe" --title "Architecture selector" --menu "Choose the bit count of your x86 chip" 0 0 4 \
64 "BIT" \
32 "BIT" 3>&1 1>&2 2>&3 3>&-)
efiornot=$(whiptail --backtitle "Koffe" --title "Boot selector" --menu "Is your soon-to-be-arch computer legacy or EUFI?" 0 0 4 \
1 "Bios/Legacy" \
2 "UEFI" 3>&1 1>&2 2>&3 3>&-)
pacman -S grub
if [[ "$efiornot" == "2" ]]
then
if [[ "$archit" == "64" ]]
then
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
fi
if [[ "$archit" == "32" ]]
then
grub-install --target=i386-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
fi
fi
if [[ "$efiornot" == "1" ]]
then
lsblk | grep disk | cut -f 1 -d ' ' > ~/drvs
sed -e 's/$/ disk/' -i ~/drvs
declare -a lname
disks=(`cat ~/drvs`)
lname=$(whiptail --title "Select drive to install grub to" --menu "Select drive to install grub to" 16 78 10 "${disks[@]}" 3>&1 1>&2 2>&3 3>&-)
grub-install --recheck /dev/$lname
grub-mkconfig -o /boot/grub/grub.cfg
fi
clear
echo Now choose a root password
passwd
myusername1=$(whiptail --inputbox "Now lets create a user, pick a username: " 0 0 4 3>&1 1>&2 2>&3 3>&-)
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
useradd -m -G wheel $myusername1
echo "and a password"
passwd $myusername1