mirror of
https://gitlab.com/prism7/archery.git
synced 2025-02-15 08:29:17 +01:00
Add: 'Machine Detection' stage > Added the choice of disabling Watchdogs in the installed system.
Change: Some code has been moved/re-written to avoid unnecessary repetition. Change: A few prompts have been edited for better aesthetics.
This commit is contained in:
parent
4c88c6e3ad
commit
b942e7653a
1 changed files with 78 additions and 50 deletions
128
Amelia.sh
128
Amelia.sh
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Amelia Installer
|
# Amelia Installer
|
||||||
# https://gitlab.com/prism7/archery
|
# https://gitlab.com/prism7/archery
|
||||||
# Version: 8.5.1
|
# Version: 8.6.0
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
@ -353,10 +353,10 @@ first_check() {
|
||||||
until slct_font; do : ; done
|
until slct_font; do : ; done
|
||||||
else
|
else
|
||||||
if [[ -e /usr/bin/pv ]]; then
|
if [[ -e /usr/bin/pv ]]; then
|
||||||
MAGENTABG " 'Terminus Font' detected ==> Log in as 'ROOT' in a tty & re-run to enable "| pv -qL 70
|
MAGENTABG " 'Terminus Font' detected ==> Log in as 'root' in a tty & re-run to enable "| pv -qL 70
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
MAGENTABG " 'Terminus Font' detected ==> Log in as 'ROOT' in a tty & re-run to enable "
|
MAGENTABG " 'Terminus Font' detected ==> Log in as 'root' in a tty & re-run to enable "
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -540,6 +540,34 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Machi
|
||||||
|
|
||||||
### The ${nc}${cpu_name} ${yellow}cpu microcode will be installed
|
### The ${nc}${cpu_name} ${yellow}cpu microcode will be installed
|
||||||
"
|
"
|
||||||
|
fi
|
||||||
|
YELLOW "
|
||||||
|
|
||||||
|
> Disable ${nc}Watchdogs ${yellow}in the installed system ? [Y/n]
|
||||||
|
|
||||||
|
|
||||||
|
### Applicable for non-critical platforms such as desktops & laptops "
|
||||||
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
|
Enter [Y/n]: "
|
||||||
|
read -r -p "
|
||||||
|
==> " kill_watchdog
|
||||||
|
|
||||||
|
kill_watchdog="${kill_watchdog:-y}"
|
||||||
|
kill_watchdog="${kill_watchdog,,}"
|
||||||
|
|
||||||
|
if [[ "${kill_watchdog}" == "y" ]]; then
|
||||||
|
sleep 0.2
|
||||||
|
YELLOW "
|
||||||
|
|
||||||
|
### Watchdogs have been disabled
|
||||||
|
"
|
||||||
|
elif [[ "${kill_watchdog}" == "n" ]]; then
|
||||||
|
skip
|
||||||
|
else
|
||||||
|
y_n
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
ok
|
ok
|
||||||
}
|
}
|
||||||
|
@ -5555,7 +5583,7 @@ ${magenta}###${nc}--------------------------${magenta}[ ${bwhite}Setting Up Wire
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
main_chroot() {
|
main_chroot() {
|
||||||
|
|
||||||
stage_prompt="Base-System Configuration"
|
local stage_prompt="Base System Configuration"
|
||||||
if arch-chroot /mnt <<-CONF > /dev/null 2>&1 2> amelia_log.txt ; then
|
if arch-chroot /mnt <<-CONF > /dev/null 2>&1 2> amelia_log.txt ; then
|
||||||
sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit
|
sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit
|
||||||
locale-gen || exit
|
locale-gen || exit
|
||||||
|
@ -5582,28 +5610,6 @@ HOSTS
|
||||||
visudo -c /etc/sudoers.d/sudoersd || exit
|
visudo -c /etc/sudoers.d/sudoersd || exit
|
||||||
CONF
|
CONF
|
||||||
stage_ok
|
stage_ok
|
||||||
|
|
||||||
if [[ "${parallel}" == "y" ]]; then
|
|
||||||
stage_prompt="Parallel Downloads Configuration"
|
|
||||||
if arch-chroot /mnt <<-PARALLEL > /dev/null 2>&1 2> amelia_log.txt ; then
|
|
||||||
sed -i "s|#ParallelDownloads = 5|ParallelDownloads = ${parallelnmbr}|g" /etc/pacman.conf || exit
|
|
||||||
PARALLEL
|
|
||||||
stage_ok
|
|
||||||
else
|
|
||||||
stage_fail
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${multilib}" == "y" ]]; then
|
|
||||||
stage_prompt="Multilib Configuration"
|
|
||||||
if arch-chroot /mnt <<-MULTILIB > /dev/null 2>&1 2> amelia_log.txt ; then
|
|
||||||
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf || exit
|
|
||||||
pacman -Syy || exit
|
|
||||||
MULTILIB
|
|
||||||
stage_ok
|
|
||||||
else
|
|
||||||
stage_fail
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
stage_fail
|
stage_fail
|
||||||
fi
|
fi
|
||||||
|
@ -5844,6 +5850,41 @@ NOUKI
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
var_opts() {
|
||||||
|
|
||||||
|
if [[ "${parallel}" == "y" ]]; then
|
||||||
|
local stage_prompt="Parallel Downloads Configuration"
|
||||||
|
if arch-chroot /mnt <<-PARALLEL > /dev/null 2>&1 2> amelia_log.txt ; then
|
||||||
|
sed -i "s|#ParallelDownloads = 5|ParallelDownloads = ${parallelnmbr}|g" /etc/pacman.conf || exit
|
||||||
|
PARALLEL
|
||||||
|
stage_ok
|
||||||
|
else
|
||||||
|
stage_fail
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ "${multilib}" == "y" ]]; then
|
||||||
|
local stage_prompt="Multilib Configuration"
|
||||||
|
if arch-chroot /mnt <<-MULTILIB > /dev/null 2>&1 2> amelia_log.txt ; then
|
||||||
|
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf || exit
|
||||||
|
pacman -Syy || exit
|
||||||
|
MULTILIB
|
||||||
|
stage_ok
|
||||||
|
else
|
||||||
|
stage_fail
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ "${CPU}" == *"GenuineIntel"* && "${kill_watchdog}" == "y" ]]; then
|
||||||
|
local stage_prompt="Intel Watchdog Configuration"
|
||||||
|
if arch-chroot /mnt <<-INTEL_WATCHDOG > /dev/null 2>&1 2> amelia_log.txt ; then
|
||||||
|
echo "blacklist iTCO_wdt" | tee /etc/modprobe.d/blacklist.conf || exit
|
||||||
|
INTEL_WATCHDOG
|
||||||
|
stage_ok
|
||||||
|
else
|
||||||
|
stage_fail
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
###################################################################################################
|
||||||
secboot_sign() {
|
secboot_sign() {
|
||||||
|
|
||||||
if [[ ${sb_sign} == "y" ]]; then
|
if [[ ${sb_sign} == "y" ]]; then
|
||||||
|
@ -5973,6 +6014,9 @@ set_vars() {
|
||||||
if [[ -n "${encr_swap_bootopts}" ]]; then
|
if [[ -n "${encr_swap_bootopts}" ]]; then
|
||||||
boot_opts+=("${encr_swap_bootopts}")
|
boot_opts+=("${encr_swap_bootopts}")
|
||||||
fi
|
fi
|
||||||
|
if [[ "${kill_watchdog}" == "y" ]]; then
|
||||||
|
boot_opts+=(nowatchdog)
|
||||||
|
fi
|
||||||
if [[ -n "${vga_bootopts[*]}" ]]; then
|
if [[ -n "${vga_bootopts[*]}" ]]; then
|
||||||
boot_opts+=("${vga_bootopts[*]}")
|
boot_opts+=("${vga_bootopts[*]}")
|
||||||
fi
|
fi
|
||||||
|
@ -6053,6 +6097,9 @@ set_vars() {
|
||||||
if [[ "${autoroot}" == "y" ]]; then
|
if [[ "${autoroot}" == "y" ]]; then
|
||||||
boot_opts+=("${multiroot_bootopts}")
|
boot_opts+=("${multiroot_bootopts}")
|
||||||
fi
|
fi
|
||||||
|
if [[ "${kill_watchdog}" == "y" ]]; then
|
||||||
|
boot_opts+=(nowatchdog)
|
||||||
|
fi
|
||||||
if [[ -n "${vga_bootopts[*]}" ]]; then
|
if [[ -n "${vga_bootopts[*]}" ]]; then
|
||||||
boot_opts+=("${vga_bootopts[*]}")
|
boot_opts+=("${vga_bootopts[*]}")
|
||||||
fi
|
fi
|
||||||
|
@ -6149,6 +6196,7 @@ NETWORK
|
||||||
vm_serv
|
vm_serv
|
||||||
zramcfg
|
zramcfg
|
||||||
nvidia_hook
|
nvidia_hook
|
||||||
|
var_opts
|
||||||
mkinitcpio_preset
|
mkinitcpio_preset
|
||||||
secboot_sign
|
secboot_sign
|
||||||
completion
|
completion
|
||||||
|
@ -6207,6 +6255,7 @@ CUSTOMSERV
|
||||||
vm_serv
|
vm_serv
|
||||||
zramcfg
|
zramcfg
|
||||||
nvidia_hook
|
nvidia_hook
|
||||||
|
var_opts
|
||||||
mkinitcpio_preset
|
mkinitcpio_preset
|
||||||
secboot_sign
|
secboot_sign
|
||||||
completion
|
completion
|
||||||
|
@ -6241,7 +6290,7 @@ CUSTOMSERV
|
||||||
MKINITCPIO
|
MKINITCPIO
|
||||||
mkinitcpio -P || exit
|
mkinitcpio -P || exit
|
||||||
cat <<-MAKEPKG > /etc/makepkg.conf.d/makepkgd.conf || exit
|
cat <<-MAKEPKG > /etc/makepkg.conf.d/makepkgd.conf || exit
|
||||||
#!/hint/bash
|
#!/hint/bash
|
||||||
CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
|
CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
|
||||||
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
|
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
|
||||||
-fstack-clash-protection -fcf-protection \
|
-fstack-clash-protection -fcf-protection \
|
||||||
|
@ -6368,28 +6417,6 @@ SUDOERS
|
||||||
systemctl enable avahi-daemon bluetooth cups ipp-usb NetworkManager rngd rtkit-daemon ${displaymanager} ${trim} ${vm_services} || exit
|
systemctl enable avahi-daemon bluetooth cups ipp-usb NetworkManager rngd rtkit-daemon ${displaymanager} ${trim} ${vm_services} || exit
|
||||||
OPTIMIZED
|
OPTIMIZED
|
||||||
stage_ok
|
stage_ok
|
||||||
|
|
||||||
if [[ "${parallel}" == "y" ]]; then
|
|
||||||
stage_prompt="Parallel Downloads Configuration"
|
|
||||||
if arch-chroot /mnt <<-PARALLEL > /dev/null 2>&1 2> amelia_log.txt ; then
|
|
||||||
sed -i "s|#ParallelDownloads = 5|ParallelDownloads = ${parallelnmbr}|g" /etc/pacman.conf || exit
|
|
||||||
PARALLEL
|
|
||||||
stage_ok
|
|
||||||
else
|
|
||||||
stage_fail
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${multilib}" == "y" ]]; then
|
|
||||||
stage_prompt="Multilib Configuration"
|
|
||||||
if arch-chroot /mnt <<-MULTILIB > /dev/null 2>&1 2> amelia_log.txt ; then
|
|
||||||
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf || exit
|
|
||||||
pacman -Syy || exit
|
|
||||||
MULTILIB
|
|
||||||
stage_ok
|
|
||||||
else
|
|
||||||
stage_fail
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
stage_fail
|
stage_fail
|
||||||
fi
|
fi
|
||||||
|
@ -6397,6 +6424,7 @@ MULTILIB
|
||||||
btldrcfg
|
btldrcfg
|
||||||
zramcfg
|
zramcfg
|
||||||
nvidia_hook
|
nvidia_hook
|
||||||
|
var_opts
|
||||||
mkinitcpio_preset
|
mkinitcpio_preset
|
||||||
secboot_sign
|
secboot_sign
|
||||||
completion
|
completion
|
||||||
|
@ -6413,7 +6441,7 @@ MULTILIB
|
||||||
tty="$(tty)"
|
tty="$(tty)"
|
||||||
disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)"
|
disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)"
|
||||||
trg=""
|
trg=""
|
||||||
vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" vgapkgs="" vgacount="" vgacard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vgaconf="" vga_conf="" vga_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" vga_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" vga_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" parallel="" parallelnmbr="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="")
|
vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" vgapkgs="" vgacount="" vgacard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vgaconf="" vga_conf="" vga_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" vga_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" vga_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" parallel="" parallelnmbr="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="")
|
||||||
export "${vars[@]}"
|
export "${vars[@]}"
|
||||||
clear
|
clear
|
||||||
first_check
|
first_check
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue