summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/rootfs-postcommands.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/rootfs-postcommands.bbclass')
-rw-r--r--meta/classes-recipe/rootfs-postcommands.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index d40adf5f0e..bf1e992bb2 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -13,6 +13,9 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'deb
13# Allow dropbear/openssh to accept root logins if debug-tweaks or allow-root-login is enabled 13# Allow dropbear/openssh to accept root logins if debug-tweaks or allow-root-login is enabled
14ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], "ssh_allow_root_login; ", "",d)}' 14ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], "ssh_allow_root_login; ", "",d)}'
15 15
16# Autologin the root user on the serial console, if empty-root-password and serial-autologin-root are active
17ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", [ 'empty-root-password', 'serial-autologin-root' ], "serial_autologin_root; ", "",d)}'
18
16# Enable postinst logging if debug-tweaks or post-install-logging is enabled 19# Enable postinst logging if debug-tweaks or post-install-logging is enabled
17ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'post-install-logging' ], "postinst_enable_logging; ", "",d)}' 20ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'post-install-logging' ], "postinst_enable_logging; ", "",d)}'
18 21
@@ -201,6 +204,23 @@ ssh_allow_root_login () {
201 fi 204 fi
202} 205}
203 206
207#
208# Autologin the 'root' user on the serial terminal,
209# if empty-root-password' AND 'serial-autologin-root are enabled
210#
211serial_autologin_root () {
212 if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
213 # add autologin option to util-linux getty only
214 sed -i 's/options="/&--autologin root /' \
215 "${IMAGE_ROOTFS}${base_bindir}/start_getty"
216 elif ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then
217 if [ -e ${IMAGE_ROOTFS}${systemd_system_unitdir}/serial-getty@.service ]; then
218 sed -i '/^\s*ExecStart\b/ s/getty /&--autologin root /' \
219 "${IMAGE_ROOTFS}${systemd_system_unitdir}/serial-getty@.service"
220 fi
221 fi
222}
223
204python sort_passwd () { 224python sort_passwd () {
205 import rootfspostcommands 225 import rootfspostcommands
206 rootfspostcommands.sort_passwd(d.expand('${IMAGE_ROOTFS}${sysconfdir}')) 226 rootfspostcommands.sort_passwd(d.expand('${IMAGE_ROOTFS}${sysconfdir}'))