Patchwork [3/4] base-passwd: move initial criation of group and passwd to preinst

login
register
mail settings
Submitter Otavio Salvador
Date Oct. 21, 2011, 3:31 a.m.
Message ID <d0e2424c7510f09a6733c16199e86c158cbfbb7c.1319167843.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/13651/
State New, archived
Headers show

Comments

Otavio Salvador - Oct. 21, 2011, 3:31 a.m.
To allow use and manipulation of users and groups at rootfs building
time, the '/etc/passwd' and '/etc/group' needs to be available as soon
as possible.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../recipes-core/base-passwd/base-passwd_3.5.22.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Scott Garman - Oct. 21, 2011, 3:41 a.m.
On 10/20/2011 08:31 PM, Otavio Salvador wrote:
> To allow use and manipulation of users and groups at rootfs building
> time, the '/etc/passwd' and '/etc/group' needs to be available as soon
> as possible.
>
> Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>

Acked-by: Scott Garman <scott.a.garman@intel.com>

> ---
>   .../recipes-core/base-passwd/base-passwd_3.5.22.bb |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
> index 137512d..9f81ba3 100644
> --- a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
> +++ b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
> @@ -1,7 +1,7 @@
>   SUMMARY = "Base system master password/group files."
>   DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group).  The update-passwd tool is also provided to keep the system databases synchronized with these master files."
>   SECTION = "base"
> -PR = "r3"
> +PR = "r4"
>   LICENSE = "GPLv2+"
>   LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
>
> @@ -37,7 +37,7 @@ do_install () {
>   	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>   }
>
> -pkg_postinst_${PN} () {
> +pkg_preinst_${PN} () {
>   	set -e
>
>   	if [ ! -e $D${sysconfdir}/passwd ] ; then
Phil Blundell - Oct. 21, 2011, 6:52 a.m.
On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
> @@ -37,7 +37,7 @@ do_install () {
>  	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>  }
>  
> -pkg_postinst_${PN} () {
> +pkg_preinst_${PN} () {
>  	set -e
>  
>  	if [ ! -e $D${sysconfdir}/passwd ] ; then

Doesn't this break on-target installs (or, more generally, installs
where preinst runs before unpacking)?

p.
Otavio Salvador - Oct. 21, 2011, 12:05 p.m.
On Fri, Oct 21, 2011 at 04:52, Phil Blundell <philb@gnu.org> wrote:
> On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
>> @@ -37,7 +37,7 @@ do_install () {
>>       install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>>  }
>>
>> -pkg_postinst_${PN} () {
>> +pkg_preinst_${PN} () {
>>       set -e
>>
>>       if [ ! -e $D${sysconfdir}/passwd ] ; then
>
> Doesn't this break on-target installs (or, more generally, installs
> where preinst runs before unpacking)?

It does indeed. I will fix it and send a new patch for it.

Patch

diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
index 137512d..9f81ba3 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
@@ -1,7 +1,7 @@ 
 SUMMARY = "Base system master password/group files."
 DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group).  The update-passwd tool is also provided to keep the system databases synchronized with these master files."
 SECTION = "base"
-PR = "r3"
+PR = "r4"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
@@ -37,7 +37,7 @@  do_install () {
 	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
 }
 
-pkg_postinst_${PN} () {
+pkg_preinst_${PN} () {
 	set -e
 
 	if [ ! -e $D${sysconfdir}/passwd ] ; then