<?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>668</bug_id>
          
          <creation_ts>2011-01-20 20:48:38 +0000</creation_ts>
          <short_desc>rpm &quot;unknown option&quot; error while do_rootfs if build from sstate</short_desc>
          <delta_ts>2011-02-16 23:21:47 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dongxiao Xu">dongxiao.xu</reporter>
          <assigned_to name="Dongxiao Xu">dongxiao.xu</assigned_to>
          <cc>edwin.zhai</cc>
    
    <cc>kevin.tian</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11538</commentid>
    <comment_count>0</comment_count>
    <who name="Dongxiao Xu">dongxiao.xu</who>
    <bug_when>2011-01-20 20:48:38 +0000</bug_when>
    <thetext>Reproduce process:

1) Build one poky image from scratch.
2) Remove all the tmp files and retain the sstate-cache prebuilt results.
3) Build another poky image from sstate.


With the above process, an rpm &quot;unknown option&quot; error will occur while executing do_rootfs.

Note that, to trigger the bug, we must remove/rename the tmp file of the original build.

Some phenomenon will be like:

| rpm: --dbpath: unknown option
| Function &apos;do_rootfs&apos; failed (see /home/dongxiao/poky.git/build-atom-pc/tmp/work/atom-pc-poky-linux/poky-image-sdk-1.0-r0/temp/log.do_rootfs.12907 for further information)
NOTE: package poky-image-sdk-1.0-r0: task do_rootfs: Failed
ERROR: Task 9 (/home/dongxiao/poky.git/meta/recipes-sato/images/poky-image-sdk.bb, do_rootfs) failed with exit code &apos;1&apos;

or

| rpmbuild: --buildroot: unknown option
| Function &apos;BUILDSPEC&apos; failed (see /distro/dongxiao/build-qemux86-sstate/tmp/work/qemux86-poky-linux/task-poky-boot-1.0-r7/temp/log.do_package_write_rpm.14059 for further information)
| ERROR: Function &apos;BUILDSPEC&apos; failed (see /distro/dongxiao/build-qemux86-sstate/tmp/work/qemux86-poky-linux/task-poky-boot-1.0-r7/temp/log.do_package_write_rpm.14059 for further information)


If running &quot;rpm --dbpath&quot; in do_rootfs, rpm will search rpmpopt file to get the meaning of this additional options. However the rpm binary from sstate still tries to find the rpmpopt file from its original build dir, which is already removed. 

Since the rpmpopt path is assigned when configuration, thus we need to rebuild rpm-native to make sstate build correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11539</commentid>
    <comment_count>1</comment_count>
    <who name="Dongxiao Xu">dongxiao.xu</who>
    <bug_when>2011-01-20 21:10:34 +0000</bug_when>
    <thetext>I just found that there is a runtime option &quot;--rpmpopt&quot; that can change the rpmpopt path, I will commit a patch to create a wrapper for rpm native binary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11645</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-02-01 10:12:47 +0000</bug_when>
    <thetext>The version of RPM we built can be overridden in an easy way.

We need to set the environment values of:

RPM_USRLIBRPM
RPM_ETCRPM
RPM_LOCALEDIR

There is an example runtime relocation wrapper included in the RPM sources:

scripts/rt-reloc-wrapper.sh:


#! /bin/sh
# Identify run path, and forward to ../lib_or_lib64/$0

PROGNAME=$(basename $0)
DIR=$(cd $(dirname $0) ; pwd)

export LD_LIBRARY_PATH=$DIR/../libMark64:$DIR/../lib:$DIR/../lib64
export RPM_USRLIBRPM=$DIR/../libMark64/rpm
export RPM_ETCRPM=$DIR/../etc/rpm
export RPM_LOCALEDIR=$DIR/../share/locale

exec $DIR/../libMark64/rpm/$PROGNAME &quot;$@&quot;

where you see &quot;libMark64&quot; is replaced by either &quot;lib&quot; or &quot;lib64&quot;...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11701</commentid>
    <comment_count>3</comment_count>
    <who name="Dongxiao Xu">dongxiao.xu</who>
    <bug_when>2011-02-08 17:15:10 +0000</bug_when>
    <thetext>Fixed in http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=d71f6fff17e7a2bd5acd4339b26a2d3b28c76814</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11835</commentid>
    <comment_count>4</comment_count>
    <who name="Edwin Zhai">edwin.zhai</who>
    <bug_when>2011-02-16 23:21:47 +0000</bug_when>
    <thetext>*** Bug 731 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>