From 1f1184c77cdddd04c657dd4d450f1a5c8b924bf0 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 13 Sep 2016 08:55:44 +0100 Subject: [PATCH] Remove machine-id on pre generated images so it's unique on each deployed device As referenced on the arm list [1] and as already being done on the docker image we should remove the unique /etc/machine-id file on compose artifacts to ensure it's regenerated and unique on each deployed host/device. This unifies the process across all base ks so it's inherited for each artifact. [1] https://lists.fedoraproject.org/archives/list/arm@lists.fedoraproject.org/message/Q3YZVF5P2OLLPUJQ2LYZSTKWGGDIU6QO/ Signed-off-by: Peter Robinson --- fedora-arm-base.ks | 3 +++ fedora-cloud-base.ks | 3 +++ fedora-docker-base.ks | 1 + fedora-live-base.ks | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/fedora-arm-base.ks b/fedora-arm-base.ks index 44b3d3f..55f61f4 100644 --- a/fedora-arm-base.ks +++ b/fedora-arm-base.ks @@ -77,5 +77,8 @@ dnf -y remove dracut-config-generic # fails due to RHBZ #1369794 /sbin/chkconfig network off +# Remove machine-id on pre generated images +rm -f /etc/machine-id + %end diff --git a/fedora-cloud-base.ks b/fedora-cloud-base.ks index e4d992a..4f1dea2 100644 --- a/fedora-cloud-base.ks +++ b/fedora-cloud-base.ks @@ -270,5 +270,8 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-ens3 # fails due to RHBZ #1369794 /sbin/chkconfig network on +# Remove machine-id on pre generated images +rm -f /etc/machine-id + %end diff --git a/fedora-docker-base.ks b/fedora-docker-base.ks index deba617..bcbb58e 100644 --- a/fedora-docker-base.ks +++ b/fedora-docker-base.ks @@ -87,6 +87,7 @@ systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connec umount /run systemd-tmpfiles --create --boot +# Remove machine-id on pre generated images rm -f /etc/machine-id %end diff --git a/fedora-live-base.ks b/fedora-live-base.ks index d1401a4..9bf998b 100644 --- a/fedora-live-base.ks +++ b/fedora-live-base.ks @@ -325,6 +325,9 @@ rm -f /boot/*-rescue* # fails due to RHBZ #1369794 /sbin/chkconfig network off +# Remove machine-id on pre generated images +rm -f /etc/machine-id + %end @@ -336,4 +339,5 @@ if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS fi + %end