summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-10-31 13:43:01 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-10-31 13:46:37 +0000
commit2625515f679822c251c40c3569fbef0105a6560b (patch)
tree43f66e5bf032318822829fec09c1ad60f23b1356
parentAdding splash png exports (to workaround librsvg with fonts-font-awesome duri... (diff)
downloadsystem-images-2625515f679822c251c40c3569fbef0105a6560b.tar.xz
system-images-2625515f679822c251c40c3569fbef0105a6560b.zip
Adding hook to configure image specific build, variant, and variant-id in /etc/os-release.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-ximages/base-system/config/hooks/normal/0001-os-release.chroot15
-rwxr-xr-ximages/container-server/config/hooks/normal/0001-os-release.chroot15
-rwxr-xr-ximages/gnome-desktop/config/hooks/normal/0001-os-release.chroot15
3 files changed, 45 insertions, 0 deletions
diff --git a/images/base-system/config/hooks/normal/0001-os-release.chroot b/images/base-system/config/hooks/normal/0001-os-release.chroot
new file mode 100755
index 0000000..b7f69a1
--- /dev/null
+++ b/images/base-system/config/hooks/normal/0001-os-release.chroot
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+BUILD_ID="$(date +%Y%m%d)"
+VARIANT="Base System"
+VARIANT_ID="base-system"
+
+if [ -e /etc/os-release ]
+then
+ sed -i -e "s|\(BUILD_ID\)=.*$|\1=\"${BUILD_ID}\"|" \
+ -e "s|\(VARIANT\)=.*$|\1=\"${VARIANT}\"|" \
+ -e "s|\(VARIANT_ID\)=.*$|\1=\"${VARIANT_ID}\"|" \
+ /etc/os-release
+fi
diff --git a/images/container-server/config/hooks/normal/0001-os-release.chroot b/images/container-server/config/hooks/normal/0001-os-release.chroot
new file mode 100755
index 0000000..2ec2ab6
--- /dev/null
+++ b/images/container-server/config/hooks/normal/0001-os-release.chroot
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+BUILD_ID="$(date +%Y%m%d)"
+VARIANT="Container Server"
+VARIANT_ID="container-server"
+
+if [ -e /etc/os-release ]
+then
+ sed -i -e "s|\(BUILD_ID\)=.*$|\1=\"${BUILD_ID}\"|" \
+ -e "s|\(VARIANT\)=.*$|\1=\"${VARIANT}\"|" \
+ -e "s|\(VARIANT_ID\)=.*$|\1=\"${VARIANT_ID}\"|" \
+ /etc/os-release
+fi
diff --git a/images/gnome-desktop/config/hooks/normal/0001-os-release.chroot b/images/gnome-desktop/config/hooks/normal/0001-os-release.chroot
new file mode 100755
index 0000000..1484bf4
--- /dev/null
+++ b/images/gnome-desktop/config/hooks/normal/0001-os-release.chroot
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+BUILD_ID="$(date +%Y%m%d)"
+VARIANT="GNOME Desktop"
+VARIANT_ID="gnome-desktop"
+
+if [ -e /etc/os-release ]
+then
+ sed -i -e "s|\(BUILD_ID\)=.*$|\1=\"${BUILD_ID}\"|" \
+ -e "s|\(VARIANT\)=.*$|\1=\"${VARIANT}\"|" \
+ -e "s|\(VARIANT_ID\)=.*$|\1=\"${VARIANT_ID}\"|" \
+ /etc/os-release
+fi