From: Jan Kiszka <jan.kis...@siemens.com>

Start with first customizations of the image by adding a dpkg-raw
package that replaces /etc/issue, allows login as root via ssh, and
pre-fills the bash history with demo commands.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 recipes-core/customizations/customizations.bb   | 27 +++++++++++++++++++++++++
 recipes-core/customizations/files/.bash_history | 10 +++++++++
 recipes-core/customizations/files/issue         |  2 ++
 recipes-core/customizations/files/postinst      |  4 ++++
 recipes-core/images/demo-image.bb               |  2 +-
 5 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 recipes-core/customizations/customizations.bb
 create mode 100644 recipes-core/customizations/files/.bash_history
 create mode 100644 recipes-core/customizations/files/issue
 create mode 100644 recipes-core/customizations/files/postinst

diff --git a/recipes-core/customizations/customizations.bb 
b/recipes-core/customizations/customizations.bb
new file mode 100644
index 0000000..667befd
--- /dev/null
+++ b/recipes-core/customizations/customizations.bb
@@ -0,0 +1,27 @@
+#
+# Jailhouse, a Linux-based partitioning hypervisor
+#
+# Copyright (c) Siemens AG, 2018
+#
+# Authors:
+#  Jan Kiszka <jan.kis...@siemens.com>
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+inherit dpkg-raw
+
+DESCRIPTION = "demo image customizations"
+
+SRC_URI = " \
+    file://postinst \
+    file://.bash_history"
+
+do_install() {
+
+       install -v -d ${D}/root
+       install -v -m 600 ${WORKDIR}/.bash_history ${D}/root/
+
+       install -v -d -m 700 ${D}/root/.ssh
+       install -v -m 644 ${WORKDIR}/known_hosts ${D}/root/.ssh/
+}
diff --git a/recipes-core/customizations/files/.bash_history 
b/recipes-core/customizations/files/.bash_history
new file mode 100644
index 0000000..7a7d301
--- /dev/null
+++ b/recipes-core/customizations/files/.bash_history
@@ -0,0 +1,10 @@
+jailhouse enable /etc/jailhouse/qemu-x86.cell
+jailhouse console
+jailhouse cell create /etc/jailhouse/apic-demo.cell
+jailhouse cell load apic-demo /usr/libexec/jailhouse/demos/apic-demo.bin
+jailhouse cell start apic-demo
+jailhouse cell stats apic-demo
+jailhouse cell destroy apic-demo
+jailhouse cell linux /etc/jailhouse/linux-x86-demo.cell /boot/vmlinuz* -i 
/usr/libexec/jailhouse/demos/rootfs.cpio -c "console=ttyS0 8250.nr_uarts=1 
ip=192.168.19.2"
+ssh 192.168.19.2
+jailhouse disable
diff --git a/recipes-core/customizations/files/issue 
b/recipes-core/customizations/files/issue
new file mode 100644
index 0000000..0fd2e65
--- /dev/null
+++ b/recipes-core/customizations/files/issue
@@ -0,0 +1,2 @@
+Jailhouse Demo Image (login: root)
+
diff --git a/recipes-core/customizations/files/postinst 
b/recipes-core/customizations/files/postinst
new file mode 100644
index 0000000..a10628c
--- /dev/null
+++ b/recipes-core/customizations/files/postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+echo "Jailhouse Demo Image (login: root/root)" > /etc/issue
+
+echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
diff --git a/recipes-core/images/demo-image.bb 
b/recipes-core/images/demo-image.bb
index c9771a9..a22db0b 100644
--- a/recipes-core/images/demo-image.bb
+++ b/recipes-core/images/demo-image.bb
@@ -13,4 +13,4 @@ require recipes-core/images/isar-image-base.bb
 
 IMAGE_PREINSTALL += "bash-completion less vim nano"
 
-IMAGE_INSTALL += "jailhouse"
+IMAGE_INSTALL += "jailhouse customizations"
-- 
2.13.6

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to