system: add config item to set root password or not
PATCH 1/1 system: add config item to set root password or not
... to address the difference of whether a password should get set versus setting an empty password.
Signed-off-by Wade Berrier <[email protected]>
--- support/dependencies/dependencies.sh | 2 +- system/Config.in | 17 +++++++++++------ system/system.mk | 5 ++++- 3 files changed, 16 insertions(+), 8 deletions(-)
support/dependencies/dependencies.sh +1 -1
@@ -173,7 +173,7 @@ if grep -q ^BR2_PACKAGE_CLASSPATH=y $BUILDROOT_CONFIG ; then done fi -if grep -E '^BR2_TARGET_GENERIC_ROOT_PASSWD=".+"$' $BUILDROOT_CONFIG > /dev/null 2>&1; then +if grep -E '^BR2_TARGET_GENERIC_SET_ROOT_PASSWD=y' $BUILDROOT_CONFIG > /dev/null 2>&1; then if ! which mkpasswd > /dev/null 2>&1; then /bin/echo -e "\nYou need the 'mkpasswd' utility to set the root password\n" /bin/echo -e "(in Debian/ubuntu, 'mkpasswd' provided by the whois package)\n"
system/Config.in +11 -6
@@ -173,15 +173,12 @@ endif if BR2_ROOTFS_SKELETON_DEFAULT -config BR2_TARGET_GENERIC_ROOT_PASSWD - string "Root password" - default "" +config BR2_TARGET_GENERIC_SET_ROOT_PASSWD + bool "Set root password" + default y help Set the initial root password (in clear). It will be md5-encrypted. - If set to empty (the default), then no root password will be set, - and root will need no password to log in. - WARNING! WARNING! Although pretty strong, MD5 is now an old hash function, and suffers from some weaknesses, which makes it susceptible to attacks.
@@ -194,6 +191,14 @@ config BR2_TARGET_GENERIC_ROOT_PASSWD in the build log! Avoid using a valuable password if either the .config file or the build log may be distributed! +config BR2_TARGET_GENERIC_ROOT_PASSWD + string "Root password" + depends on BR2_TARGET_GENERIC_SET_ROOT_PASSWD + default "" + help + If set to empty (the default), then no root password will be set, + and root will need no password to log in. + config BR2_TARGET_GENERIC_GETTY_PORT string "Port to run a getty (login prompt) on" default "ttyS0"
system/system.mk +4 -1
@@ -1,8 +1,9 @@ TARGET_GENERIC_HOSTNAME:=$(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME)) TARGET_GENERIC_ISSUE:=$(call qstrip,$(BR2_TARGET_GENERIC_ISSUE)) +TARGET_GENERIC_SET_ROOT_PASSWD:=$(call qstrip,$(BR2_TARGET_GENERIC_SET_ROOT_PASSWD)) TARGET_GENERIC_ROOT_PASSWD:=$(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD)) TARGET_GENERIC_PASSWD_METHOD:=$(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD)) -ifneq ($(TARGET_GENERIC_ROOT_PASSWD),) +ifeq ($(TARGET_GENERIC_SET_ROOT_PASSWD),y) TARGET_GENERIC_ROOT_PASSWD_HASH=$(shell mkpasswd -m "$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)") endif TARGET_GENERIC_GETTY:=$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT))
@@ -57,7 +58,9 @@ TARGETS += target-generic-issue endif ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y) +ifeq ($(TARGET_GENERIC_SET_ROOT_PASSWD),y) TARGETS += target-root-passwd +endif ifneq ($(TARGET_GENERIC_GETTY),) TARGETS += target-generic-getty-$(if $(BR2_PACKAGE_SYSVINIT),sysvinit,busybox)
Signature · 1 line
1.7.9.5