Bug 3917

Summary: base-passwd.preinst:bitbake core-image-minimal failed
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Hongxu Jia <hongxu.jia>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: hongxu.jia, kai.kang, liang.li2, liezhi.yang, meta.mr.watcher, meta.watcher, Qi.Chen, sgw, yi.zhao, zhenfeng.zhao
Version: 1.4   
Target Milestone: 1.4 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Hongxu Jia 2013-02-20 10:45:05 UTC
*env
Settings from local.conf:
PACKAGE_CLASSES ?= "package_deb"
IMAGE_FEATURES += "package-management ssh-server-openssh"

*problem
Run `bitbake core-image-minimal' failed
>>log<<
cannot create $D${sysconfdir}/passwd: Directory nonexistent
cannot create $D${sysconfdir}/group: Directory nonexistent

*analysis
In meta/recipes-core/base-passwd/base-passwd_3.5.26.bb, 
.................
 if [ ! -e $D${sysconfdir}/passwd ]; then
 \tcat << EOF > $D${sysconfdir}/passwd
 """ + passwd + """EOF
 fi
 if [ ! -e $D${sysconfdir}/group ]; then
 \tcat << EOF > $D${sysconfdir}/group
 """ + group + """EOF
 fi
.................
It creates files `passwd' and `group' in `$D${sysconfdir}',
if `$D${sysconfdir}' does not exist, run base-passwd.preinst
to install base-passwd at image ceation time failed.

*resolution
Check the existance of dir before file creation.
Comment 2 Yi Zhao 2013-03-01 05:47:51 UTC
Verified with master branch: 0bedc0b80d9b46cbbf4a2c5e120a6aa52cbc7c2e

Steps:
1. In conf/local.conf:
    PACKAGE_CLASSES ?= "package_deb"
    IMAGE_FEATURES += "package-management ssh-server-openssh"
2. Run `bitbake core-image-minimal