* [PATCH 0/1] base-passwd: install passwd and group atomically
@ 2014-07-07 4:40 Robert Yang
2014-07-07 4:40 ` [PATCH 1/1] " Robert Yang
0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2014-07-07 4:40 UTC (permalink / raw)
To: openembedded-core
The following changes since commit a5531a2b8983318b99c119a87b78a92cf84160b8:
bitbake: fetch2/svn: Add transportuser parameter (2014-07-04 09:28:36 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib rbt/pw
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/pw
Robert Yang (1):
base-passwd: install passwd and group atomically
.../recipes-core/base-passwd/base-passwd_3.5.29.bb | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] base-passwd: install passwd and group atomically
2014-07-07 4:40 [PATCH 0/1] base-passwd: install passwd and group atomically Robert Yang
@ 2014-07-07 4:40 ` Robert Yang
0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2014-07-07 4:40 UTC (permalink / raw)
To: openembedded-core
Fixed the race issue:
util-macros.do_package failed: 'getpwnam(): name not found: root'
The error happens when there is a half etc/passwd, fixed by:
$ install usr/share/base-passwd/passwd.master etc/passwd.master
$ mv etc/passwd.master etc/passwd
The "mv" is atomic which will fix this problem.
[YOCTO #6124]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
.../recipes-core/base-passwd/base-passwd_3.5.29.bb | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
index 59bd413..ec8f2af 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -47,9 +47,14 @@ base_passwd_sstate_postinst() {
# put these files in the target sysroot so they can
# be used by recipes which use custom user/group
# permissions.
+ # Install passwd.master and group.master to sysconfdir and mv
+ # them to make sure they are atomically install.
install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
- install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
- install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
+ for i in passwd group; do
+ install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/$i.master \
+ ${STAGING_DIR_TARGET}${sysconfdir}/
+ mv ${STAGING_DIR_TARGET}${sysconfdir}/$i.master ${STAGING_DIR_TARGET}${sysconfdir}/$i
+ done
fi
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-07 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-07 4:40 [PATCH 0/1] base-passwd: install passwd and group atomically Robert Yang
2014-07-07 4:40 ` [PATCH 1/1] " Robert Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox