COMPRESS=xz support for mkinitramfs

2011-02-16 Thread trentbuck
Hi, now that upstream linux-2.6 kernels support xz-compressed
ramdisks, I would like update-initramfs to support generating them.

This minimal patch WORKS FOR ME:

$ sed '/lzop/ {p; s/lzop/xz/g; }' /usr/sbin/mkinitramfs | diff -pud 
/usr/sbin/mkinitramfs -
--- /usr/sbin/mkinitramfs   2010-09-27 20:46:10.0 +1000
+++ -   2011-02-17 01:41:52.028878435 +1100
@@ -148,6 +148,7 @@ if ! `grep -q -i ^config_rd_${COMPRESS%p
 fi

 [ "${compress}" = lzop ] && compress="lzop -9"
+[ "${compress}" = xz ] && compress="xz -9"

 if [ -d "${outfile}" ]; then
echo "${outfile} is a directory" >&2

At least this far:

$ file -s /var/tmp/cdeboo*/boot/initr*
/var/tmp/cdebootstrap-amd64~/boot/initrd.img-2.6.38-rc5:
gzip compressed data, from Unix, last modified: Thu Feb 17 01:25:54 2011
/var/tmp/cdebootstrap-amd64/boot/initrd.img-2.6.38-rc5:
xz compressed data

I haven't actually tried booting it yet, and obviously updating the
documentation is left as an exercise for the reader.

PS: xz has an -e option for "compress me harder".  Given the
compress/decompress ratio for ramdisks (i.e. once vs. every boot), it
might be advisable to do "xz -9e" instead of the "xz -9" above.


-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110216144546.GA20971@dali



Bug#579336: update-initramfs: recognize (and ignore?) moduleless/ramdiskless kernels.

2010-04-26 Thread trentbuck
maximilian attems wrote:
> On Tue, Apr 27, 2010 at 02:47:38PM +1000, Trent W. Buck wrote:
> > Package: initramfs-tools
> > Version: 0.94.4
> > Severity: wishlist
> > 
> > Following the kernel handbook, I built a mainline kernel using "make
> > deb-pkg". 
> 
> ok, fine so far.
> 
> >This kernel is configured without modules or initrd support.
> 
> pretty sure that this is not a recommended way by referenced book.

Correct; I didn't mean to imply that.

I'm just killing time playing with kernel options, which is why... 

>> If the problem is in the kernel -- if "make deb-pkg" always invokes
>> update-initramfs, but shouldn't -- let me know and I'll take this
>> issue upstream.
> 
> if your box does not need initramfs-tools why would it be there.
> once you remove it, it can't be run.

...initramfs-tools is installed on this host -- it's needed for the
normal (non-play) Debian kernels.

> good luck in going down that road without UUID support, nor
> md support.

Granted.  A show-stopper for the general case, but not for the
specific toy that I'm playing with right now.

> > 2) gave a clearer error message, such as:
> > 
> > update-initramfs: Generating /boot/initrd.img-2.6.34-rc5
> > WARNING: CONFIG_MODULES=n in 2.6.34-rc5, a ramdisk is likely useless.
> > FATAL: CONFIG_BLK_DEV_INITRD=n in 2.6.34-rc5, a ramdisk is useless.
> > 
> > In particular, this current warning is unintelligible:
> > 
> > Device driver support needs thus be built-in linux image!
> 
> lol indeed this was a funny minute when I put that in.
> the meaning is that you'd better really have everything built in.
> for eventual MODULES config settings we have now way to know.

I was thinking you could look at /boot/config-.



-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100427054311.ga1...@dali