Skip to content

Commit 897c0f8

Browse files
authored
Merge pull request #86 from anderbubble/truncate-machine-id
Truncate /etc/machine-id to bypass first-boot semantics
2 parents 8d55f81 + ed43cad commit 897c0f8

File tree

13 files changed

+26
-13
lines changed

13 files changed

+26
-13
lines changed

almalinux-10/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export LANG=C LC_CTYPE=C
1313

1414
set -x
1515
dnf clean all
16-
rm -f /etc/machine-id /var/lib/dbus/machine-id
16+
rm -f /var/lib/dbus/machine-id
17+
truncate -s0 /etc/machine-id

almalinux-8/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export LANG=C LC_CTYPE=C
1313

1414
set -x
1515
dnf clean all
16-
rm -f /etc/machine-id /var/lib/dbus/machine-id
16+
rm -f /var/lib/dbus/machine-id
17+
truncate -s0 /etc/machine-id

almalinux-9/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export LANG=C LC_CTYPE=C
1313

1414
set -x
1515
dnf clean all
16-
rm -f /etc/machine-id /var/lib/dbus/machine-id
16+
rm -f /var/lib/dbus/machine-id
17+
truncate -s0 /etc/machine-id

debian/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ LANG=C
44
LC_CTYPE=C
55
export LANG LC_CTYPE
66
apt-get clean
7-
rm -f /etc/machine-id /var/lib/dbus/machine-id
7+
rm -f /var/lib/dbus/machine-id
8+
truncate -s0 /etc/machine-id

examples/rhel-9/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ LANG=C
44
LC_CTYPE=C
55
export LANG LC_CTYPE
66
dnf clean all
7-
rm -f /etc/machine-id /var/lib/dbus/machine-id
7+
rm -f /var/lib/dbus/machine-id
8+
truncate -s0 /etc/machine-id

examples/rockylinux-mofed/Containerfile-8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ RUN dnf -y install \
2323

2424
RUN (cd /tmp && tar -xf /mnt/$MOFED_TGZ) \
2525
&& (cd /tmp/MLNX_OFED_LINUX* && ./mlnxofedinstall --distro rhel8.10 --skip-repo --kernel $(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}\n' | tail -n 1) --add-kernel-support --hpc --without-fw-update) \
26-
&& rm -rf /tmp/MLNX_OFED_LINUX* /etc/machine-id
26+
&& rm -rf /tmp/MLNX_OFED_LINUX* \
27+
&& truncate -s0 /etc/machine-id

examples/rockylinux-mofed/Containerfile-9

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ RUN dnf -y install \
2525

2626
RUN (cd /tmp && tar -xf /mnt/$MOFED_TGZ) \
2727
&& (cd /tmp/MLNX_OFED_LINUX* && ./mlnxofedinstall --distro rhel9.4 --skip-repo --kernel $(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}\n' | tail -n 1) --add-kernel-support --hpc --without-fw-update) \
28-
&& rm -rf /tmp/MLNX_OFED_LINUX* /etc/machine-id
28+
&& rm -rf /tmp/MLNX_OFED_LINUX* \
29+
&& truncate -s0 /etc/machine-id

leap/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
export LANG=C LC_CTYPE=C
33
set -x
44
zypper clean -a
5-
rm -f /etc/machine-id /var/lib/dbus/machine-id
5+
rm -f /var/lib/dbus/machine-id
6+
truncate -s0 /etc/machine-id

openeuler-24.03/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ LANG=C
44
LC_CTYPE=C
55
export LANG LC_CTYPE
66
dnf clean all
7-
rm -f /etc/machine-id /var/lib/dbus/machine-id
7+
rm -f /var/lib/dbus/machine-id
8+
truncate -s0 /etc/machine-id

rockylinux-10/container_exit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export LANG=C LC_CTYPE=C
1313

1414
set -x
1515
dnf clean all
16-
rm -f /etc/machine-id /var/lib/dbus/machine-id
16+
rm -f /var/lib/dbus/machine-id
17+
truncate -s0 /etc/machine-id

0 commit comments

Comments
 (0)