-
Notifications
You must be signed in to change notification settings - Fork 0
/
pi.is
72 lines (72 loc) · 2.9 KB
/
pi.is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
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 UEFI?" 0 0 4 \
1 "Bios/Legacy" \
2 "UEFI" 3>&1 1>&2 2>&3 3>&-)
if [[ "$efiornot" == "2" ]]
then
if [[ "$archit" == "64" ]]
then
mkdir /boot/EFI
grub-install --target=x86_64-efi --efi-directory=/boot/
grub-mkconfig -o /boot/grub/grub.cfg
fi
if [[ "$archit" == "32" ]]
then
mkdir /boot/EFI
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
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
clear
echo "If you need to run any special commands to enable or configure something in chroot do so now"
echo "Then type 'exit' to go back to the installer"