@@ -14,16 +14,20 @@ inherit dpkg-raw
FILESPATH:append := ":${FILE_DIRNAME}/files"
SRC_URI = " \
- file://postinst \
+ file://postinst.tmpl \
file://ethernet \
file://99-silent-printk.conf \
file://99-watchdog.conf"
SRC_URI:append:swupdate = " file://swupdate.cfg"
+CUSTOM_HOSTNAME ??= "demo"
WIRELESS_FIRMWARE_PACKAGE ?= ""
INSTALL_WIRELESS_TOOLS ??= "0"
+TEMPLATE_FILES += "postinst.tmpl"
+TEMPLATE_VARS += "CUSTOM_HOSTNAME"
+
DEPENDS += "sshd-regen-keys change-root-homedir"
DEBIAN_DEPENDS = " \
similarity index 85%
rename from recipes-core/customizations/files/postinst
rename to recipes-core/customizations/files/postinst.tmpl
@@ -2,7 +2,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2019
+# Copyright (c) Siemens AG, 2019-2023
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
@@ -18,6 +18,6 @@ if ! grep -e "^PermitRootLogin.*yes" -q /etc/ssh/sshd_config; then
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
fi
-HOSTNAME=demo
+HOSTNAME="${CUSTOM_HOSTNAME}"
echo "$HOSTNAME" > /etc/hostname
echo "127.0.0.1 $HOSTNAME" >> /etc/hosts