Skip to content

Overlay reformats on reboot with fstools_overlay_name bootparam #18

Description

@hbalint2100

I tested the latest fstools boot parameter option (fstools_overlay_name) introduced in #9, but it has an issue: the overlay partition gets reformatted on every boot, causing all changes on the device to be lost.

It appears that during the mount_root done phase, mount_root does not pick up the overlay name from the fstools_overlay_name boot parameter, so it fails to locate the correct partition. As a result, the .fs_state file is not created.

From fad83e23386ae9101c3a5785be2bd9c5131c6ce5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C3=A1lint=20Husz=C3=A1r?= <balint.huszar@intelliport.hu>
Date: Thu, 9 Apr 2026 17:11:13 +0200
Subject: [PATCH] Fix volume_find dataname param to use bootargs

---
 mount_root.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mount_root.c b/mount_root.c
index 392e912..37c5650 100644
--- a/mount_root.c
+++ b/mount_root.c
@@ -115,7 +115,13 @@ stop(int argc, char *argv[1])
 static int
 done(int argc, char *argv[1])
 {
-	struct volume *v = volume_find("rootfs_data");
+	char dataparam[BUFLEN];
+	char *dataname = "rootfs_data";
+
+	if (get_var_from_file("/proc/cmdline", "fstools_overlay_name", dataparam, sizeof(dataparam)))
+		dataname = dataparam;
+	
+	struct volume *v = volume_find(dataname);
 
 	if (!v)
 		return -1;
-- 
2.39.5


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions