In CentOS 6.2 (minimal install, at least), file(1) does not recognise xz archives:
[code]# file initrd.img
initrd.img: data[/code]
Expected result: something along the lines of
[code]#file initrd.img
initrd.img: xz LZMA compressed archive[/code]
Is that a CentOS, Upstream Vendor, or Fedora bug?
file command does not recognise xz archives
Re: file command does not recognise xz archives
Works for me. My /boot/init* files are not in xz format however so I had to xz an existing file to test with and that came back and said
[code]
$ file modes.txt.xz
modes.txt.xz: xz compressed data
$ mv modes.txt.xz modes.txt.img
$ file modes.txt.img
modes.txt.img: xz compressed data
[/code]
[code]
$ file modes.txt.xz
modes.txt.xz: xz compressed data
$ mv modes.txt.xz modes.txt.img
$ file modes.txt.img
modes.txt.img: xz compressed data
[/code]
Re: file command does not recognise xz archives
Ah. Naturally.
[code]$ echo Hello | xz -c | file -
/dev/stdin: xz compressed data[/code]
but
[code]$ echo Hello | xz -c --format=lzma | file -
/dev/stdin: data[/code]
The specific format that [url=http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.2_Release_Notes/installation.html]they use[/url] is the very one that it can't identify.
[code]$ echo Hello | xz -c | file -
/dev/stdin: xz compressed data[/code]
but
[code]$ echo Hello | xz -c --format=lzma | file -
/dev/stdin: data[/code]
The specific format that [url=http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.2_Release_Notes/installation.html]they use[/url] is the very one that it can't identify.
Re: file command does not recognise xz archives
Mine are still in gzip format
[code]
# file /boot/initramfs-2.6.32-220.*
/boot/initramfs-2.6.32-220.13.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Fri Apr 20 01:43:30 2012, max compression
/boot/initramfs-2.6.32-220.17.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Wed May 30 10:34:48 2012, max compression
/boot/initramfs-2.6.32-220.7.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Wed Mar 14 23:27:52 2012, max compression
[/code]
[code]
# file /boot/initramfs-2.6.32-220.*
/boot/initramfs-2.6.32-220.13.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Fri Apr 20 01:43:30 2012, max compression
/boot/initramfs-2.6.32-220.17.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Wed May 30 10:34:48 2012, max compression
/boot/initramfs-2.6.32-220.7.1.el6.x86_64.img: gzip compressed data, from Unix, last modified: Wed Mar 14 23:27:52 2012, max compression
[/code]
Re: file command does not recognise xz archives
The initramfs files on the running system are, but the initrd file on the install CD isn't:
[code]# mount /dev/cdrom /mnt
# file /mnt/isolinux/initrd.img
/mnt/isolinux/initrd.img: data[/code]
Although according to [url=http://svn.python.org/projects/external/xz-5.0.3/doc/lzma-file-format.txt]The .lzma File Format[/url] it might be quite difficult to get file(1) to recognise the .lzma. There is no specific header sequence as there is for .xz, just a variable sequence of property data. That might make this a feature, not a bug.
[code]# mount /dev/cdrom /mnt
# file /mnt/isolinux/initrd.img
/mnt/isolinux/initrd.img: data[/code]
Although according to [url=http://svn.python.org/projects/external/xz-5.0.3/doc/lzma-file-format.txt]The .lzma File Format[/url] it might be quite difficult to get file(1) to recognise the .lzma. There is no specific header sequence as there is for .xz, just a variable sequence of property data. That might make this a feature, not a bug.