r1k0 / kigen

a decent Python3 Kernel|Initramfs generator for Portage (Gentoo/Funtoo/Sabayon/Exherbo/VidaLinux/Calculate)
1 stars 0 forks source link

extracting an initramfs only supports gzip format not xz #20

Closed r1k0 closed 11 years ago

r1k0 commented 11 years ago
pred ~ # kigen t --extract /boot/initramfs-genkernel-x86_64-3.6.4-gentoo  
 * Gentoo Base System release 2.1 on x86_64
 * tool.extract.initramfs to /var/tmp/kigen/extracted-initramfs
sh: initramfs_data.cpio: No such file or directory
rm: cannot remove 'initramfs_data.cpio': No such file or directory
pred ~ # kigen t --extract /boot/initramfs-genkernel-x86_64-3.6.4-gentoo ^C
pred ~ # ll /var/tmp/kigen/extracted-initramfs
total 1836
-rw-r--r-- 1 root root 1878640 Nov  6 19:50 initramfs_data.cpio.gz
pred ~ # ll /var/tmp/kigen/extracted-initramfs
extracted-initramfs/                     extracted-initramfs-2012-06-29-21-40-27/ extracted-initramfs-2012-06-29-21-40-36/ extracted-initramfs-2012-11-06-19-50-02/ 
pred ~ # ll /var/tmp/kigen/extracted-initramfs/
total 1836
-rw-r--r-- 1 root root 1878640 Nov  6 19:50 initramfs_data.cpio.gz
pred ~ # gzip -d -f  /var/tmp/kigen/extracted-initramfs/initramfs_data.cpio.gz 

gzip: /var/tmp/kigen/extracted-initramfs/initramfs_data.cpio.gz: not in gzip format
pred ~ # file /var/tmp/kigen/extracted-initramfs/initramfs_data.cpio.gz
/var/tmp/kigen/extracted-initramfs/initramfs_data.cpio.gz: XZ compressed data
pred ~ # kigen t --extract /boot/initramfs-genkernel-x86_64-3.
initramfs-genkernel-x86_64-3.3.8-gentoo  initramfs-genkernel-x86_64-3.5.2-gentoo  initramfs-genkernel-x86_64-3.6.4-gentoo  
pred ~ # kigen t --extract /boot/initramfs-genkernel-x86_64-3.3.8-gentoo 
 * Gentoo Base System release 2.1 on x86_64
 * tool.extract.initramfs to /var/tmp/kigen/extracted-initramfs
pred ~ # file /boot/initramfs-genkernel-x86_64-3.*
/boot/initramfs-genkernel-x86_64-3.3.8-gentoo: gzip compressed data, was "initramfs-3.3.8-gentoo", from Unix, last modified: Thu Jul 12 18:15:41 2012, max compression
/boot/initramfs-genkernel-x86_64-3.5.2-gentoo: gzip compressed data, was "initramfs-3.5.2-gentoo", from Unix, last modified: Sat Aug 25 18:59:43 2012, max compression
/boot/initramfs-genkernel-x86_64-3.6.4-gentoo: XZ compressed data
pred ~ # 

Should check a call for 'file', parse it and call the right decompressor.

r1k0 commented 11 years ago

genkernel might now use XZ to compress an initramfs. mmm, well we shall stay GZIP by default for 'kigen i' but will support XZ for 'kigen t'.

r1k0 commented 11 years ago

support added.