Patchwork [2/2] base-files: stage the /home directory

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 14, 2014, 6:31 a.m.
Message ID <c36d415106e1210c21f520017b52b0ce84e064f3.1405319307.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/75421/
State New
Headers show

Comments

Qi.Chen@windriver.com - July 14, 2014, 6:31 a.m.
The /home directory might be needed by packages that inherit useradd.bbclass.
One example is the 'xuser-account' recipe.

Previously, we patched the shadow package to change the behaviour of the
'--create-home' option. This is not appropriate. Instead, we should let
the base-files package also stage the /home directory.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb |    6 ++++++
 1 file changed, 6 insertions(+)
Saul Wold - July 14, 2014, 11:48 p.m.
On 07/13/2014 11:31 PM, Chen Qi wrote:
> The /home directory might be needed by packages that inherit useradd.bbclass.
> One example is the 'xuser-account' recipe.
>
> Previously, we patched the shadow package to change the behaviour of the
> '--create-home' option. This is not appropriate. Instead, we should let
> the base-files package also stage the /home directory.
>
Why is this not appropriate, we had been doing it in the past. I believe 
that we do not want to stage a /home dir that will never be used, so 
having it staged by default does not make sense.

Sau!

> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-core/base-files/base-files_3.0.14.bb |    6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
> index 6d76a2b..fe82d20 100644
> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
> @@ -138,6 +138,12 @@ do_install_append_linuxstdbase() {
>           done
>   }
>
> +sysroot_stage_home () {
> +	sysroot_stage_dir ${D}/home ${SYSROOT_DESTDIR}/home
> +}
> +
> +SYSROOT_PREPROCESS_FUNCS = "sysroot_stage_home"
> +
>   PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
>   FILES_${PN} = "/"
>   FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
>

Patch

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 6d76a2b..fe82d20 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -138,6 +138,12 @@  do_install_append_linuxstdbase() {
         done
 }
 
+sysroot_stage_home () {
+	sysroot_stage_dir ${D}/home ${SYSROOT_DESTDIR}/home
+}
+
+SYSROOT_PREPROCESS_FUNCS = "sysroot_stage_home"
+
 PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
 FILES_${PN} = "/"
 FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"