From c7a9a0b906817157acc8be912f413bb836d65ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Thu, 12 Dec 2024 20:44:15 +0100 Subject: [PATCH] Remove existing rauc.db from a data disk on the first boot (#3737) If data disk is adopted on Yellow using the mechanism added in #3686, it contains RAUC version information that is very likely invalid. In such case, remove the file on first boot and have it recreated by the raucdb-update service. --- .../lib/systemd/system/raucdb-first-boot.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/raucdb-first-boot.service diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/raucdb-first-boot.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/raucdb-first-boot.service new file mode 100644 index 000000000..efc724261 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/raucdb-first-boot.service @@ -0,0 +1,14 @@ +[Unit] +Description=Remove adopted rauc.db on first boot +After=rauc.service +Before=raucdb-update.service +RequiresMountsFor=/mnt/data +ConditionFirstBoot=yes +ConditionFileNotEmpty=/mnt/data/rauc.db + +[Service] +Type=oneshot +ExecStart=/bin/rm -f /mnt/data/rauc.db + +[Install] +WantedBy=multi-user.target