From 8142d689832cbfe9b6d2f283da7d8a0b1bd9ac59 Mon Sep 17 00:00:00 2001 From: Chrysostomus Date: Tue, 28 Feb 2017 01:23:39 +0800 Subject: [PATCH] Add final_check --- lib/util-menu.sh | 3 ++- lib/util.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/util-menu.sh b/lib/util-menu.sh index 714297f..a772b7b 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -44,7 +44,8 @@ main_menu_online() { ;; "8") edit_configs ;; - *) dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody" 0 0 + *) final_check + dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0 if [[ $? -eq 0 ]]; then check_for_error "exit installer." if [[ -e /mnt/usr ]]; then diff --git a/lib/util.sh b/lib/util.sh index 74185d5..f774468 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -402,3 +402,26 @@ evaluate_openrc() { esac fi } + +final_check() +{ + CHECKLIST=/tmp/.final_check + # Empty the list + echo "" > ${CHECKLIST} + # Check if base is installed + [[ -e /mnt/etc ]] || echo "- Base is not installed" >> ${CHECKLIST} + # Check if bootloader is installed + if [[ $SYSTEM == "BIOS" ]]; then + arch_chroot "pacman -Qq grub" &> /dev/null || echo "- Bootloader is not installed" >> ${CHECKLIST} + else + [[ -e /mnt/boot/efi/EFI/manjaro_grub/grubx64.efi ]] || echo "- Bootloader is not installed" >> ${CHECKLIST} + fi + # Check if fstab is generated + grep -qv '^#' /mnt/etc/fstab || echo "- Fstab has not been generated" >> ${CHECKLIST} + # Check if locales have been generated + [[ $(manjaro-chroot /mnt 'locale -a' | wc -l) -ge '3' ]] || echo "- Locales have not been generated" >> ${CHECKLIST} + # Check if root password has been set + $(grep -q -e 'root:!:' -e 'root:\*:' /mnt/etc/shadow) && echo "- Root password is not set" >> ${CHECKLIST} + # check if user account has been generated + [[ $(ls /mnt/home) == "" ]] && echo "- No user accounts have been generated" >> ${CHECKLIST} +} \ No newline at end of file