Re: [OE-core] [PATCH v2] systemd: sysusersd: change how the root home directory is set

2023-10-06 Thread Alexandre Belloni via lists.openembedded.org
Hello,

This causes the following warnings:

https://autobuilder.yoctoproject.org/typhoon/#/builders/106/builds/6888/steps/11/logs/warnings

On 05/10/2023 22:55:08+0200, Louis Rannou wrote:
> From: Louis Rannou 
> 
> Modifying the sources brings troubles in the devtool command. Therefore it is
> better to patch the source with a custom variable, and later replace it with 
> the
> correct root path.
> 
> Suggestion from :
> 
> 
> Signed-off-by: Louis Rannou 
> Suggested-by: Peter Kjellerstedt 
> Signed-off-by: Louis Rannou 
> ---
>  ...usersd-Change-the-user-root-s-home-direct.patch | 31 
> ++
>  meta/recipes-core/systemd/systemd_254.4.bb | 11 
>  2 files changed, 37 insertions(+), 5 deletions(-)
> 
> diff --git 
> a/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
>  
> b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
> new file mode 100644
> index 00..dd0d96d11b
> --- /dev/null
> +++ 
> b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
> @@ -0,0 +1,31 @@
> +From bf97001978cdefad644f7b4b909f281368e5a4dd Mon Sep 17 00:00:00 2001
> +From: Kas User 
> +Date: Thu, 27 Jul 2023 08:23:06 +
> +Subject: [PATCH] sysusers.d: Change the user root's home directory
> +
> +The default sysusers basic.conf.in file sets the root home directory to 
> `/root`
> +and does not permit its configuration. Change this to `:ROOT_HOME:` which 
> must
> +be set before the installation.
> +
> +The upstream considers the root home directory should not be changed
> +
> +
> +Upstream-Status: Denied
> +Signed-off-by: Louis Rannou 
> +---
> + sysusers.d/basic.conf.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
> +index 0aec080a4c..f26c224341 100644
> +--- a/sysusers.d/basic.conf.in
>  b/sysusers.d/basic.conf.in
> +@@ -7,7 +7,7 @@
> + 
> + # The superuser
> + g root0   --
> +-u root0:0 "Super User" /root
> ++u root0:0 "Super User" :ROOT_HOME:
> + 
> + # The nobody user/group for NFS file systems
> + g {{NOBODY_GROUP_NAME}} 65534   --
> diff --git a/meta/recipes-core/systemd/systemd_254.4.bb 
> b/meta/recipes-core/systemd/systemd_254.4.bb
> index 77724eb822..3adf62935d 100644
> --- a/meta/recipes-core/systemd/systemd_254.4.bb
> +++ b/meta/recipes-core/systemd/systemd_254.4.bb
> @@ -21,7 +21,6 @@ REQUIRED_DISTRO_FEATURES += "systemd"
>  SRC_URI += " \
> file://touchscreen.rules \
> file://00-create-volatile.conf \
> -   file://basic.conf.in \
> ${@bb.utils.contains('PACKAGECONFIG', 
> 'polkit_hostnamed_fallback', 
> 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
> ${@bb.utils.contains('PACKAGECONFIG', 
> 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} 
> \
> file://init \
> @@ -30,6 +29,7 @@ SRC_URI += " \
> 
> file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
> file://0008-implment-systemd-sysv-install-for-OE.patch \
> 
> file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
> +   file://0029-sysusersd-Change-the-user-root-s-home-direct.patch \
> "
>  
>  # patches needed by musl
> @@ -260,10 +260,6 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
>  # The 60 seconds is watchdog's default vaule.
>  WATCHDOG_TIMEOUT ??= "60"
>  
> -do_configure:prepend() {
> -  sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > 
> ${S}/sysusers.d/basic.conf.in
> -}
> -
>  do_install() {
>   meson_do_install
>   install -d ${D}/${base_sbindir}
> @@ -375,6 +371,11 @@ do_install() {
>  sed -i -e 
> 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
>  ${D}/${sysconfdir}/systemd/system.conf
>  fi
> +
> + # The root home directory specified in sysusers.d/ was patched to
> + # `:ROOT_HOME:`. Change now to the correct path given by ${ROOT_HOME}.
> + [ ! -f ${D}${libdir}/sysusers.d/basic.conf ] ||
> + sed -i s@:ROOT_HOME:@${ROOT_HOME}@g 
> ${D}${libdir}/sysusers.d/basic.conf
>  }
>  
>  python populate_packages:prepend (){
> 
> ---
> base-commit: 095021ac61c1df357e5f1868badd38038004317f
> change-id: 20231005-sysusers3-f448703f294f
> 
> Best regards,
> -- 
> Louis Rannou 
> 

> 
> 
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188793): 
https://lists.openembedded.org/g/openembedded-core/message/188793
Mute This Topic: 

Re: [OE-core] [PATCH v2] systemd: sysusersd: change how the root home directory is set

2023-10-06 Thread Louis Rannou



On 06/10/2023 15:16, Julien Stephan wrote:

Le jeu. 5 oct. 2023 à 22:55, Louis Rannou  a écrit :


From: Louis Rannou 

Modifying the sources brings troubles in the devtool command. Therefore it is
better to patch the source with a custom variable, and later replace it with the
correct root path.

Suggestion from :


Signed-off-by: Louis Rannou 
Suggested-by: Peter Kjellerstedt 
Signed-off-by: Louis Rannou 
---
  ...usersd-Change-the-user-root-s-home-direct.patch | 31 ++
  meta/recipes-core/systemd/systemd_254.4.bb | 11 
  2 files changed, 37 insertions(+), 5 deletions(-)

diff --git 
a/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
 
b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
new file mode 100644
index 00..dd0d96d11b
--- /dev/null
+++ 
b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
@@ -0,0 +1,31 @@
+From bf97001978cdefad644f7b4b909f281368e5a4dd Mon Sep 17 00:00:00 2001
+From: Kas User 


Hi Louis,

Is this intended to have kas user and email address instead of yours?


No, I thought I changed that.



+Date: Thu, 27 Jul 2023 08:23:06 +
+Subject: [PATCH] sysusers.d: Change the user root's home directory
+
+The default sysusers basic.conf.in file sets the root home directory to `/root`
+and does not permit its configuration. Change this to `:ROOT_HOME:` which must
+be set before the installation.
+
+The upstream considers the root home directory should not be changed
+
+
+Upstream-Status: Denied
+Signed-off-by: Louis Rannou 
+---
+ sysusers.d/basic.conf.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
+index 0aec080a4c..f26c224341 100644
+--- a/sysusers.d/basic.conf.in
 b/sysusers.d/basic.conf.in
+@@ -7,7 +7,7 @@
+
+ # The superuser
+ g root0   --
+-u root0:0 "Super User" /root
++u root0:0 "Super User" :ROOT_HOME:
+
+ # The nobody user/group for NFS file systems
+ g {{NOBODY_GROUP_NAME}} 65534   --
diff --git a/meta/recipes-core/systemd/systemd_254.4.bb 
b/meta/recipes-core/systemd/systemd_254.4.bb
index 77724eb822..3adf62935d 100644
--- a/meta/recipes-core/systemd/systemd_254.4.bb
+++ b/meta/recipes-core/systemd/systemd_254.4.bb
@@ -21,7 +21,6 @@ REQUIRED_DISTRO_FEATURES += "systemd"
  SRC_URI += " \
 file://touchscreen.rules \
 file://00-create-volatile.conf \
-   file://basic.conf.in \


If this file is not needed anymore you should probably delete it with
this commit


Good catch. Thanks
Louis



Cheers
Julien


 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://00-hostnamed-network-user.conf', '', d)} \
 file://init \
@@ -30,6 +29,7 @@ SRC_URI += " \
 
file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
 file://0008-implment-systemd-sysv-install-for-OE.patch \
 
file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
+   file://0029-sysusersd-Change-the-user-root-s-home-direct.patch \
 "

  # patches needed by musl
@@ -260,10 +260,6 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
  # The 60 seconds is watchdog's default vaule.
  WATCHDOG_TIMEOUT ??= "60"

-do_configure:prepend() {
-  sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > 
${S}/sysusers.d/basic.conf.in
-}
-
  do_install() {
 meson_do_install
 install -d ${D}/${base_sbindir}
@@ -375,6 +371,11 @@ do_install() {
  sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
  ${D}/${sysconfdir}/systemd/system.conf
  fi
+
+   # The root home directory specified in sysusers.d/ was patched to
+   # `:ROOT_HOME:`. Change now to the correct path given by ${ROOT_HOME}.
+   [ ! -f ${D}${libdir}/sysusers.d/basic.conf ] ||
+   sed -i s@:ROOT_HOME:@${ROOT_HOME}@g 
${D}${libdir}/sysusers.d/basic.conf
  }

  python populate_packages:prepend (){

---
base-commit: 095021ac61c1df357e5f1868badd38038004317f
change-id: 20231005-sysusers3-f448703f294f

Best regards,
--
Louis Rannou 





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188771): 
https://lists.openembedded.org/g/openembedded-core/message/188771
Mute This Topic: https://lists.openembedded.org/mt/101785446/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]

Re: [OE-core] [PATCH v2] systemd: sysusersd: change how the root home directory is set

2023-10-06 Thread Julien Stephan
Le jeu. 5 oct. 2023 à 22:55, Louis Rannou  a écrit :
>
> From: Louis Rannou 
>
> Modifying the sources brings troubles in the devtool command. Therefore it is
> better to patch the source with a custom variable, and later replace it with 
> the
> correct root path.
>
> Suggestion from :
> 
>
> Signed-off-by: Louis Rannou 
> Suggested-by: Peter Kjellerstedt 
> Signed-off-by: Louis Rannou 
> ---
>  ...usersd-Change-the-user-root-s-home-direct.patch | 31 
> ++
>  meta/recipes-core/systemd/systemd_254.4.bb | 11 
>  2 files changed, 37 insertions(+), 5 deletions(-)
>
> diff --git 
> a/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
>  
> b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
> new file mode 100644
> index 00..dd0d96d11b
> --- /dev/null
> +++ 
> b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
> @@ -0,0 +1,31 @@
> +From bf97001978cdefad644f7b4b909f281368e5a4dd Mon Sep 17 00:00:00 2001
> +From: Kas User 

Hi Louis,

Is this intended to have kas user and email address instead of yours?

> +Date: Thu, 27 Jul 2023 08:23:06 +
> +Subject: [PATCH] sysusers.d: Change the user root's home directory
> +
> +The default sysusers basic.conf.in file sets the root home directory to 
> `/root`
> +and does not permit its configuration. Change this to `:ROOT_HOME:` which 
> must
> +be set before the installation.
> +
> +The upstream considers the root home directory should not be changed
> +
> +
> +Upstream-Status: Denied
> +Signed-off-by: Louis Rannou 
> +---
> + sysusers.d/basic.conf.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
> +index 0aec080a4c..f26c224341 100644
> +--- a/sysusers.d/basic.conf.in
>  b/sysusers.d/basic.conf.in
> +@@ -7,7 +7,7 @@
> +
> + # The superuser
> + g root0   --
> +-u root0:0 "Super User" /root
> ++u root0:0 "Super User" :ROOT_HOME:
> +
> + # The nobody user/group for NFS file systems
> + g {{NOBODY_GROUP_NAME}} 65534   --
> diff --git a/meta/recipes-core/systemd/systemd_254.4.bb 
> b/meta/recipes-core/systemd/systemd_254.4.bb
> index 77724eb822..3adf62935d 100644
> --- a/meta/recipes-core/systemd/systemd_254.4.bb
> +++ b/meta/recipes-core/systemd/systemd_254.4.bb
> @@ -21,7 +21,6 @@ REQUIRED_DISTRO_FEATURES += "systemd"
>  SRC_URI += " \
> file://touchscreen.rules \
> file://00-create-volatile.conf \
> -   file://basic.conf.in \

If this file is not needed anymore you should probably delete it with
this commit

Cheers
Julien

> ${@bb.utils.contains('PACKAGECONFIG', 
> 'polkit_hostnamed_fallback', 
> 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
> ${@bb.utils.contains('PACKAGECONFIG', 
> 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} 
> \
> file://init \
> @@ -30,6 +29,7 @@ SRC_URI += " \
> 
> file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
> file://0008-implment-systemd-sysv-install-for-OE.patch \
> 
> file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
> +   file://0029-sysusersd-Change-the-user-root-s-home-direct.patch \
> "
>
>  # patches needed by musl
> @@ -260,10 +260,6 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
>  # The 60 seconds is watchdog's default vaule.
>  WATCHDOG_TIMEOUT ??= "60"
>
> -do_configure:prepend() {
> -  sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > 
> ${S}/sysusers.d/basic.conf.in
> -}
> -
>  do_install() {
> meson_do_install
> install -d ${D}/${base_sbindir}
> @@ -375,6 +371,11 @@ do_install() {
>  sed -i -e 
> 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
>  ${D}/${sysconfdir}/systemd/system.conf
>  fi
> +
> +   # The root home directory specified in sysusers.d/ was patched to
> +   # `:ROOT_HOME:`. Change now to the correct path given by ${ROOT_HOME}.
> +   [ ! -f ${D}${libdir}/sysusers.d/basic.conf ] ||
> +   sed -i s@:ROOT_HOME:@${ROOT_HOME}@g 
> ${D}${libdir}/sysusers.d/basic.conf
>  }
>
>  python populate_packages:prepend (){
>
> ---
> base-commit: 095021ac61c1df357e5f1868badd38038004317f
> change-id: 20231005-sysusers3-f448703f294f
>
> Best regards,
> --
> Louis Rannou 
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188766): 
https://lists.openembedded.org/g/openembedded-core/message/188766
Mute This Topic: https://lists.openembedded.org/mt/101785446/21656
Group Owner: 

[OE-core] [PATCH v2] systemd: sysusersd: change how the root home directory is set

2023-10-05 Thread Louis Rannou
From: Louis Rannou 

Modifying the sources brings troubles in the devtool command. Therefore it is
better to patch the source with a custom variable, and later replace it with the
correct root path.

Suggestion from :


Signed-off-by: Louis Rannou 
Suggested-by: Peter Kjellerstedt 
Signed-off-by: Louis Rannou 
---
 ...usersd-Change-the-user-root-s-home-direct.patch | 31 ++
 meta/recipes-core/systemd/systemd_254.4.bb | 11 
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git 
a/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
 
b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
new file mode 100644
index 00..dd0d96d11b
--- /dev/null
+++ 
b/meta/recipes-core/systemd/systemd/0029-sysusersd-Change-the-user-root-s-home-direct.patch
@@ -0,0 +1,31 @@
+From bf97001978cdefad644f7b4b909f281368e5a4dd Mon Sep 17 00:00:00 2001
+From: Kas User 
+Date: Thu, 27 Jul 2023 08:23:06 +
+Subject: [PATCH] sysusers.d: Change the user root's home directory
+
+The default sysusers basic.conf.in file sets the root home directory to `/root`
+and does not permit its configuration. Change this to `:ROOT_HOME:` which must
+be set before the installation.
+
+The upstream considers the root home directory should not be changed
+
+
+Upstream-Status: Denied
+Signed-off-by: Louis Rannou 
+---
+ sysusers.d/basic.conf.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
+index 0aec080a4c..f26c224341 100644
+--- a/sysusers.d/basic.conf.in
 b/sysusers.d/basic.conf.in
+@@ -7,7 +7,7 @@
+ 
+ # The superuser
+ g root0   --
+-u root0:0 "Super User" /root
++u root0:0 "Super User" :ROOT_HOME:
+ 
+ # The nobody user/group for NFS file systems
+ g {{NOBODY_GROUP_NAME}} 65534   --
diff --git a/meta/recipes-core/systemd/systemd_254.4.bb 
b/meta/recipes-core/systemd/systemd_254.4.bb
index 77724eb822..3adf62935d 100644
--- a/meta/recipes-core/systemd/systemd_254.4.bb
+++ b/meta/recipes-core/systemd/systemd_254.4.bb
@@ -21,7 +21,6 @@ REQUIRED_DISTRO_FEATURES += "systemd"
 SRC_URI += " \
file://touchscreen.rules \
file://00-create-volatile.conf \
-   file://basic.conf.in \
${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://00-hostnamed-network-user.conf', '', d)} \
file://init \
@@ -30,6 +29,7 @@ SRC_URI += " \

file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
file://0008-implment-systemd-sysv-install-for-OE.patch \

file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
+   file://0029-sysusersd-Change-the-user-root-s-home-direct.patch \
"
 
 # patches needed by musl
@@ -260,10 +260,6 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
 # The 60 seconds is watchdog's default vaule.
 WATCHDOG_TIMEOUT ??= "60"
 
-do_configure:prepend() {
-  sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > 
${S}/sysusers.d/basic.conf.in
-}
-
 do_install() {
meson_do_install
install -d ${D}/${base_sbindir}
@@ -375,6 +371,11 @@ do_install() {
 sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
 ${D}/${sysconfdir}/systemd/system.conf
 fi
+
+   # The root home directory specified in sysusers.d/ was patched to
+   # `:ROOT_HOME:`. Change now to the correct path given by ${ROOT_HOME}.
+   [ ! -f ${D}${libdir}/sysusers.d/basic.conf ] ||
+   sed -i s@:ROOT_HOME:@${ROOT_HOME}@g 
${D}${libdir}/sysusers.d/basic.conf
 }
 
 python populate_packages:prepend (){

---
base-commit: 095021ac61c1df357e5f1868badd38038004317f
change-id: 20231005-sysusers3-f448703f294f

Best regards,
-- 
Louis Rannou 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188739): 
https://lists.openembedded.org/g/openembedded-core/message/188739
Mute This Topic: https://lists.openembedded.org/mt/101785446/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-