mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
move root password check to configuration
This commit is contained in:
parent
300a11c083
commit
1ac51c841c
2 changed files with 12 additions and 7 deletions
|
@ -109,9 +109,7 @@ configure_system() {
|
|||
fi
|
||||
## END PREPROCESS ##
|
||||
geteditor || return 1
|
||||
# check for no root password
|
||||
chroot "${DESTDIR}" passwd -S root | cut -d ' ' -f2 | grep -q NP && set_password
|
||||
chroot "${DESTDIR}" passwd -S root | cut -d ' ' -f2 | grep -q L && set_password
|
||||
check_root_password
|
||||
FILE=""
|
||||
|
||||
# main menu loop
|
||||
|
@ -141,13 +139,13 @@ configure_system() {
|
|||
if [[ "${FILE}" = "Return" || -z "${FILE}" ]]; then # exit
|
||||
S_CONFIG=1
|
||||
break
|
||||
elif [[ "${FILE}" = "/etc/mkinitcpio.conf" ]]; then # non-file
|
||||
elif [[ "${FILE}" = "/etc/mkinitcpio.conf" ]]; then # non-file
|
||||
set_mkinitcpio
|
||||
elif [[ "${FILE}" = "/etc/locale.gen" ]]; then # non-file
|
||||
elif [[ "${FILE}" = "/etc/locale.gen" ]]; then # non-file
|
||||
set_locale
|
||||
elif [[ "${FILE}" = "Root-Password" ]]; then # non-file
|
||||
elif [[ "${FILE}" = "Root-Password" ]]; then # non-file
|
||||
set_password
|
||||
else #regular file
|
||||
else #regular file
|
||||
${EDITOR} "${DESTDIR}""${FILE}"
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
#!/bin/bash
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
check_root_password() {
|
||||
# check if empty password is set
|
||||
chroot "${DESTDIR}" passwd -S root | cut -d ' ' -f2 | grep -q NP && set_password
|
||||
# check if account is locked
|
||||
chroot "${DESTDIR}" passwd -S root | cut -d ' ' -f2 | grep -q L && set_password
|
||||
}
|
||||
|
||||
set_mkinitcpio() {
|
||||
DIALOG --msgbox "The mkinitcpio.conf file controls which modules will be placed into the initramfs for your system's kernel.\n\n- Non US keymap users should add 'keymap' to HOOKS= array\n- If you install under VMWARE add 'BusLogic' to MODULES= array\n- raid, lvm2, encrypt are not enabled by default\n- 2 or more disk controllers, please specify the correct module\n loading order in MODULES= array \n\nMost of you will not need to change anything in this file." 15 70
|
||||
HOOK_ERROR=""
|
||||
|
|
Loading…
Reference in a new issue