<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9496</bug_id>
          
          <creation_ts>2016-04-21 08:43:51 +0000</creation_ts>
          <short_desc>smart fails to install packages which adds groups in core-image-minimal</short_desc>
          <delta_ts>2016-06-21 17:01:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>2.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Maxin B. John">maxin.john</reporter>
          <assigned_to name="Maxin B. John">maxin.john</assigned_to>
          <cc>gary</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>61473</commentid>
    <comment_count>0</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-21 08:43:51 +0000</bug_when>
    <thetext>In core-image-minimal, &quot;smart&quot; package manager fails to install packages which adds groups/users (eg: cronie)


How to recreate the scenario:

# cd poky
# source 

Edit the &quot;local.conf&quot; file and add these lines (just an example for cronie):

MACHINE = &quot;qemux86-64&quot;
DISTRO_FEATURES_append = &quot; systemd&quot;
VIRTUAL-RUNTIME_init_manager = &quot;systemd&quot;
DISTRO_FEATURES_BACKFILL_CONSIDERED = &quot;sysvinit&quot;
VIRTUAL-RUNTIME_initscripts = &quot;&quot;
IMAGE_FEATURES += &quot;package-management&quot;

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 &quot;cronie&quot; 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...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61474</commentid>
    <comment_count>1</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-21 08:48:22 +0000</bug_when>
    <thetext>The reason for this seems to be the difference in behavior of &quot;flock&quot; command present in busybox.

In busybox/util-linux/flock.c, comment says:

 * TODO: in upstream, -c &apos;PROG ARGS&apos; means &quot;run sh -c &apos;PROG ARGS&apos;

Due to this, the &quot;rpm preinstall script&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61479</commentid>
    <comment_count>2</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-21 10:58:00 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61601</commentid>
    <comment_count>3</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-25 11:52:41 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61799</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-04-28 14:46:22 +0000</bug_when>
    <thetext>*** Bug 9521 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63209</commentid>
    <comment_count>5</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2016-06-21 17:00:07 +0000</bug_when>
    <thetext>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...

..........................................................................</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63211</commentid>
    <comment_count>6</comment_count>
    <who name="Jose Perez C">jose.perez.carranza</who>
    <bug_when>2016-06-21 17:01:04 +0000</bug_when>
    <thetext>Verified as per Comment 5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>