minor updates and bootloaders
This commit is contained in:
parent
282f9d4d5c
commit
0dca8f7d8c
|
|
@ -155,7 +155,7 @@ else
|
||||||
PART1=${DISK}1
|
PART1=${DISK}1
|
||||||
PART2=${DISK}2
|
PART2=${DISK}2
|
||||||
fi
|
fi
|
||||||
_PART_UUID=$(blkid -s UUID -o value "$PART2")
|
|
||||||
|
|
||||||
if [[ "$LAYOUT" -eq 1 ]]; then
|
if [[ "$LAYOUT" -eq 1 ]]; then
|
||||||
do_partition
|
do_partition
|
||||||
|
|
@ -186,7 +186,7 @@ elif [[ "$LUKS" -eq 1 ]]; then
|
||||||
do_lvm
|
do_lvm
|
||||||
lvm_mount
|
lvm_mount
|
||||||
mount_boot
|
mount_boot
|
||||||
set_option "ENCRYP_PART" "$_PART_UUID"
|
# set_option "ENCRYP_PART" "$_PART_UUID"
|
||||||
# HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
|
# HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
|
||||||
set_option "HOOKS" "(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)"
|
set_option "HOOKS" "(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)"
|
||||||
|
|
||||||
|
|
@ -225,7 +225,6 @@ genfstab -U "$MOUNTPOINT" >>"$MOUNTPOINT"/etc/fstab
|
||||||
cp -R "${SCRIPT_DIR}" "$MOUNTPOINT"/root/ArchTitus
|
cp -R "${SCRIPT_DIR}" "$MOUNTPOINT"/root/ArchTitus
|
||||||
cp /etc/pacman.d/mirrorlist "$MOUNTPOINT"/etc/pacman.d/mirrorlist
|
cp /etc/pacman.d/mirrorlist "$MOUNTPOINT"/etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
|
||||||
# TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
# TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
||||||
TOTALMEM="$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')"
|
TOTALMEM="$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')"
|
||||||
if [[ $TOTALMEM -lt 8000000 ]]; then
|
if [[ $TOTALMEM -lt 8000000 ]]; then
|
||||||
|
|
|
||||||
90
1-setup.sh
90
1-setup.sh
|
|
@ -12,32 +12,31 @@ fi
|
||||||
|
|
||||||
title basic installations
|
title basic installations
|
||||||
install_pkg networkmanager dhclient reflector \
|
install_pkg networkmanager dhclient reflector \
|
||||||
rsync grub btrfs-progs arch-install-scripts \
|
rsync btrfs-progs arch-install-scripts \
|
||||||
git pacman-contrib curl
|
git pacman-contrib curl
|
||||||
|
|
||||||
title Network Setup
|
echo "Network Setup"
|
||||||
systemctl enable --now NetworkManager
|
systemctl enable --now NetworkManager
|
||||||
|
|
||||||
install_xorg() {
|
install_xorg() {
|
||||||
install_pkg "xorg xorg-server"
|
install_pkg "xorg xorg-server"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TOTALMEM="$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')"
|
||||||
CPU="$(grep -c ^processor /proc/cpuinfo)"
|
CPU="$(grep -c ^processor /proc/cpuinfo)"
|
||||||
echo -ne "
|
if [[ $TOTALMEM -gt 8000000 ]]; then
|
||||||
|
echo -ne "
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
You have \"$CPU\" cores. And
|
You have \"$CPU\" cores. And
|
||||||
changing the makeflags for \"$CPU\" cores. As well as
|
changing the makeflags for \"$CPU\" cores. As well as
|
||||||
changing the compression settings.
|
changing the compression settings.
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
|
|
||||||
TOTALMEM="$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')"
|
|
||||||
if [[ $TOTALMEM -gt 8000000 ]]; then
|
|
||||||
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$CPU\"/g" /etc/makepkg.conf
|
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$CPU\"/g" /etc/makepkg.conf
|
||||||
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $CPU -z -)/g" /etc/makepkg.conf
|
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $CPU -z -)/g" /etc/makepkg.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
title Setup Language and set locale
|
echo "Setup Language and set locale"
|
||||||
# sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
|
# sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
|
||||||
echo "$LOCALE" | sed -i "s/\"//g" >>/etc/locale.gen
|
echo "$LOCALE" | sed -i "s/\"//g" >>/etc/locale.gen
|
||||||
|
|
||||||
|
|
@ -59,7 +58,7 @@ sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
|
||||||
# pacman -Sy --noconfirm
|
# pacman -Sy --noconfirm
|
||||||
refresh_pacman
|
refresh_pacman
|
||||||
|
|
||||||
title Installing desktop
|
echo "Installing desktop"
|
||||||
case "$DESKTOP" in
|
case "$DESKTOP" in
|
||||||
"default")
|
"default")
|
||||||
while IFS= read -r LINE; do
|
while IFS= read -r LINE; do
|
||||||
|
|
@ -127,7 +126,7 @@ case "$DESKTOP" in
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
title Installing Microcode
|
echo "Installing Microcode"
|
||||||
# determine processor type and install microcode
|
# determine processor type and install microcode
|
||||||
PROC_TYPE="$(lscpu | grep "Vendor ID:" | awk '{print $3}')"
|
PROC_TYPE="$(lscpu | grep "Vendor ID:" | awk '{print $3}')"
|
||||||
|
|
||||||
|
|
@ -135,17 +134,19 @@ case "$PROC_TYPE" in
|
||||||
"GenuineIntel")
|
"GenuineIntel")
|
||||||
echo "Installing Intel microcode"
|
echo "Installing Intel microcode"
|
||||||
install_pkg intel-ucode
|
install_pkg intel-ucode
|
||||||
|
IMG=intel-ucode.img
|
||||||
;;
|
;;
|
||||||
"AuthenticAMD")
|
"AuthenticAMD")
|
||||||
echo "Installing AMD microcode"
|
echo "Installing AMD microcode"
|
||||||
install_pkg amd-ucode
|
install_pkg amd-ucode
|
||||||
|
IMG=amd-ucode.img
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
something_failed
|
something_failed
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
title Installing Graphics Drivers
|
echo "Installing Graphics Drivers"
|
||||||
# Graphics Drivers find and install
|
# Graphics Drivers find and install
|
||||||
if [[ "$(lspci | grep -E '(NVIDIA|GeForce)' -c)" -gt "0" ]]; then
|
if [[ "$(lspci | grep -E '(NVIDIA|GeForce)' -c)" -gt "0" ]]; then
|
||||||
install_pkg "nvidia nvidia-utils libglvnd"
|
install_pkg "nvidia nvidia-utils libglvnd"
|
||||||
|
|
@ -158,7 +159,72 @@ else
|
||||||
echo "No graphics card found!"
|
echo "No graphics card found!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
title Adding User
|
ENCRYP_UUID=$(blkid -s UUID -o value "$PART2")
|
||||||
|
PART_UUID=$(blkid -s PARTUUID -o value "$PART2")
|
||||||
|
|
||||||
|
case "$BOOTLOADER" in
|
||||||
|
grub)
|
||||||
|
echo "Installing GRUB"
|
||||||
|
install_pkg grub os-prober
|
||||||
|
if [[ "$LUKS" -eq 1 ]]; then
|
||||||
|
echo "Installing GRUB for LUKS"
|
||||||
|
sed -i -e 's/GRUB_CMDLINE_LINUX="\(.\+\)"/GRUB_CMDLINE_LINUX="\1 cryptdevice=UUID='"${ENCRYP_UUID}"':luks"/g' -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cryptdevice=UUID'"${ENCRYP_UUID}"':luks"/g' /etc/default/grub
|
||||||
|
fi
|
||||||
|
if [[ "$UEFI" -eq 1 ]]; then
|
||||||
|
grub-install --target=x86_64-efi --efi-directory="$MOUNTPOINT"/boot --bootloader-id=GRUB --recheck
|
||||||
|
else
|
||||||
|
grub-install --target=i386-pc --recheck "$DISK"
|
||||||
|
fi
|
||||||
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
;;
|
||||||
|
systemd)
|
||||||
|
if [[ "$UEFI" -eq 1 ]]; then
|
||||||
|
echo "Installing systemd-boot"
|
||||||
|
bootctl --path=/boot install
|
||||||
|
|
||||||
|
if [[ $LUKS -eq 1 ]]; then
|
||||||
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\tcryptdevice=UUID=$ENCRYP_UUID:luks root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
||||||
|
elif [[ $LVM -eq 1 ]]; then
|
||||||
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\troot=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
||||||
|
else
|
||||||
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\troot=PARTUUID=$PART_UUID rw" >/boot/loader/entries/arch.conf
|
||||||
|
fi
|
||||||
|
echo -e "default arch\ntimeout 5" >/boot/loader/loader.conf
|
||||||
|
else
|
||||||
|
echo "ERROR! Systemd-boot is not supported for BIOS systems"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
uefi)
|
||||||
|
if [[ "$UEFI" -eq 1 ]]; then
|
||||||
|
echo "Installing efistub"
|
||||||
|
if [[ "$LUKS" -eq 1 && "$FS" =~ "btrfs" ]]; then
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw rootflags=subvol=@ initrd=\\$IMG initrd=\initramfs-linux.img"
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw rootflags=subvol=@ initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
||||||
|
elif [[ "$LUKS" -eq 1 ]]; then
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux.img"
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
||||||
|
elif [[ "$LVM" -eq 1 ]]; then
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux.img"
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "root=\/dev\/$LVM_VG\/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
||||||
|
else
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "root=PARTUUID=$PART_UUID rw initrd=\\$IMG initrd=\initramfs-linux.img"
|
||||||
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "root=PARTUUID=$PART_UUID rw initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "ERROR! efistub is not supported for BIOS systems"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
none)
|
||||||
|
echo "Skipping bootloader installation"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
something_failed
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Adding User"
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
if [[ "$LAYOUT" -eq 1 ]]; then
|
if [[ "$LAYOUT" -eq 1 ]]; then
|
||||||
groupadd libvirt
|
groupadd libvirt
|
||||||
|
|
@ -182,7 +248,7 @@ elif [[ "$LUKS" -eq 1 ]]; then
|
||||||
sed -i "s/^HOOK.*/HOOKS=(${HOOKS[*]})/" /etc/mkinitcpio.conf
|
sed -i "s/^HOOK.*/HOOKS=(${HOOKS[*]})/" /etc/mkinitcpio.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "/etc/mkinitcpio.conf" ]];then
|
if [[ -f "/etc/mkinitcpio.conf" ]]; then
|
||||||
# making mkinitcpio with linux kernel
|
# making mkinitcpio with linux kernel
|
||||||
echo "Building initramfs"
|
echo "Building initramfs"
|
||||||
mkinitcpio -p linux
|
mkinitcpio -p linux
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
# shellcheck source=./setup.conf
|
# shellcheck source=./setup.conf
|
||||||
|
|
||||||
# Find the name of the folder the scripts are in
|
|
||||||
pacman -Sy --noconfirm
|
pacman -Sy --noconfirm
|
||||||
pacman -S --noconfirm --needed terminus-font
|
pacman -S --noconfirm --needed terminus-font
|
||||||
setfont ter-v22b
|
setfont ter-v22b
|
||||||
clear
|
clear
|
||||||
|
# Find the name of the folder the scripts are in
|
||||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
CONFIG_FILE="$SCRIPT_DIR"/setup.conf
|
CONFIG_FILE="$SCRIPT_DIR"/setup.conf
|
||||||
|
|
|
||||||
28
startup.sh
28
startup.sh
|
|
@ -126,7 +126,7 @@ elements_present() {
|
||||||
}
|
}
|
||||||
|
|
||||||
invalid_option() {
|
invalid_option() {
|
||||||
echo -ne "Your selected option is invalid, retry \n"
|
echo -ne "ERROR! Your selected option is invalid, retry \n"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_password() {
|
set_password() {
|
||||||
|
|
@ -137,7 +137,7 @@ set_password() {
|
||||||
if [[ "$PASSWORD1" == "$PASSWORD2" ]]; then
|
if [[ "$PASSWORD1" == "$PASSWORD2" ]]; then
|
||||||
set_option "$1" "$PASSWORD1"
|
set_option "$1" "$PASSWORD1"
|
||||||
else
|
else
|
||||||
echo -ne "Passwords do not match \n"
|
echo -ne "ERROR! Passwords do not match \n"
|
||||||
set_password
|
set_password
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -162,12 +162,9 @@ title () {
|
||||||
}
|
}
|
||||||
|
|
||||||
set_option() {
|
set_option() {
|
||||||
# Check if option exists
|
|
||||||
if grep -Eq "^\${1}.*" "\$CONFIG_FILE"; then
|
if grep -Eq "^\${1}.*" "\$CONFIG_FILE"; then
|
||||||
# delete option if exists
|
|
||||||
sed -i -e "/^\${1}.*/d" "\$CONFIG_FILE"
|
sed -i -e "/^\${1}.*/d" "\$CONFIG_FILE"
|
||||||
fi
|
fi
|
||||||
# Else add option
|
|
||||||
echo "\${1}=\${2}" >>"\$CONFIG_FILE"
|
echo "\${1}=\${2}" >>"\$CONFIG_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,7 +177,7 @@ refresh_pacman() {
|
||||||
}
|
}
|
||||||
|
|
||||||
something_failed() {
|
something_failed() {
|
||||||
echo "Something is not right. Exiting."
|
echo "ERROR! Something is not right. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,6 +476,24 @@ set_desktop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_bootloader() {
|
||||||
|
title "Select your bootloader"
|
||||||
|
SELECTION=("GRUB" "Systemd" "UEFI" "None")
|
||||||
|
echo "Systemd and UEFI are only available on a UEFI system"
|
||||||
|
echo "None will skip a bootloader and you will not be able to boot"
|
||||||
|
PS3="$PROMPT"
|
||||||
|
select OPT in "${SELECTION[@]}"; do
|
||||||
|
if elements_present "$OPT" "${SELECTION[@]}"; then
|
||||||
|
set_option "BOOTLOADER" "${OPT,,}"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
invalid_option
|
||||||
|
set_bootloader
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
make_choice() {
|
make_choice() {
|
||||||
title "Your system choice"
|
title "Your system choice"
|
||||||
CHOICE=("Default Install" "Custom Install")
|
CHOICE=("Default Install" "Custom Install")
|
||||||
|
|
@ -525,6 +540,7 @@ make_choice() {
|
||||||
ssd_drive
|
ssd_drive
|
||||||
# Advance options
|
# Advance options
|
||||||
set_partion_layout
|
set_partion_layout
|
||||||
|
set_bootloader
|
||||||
set_filesystem
|
set_filesystem
|
||||||
set_desktop
|
set_desktop
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue