Skip to contentSkip to conversation

package/systemd: random-seed: add missing header for GRND_NONBLOCK

PATCH New Romain Naour 2 participants 4 messages Mar 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/systemd: random-seed: add missing header for GRND_NONBLOCK

GRND_NONBLOCK has been introduced with the 3.17 kernel version [1] while adding getrandom(2) system call.

The header missing_random.h is needed for random-seed.c when building with old toolchain, such Sourcery CodeBench ARM 2014.05 (kernel headers 3.13).

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895

---
 ...add-missing-header-for-GRND_NONBLOCK.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/systemd/0001-random-seed-add-missing-header-for-GRND_NONBLOCK.patch
package/systemd/0001-random-seed-add-missing-header-for-GRND_NONBLOCK.patch new file +39 -0
new file mode 100644
index 0000000000..e74df10e9d
@@ -0,0 +1,39 @@
+From 806e2011a0ea684b10a07b74c4ee0f817437e8c6 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 1 Mar 2020 15:19:01 +0100
+Subject: [PATCH] random-seed: add missing header for GRND_NONBLOCK
+
+GRND_NONBLOCK has been introduced with the 3.17 kernel version [1]
+while adding getrandom(2) system call.
+
+The header missing_random.h is needed for random-seed.c when building
+with old toolchain, such Sourcery CodeBench ARM 2014.05.
+
+Fixes:
+https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895
+
+Upstream status:
+https://github.com/systemd/systemd/pull/14988
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ src/random-seed/random-seed.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c
+index 2fcbcb281a..596bff98f1 100644
+--- a/src/random-seed/random-seed.c
++++ b/src/random-seed/random-seed.c
+@@ -19,6 +19,7 @@
+ #include "io-util.h"
+ #include "log.h"
+ #include "main-func.h"
++#include "missing_random.h"
+ #include "missing_syscall.h"
+ #include "mkdir.h"
+ #include "parse-util.h"
+-- 
+2.24.1
+
Signature · 1 line
2.24.1
#1 lore raw

PATCH 2/2 support/testing: test_systemd.py: add linux fragment to enable CONFIG_BINFMT_MISC

While investigating [1] one units failed due to missing kernel option CONFIG_BINFMT_MISC needed by "proc-sys-fs-binfmt_misc.mount" service.

It's because the kernel support autofs4 but not MISC binaries.

Since the systemd test infra use the default defconfig (vexpress), we need to provide a linux fragment to enable CONFIG_BINFMT_MISC.

[1] https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917

---
 support/testing/tests/init/systemd-linux/linux.fragment | 2 ++
 support/testing/tests/init/test_systemd.py              | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 support/testing/tests/init/systemd-linux/linux.fragment
support/testing/tests/init/systemd-linux/linux.fragment new file +2 -0
new file mode 100644
index 0000000000..7c992ff71b
@@ -0,0 +1,2 @@
+# Needed for binfmt_misc service: "Arbitrary Executable File Formats File System"
+CONFIG_BINFMT_MISC=y
support/testing/tests/init/test_systemd.py +2 -1
index a324ba8569..0300b58be8 100644
@@ -13,10 +13,11 @@ class InitSystemSystemdBase(InitSystemBase):
         BR2_LINUX_KERNEL_CUSTOM_VERSION=y
         BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.3"
         BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
+        BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
         BR2_LINUX_KERNEL_DTS_SUPPORT=y
         BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9"
         # BR2_TARGET_ROOTFS_TAR is not set
-        """
+        """.format(infra.filepath("tests/init/systemd-linux/linux.fragment"))
 
     def check_init(self):
         super(InitSystemSystemdBase, self).check_init("/lib/systemd/systemd")
Signature · 1 line
2.24.1
#2 lore raw

PATCH 2/2 support/testing: test_systemd.py: add linux fragment to enable CONFIG_BINFMT_MISC

Applied to master, thanks.

