blob: b9bddab3d8c6ccdfb83dd6b5cc61f700d9ee69f3 [file] [log] [blame]
Jan Kundrát2f100fc2020-11-02 22:10:16 +01001From e09ad9a33840ed83b91dd3901492ecf99ab89076 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
3Date: Wed, 21 Oct 2020 23:06:21 +0200
4Subject: [PATCH] fw_*env: do not rely on /var/lock
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9...because these are not available under the new Buildroot.
10
11Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
12---
13 tools/env/README | 2 +-
14 tools/env/fw_env_main.c | 6 +++---
15 2 files changed, 4 insertions(+), 4 deletions(-)
16
17diff --git a/tools/env/README b/tools/env/README
18index 709251383c..480a893202 100644
19--- a/tools/env/README
20+++ b/tools/env/README
21@@ -59,5 +59,5 @@ this environment instance. On NAND this is used to limit the range
22 within which bad blocks are skipped, on NOR it is not used.
23
24 To prevent losing changes to the environment and to prevent confusing the MTD
25-drivers, a lock file at /var/lock/fw_printenv.lock is used to serialize access
26+drivers, a lock file at /run/fw_printenv.lock is used to serialize access
27 to the environment.
28diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
29index 26ba6624cd..4c84b13cfc 100644
30--- a/tools/env/fw_env_main.c
31+++ b/tools/env/fw_env_main.c
32@@ -72,7 +72,7 @@ void usage_printenv(void)
33 " -c, --config configuration file, default:" CONFIG_FILE "\n"
34 #endif
35 " -n, --noheader do not repeat variable name in output\n"
36- " -l, --lock lock node, default:/var/lock\n"
37+ " -l, --lock lock node, default:/run\n"
38 "\n");
39 }
40
41@@ -87,7 +87,7 @@ void usage_env_set(void)
42 #ifdef CONFIG_FILE
43 " -c, --config configuration file, default:" CONFIG_FILE "\n"
44 #endif
45- " -l, --lock lock node, default:/var/lock\n"
46+ " -l, --lock lock node, default:/run\n"
47 " -s, --script batch mode to minimize writes\n"
48 "\n"
49 "Examples:\n"
50@@ -205,7 +205,7 @@ int parse_setenv_args(int argc, char *argv[])
51
52 int main(int argc, char *argv[])
53 {
54- char *lockname = "/var/lock/" CMD_PRINTENV ".lock";
55+ char *lockname = "/run/" CMD_PRINTENV ".lock";
56 int lockfd = -1;
57 int retval = EXIT_SUCCESS;
58 char *_cmdname;
59--
602.28.0
61