137 lines
3.6 KiB
Plaintext
137 lines
3.6 KiB
Plaintext
# screen 1
|
|
whiptail --title "Welcome" --backtitle "SaturnArch" --msgbox "Welcome to SaturnArch installation wizard" 12 80
|
|
|
|
# screen 3
|
|
exec 3>&1;
|
|
job=$(whiptail --title "Disks" --backtitle "SaturnArch" --menu "Do you whant edit disks before install?" 25 78 10 \
|
|
"yes" "Delete\Create\Formate Disks Partions." \
|
|
"no" "Disks are ready for install" 2>&1 1>&3)
|
|
exec 3>&-;
|
|
|
|
while [ "$job" == "yes" ]; do
|
|
|
|
exec 3>&1;
|
|
disk=$(whiptail --title "Disk for edit" --backtitle "SaturnArch" --menu "Select disk for edit" 25 90 10 `lsblk -r -o name,size -n -d` 2>&1 1>&3)
|
|
exec 3>&-;
|
|
|
|
cfdisk /dev/$disk;
|
|
|
|
exec 3>&1;
|
|
job=$(whiptail --title "Disks" --backtitle "SaturnArch" --menu "Edit another disk?" 25 78 10 \
|
|
"yes" "Im not done, I need edit another" \
|
|
"no" "Im done" 2>&1 1>&3)
|
|
exec 3>&-;
|
|
done
|
|
|
|
exec 3>&1;
|
|
disk=$(whiptail --title "Disk for install" --backtitle "SaturnArch" --menu "Select disk for SaturnArch install" 25 90 10 `lsblk -r -o name,size -n` 2>&1 1>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
grubdisk=$(whiptail --title "Disk for install" --backtitle "SaturnArch" --menu "Select disk for bootloader install" 25 90 10 `lsblk -r -o name,size -n -d` 2>&1 1>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
hostname=$(whiptail --backtitle "SaturnArch" --inputbox "please enter your hostname" 8 39 saturnarch --title "Hostname" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
username=$(whiptail --backtitle "SaturnArch" --inputbox "please enter your username" 8 39 user --title "Username" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
timezone=$(whiptail --backtitle "SaturnArch" --inputbox "please enter your timezone" 8 39 Europe/Prague --title "timezone" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
userpass=$(whiptail --backtitle "SaturnArch" --passwordbox "please enter your user password" 8 39 --title "user password" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
rootpass=$(whiptail --backtitle "SaturnArch" --passwordbox "please enter your root password" 8 39 --title "root password" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
exec 3>&1;
|
|
lang=$(whiptail --backtitle "SaturnArch" --inputbox "please enter your root LANG" 8 39 cs_CZ --title "LANG" 3>&1 1>&2 2>&3)
|
|
exec 3>&-;
|
|
|
|
##
|
|
# INSTALL
|
|
##
|
|
|
|
echo "starting install"
|
|
|
|
#update keys
|
|
echo "update keys"
|
|
gpg --refresh-keys
|
|
pacman-key --init && pacman-key --populate
|
|
pacman-key --refresh-keys
|
|
|
|
mount /dev/$disk /mnt
|
|
pacstrap /mnt base linux linux-firmware
|
|
|
|
#copy install data
|
|
cp -r /to_install/* /mnt/
|
|
|
|
#remove autologin
|
|
rm -rf /mnt/etc/systemd/system/getty@tty1.service.d/
|
|
|
|
rm -f /mnt/do_not_edit
|
|
|
|
genfstab -U /mnt >> /mnt/etc/fstab
|
|
|
|
##
|
|
# Chroot work
|
|
##
|
|
echo "arch-choot"
|
|
arch-chroot /mnt <<EOF
|
|
|
|
echo "set time zone"
|
|
hwclock --systohc --utc
|
|
timedatectl set-timezone $timezone
|
|
timedatectl set-ntp true
|
|
|
|
locale-gen
|
|
|
|
echo "set host name"
|
|
echo "LANG=$lang.UTF-8" > /etc/locale.conf
|
|
echo "KEYMAP=de-latin1" > /etc/vconsole.conf
|
|
echo "$hostname" > /etc/hostname
|
|
echo "127.0.0.1 localhost" > /etc/hosts
|
|
echo "::1 localhost" >> /etc/hosts
|
|
echo "127.0.1.1 $hostname.localdomain $hostname" >> /etc/hosts
|
|
|
|
mkinitcpio -P
|
|
|
|
#install from lists
|
|
gpg --refresh-keys
|
|
pacman-key --init && pacman-key --populate
|
|
pacman-key --refresh-keys
|
|
pacman -Syy
|
|
|
|
sed -r '/^#/d' /packages.x86_64 | pacman --noconfirm -S -
|
|
rm -f /packages.x86_64
|
|
|
|
#chmod +x all local/bin
|
|
chmod +x /usr/local/bin/*
|
|
|
|
#user create
|
|
groupadd sudo
|
|
useradd -m -G sudo "$username"
|
|
|
|
echo "$username:$userpass" | chpasswd
|
|
echo "root:$rootpass" | chpasswd
|
|
|
|
systemctl enable gdm.service
|
|
systemctl enable NetworkManager.service
|
|
systemctl --user enable pulseaudio.service
|
|
|
|
#install grub
|
|
pacman --noconfirm -S grub
|
|
grub-install /dev/$grubdisk
|
|
grub-mkconfig -o /boot/grub/grub.cfg
|
|
exit
|
|
EOF
|
|
|
|
echo "install complete, please reboot the system"
|