Skip to content

Commit 34a5f67

Browse files
committed
Add new entry if entry is missing
1 parent 43a27f8 commit 34a5f67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

buildroot-external/rootfs-overlay/usr/libexec/hassos-persists

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ elif [ -e /usr/bin/grub-editenv ]; then
3030
else
3131
if ! grep -q "systemd.machine_id=${MACHINE_ID}" /mnt/boot/cmdline.txt; then
3232
echo "[INFO] set machine-id to ${MACHINE_ID}"
33-
sed -i "s/systemd.machine_id=[0-f]*/systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt
33+
if sed -i "s/systemd.machine_id=[0-f]*/systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt; then
34+
echo "systemd.machine_id=${MACHINE_ID}" > /mnt/boot/cmdline.txt
35+
fi
3436
else
3537
echo "[INFO] machine-id is okay"
3638
fi

0 commit comments

Comments
 (0)