Adding the option for kernel flavor and microcode

This commit is contained in:
TommyTran732 2021-04-14 08:09:49 -04:00 committed by GitHub
parent aa4edb94f1
commit 50934ead01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,58 @@
# Cleaning the TTY. # Cleaning the TTY.
clear clear
# Selecting the kernel flavor to install
kernel_options() {
echo "Which kernel flavor would you want?"
echo "[1] Stable — Vanilla Linux kernel and modules, with a few patches applied."
echo "[2] Hardened — A security-focused Linux kernel applying a set of hardening patches to mitigate kernel and userspace exploits. It also enables more upstream kernel hardening features than Stable."
echo "[3] Longterm — Long-term support (LTS) Linux kernel and modules."
echo "[4] Zen Kernel — Result of a collaborative effort of kernel hackers to provide the best Linux kernel possible for everyday systems. Some more details can be found on https://liquorix.net (which provides kernel binaries based on Zen for Debian)."
echo ""
read choice
case $choice in
1 ) KERNEL=linux
echo "You have selected to install the vanilla Linux kernel."
echo ""
;;
2 ) KERNEL=linux-hardened
echo "You have selected to install the hardened kernel."
echo ""
;;
3 ) KERNEL=linux-lts
echo "You have selected to install the long term kernel."
echo ""
;;
4 ) KERNEL=linux-zen
echo "You have selected to install the Zen kernel."
echo ""
;;
* ) echo "You did not enter a valid selection."
kernel_options
esac
}
# Selecting the microcode to install
cpu_options() {
echo "Which brand is your CPU?"
echo "[1] Intel"
echo "[2] AMD"
echo ""
read choice
case $choice in
1 ) CPU=intel-ucode
echo "Intel microcode will be installed."
echo ""
;;
2 ) CPU=amd-ucode
echo "AMD microcode will be installed."
echo ""
;;
* ) echo "You did not enter a valid selection."
cpu_options
esac
}
# Selecting the target for the installation. # Selecting the target for the installation.
PS3="Select the disk where Arch Linux is going to be installed: " PS3="Select the disk where Arch Linux is going to be installed: "
select ENTRY in $(lsblk -dpnoNAME|grep -P "/dev/sd|nvme|vd"); select ENTRY in $(lsblk -dpnoNAME|grep -P "/dev/sd|nvme|vd");
@ -76,9 +128,12 @@ mount -o nodatacow,subvol=@swap $BTRFS /mnt/swap
mkdir /mnt/boot/efi mkdir /mnt/boot/efi
mount $ESP /mnt/boot/efi mount $ESP /mnt/boot/efi
kernel_options
cpu_options
# Pacstrap (setting up a base sytem onto the new root). # Pacstrap (setting up a base sytem onto the new root).
echo "Installing the base system (it may take a while)." echo "Installing the base system (it may take a while)."
pacstrap /mnt base linux linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo networkmanager pacstrap /mnt base ${KERNEL} ${CPU} linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper sudo networkmanager
# Generating /etc/fstab. # Generating /etc/fstab.
echo "Generating a new fstab." echo "Generating a new fstab."