mirror of
https://github.com/tommytran732/Arch-Setup-Script
synced 2024-11-22 01:21:34 -05:00
Auto CPU detection
This commit is contained in:
parent
acb770130b
commit
d513f7579c
67
install.sh
67
install.sh
@ -3,57 +3,37 @@
|
|||||||
# Cleaning the TTY.
|
# Cleaning the TTY.
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# Selecting the kernel flavor to install
|
# Selecting the kernel flavor to install.
|
||||||
kernel_options() {
|
kernel_selector () {
|
||||||
echo "Which kernel flavor would you want?"
|
echo "List of kernels:"
|
||||||
echo "[1] Stable — Vanilla Linux kernel and modules, with a few patches applied."
|
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 "2) Hardened — A security-focused Linux kernel."
|
||||||
echo "[3] Longterm — Long-term support (LTS) Linux kernel and modules."
|
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 "4) Zen Kernel — Optimized for desktop usage."
|
||||||
echo ""
|
read -r -p "Insert the number of the corresponding kernel: " choice
|
||||||
read choice
|
echo "$choice will be installed"
|
||||||
case $choice in
|
case $choice in
|
||||||
1 ) KERNEL=linux
|
1 ) kernel=linux
|
||||||
echo "You have selected to install the vanilla Linux kernel."
|
|
||||||
echo ""
|
|
||||||
;;
|
;;
|
||||||
2 ) KERNEL=linux-hardened
|
2 ) kernel=linux-hardened
|
||||||
echo "You have selected to install the hardened kernel."
|
|
||||||
echo ""
|
|
||||||
;;
|
;;
|
||||||
3 ) KERNEL=linux-lts
|
3 ) kernel=linux-lts
|
||||||
echo "You have selected to install the long term kernel."
|
|
||||||
echo ""
|
|
||||||
;;
|
;;
|
||||||
4 ) KERNEL=linux-zen
|
4 ) kernel=linux-zen
|
||||||
echo "You have selected to install the Zen kernel."
|
|
||||||
echo ""
|
|
||||||
;;
|
;;
|
||||||
* ) echo "You did not enter a valid selection."
|
* ) echo "You did not enter a valid selection."
|
||||||
kernel_options
|
kernel_selector
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Selecting the microcode to install
|
# Checking the microcode to install.
|
||||||
cpu_options() {
|
CPU=$(grep vendor_id /proc/cpuinfo)
|
||||||
echo "Which brand is your CPU?"
|
if [[ $CPU == *"AuthenticAMD"* ]]
|
||||||
echo "[1] Intel"
|
then
|
||||||
echo "[2] AMD"
|
microcode=amd-ucode
|
||||||
echo ""
|
else
|
||||||
read choice
|
microcode=intel-ucode
|
||||||
case $choice in
|
fi
|
||||||
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: "
|
||||||
@ -126,8 +106,7 @@ mount $ESP /mnt/boot/efi
|
|||||||
|
|
||||||
chattr +C /mnt/var
|
chattr +C /mnt/var
|
||||||
|
|
||||||
kernel_options
|
kernel_selector
|
||||||
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)."
|
||||||
|
Loading…
Reference in New Issue
Block a user