[PATCH][libubootenv] uboot_env: Add default FreeBSD lock file path

5 views
Skip to first unread message

Christian Storm

unread,
Jul 22, 2026, 8:38:40 AM (14 days ago) Jul 22
to swup...@googlegroups.com
FreeBSD doesn't have /var/lock as Linux does per the FHS.
On FreeBSD, /var/run is the closest match being used for
daemon/service lock files.

Signed-off-by: Christian Storm <christi...@siemens.com>
---
src/uboot_env.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/src/uboot_env.c b/src/uboot_env.c
index ea58f6d..c4b2405 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -53,7 +53,11 @@ extern int parse_yaml_config(struct uboot_ctx **ctxlist, FILE *fp);
* the fw_printenv utilities. Custom lockfile can be set via
* configuration file.
*/
+#if defined(__FreeBSD__)
+static const char *default_lockname = "/var/run/fw_printenv.lock";
+#else
static const char *default_lockname = "/var/lock/fw_printenv.lock";
+#endif
static struct uboot_version_info libinfo;

static int libuboot_lock(struct uboot_ctx *ctx)
--
2.55.0

Stefano Babic

unread,
Jul 27, 2026, 11:56:14 AM (9 days ago) Jul 27
to Christian Storm, swup...@googlegroups.com
Applied to -master, thanks !

Best regards,
Stefano

--
_______________________________________________________________________
Nabla Software Engineering GmbH
Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596
Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
E-Mail: sba...@nabladev.com

Reply all
Reply to author
Forward
0 new messages