I just moved the kernel fragment with the others in the conf/ sub-dir of the test infra. Yeah, the lxc fragment is not there, though, but that's the outlier now.

Regards,
Yann E. MORIN.

On 2020-03-01 17:26 +0100, Romain Naour spake thusly:

Quoted 46 lines

While investigating [1] one units failed due to missing kernel option CONFIG_BINFMT_MISC needed by "proc-sys-fs-binfmt_misc.mount" service.

It's because the kernel support autofs4 but not MISC binaries.

Since the systemd test infra use the default defconfig (vexpress), we need to provide a linux fragment to enable CONFIG_BINFMT_MISC.

[1] https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917

---
 support/testing/tests/init/systemd-linux/linux.fragment | 2 ++
 support/testing/tests/init/test_systemd.py              | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 support/testing/tests/init/systemd-linux/linux.fragment
support/testing/tests/init/systemd-linux/linux.fragment new file +2 -0
new file mode 100644
index 0000000000..7c992ff71b
@@ -0,0 +1,2 @@
+# Needed for binfmt_misc service: "Arbitrary Executable File Formats File System"
+CONFIG_BINFMT_MISC=y
support/testing/tests/init/test_systemd.py +2 -1
index a324ba8569..0300b58be8 100644
@@ -13,10 +13,11 @@ class InitSystemSystemdBase(InitSystemBase):
         BR2_LINUX_KERNEL_CUSTOM_VERSION=y
         BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.3"
         BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
+        BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
         BR2_LINUX_KERNEL_DTS_SUPPORT=y
         BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9"
         # BR2_TARGET_ROOTFS_TAR is not set
-        """
+        """.format(infra.filepath("tests/init/systemd-linux/linux.fragment"))
 
     def check_init(self):
         super(InitSystemSystemdBase, self).check_init("/lib/systemd/systemd")
Signature · 1 line
2.24.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/2 package/systemd: random-seed: add missing header for GRND_NONBLOCK

In reply to Romain Naour

Romain, All,

On 2020-03-01 17:26 +0100, Romain Naour spake thusly:

Quoted 7 lines

GRND_NONBLOCK has been introduced with the 3.17 kernel version [1] while adding getrandom(2) system call.

The header missing_random.h is needed for random-seed.c when building with old toolchain, such Sourcery CodeBench ARM 2014.05 (kernel headers 3.13).

Quoted 7 lines

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 53 lines
---
 ...add-missing-header-for-GRND_NONBLOCK.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/systemd/0001-random-seed-add-missing-header-for-GRND_NONBLOCK.patch
package/systemd/0001-random-seed-add-missing-header-for-GRND_NONBLOCK.patch new file +39 -0
new file mode 100644
index 0000000000..e74df10e9d
@@ -0,0 +1,39 @@
+From 806e2011a0ea684b10a07b74c4ee0f817437e8c6 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 1 Mar 2020 15:19:01 +0100
+Subject: [PATCH] random-seed: add missing header for GRND_NONBLOCK
+
+GRND_NONBLOCK has been introduced with the 3.17 kernel version [1]
+while adding getrandom(2) system call.
+
+The header missing_random.h is needed for random-seed.c when building
+with old toolchain, such Sourcery CodeBench ARM 2014.05.
+
+Fixes:
+https://gitlab.com/buildroot.org/buildroot/-/jobs/454255917
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895
+
+Upstream status:
+https://github.com/systemd/systemd/pull/14988
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ src/random-seed/random-seed.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c
+index 2fcbcb281a..596bff98f1 100644
+--- a/src/random-seed/random-seed.c
++++ b/src/random-seed/random-seed.c
+@@ -19,6 +19,7 @@
+ #include "io-util.h"
+ #include "log.h"
+ #include "main-func.h"
++#include "missing_random.h"
+ #include "missing_syscall.h"
+ #include "mkdir.h"
+ #include "parse-util.h"
+-- 
+2.24.1
+
Signature · 1 line
2.24.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'