In core-image-minimal, "smart" package manager fails to install packages which adds groups/users (eg: cronie) How to recreate the scenario: # cd poky # source Edit the "local.conf" file and add these lines (just an example for cronie): MACHINE = "qemux86-64" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" VIRTUAL-RUNTIME_initscripts = "" IMAGE_FEATURES += "package-management" Build the image: # bitbake core-image-minimal # bitbake cronie Copy the cronie rpm to the image and boot it: # cd tmp/deploy/images/qemux86-64 # mkdir test # sudo mount core-image-minimal-qemux86-64.tar.bz2 test Copy cronie rpm to the media directory, unmount it and boot the image: # sudo cp {build}/tmp/deploy/rpm/core2_64/cronie-1.5.0-r0.core2_64.rpm test/media # sudo umount test # cd {build} # runqemu qemux86-64 core-image-minimal nographic After booting the image, install "cronie" with smart package manager: root@qemux86-64:~# smart install /media/cronie-1.5.0-r0.core2_64.rpm Updating cache... ###################################################################################################################################################################################################################################################### [100%] Computing transaction... Installing packages (1): cronie-1.5.0-r0@core2_64 54.7kB of package files are needed. 88.7kB will be used. Confirm changes? (Y/n): Y Committing transaction... Preparing... ###################################################################################################################################################################################################################################################### [ 0%] Output from cronie-1.5.0-r0@core2_64: Running groupadd commands... NOTE: cronie: Performing groupadd with [ --system crontab] ERROR: cronie: groupadd command did not succeed. error: %pre(cronie-1.5.0-r0.core2_64) scriptlet failed, exit status 1 error: install: %pre scriptlet failed (2), skipping cronie-1.5.0-r0.core2_64 Saving cache...
The reason for this seems to be the difference in behavior of "flock" command present in busybox. In busybox/util-linux/flock.c, comment says: * TODO: in upstream, -c 'PROG ARGS' means "run sh -c 'PROG ARGS' Due to this, the "rpm preinstall script" which adds the group fails. Prepared a patch and sent it to the busybox mailing list: http://lists.busybox.net/pipermail/busybox/2016-April/084142.html
IMHO, cronie (for groupadd) and dhcp-server (for useradd) should be included in package manager tests. Fix sent to oe-core: http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120489.html
Updated version of the patch is present in busybox now: https://git.busybox.net/busybox/commit/?id=2fbc3123a2d94a85317b2269c724939db7e18fbf https://git.busybox.net/busybox/commit/?id=e1d426fd65c00a6d01a10d85edf8a294ae8a2d2b Patch accepted in oe-core: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2755304a7dedf0bf07346c7c8a247b040313071a
*** Bug 9521 has been marked as a duplicate of this bug. ***
this is working as expected now Validated on : commit 6f0c5537e02c59e1c8f3b08f598dc049ff8ee098 .............................................................................. root@qemux86-64:~# smart install cronie-1.5.0-r0.core2_64.rpm Updating cache... ################################################################################################################### [100%] Computing transaction... Installing packages (1): cronie-1.5.0-r0@core2_64 54.7kB of package files are needed. 88.5kB will be used. Confirm changes? (Y/n): y Committing transaction... Preparing... ################################################################################################################### [ 0%] Output from cronie-1.5.0-r0@core2_64: Running groupadd commands... NOTE: cronie: Performing groupadd with [ --system crontab] 1:Installing cronie ################################################################################################################### [100%] Created symlink from /etc/systemd/system/multi-user.target.wants/crond.service to /lib/systemd/system/crond.service. Saving cache... ..........................................................................
Verified as per Comment 5