base-passwd.preinst:fix creating passwd and group error

Create files `passwd' and `group' in `$D${sysconfdir}', if `$D${sysconfdir}'
does not exist, there is an error:
...
cannot create $D${sysconfdir}/passwd: Directory nonexistent
cannot create $D${sysconfdir}/group: Directory nonexistent
...

Attampt to create dir before file creation.

[YOCTO #3917]

(From OE-Core rev: aea1d6c29e0c3f7c854045057d8bb389a1609b2b)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Hongxu Jia 2013-02-21 14:22:16 +08:00 committed by Richard Purdie
parent e723d3b234
commit 5e3bbb6520
1 changed files with 2 additions and 1 deletions

View File

@ -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 = "r0"
PR = "r1"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
@ -64,6 +64,7 @@ python populate_packages_prepend() {
f.close()
preinst = """#!/bin/sh
mkdir -p $D${sysconfdir}
if [ ! -e $D${sysconfdir}/passwd ]; then
\tcat << EOF > $D${sysconfdir}/passwd
""" + passwd + """EOF