Skip to contentSkip to conversation

systemd-container: sort RRECOMMENDS alphabetically

PATCH In review Vivien Didelot 2 participants 5 messages Feb 25, 2021 – Feb 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 systemd-container: sort RRECOMMENDS alphabetically

Sort packages in RRECOMMENDS_${PN}-container alphabetically to avoid subjective sorting and ease future additions.

---
 meta/recipes-core/systemd/systemd_244.5.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_244.5.bb +2 -2
index 70700820d7..aaed047e63 100644
@@ -447,9 +447,9 @@ FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c
                         "
 
 RRECOMMENDS_${PN}-container += "\
-                         ${PN}-journal-upload \
-                         ${PN}-journal-remote \
                          ${PN}-journal-gatewayd \
+                         ${PN}-journal-remote \
+                         ${PN}-journal-upload \
                         "
 
 FILES_${PN}-extra-utils = "\
Signature · 1 line
2.30.1
#1 lore raw

PATCH 2/3 systemd-container: recommend tar

If systemd is configured with importd, "machinectl import-*" can be used to add container trees under /var/lib/machines.

But "machinectl import-tar" makes use of "tar --numeric-owner" which is not supported by the busybox binary, as shown below:

    # machinectl import-tar /tmp/container.tar.xz
    Enqueued transfer job 1. Press C-c to continue download in background.
    Importing '/tmp/container.tar.xz', saving as 'container'.
    Imported 0%.
    tar: unrecognized option '--numeric-owner'
    BusyBox v1.31.1 () multi-call binary.
    Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [FILE]...
    Failed to decode and write: Broken pipe
    Exiting.

To fix this, recommend the standard tar package.

---
 meta/recipes-core/systemd/systemd_244.5.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_244.5.bb +2 -0
index aaed047e63..8a30d7d795 100644
@@ -446,10 +446,12 @@ FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c
                          ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
                         "
 
+# "machinectl import-tar" uses "tar --numeric-owner", not supported by busybox.
 RRECOMMENDS_${PN}-container += "\
                          ${PN}-journal-gatewayd \
                          ${PN}-journal-remote \
                          ${PN}-journal-upload \
+                         tar \
                         "
 
 FILES_${PN}-extra-utils = "\
Signature · 1 line
2.30.1
#2 lore raw

PATCH 3/3 systemd-container: recommends StartExecPre modules

In reply to Vivien Didelot

The [email protected] file uses the following line to try loading the tun, loop and dm-mod kernel modules, in a non fatal way:

ExecStartPre=-/sbin/modprobe -abq tun loop dm-mod

A non-zero return code from modprobe will not stop the service from starting, but it would be convenient to inform the user about this optional support, so add these modules to RRECOMMENDS.

---
 meta/recipes-core/systemd/systemd_244.5.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd_244.5.bb +3 -0
index 8a30d7d795..3314930e9d 100644
@@ -451,6 +451,9 @@ RRECOMMENDS_${PN}-container += "\
                          ${PN}-journal-gatewayd \
                          ${PN}-journal-remote \
                          ${PN}-journal-upload \
+                         kernel-module-dm-mod \
+                         kernel-module-loop \
+                         kernel-module-tun \
                          tar \
                         "
 
Signature · 1 line
2.30.1
#3 lore raw
In reply to Vivien Didelot
Quoted 24 lines · Vivien Didelot

Sort packages in RRECOMMENDS_${PN}-container alphabetically to avoid subjective sorting and ease future additions.

---
 meta/recipes-core/systemd/systemd_244.5.bb | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_244.5.bb +0 -0
index 70700820d7..aaed047e63 100644
@@ -447,9 +447,9 @@ FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c

                         "

 RRECOMMENDS_${PN}-container += "\

meta/recipes-core/systemd/systemd_244.5.bb +0 -2
-                         ${PN}-journal-upload \
-                         ${PN}-journal-remote \

                          ${PN}-journal-gatewayd \

meta/recipes-core/systemd/systemd_244.5.bb +2 -0
+                         ${PN}-journal-remote \
+                         ${PN}-journal-upload \
Quoted 3 lines

                         "

These look like ok changes to me but they're against an older version of systemd, we currently have 247.3 in master. Would you be able to send against that version please?

Cheers,

Richard

#4 lore raw

Hi Richard,

Quoted 19 lines · On Thu, 25 Feb 2021 21:47:24 +0000 Richard Purdie…
Quoted 18 lines · Vivien Didelot

Sort packages in RRECOMMENDS_${PN}-container alphabetically to avoid subjective sorting and ease future additions.

---
 meta/recipes-core/systemd/systemd_244.5.bb | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_244.5.bb +0 -0
index 70700820d7..aaed047e63 100644
@@ -447,9 +447,9 @@ FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c

                         "

Quoted 13 lines
Quoted 9 lines

 RRECOMMENDS_${PN}-container += "\

meta/recipes-core/systemd/systemd_244.5.bb +0 -2
-                         ${PN}-journal-upload \
-                         ${PN}-journal-remote \

                          ${PN}-journal-gatewayd \

meta/recipes-core/systemd/systemd_244.5.bb +2 -0
+                         ${PN}-journal-remote \
+                         ${PN}-journal-upload \

                         "

These look like ok changes to me but they're against an older version of systemd, we currently have 247.3 in master. Would you be able to send against that version please?

Oops, I based my patches against latest "dunfell".

They do apply cleanly on latest master though (containing systemd_247.3.bb). Do you wish me to resend them anyway?

Also regarding patch 2/3, I placed "tar" in RRECOMMENDS because one can use machinectl without the "import-tar" subcommand, but one could argue that this subcommand is broken without a version of tar supporting --numeric-owner, thus could be a candidate for RDEPENDS. What is your view on this?

Thank you,
Vivien