Skip to contentSkip to conversation

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

PATCH New Bartosz Bilas 2 participants 3 messages Nov 17, 2020 – Dec 10, 2020

lore
Share & tools
lore
#0 lore raw

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

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.

---
 package/dt-utils/dt-utils.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/dt-utils/dt-utils.mk +7 -0
index 25c287d434..454b00e3d6 100644
@@ -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))
Signature · 1 line
2.29.2
#1 lore raw

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

Hi Bartosz,

Quoted 18 lines · Bartosz Bilas

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.

---
 package/dt-utils/dt-utils.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/dt-utils/dt-utils.mk +0 -0
index 25c287d434..454b00e3d6 100644

package/dt-utils/dt-utils.mk DT_UTILS_LICENSE_FILES = COPYING · line 20

Quoted 9 lines
package/dt-utils/dt-utils.mk +6 -0
@@ -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

I'm afraid this won't help for minimal rootfs images, where /var/lock is a symlink at /tmp. What is the type of rootfs skeleton that you tested your changes with?

Quoted 2 lines
package/dt-utils/dt-utils.mk +1 -0
+
 $(eval $(autotools-package))
Signature · 2 lines
Regards,
Marcin
#2 lore raw

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

Hello Marcin,

Quoted 25 lines · Marcin Niestr?j

Hi Bartosz,

Quoted 21 lines · Bartosz Bilas

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.

---
  package/dt-utils/dt-utils.mk | 7 +++++++
  1 file changed, 7 insertions(+)
package/dt-utils/dt-utils.mk +0 -0
index 25c287d434..454b00e3d6 100644
@@ -12,4 +12,11 @@ DT_UTILS_LICENSE_FILES = COPYING
  DT_UTILS_DEPENDENCIES = udev
  DT_UTILS_AUTORECONF = YES
 
Quoted 9 lines

package/dt-utils/dt-utils.mk DT_UTILS_LICENSE_FILES = COPYING · line 20

Quoted 6 lines
package/dt-utils/dt-utils.mk +6 -0
+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

I'm afraid this won't help for minimal rootfs images, where /var/lock is a symlink at /tmp. What is the type of rootfs skeleton that you tested your changes with?

I've been testing this patch using skeleton-init-systemd.

Quoted 3 lines

package/dt-utils/dt-utils.mk DT_UTILS_LICENSE_FILES = COPYING · line 22

Quoted 3 lines
package/dt-utils/dt-utils.mk +1 -0
+
  $(eval $(autotools-package))

Best
Bartek