# immutable globals
-readonly VER="1.7.30" # Installer version
+readonly VER="1.7.33" # Installer version
readonly DIST="ArchLabs" # Linux distributor
readonly MNT="/mnt" # Install mountpoint
readonly ERR="/tmp/errlog" # Built-in error log
tput civis
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_PrepTitle " --default-item $SELECTED \
- --menu "$_PrepBody" 0 0 0 \
+ --cancel-label "Exit" --menu "$_PrepBody" 0 0 0 \
"1" "$_PrepShowDev" "2" "$_PrepParts" \
"3" "$_PrepLUKS" "4" "$_PrepLVM" \
"5" "$_PrepMount" "6" "$_PrepConfig" \
local cfg="$MNT/etc/default/grub"
sed -i "s/GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"${DIST}\"/g;
s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/g" $cfg
+
if [[ $LUKS_DEV ]]; then
sed -i "s~#GRUB_ENABLE_CRYPTODISK~GRUB_ENABLE_CRYPTODISK~g;
s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"${LUKS_DEV}\"~g" $cfg
fi
+
if [[ $SYS == 'BIOS' && $LVM && $SEPERATE_BOOT == false ]]; then
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" $cfg
fi
+
+ if [[ $SYS == 'UEFI' ]]; then
+ # needed for os-prober module to work properly in the chroot
+ mkdir -p /run/lvm
+ mkdir -p /run/udev
+ mkdir -p $MNT/hostrun/lvm
+ mkdir -p $MNT/hostrun/udev
+ mount --bind /run/lvm $MNT/hostrun/lvm
+ mount --bind /run/udev $MNT/hostrun/udev
+ BCMDS[grub]="mkdir -p /run/udev; mkdir -p /run/lvm; \
+ mount --bind /hostrun/udev /run/udev; \
+ mount --bind /hostrun/lvm /run/lvm; \
+ ${BCMDS[grub]}; \
+ umount /run/udev; \
+ umount /run/lvm"
+ fi
+
return 0
}
# install/setup the bootloader by running the BCMD (boot command)
printf "\nInstalling and setting up $BOOTLDR in ${BMNTS[$SYS-$BOOTLDR]}\n\n"
- mkdir -p $MNT/{hostrun,run/udev}
- mount --bind /run $MNT/hostrun
- chrun "mount --bind /hostrun/lvm /run/lvm; mount --bind /hostrun/udev /run/udev ${BCMDS[$BOOTLDR]}; umount /run/lvm; umount /run/udev"
- echeck "${BCMDS[$BOOTLDR]}"
+ chrun "${BCMDS[$BOOTLDR]}"
+
+ if [[ -d $MNT/hostrun ]]; then
+ umount $MNT/hostrun/lvm
+ umount $MNT/hostrun/udev
+ rm -rf $MNT/hostrun
+ fi
# copy efi stub to generic catch all
[[ $SYS == 'UEFI' && $BOOTLDR =~ (grub|syslinux) ]] && uefi_boot_fallback
# shellcheck disable=2153
readonly RUN="/run/archiso/bootmnt/arch/boot"
-readonly SERVICE="$MNT/etc/systemd/system/getty@tty1.service.d"
readonly VM="$(dmesg | grep -i "hypervisor")"
install()
{
# compressed image?
if [[ -e /run/archiso/sfs/airootfs/etc/skel ]]; then
- printf "\n\nUnpacking base system --- Total: ~ 2.7G\n\n"
+ printf "\n\nUnpacking base system --- Total: ~ 2.6G\n\n"
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
else
# update the mirrorlist.. MUST be done before pacstrapping or it may be slow
# automatic startx for login shells
local loginrc
case $MYSHELL in
- *bash)
+ "/bin/bash")
loginrc=".bash_profile"
rm -rf $MNT/home/$NEWUSER/.{z,mksh}*
;;
- *mksh)
+ "/usr/bin/mksh")
loginrc=".profile"
rm -rf $MNT/home/$NEWUSER/.{z,bash}*
cat >> $MNT/home/$NEWUSER/.mkshrc << EOF
EOF
else
rm -rf $SERVICE
- rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile}
+ rm -rf $MNT/home/$NEWUSER/.{profile,zprofile,bash_profile}
fi
}
login_manager()
{
+ SERVICE="$MNT/etc/systemd/system/getty@tty1.service.d"
# remove welcome message
sed -i '/printf/d' $MNT/root/.zshrc
[mpd]="mpc"
[mupdf]="mupdf-tools"
[qt5ct]="qt5-styleplugins"
-# [steam]="steam-native-runtime"
[zathura]="zathura-pdf-poppler"
[cairo-dock]="cairo-dock-plug-ins"
[noto-fonts]="noto-fonts-emoji"