More regression fixes

This commit is contained in:
natemaia
2018-09-01 13:39:24 -07:00
parent fe1749bed5
commit 989a952751
4 changed files with 84 additions and 74 deletions

View File

@ -20,14 +20,30 @@ select_boot_setup() {
if [[ $BOOTLDR == 'systemd-boot' ]]; then
FILES[9]="/boot/loader/entries/$DIST.conf"
elif [[ $BOOTLDR == 'syslinux' && $SYS == 'BIOS' ]]; then
BCMDS[$BOOTLDR]="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_InstSysTitle " --menu "$_InstSysBody" 0 0 0 \
"syslinux-install_update -iam" "Install to MBR (Master Boot Record)" \
"syslinux-install_update -i" "Install to root partition (/)")"
[[ $? != 0 || ${BCMDS[$BOOTLDR]} == "" ]] && return 1
elif [[ $BOOTLDR == 'syslinux' ]]; then
if [[ $SYS == 'BIOS' ]]; then
FILES[9]="/boot/syslinux/syslinux.cfg"
BCMDS[$BOOTLDR]="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_InstSysTitle " --menu "$_InstSysBody" 0 0 0 \
"syslinux-install_update -iam" "Install to MBR (Master Boot Record)" \
"syslinux-install_update -i" "Install to root partition (/)")"
[[ $? != 0 || ${BCMDS[$BOOTLDR]} == "" ]] && return 1
else
FILES[9]="/boot/EFI/syslinux/syslinux.cfg"
BCMDS[syslinux]="efibootmgr -c -d $BOOT_DEVICE -p $BOOT_PART_NUM -l /EFI/syslinux/syslinux.efi -L $DIST"
fi
else
FILES[9]="/etc/default/grub"
if [[ $SYS == 'UEFI' ]]; then
local ttype
[[ $IS_64BIT != true ]] && ttype='i386-efi' || ttype='x86_64-efi'
BCMDS[grub]="${BCMDS[grub]} --target=$ttype --bootloader-id=$DIST"
else
BCMDS[grub]="${BCMDS[grub]} --target=i386-pc $BOOT_DEVICE"
fi
BCMDS[grub]="${BCMDS[grub]} && grub-mkconfig -o /boot/grub/grub.cfg"
fi
return 0
@ -77,16 +93,6 @@ uefi_boot_fallback() {
prep_for_grub() {
local cfg="$MNT/etc/default/grub"
if [[ $SYS == 'UEFI' ]]; then
local ttype
[[ $IS_64BIT != true ]] && ttype='i386-efi' || ttype='x86_64-efi'
BCMDS[grub]="${BCMDS[grub]} --target=$ttype --bootloader-id=$DIST"
else
BCMDS[grub]="${BCMDS[grub]} --target=i386-pc $BOOT_DEVICE"
fi
BCMDS[grub]="${BCMDS[grub]} && grub-mkconfig -o /boot/grub/grub.cfg"
sed -i "s/GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"${DIST}\"/g;
s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/g" $cfg
@ -113,14 +119,12 @@ default $DIST
timeout 5
editor no
EOF
cat > $MNT/boot/loader/entries/${DIST}.conf << EOF
title $DIST Linux
linux /vmlinuz-${KERNEL}$([[ $UCODE ]] && echo -en "\ninitrd /$UCODE")
initrd /initramfs-$KERNEL.img
options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && echo -n "$LUKS_DEV")rw
EOF
# add pacman hook to update the bootloader when systemd receives an update
mkdir -p $MNT/pacman.d/hooks
cat > $MNT/pacman.d/hooks/systemd-boot.hook << EOF
@ -140,15 +144,16 @@ EOF
}
prep_for_syslinux() {
local cfgdir="$MNT/boot/syslinux"
local cfgsrcdir="/usr/lib/syslinux/bios/"
FILES[9]="/boot/syslinux/syslinux.cfg"
if [[ $SYS == 'UEFI' ]]; then
FILES[9]="/boot/EFI/syslinux/syslinux.cfg"
BCMDS[syslinux]="efibootmgr -c -d $BOOT_DEVICE -p $BOOT_PART_NUM -l /EFI/syslinux/syslinux.efi -L $DIST"
cfgdir="$MNT/boot/EFI/syslinux"
cfgsrcdir="/usr/lib/syslinux/efi64/"
local cfgdir="$MNT/boot/EFI/syslinux"
if [[ $IS_64BIT == true ]]; then
local cfgsrcdir="/usr/lib/syslinux/efi64/"
else
local cfgsrcdir="/usr/lib/syslinux/efi32/"
fi
else
local cfgdir="$MNT/boot/syslinux"
local cfgsrcdir="/usr/lib/syslinux/bios/"
fi
mkdir -p $cfgdir
@ -190,7 +195,7 @@ install_bootloader() {
[[ $SYS == 'UEFI' ]] && find $MNT${BMNTS[$SYS-$BOOTLDR]}/EFI/ -maxdepth 1 -mindepth 1 \
-name '[aA][rR][cC][hH][lL]abs' -type d -exec rm -rf '{}' \; >/dev/null 2>&1
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}
# sets up the bootloader configs
prep_for_$BOOTLDR
# run the bootloader command

View File

@ -13,25 +13,21 @@ install_main() {
genfstab -U $MNT > $MNT/etc/fstab 2>$ERR
check_for_errors "genfstab -U $MNT > $MNT/etc/fstab"
# touch up fstab if we used a swapfile
# touch up /etc/fstab if we used a swapfile
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
# update the mirrorlist, if this isn't done before updating or it may be slow
# update the mirrorlist
# MUST be done before updating or it may be slow
local cmdtail="--verbose --save $MNT/etc/pacman.d/mirrorlist"
$MIRROR_CMD $cmdtail || reflector --score 100 -l 50 -f 10 --sort rate $cmdtail
oneshot update_system # MUST be before bootloader and mkinitcpio
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
oneshot setup_lightdm
fi
run_mkinitcpio || return 1
install_bootloader || return 1
oneshot update_system # MUST be before bootloader and mkinitcpio
[[ $LOGIN_TYPE == 'lightdm' ]] && oneshot setup_lightdm
run_mkinitcpio
install_bootloader
chroot_cmd "hwclock --systohc --utc" || chroot_cmd "hwclock --systohc --utc --directisa"
oneshot create_user || return 1
oneshot create_user
return 0
}
@ -141,7 +137,10 @@ create_user() {
rm -rf $service
fi
sed -i "s/openbox-session/${LOGIN_WM}/g" $_home/.xinitrc
sed -i 's|exec sudo archlabs-installer|exec startx -- vt1 &>/dev/null|' $_home/.zprofile
sed -i '/archlabs-installer/d' $_home/.zprofile
cat >> $_home/.zprofile << EOF
[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && exec startx -- vt1 &>/dev/null
EOF
fi
sed -i "s/${LIVE}/${NEWUSER}/g" $_home/.config/gtk-3.0/bookmarks $_home/.mozilla/firefox/archlabs.default/{prefs,sessionstore}.js

View File

@ -19,7 +19,7 @@ identify_system() {
if [[ -d /sys/firmware/efi ]]; then
SYS="UEFI"
[[ $(mount) =~ $EFI ]] && mount -t efivarfs efivarfs $EFI >/dev/null 2>&1
# [[ $(mount) =~ $EFI ]] && mount -t efivarfs efivarfs $EFI >/dev/null 2>&1
local bitness
bitness=$(cat /sys/firmware/efi/fw_platform_size)
@ -32,7 +32,12 @@ identify_system() {
SYS="BIOS"
fi
readonly BT="$DIST Installer - $SYS (x86_64) - Version $VER"
if [[ $IS_64BIT == true ]]; then
readonly BT="$DIST Installer - $SYS (i686) - Version $VER"
else
readonly BT="$DIST Installer - $SYS (x86_64) - Version $VER"
fi
return 0
}
check_requirements() {