From 0c01c7f2cba0f12f8659b0a99dc5bccf4e90cfb1 Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
Date: Mon, 11 Sep 2023 17:53:02 +0200
Subject: [PATCH] sbin/reform-flash-rescue: change disk labels after dd

Otherwise, an inserted SD card will look for a partition with the
reformsdboot and reformsdroot label, find it on the emmc and use those
instead of sd-card.
---
 debian/changelog         | 6 ++++++
 sbin/reform-flash-rescue | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index bf72d08..2842504 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+reform-tools (1.26) reform; urgency=medium
+
+  * sbin/reform-flash-rescue: change disk labels after dd
+
+ -- Johannes Schauer Marin Rodrigues <josch@debian.org>  Mon, 11 Sep 2023 17:54:27 +0200
+
 reform-tools (1.25) reform; urgency=medium
 
   * updates for sysimage-v4
diff --git a/sbin/reform-flash-rescue b/sbin/reform-flash-rescue
index 055a4c8..a4c2bc7 100755
--- a/sbin/reform-flash-rescue
+++ b/sbin/reform-flash-rescue
@@ -71,6 +71,10 @@ else
 fi; } | gzip --decompress --to-stdout | dd of=/dev/mmcblk0 status=progress
 partprobe /dev/mmcblk0
 
+# overwrite the partition label
+e2label /dev/mmcblk0p1 reformemmcboot
+e2label /dev/mmcblk0p2 reformemmcroot
+
 # The rescue system image that we downloaded and wrote to the eMMC above is
 # configured to use the rootfs on the SD-Card but we want the initramfs on eMMC
 # to boot the rootfs on eMMC and not the rootfs from SD-Card.  Use
-- 
GitLab