Skip to contentSkip to conversation

package/openrc: add patch to create /run/lock/subsys

PATCH Applied Norbert Lange 3 participants 4 messages Jan 9, 2022 – Jan 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/openrc: add patch to create /run/lock/subsys

Together with changes to sysv/busybox init, this directory will already exist on all init systems before any service scripts are run.

---
v1->v2:
* refresh patch

---
 ...lso-create-run-lock-subsys-directory.patch | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/openrc/0006-Also-create-run-lock-subsys-directory.patch
package/openrc/0006-Also-create-run-lock-subsys-directory.patch new file +29 -0
new file mode 100644
index 0000000000..cf592a88b0
@@ -0,0 +1,29 @@
+From 49e5929b468f604d80a0c04a6ce78eb96ca36090 Mon Sep 17 00:00:00 2001
+From: Norbert Lange <[email protected]>
+Date: Sun, 9 Jan 2022 00:22:40 +0100
+Subject: [PATCH] Also create /run/lock/subsys directory
+
+Buildroot service scripts regularly use this directory, so
+create it in the most appropriate spot.
+
+Signed-off-by: Norbert Lange <[email protected]>
+---
+ sh/init.sh.Linux.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
+index e8afc1fb..662ab223 100644
+--- a/sh/init.sh.Linux.in
++++ b/sh/init.sh.Linux.in
+@@ -82,7 +82,7 @@ elif ! mountinfo -q /run; then
+ fi
+ 
+ checkpath -d "$RC_SVCDIR"
+-checkpath -d -m 0775 -o root:daemon /run/lock
++checkpath -d -m 0775 -o root:daemon /run/lock /run/lock/subsys
+ 
+ # Try to mount xenfs as early as possible, otherwise rc_sys() will always
+ # return RC_SYS_XENU and will think that we are in a domU while it's not.
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 5 lines · Norbert Lange

Together with changes to sysv/busybox init, this directory will already exist on all init systems before any service scripts are run.

Applied to master, thanks.

Normally we require patches to be upstreamed first, but there are already
plenty of other patches that haven't been sent upstream. It could also be a bit buildroot-specific (though I think the subsys is there because some packages actually use that directory).

Still, Michał, do you think this patch would be acceptable upstream? Obviously
not in its current form since upstream has group uucp rather than daemon.

Regards,
Arnout

Quoted 34 lines

---
v1->v2:
* refresh patch

---
  ...lso-create-run-lock-subsys-directory.patch | 29 +++++++++++++++++++
  1 file changed, 29 insertions(+)

create mode 100644 package/openrc/0006-Also-create-run-lock-subsys-directory.patch

package/openrc/0006-Also-create-run-lock-subsys-directory.patch new file +19 -0
new file mode 100644
index 0000000000..cf592a88b0
@@ -0,0 +1,29 @@
+From 49e5929b468f604d80a0c04a6ce78eb96ca36090 Mon Sep 17 00:00:00 2001
+From: Norbert Lange <[email protected]>
+Date: Sun, 9 Jan 2022 00:22:40 +0100
+Subject: [PATCH] Also create /run/lock/subsys directory
+
+Buildroot service scripts regularly use this directory, so
+create it in the most appropriate spot.
+
+Signed-off-by: Norbert Lange <[email protected]>
+---
+ sh/init.sh.Linux.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
+index e8afc1fb..662ab223 100644
+--- a/sh/init.sh.Linux.in
++++ b/sh/init.sh.Linux.in
+@@ -82,7 +82,7 @@ elif ! mountinfo -q /run; then
+ fi

package/openrc/0006-Also-create-run-lock-subsys-directory.patch line 29

Quoted 10 lines
package/openrc/0006-Also-create-run-lock-subsys-directory.patch new file +10 -0
+
+ checkpath -d "$RC_SVCDIR"
+-checkpath -d -m 0775 -o root:daemon /run/lock
++checkpath -d -m 0775 -o root:daemon /run/lock /run/lock/subsys
+
+ # Try to mount xenfs as early as possible, otherwise rc_sys() will always
+ # return RC_SYS_XENU and will think that we are in a domU while it's not.
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 11 lines · Arnout Vandecappelle
Quoted 5 lines · Norbert Lange

Together with changes to sysv/busybox init, this directory will already exist on all init systems before any service scripts are run.

Applied to master, thanks.

Quoted 8 lines

Normally we require patches to be upstreamed first, but there are already
plenty of other patches that haven't been sent upstream. It could also be a bit buildroot-specific (though I think the subsys is there because some packages actually use that directory).

Still, Michał, do you think this patch would be acceptable upstream?
Obviously not in its current form since upstream has group uucp rather than daemon.

I think it won't be accepted by upstream. Seems that openrc does not use /var/lock/subsys anywhere, nor does Gentoo. I also think that /var/lock/susbsys is used mainly by redhat/rpm packages with plain rc.d scripts. So in that case this rather seem like buildroot specific change and is not really related to openrc, thus I don't see why openrc would commit this patch.

But bear in mind, I am not a Gentoo nor openrc developer, so that might not be true.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Norbert Lange
Quoted 5 lines · Norbert Lange

Together with changes to sysv/busybox init, this directory will already exist on all init systems before any service scripts are run.

Applied to master, thanks.

Regards,
Arnout

Quoted 34 lines

---
v1->v2:
* refresh patch

---
  ...lso-create-run-lock-subsys-directory.patch | 29 +++++++++++++++++++
  1 file changed, 29 insertions(+)

create mode 100644 package/openrc/0006-Also-create-run-lock-subsys-directory.patch

package/openrc/0006-Also-create-run-lock-subsys-directory.patch new file +19 -0
new file mode 100644
index 0000000000..cf592a88b0
@@ -0,0 +1,29 @@
+From 49e5929b468f604d80a0c04a6ce78eb96ca36090 Mon Sep 17 00:00:00 2001
+From: Norbert Lange <[email protected]>
+Date: Sun, 9 Jan 2022 00:22:40 +0100
+Subject: [PATCH] Also create /run/lock/subsys directory
+
+Buildroot service scripts regularly use this directory, so
+create it in the most appropriate spot.
+
+Signed-off-by: Norbert Lange <[email protected]>
+---
+ sh/init.sh.Linux.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
+index e8afc1fb..662ab223 100644
+--- a/sh/init.sh.Linux.in
++++ b/sh/init.sh.Linux.in
+@@ -82,7 +82,7 @@ elif ! mountinfo -q /run; then
+ fi

package/openrc/0006-Also-create-run-lock-subsys-directory.patch line 29

Quoted 10 lines
package/openrc/0006-Also-create-run-lock-subsys-directory.patch new file +10 -0
+
+ checkpath -d "$RC_SVCDIR"
+-checkpath -d -m 0775 -o root:daemon /run/lock
++checkpath -d -m 0775 -o root:daemon /run/lock /run/lock/subsys
+
+ # Try to mount xenfs as early as possible, otherwise rc_sys() will always
+ # return RC_SYS_XENU and will think that we are in a domU while it's not.
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot