@@ -15,20 +15,9 @@
echo "CIP Core Demo & Test Image" > /etc/issue
# permit root login without password
-echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
-echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
passwd root -d
-# serial getty service for autologin
-mkdir -p /etc/systemd/system/serial-getty@.service.d/
-echo "[Service]" > /etc/systemd/system/serial-getty@.service.d/override.conf
-echo "ExecStart=" >> /etc/systemd/system/serial-getty@.service.d/override.conf
-echo "ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM" >> /etc/systemd/system/serial-getty@.service.d/override.conf
-
# set the profile for KernelCI
echo "PS1='\$(pwd) # '" > /root/.profile
echo "cd /" >> /root/.profile
-HOSTNAME=demo
-echo "$HOSTNAME" > /etc/hostname
-echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
new file mode 100644
@@ -0,0 +1,3 @@
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM
new file mode 100644
@@ -0,0 +1,2 @@
+PermitEmptyPasswords yes
+
@@ -11,13 +11,23 @@
# SPDX-License-Identifier: MIT
#
-require recipes-core/customizations/common.inc
+inherit dpkg-raw
DESCRIPTION = "CIP Core KernelCI image customizations"
-SRC_URI += "file://dmesg.sh"
+DEPENDS += "customizations"
+DEBIAN_DEPENDS += "customizations"
-do_install:append() {
- install -v -d ${D}/opt/kernelci
+SRC_URI = "file://postinst \
+ file://dmesg.sh \
+ file://serial-getty-kernelci-override.conf \
+ file://ssh-permit-empty-passwords.conf"
+
+do_install[cleandirs] = "${D}/opt/kernelci/ \
+ ${D}/etc/systemd/system/serial-getty@.service.d/ \
+ ${D}/etc/ssh/sshd_config.d/"
+do_install() {
install -v -m 744 ${WORKDIR}/dmesg.sh ${D}/opt/kernelci/
+ install -v -m 644 ${WORKDIR}/serial-getty-kernelci-override.conf ${D}/etc/systemd/system/serial-getty@.service.d/serial-getty-kernelci-override.conf
+ install -v -m 600 ${WORKDIR}/ssh-permit-empty-passwords.conf ${D}/etc/ssh/sshd_config.d/ssh-permit-empty-passwords.conf
}