Bug 826

Summary: rpm do_unpack failure when using sstate cache
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Kevin Tian <kevin.tian>
Component: devtools / tool chainAssignee: Xiaofeng Yan <Xiaofeng.yan>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium CC: liang.li2, liangliang.wang, mark.hatle, meta.mr.watcher, meta.watcher, sgw, yi.zhao
Version: 1.0   
Target Milestone: 1.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Kevin Tian 2011-03-08 23:05:27 UTC
/usr/bin/unlzma: Decoder error

it's because the magic file is not found by 'file' utility, and thus rpm2cpio.sh falls back to lzma compression format though it's actually gzip format.

Previously http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?h=bernard&id=9c63e3fd295e4fceb196baadd53801bba3e3e1b3 tends to create a cmdline wrapper which however is incomplete. The end result is that wrapper is created but the desired cmdline options are encapsulated in the wrapper script
Comment 1 Mark Hatle 2011-07-19 13:05:47 UTC
The rpm2cpio.sh should likely be updated to not use file.  Instead look at the component directly for the gzip, lzma, etc markers.
Comment 2 Xiaofeng Yan 2011-07-21 01:52:01 UTC
Hi Mark & Kevin,

I don't know what command can cause this error. So please give me function to reproduce this error. This is my test method:
$ lzma exmaple.txt
example.txt.lzma
$ unlzma example.txt.lzma 
example.txt

$ /usr/lib/rpm/rpm2cpio lsbsetup-0.9-r2.core2.rpm > lsbsetup.cpio
$ mkdir test
$ cd test
$ cpio -idv < ../lsbsetup.cpio
./usr
./usr/bin
./usr/lib
./usr/lib/lsb
./usr/lib/lsb/install_initd
./usr/lib/lsb/remove_initd
./usr/lib/lsb/sendmail
./usr/bin/LSB_Setup.sh
15 blocks
Comment 3 Xiaofeng Yan 2011-07-21 01:53:20 UTC
Hi Mark & Kevin,

I don't know what command can cause this error. So please give me function to reproduce this error. This is my test method:
$ lzma exmaple.txt
example.txt.lzma
$ unlzma example.txt.lzma 
example.txt

$ /usr/lib/rpm/rpm2cpio lsbsetup-0.9-r2.core2.rpm > lsbsetup.cpio
$ mkdir test
$ cd test
$ cpio -idv < ../lsbsetup.cpio
./usr
./usr/bin
./usr/lib
./usr/lib/lsb
./usr/lib/lsb/install_initd
./usr/lib/lsb/remove_initd
./usr/lib/lsb/sendmail
./usr/bin/LSB_Setup.sh
15 blocks
Comment 4 Mark Hatle 2011-07-25 08:28:05 UTC
The defect itself is due to some type of issue with the 'file' utility being installed onto the system.  If 'file' doesn't work right then rpm2cpio doesn't work right.

So for a reproducer simply create a broken "file" program on your system.  Then try to extract an SRPM using rpm2cpio.  (Broken can be as simple as symlinking file to false or true.)

The lzma version of the SRPMs is a bit unique.  I'm not exactly sure where to download one.  I suspect that SuSE, or Mandriva uses lzma as their SRPM format.
Comment 5 Xiaofeng Yan 2011-07-28 03:04:31 UTC
(In reply to comment #4)
> The defect itself is due to some type of issue with the 'file' utility being
> installed onto the system.  If 'file' doesn't work right then rpm2cpio doesn't
> work right.
> 
> So for a reproducer simply create a broken "file" program on your system.  Then
> try to extract an SRPM using rpm2cpio.  (Broken can be as simple as symlinking
> file to false or true.)
> 
> The lzma version of the SRPMs is a bit unique.  I'm not exactly sure where to
> download one.  I suspect that SuSE, or Mandriva uses lzma as their SRPM format.

Hi Mark,

I reproduced this error according to your reply. when 'file' command was broken, this error happen. "file" utility doesn't be broken during building image now. perhaps it could be broken before.  I think we should find how poky destroy "file" utility when this error happen during building. but poky didn't change "file" now.  you mean I should adopt a new method instead of "file" utility in rpm2cpio.sh?
Comment 6 Xiaofeng Yan 2011-08-01 01:06:57 UTC
"rpm2cpio.sh" uses 'file' utility compiled by Oe-core(file native) other than 'file' in host. so 'file' utility can't be damaged.  'file' utility calls the magic file in ${datadir}/misc from Oe-core other than host directory "/usr/share/misc".