diff mbox series

package/dt-utils: install barebox-state lock file

Message ID 20201117102534.107484-1-b.bilas@grinn-global.com
State New
Headers show
Series package/dt-utils: install barebox-state lock file | expand

Commit Message

Bartosz Bilas Nov. 17, 2020, 10:25 a.m. UTC
By default there is no /var/lock/barebox-state file what causes
the following error when we try to execute barebox-state command:

# barebox-state
Failed to open lock-file /var/lock/barebox-state

Fix it by adding an empty file in post install hook.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
---
 package/dt-utils/dt-utils.mk | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/package/dt-utils/dt-utils.mk b/package/dt-utils/dt-utils.mk
index 25c287d434..454b00e3d6 100644
--- a/package/dt-utils/dt-utils.mk
+++ b/package/dt-utils/dt-utils.mk
@@ -12,4 +12,11 @@  DT_UTILS_LICENSE_FILES = COPYING
 DT_UTILS_DEPENDENCIES = udev
 DT_UTILS_AUTORECONF = YES
 
+define DT_UTILS_INSTALL_LOCK_FILE
+	rm -f $(TARGET_DIR)/var/lock/barebox-state
+	mkdir -p $(TARGET_DIR)/var/lock
+	touch $(TARGET_DIR)/var/lock/barebox-state
+endef
+DT_UTILS_POST_INSTALL_TARGET_HOOKS += DT_UTILS_INSTALL_LOCK_FILE
+
 $(eval $(autotools-package))