Re: [OE-core] [kirkstone][PATCH 3/4] pseudo: Add PW_SUBDIR

2023-11-26 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Joakim Tjernlund via 
> lists.openembedded.org
> Sent: den 24 november 2023 15:11
> To: openembedded-core@lists.openembedded.org
> Cc: Joakim Tjernlund 
> Subject: [OE-core] [kirkstone][PATCH 3/4] pseudo: Add PW_SUBDIR
> 
> Add support for creating passwd files in a /etc subdir
> Set PW_SUBIR to pwdb to get passwd files in /etc/pwdb
> 
> Signed-off-by: Joakim Tjernlund 
> ---
>  meta/recipes-devtools/pseudo/pseudo.inc | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/pseudo/pseudo.inc 
> b/meta/recipes-devtools/pseudo/pseudo.inc
> index 7e09b6d58c..7ba2e2261c 100644
> --- a/meta/recipes-devtools/pseudo/pseudo.inc
> +++ b/meta/recipes-devtools/pseudo/pseudo.inc
> @@ -10,6 +10,9 @@ SECTION = "base"
>  LICENSE = "LGPL-2.1-only"
>  DEPENDS = "sqlite3 attr"
> 
> +#Set PW_SUBDIR to pwdb to get passwd files in /etc/pwdb
> +PW_SUBDIR ?= ""
> +
>  FILES:${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* 
> ${localstatedir}/pseudo ${prefix}/var/pseudo"
>  INSANE_SKIP:${PN} += "libdir"
>  INSANE_SKIP:${PN}-dbg += "libdir"
> @@ -131,10 +134,12 @@ do_install () {
> 
>  do_install:append:class-native () {
>   chrpath ${D}${bindir}/pseudo -r `chrpath ${D}${bindir}/pseudo | cut -d 
> = -f 2 | sed s/XORIGIN/\\$ORIGIN/`
> - install -d ${D}${sysconfdir}
> + install -d ${D}${sysconfdir}/${PW_SUBDIR}
>   # The fallback files should never be modified
> - install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
> - install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
> + install -m 444 ${WORKDIR}/fallback-passwd 
> ${D}${sysconfdir}/${PW_SUBDIR}/passwd
> +[ -n "${PW_SUBDIR}" ] && ln -fs ${PW_SUBDIR}/passwd 
> ${D}${sysconfdir}/passwd

Inconsistent indentation (spaces instead of tab). And here too I 
recommend to use || instead of &&.

> + install -m 444 ${WORKDIR}/fallback-group 
> ${D}${sysconfdir}/${PW_SUBDIR}/group
> +[ -n "${PW_SUBDIR}" ] && ln -fs ${PW_SUBDIR}/group 
> ${D}${sysconfdir}/group

Inconsistent indentation (spaces instead of tab).

> 
>   # Two native/nativesdk entries below are the same
>   # If necessary install for the alternative machine arch.  This is only
> --
> 2.41.0

//Peter


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



[OE-core] [kirkstone][PATCH 3/4] pseudo: Add PW_SUBDIR

2023-11-24 Thread Joakim Tjernlund via lists.openembedded.org
Add support for creating passwd files in a /etc subdir
Set PW_SUBIR to pwdb to get passwd files in /etc/pwdb

Signed-off-by: Joakim Tjernlund 
---
 meta/recipes-devtools/pseudo/pseudo.inc | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/pseudo/pseudo.inc 
b/meta/recipes-devtools/pseudo/pseudo.inc
index 7e09b6d58c..7ba2e2261c 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -10,6 +10,9 @@ SECTION = "base"
 LICENSE = "LGPL-2.1-only"
 DEPENDS = "sqlite3 attr"
 
+#Set PW_SUBDIR to pwdb to get passwd files in /etc/pwdb
+PW_SUBDIR ?= ""
+
 FILES:${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* 
${localstatedir}/pseudo ${prefix}/var/pseudo"
 INSANE_SKIP:${PN} += "libdir"
 INSANE_SKIP:${PN}-dbg += "libdir"
@@ -131,10 +134,12 @@ do_install () {
 
 do_install:append:class-native () {
chrpath ${D}${bindir}/pseudo -r `chrpath ${D}${bindir}/pseudo | cut -d 
= -f 2 | sed s/XORIGIN/\\$ORIGIN/`
-   install -d ${D}${sysconfdir}
+   install -d ${D}${sysconfdir}/${PW_SUBDIR}
# The fallback files should never be modified
-   install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
-   install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+   install -m 444 ${WORKDIR}/fallback-passwd 
${D}${sysconfdir}/${PW_SUBDIR}/passwd
+[ -n "${PW_SUBDIR}" ] && ln -fs ${PW_SUBDIR}/passwd 
${D}${sysconfdir}/passwd
+   install -m 444 ${WORKDIR}/fallback-group 
${D}${sysconfdir}/${PW_SUBDIR}/group
+[ -n "${PW_SUBDIR}" ] && ln -fs ${PW_SUBDIR}/group 
${D}${sysconfdir}/group
 
# Two native/nativesdk entries below are the same
# If necessary install for the alternative machine arch.  This is only
-- 
2.41.0


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