summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/core-image.bbclass2
-rw-r--r--meta/classes/image.bbclass7
2 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
index e2ad0fcf31..25f5c5a8dc 100644
--- a/meta/classes/core-image.bbclass
+++ b/meta/classes/core-image.bbclass
@@ -69,4 +69,6 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
69 69
70# Zap the root password if debug-tweaks feature is not enabled 70# Zap the root password if debug-tweaks feature is not enabled
71ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}' 71ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}'
72# Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled
73ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}'
72 74
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index fb932b9d66..0772363f18 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -318,6 +318,13 @@ zap_root_password () {
318 mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd 318 mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
319} 319}
320 320
321# allow openssh accept login with empty password string
322openssh_allow_empty_password () {
323 if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
324 sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
325 fi
326}
327
321# Turn any symbolic /sbin/init link into a file 328# Turn any symbolic /sbin/init link into a file
322remove_init_link () { 329remove_init_link () {
323 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then 330 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then