diff --git a/lib/util-base.sh b/lib/util-base.sh index aa8f467..f1b335f 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -48,9 +48,13 @@ enable_services() { # enable display manager for systemd if [[ "$(cat /tmp/.display-manager)" == lightdm ]]; then - set_lightdm_greeter - arch_chroot "systemctl enable lightdm" 2>$ERR - check_for_error "enable lightdm" "$?" + if arch_chroot "pacman -Qq lightdm > /dev/null"; then + set_lightdm_greeter + arch_chroot "systemctl enable lightdm" 2>$ERR + check_for_error "enable lightdm" "$?" + else + echo "lightdm was listed but not actually installed. No display-manager was enabled" + fi elif [[ "$(cat /tmp/.display-manager)" == sddm ]]; then arch_chroot "systemctl enable sddm" 2>$ERR check_for_error "enable sddm" "$?" @@ -380,11 +384,7 @@ install_grub_uefi() { else bootid="manjaro" fi - # For quiet grub, remove fsck - if grep "^HOOKS" ${MOUNTPOINT}/etc/mkinitcpio.conf | grep -q fsck; then - sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf - arch_chroot "mkinitcpio -P" - fi + clear mkdir /mnt/hostlvm mount --bind /run/lvm /mnt/hostlvm @@ -495,7 +495,7 @@ install_refind() ;; esac # Mount as rw - sed -i 's/ro\ /rw\ \ /g' /mnt/boot/refind_linux.conf + #sed -i 's/ro\ /rw\ \ /g' /mnt/boot/refind_linux.conf # Boot in graphics mode sed -i -e '/use_graphics_for/ s/^#*//' ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind.conf diff --git a/lib/util-desktop.sh b/lib/util-desktop.sh index 73899c6..5ef27f8 100644 --- a/lib/util-desktop.sh +++ b/lib/util-desktop.sh @@ -308,7 +308,7 @@ install_desktop() { filter_packages # remove grub sed -i '/grub/d' /mnt/.base - echo "nilfs-utils" >> /mnt/.base + #echo "nilfs-utils" >> /mnt/.base check_for_error "packages to install: $(cat /mnt/.base | sort | tr '\n' ' ')" clear set -o pipefail @@ -353,6 +353,14 @@ install_desktop() { # the order is important here so strip out what we want changed and put it back in the correct order sed -e '/^HOOKS=/s/\ filesystems//g' -e '/^HOOKS=/s/\ keyboard/\ keyboard\ zfs\ filesystems/g' -e '/^HOOKS=/s/\ fsck//g' -e '/^FILES=/c\FILES=("/usr/lib/libgcc_s.so.1")' -i ${MOUNTPOINT}/etc/mkinitcpio.conf check_for_error "root on zfs volume. Amend mkinitcpio." + ;; + *) + if $FSCK_HOOK; then + # Remove fsck unless chosen otherwise + sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf + check_for_error "no fsck specified. Removing fsck hook from mkinitcpio.conf." + fi + ;; esac @@ -365,6 +373,11 @@ install_desktop() { [[ $((LVM + LUKS + BTRFS_ROOT + ZFS_ROOT)) -gt 0 ]] && { arch_chroot "mkinitcpio -P" 2>$ERR; check_for_error "re-run mkinitcpio" $?; } + # Generate fstab with UUID + fstabgen -U -p ${MOUNTPOINT} > ${MOUNTPOINT}/etc/fstab + # Edit fstab in case of btrfs subvolumes + sed -i "s/subvolid=.*,subvol=\/.*,//g" /mnt/etc/fstab + # If specified, copy over the pacman.conf file to the installation if [[ $COPY_PACCONF -eq 1 ]]; then cp -f /etc/pacman.conf ${MOUNTPOINT}/etc/pacman.conf diff --git a/lib/util-menu.sh b/lib/util-menu.sh index cd20fb7..b91e0b2 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -223,8 +223,8 @@ prep_menu() { local PARENT="$FUNCNAME" declare -i loopmenu=1 while ((loopmenu)); do - submenu 11 - DIALOG " $_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_PrepMenuBody\n " 20 60 11 \ + submenu 13 + DIALOG " $_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_PrepMenuBody\n " 0 0 0 \ "1" "$_VCKeymapTitle" \ "2" "$_DevShowOpt" \ "3" "$_PrepPartDisk|>" \ @@ -235,7 +235,8 @@ prep_menu() { "8" "$_PrepMirror|>" \ "9" "$_PrepPacKey" \ "10" "$_HostCache" \ - "11" "$_Back" 2>${ANSWER} + "11" "Enable fsck hook" \ + "12" "$_Back" 2>${ANSWER} HIGHLIGHT_SUB=$(cat ${ANSWER}) case $(cat ${ANSWER}) in @@ -270,6 +271,8 @@ prep_menu() { ;; "10") set_cache ;; + "11") set_fsck_hook + ;; *) loopmenu=0 return 0 ;; @@ -277,6 +280,16 @@ prep_menu() { done } +# Fsck hook + +set_fsck_hook() { + DIALOG " Set fsck hook " --yesno "\nDo you want to use fsck hook?\n " 0 0 + if [[ $? -eq 0 ]]; then + FSCK_HOOK=true + else + FSCK_HOOK=false + fi +} # Base Installation install_base_menu() { local PARENT="$FUNCNAME"