Add intel and amd ucode setup
This commit is contained in:
parent
9bc3c70c5a
commit
ac48a3640d
@ -12,7 +12,7 @@
|
|||||||
# immutable variables {
|
# immutable variables {
|
||||||
|
|
||||||
readonly DIST="ArchLabs" # Linux distributor
|
readonly DIST="ArchLabs" # Linux distributor
|
||||||
readonly VER="1.6.58" # Installer version
|
readonly VER="1.6.59" # Installer version
|
||||||
readonly LIVE="liveuser" # Live session user
|
readonly LIVE="liveuser" # Live session user
|
||||||
readonly MNT="/mnt/install" # Install mountpoint
|
readonly MNT="/mnt/install" # Install mountpoint
|
||||||
readonly ERR="/tmp/errlog" # Built-in error log
|
readonly ERR="/tmp/errlog" # Built-in error log
|
||||||
@ -485,7 +485,7 @@ mirrorlist_cmd() {
|
|||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
display_selection() {
|
display_selection() {
|
||||||
local msg="Below are the configuration and setup values used during install
|
local msg="Configuration values used for install
|
||||||
|
|
||||||
Root Partition: $ROOT_PART
|
Root Partition: $ROOT_PART
|
||||||
Boot Partition: $BOOT_PART
|
Boot Partition: $BOOT_PART
|
||||||
@ -514,8 +514,7 @@ Sessions: $INSTALL_WMS
|
|||||||
Mirrors: $MIRROR_CMD
|
Mirrors: $MIRROR_CMD
|
||||||
Packages: $EXTRA_PACKAGES"
|
Packages: $EXTRA_PACKAGES"
|
||||||
|
|
||||||
msgbox "Install Info" "\n$msg\n"
|
msgbox "$_PrepTitle" "\n$msg\n"
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_install() {
|
configure_install() {
|
||||||
@ -570,8 +569,6 @@ edit_configs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local retval
|
|
||||||
|
|
||||||
if [[ $CURRENT_MENU != "main" ]]; then
|
if [[ $CURRENT_MENU != "main" ]]; then
|
||||||
MENU_HIGHLIGHT=1
|
MENU_HIGHLIGHT=1
|
||||||
CURRENT_MENU="main"
|
CURRENT_MENU="main"
|
||||||
@ -583,14 +580,14 @@ main() {
|
|||||||
MENU_HIGHLIGHT=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
MENU_HIGHLIGHT=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||||
--title " $_PrepTitle " --default-item $MENU_HIGHLIGHT --menu "$_PrepBody" 0 0 0 \
|
--title " $_PrepTitle " --default-item $MENU_HIGHLIGHT --menu "$_PrepBody" 0 0 0 \
|
||||||
"1" "$_PrepShowDev" "2" "$_PrepParts" "3" "$_PrepLUKS" "4" "$_PrepLVM" \
|
"1" "$_PrepShowDev" "2" "$_PrepParts" "3" "$_PrepLUKS" "4" "$_PrepLVM" \
|
||||||
"5" "$_PrepMount" "6" "$_PrepConfig" "7" "Check Selections" "8" "$_PrepInstall" \
|
"5" "$_PrepMount" "6" "$_PrepConfig" "7" "Check Choices" "8" "$_PrepInstall" \
|
||||||
"9" "$_Done")
|
"9" "$_Done")
|
||||||
|
|
||||||
# if trying to install the system, make sure the partitions are mounted
|
# if trying to install the system, make sure the partitions are mounted
|
||||||
# and that the needed config variables and user variables have been set up
|
# and that the needed config variables and user variables have been set up
|
||||||
if [[ $MENU_HIGHLIGHT && $MENU_HIGHLIGHT -eq 8 ]]; then
|
if [[ $MENU_HIGHLIGHT && $MENU_HIGHLIGHT -eq 8 ]]; then
|
||||||
check_install_ready
|
check_install_ready
|
||||||
retval=$?
|
local retval=$?
|
||||||
[[ $retval -gt 0 ]] && { MENU_HIGHLIGHT=$retval; return 1; }
|
[[ $retval -gt 0 ]] && { MENU_HIGHLIGHT=$retval; return 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -75,10 +75,11 @@ uefi_boot_fallback() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prep_for_grub() {
|
prep_for_grub() {
|
||||||
local ttype
|
local ucode="$1"
|
||||||
local cfg="$MNT/etc/default/grub"
|
local cfg="$MNT/etc/default/grub"
|
||||||
|
|
||||||
if [[ $SYS == 'UEFI' ]]; then
|
if [[ $SYS == 'UEFI' ]]; then
|
||||||
|
local ttype
|
||||||
[[ $IS_64BIT != true ]] && ttype='i386-efi' || ttype='x86_64-efi'
|
[[ $IS_64BIT != true ]] && ttype='i386-efi' || ttype='x86_64-efi'
|
||||||
BCMDS[grub]="${BCMDS[grub]} --target=$ttype --bootloader-id=$DIST"
|
BCMDS[grub]="${BCMDS[grub]} --target=$ttype --bootloader-id=$DIST"
|
||||||
else
|
else
|
||||||
@ -103,6 +104,8 @@ prep_for_grub() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prep_for_systemd-boot() {
|
prep_for_systemd-boot() {
|
||||||
|
local ucode="$1"
|
||||||
|
|
||||||
# create the boot entry configs
|
# create the boot entry configs
|
||||||
mkdir -p $MNT/boot/loader/entries
|
mkdir -p $MNT/boot/loader/entries
|
||||||
cat > $MNT/boot/loader/loader.conf << EOF
|
cat > $MNT/boot/loader/loader.conf << EOF
|
||||||
@ -112,7 +115,7 @@ editor no
|
|||||||
EOF
|
EOF
|
||||||
cat > $MNT/boot/loader/entries/${DIST}.conf << EOF
|
cat > $MNT/boot/loader/entries/${DIST}.conf << EOF
|
||||||
title $DIST Linux
|
title $DIST Linux
|
||||||
linux /vmlinuz-${KERNEL}$([[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]] && echo -en "\ninitrd /intel-ucode.img")
|
linux /vmlinuz-${KERNEL}$([[ $ucode ]] && echo -en "\ninitrd $ucode")
|
||||||
initrd /initramfs-$KERNEL.img
|
initrd /initramfs-$KERNEL.img
|
||||||
options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV")rw
|
options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV")rw
|
||||||
EOF
|
EOF
|
||||||
@ -136,6 +139,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
prep_for_syslinux() {
|
prep_for_syslinux() {
|
||||||
|
local ucode="$1"
|
||||||
local cfgdir="$MNT/boot/syslinux"
|
local cfgdir="$MNT/boot/syslinux"
|
||||||
local cfgsrcdir="/usr/lib/syslinux/bios/"
|
local cfgsrcdir="/usr/lib/syslinux/bios/"
|
||||||
FILES[9]="/boot/syslinux/syslinux.cfg"
|
FILES[9]="/boot/syslinux/syslinux.cfg"
|
||||||
@ -162,14 +166,14 @@ MENU LABEL $DIST Linux
|
|||||||
LINUX ../vmlinuz-$KERNEL
|
LINUX ../vmlinuz-$KERNEL
|
||||||
APPEND root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV ")rw
|
APPEND root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV ")rw
|
||||||
INITRD ../initramfs-$KERNEL.img
|
INITRD ../initramfs-$KERNEL.img
|
||||||
$([[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]] && echo -en "\ninitrd /intel-ucode.img")
|
$([[ $ucode ]] && echo -en "\nINITRD ..$ucode")
|
||||||
|
|
||||||
LABEL ${DIST}fallback
|
LABEL ${DIST}fallback
|
||||||
MENU LABEL $DIST Linux Fallback
|
MENU LABEL $DIST Linux Fallback
|
||||||
LINUX ../vmlinuz-$KERNEL
|
LINUX ../vmlinuz-$KERNEL
|
||||||
APPEND root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV ")rw
|
APPEND root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV ")rw
|
||||||
INITRD ../initramfs-$KERNEL-fallback.img
|
INITRD ../initramfs-$KERNEL-fallback.img
|
||||||
$([[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]] && echo -en "\ninitrd /intel-ucode.img")
|
$([[ $ucode ]] && echo -en "\nINITRD ..$ucode")
|
||||||
EOF
|
EOF
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -177,9 +181,12 @@ EOF
|
|||||||
install_bootloader() {
|
install_bootloader() {
|
||||||
chroot_cmd "export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/core_perl"
|
chroot_cmd "export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/core_perl"
|
||||||
|
|
||||||
local msg="$_InstBootloader $BOOTLDR\n"
|
local ucode=""
|
||||||
[[ $BOOT_PART != "" ]] && msg="$msg\n$_InstBootDev $BOOT_PART\n"
|
if [[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]]; then
|
||||||
echo -e "$msg\nMountpoint: ${BMNTS[$SYS-$BOOTLDR]}\n"
|
ucode="/intel-ucode.img"
|
||||||
|
elif [[ $(grep 'AuthenticAMD' /proc/cpuinfo) && -e $MNT/boot/amd-ucode.img ]]; then
|
||||||
|
ucode="/amd-ucode.img"
|
||||||
|
fi
|
||||||
|
|
||||||
# if not on an LVM we can use the UUID for booting
|
# if not on an LVM we can use the UUID for booting
|
||||||
if ! [[ $ROOT_PART =~ /dev/mapper ]]; then
|
if ! [[ $ROOT_PART =~ /dev/mapper ]]; then
|
||||||
@ -210,7 +217,7 @@ install_bootloader() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}
|
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}
|
||||||
prep_for_$BOOTLDR
|
prep_for_$BOOTLDR "$ucode"
|
||||||
|
|
||||||
# run the bootloader command
|
# run the bootloader command
|
||||||
chroot_cmd "${BCMDS[$BOOTLDR]}"
|
chroot_cmd "${BCMDS[$BOOTLDR]}"
|
||||||
|
Reference in New Issue
Block a user