Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
> some OpenFirmware implementations, such as the one in the PegasosII,
> have a 12 MB size limit on kernel images, and no initrd loading
> capability. The latter is worked around by merging the initrd into the
> image with the "mkvmlinuz" tool, however the generated images are
> unbootable if they exceed 12 MB.
The attached patch brings vmlinuz from about 13MB to about 9.5MB, which
is well under the 12MB limit. Downside is that xz compressing is
noticeably slower than currently used gzip, but decompressing speed
difference is not noticeable.
I've tested it on Pegasos II machine, it boots really fast. Updated
mkvmlinuz package is waiting on mentors.debian.net for a willing sponsor
for upload.
Milan
07-01-2012, 11:05 AM
Touko Korpela
Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
On Sat, Jun 30, 2012 at 11:01:47PM -0400, Milan Kupcevic wrote:
> The attached patch brings vmlinuz from about 13MB to about 9.5MB, which
> is well under the 12MB limit. Downside is that xz compressing is
> noticeably slower than currently used gzip, but decompressing speed
> difference is not noticeable.
>
> I've tested it on Pegasos II machine, it boots really fast. Updated
> mkvmlinuz package is waiting on mentors.debian.net for a willing sponsor
> for upload.
> ...
> +if test "$post_2_6_38"; then
> + XZ="xz --check=crc32 -8"
> +else
> + XZ=false
> +fi
Better to use default setting "-6" that has lower memory requirement.
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20120701110505.GA6166@tiikeri.vuoristo.local
07-01-2012, 04:31 PM
Ben Hutchings
Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
On Sat, 2012-06-30 at 23:01 -0400, Milan Kupcevic wrote:
[...]
> --- mkvmlinuz (revision 19233)
> +++ mkvmlinuz (working copy)
[...]
> @@ -158,6 +153,12 @@
> post_2_6_19=
> fi
>
> +if dpkg --compare-versions $release ge 2.6.38 && test "$arch" != "prep" ; then
> + post_2_6_38=Yes
> +else
> + post_2_6_38=
> +fi
> +
[...]
We should actually check for CONFIG_RD_XZ=y in /boot/config-$release, to
allow for custom kernels that don't enable it. And of course the
variable name should be something like is_xz_supported.
Ben.
--
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.
07-01-2012, 07:13 PM
Milan Kupcevic
Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
On 07/01/2012 12:31 PM, Ben Hutchings wrote:
> On Sat, 2012-06-30 at 23:01 -0400, Milan Kupcevic wrote:
> [...]
>> --- mkvmlinuz (revision 19233)
>> +++ mkvmlinuz (working copy)
> [...]
>> @@ -158,6 +153,12 @@
>> post_2_6_19=
>> fi
>>
>> +if dpkg --compare-versions $release ge 2.6.38 && test "$arch" != "prep" ; then
>> + post_2_6_38=Yes
>> +else
>> + post_2_6_38=
>> +fi
>> +
> [...]
>
> We should actually check for CONFIG_RD_XZ=y in /boot/config-$release, to
> allow for custom kernels that don't enable it. And of course the
> variable name should be something like is_xz_supported.
>
> Ben.
>
Updated patch is attached.
Milan
07-01-2012, 08:13 PM
Geert Stappers
Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
On Sun, Jul 01, 2012 at 03:13:57PM -0400, Milan Kupcevic wrote:
> +if test "$is_xz_supported"; then
> + XZ="xz --check=crc32 -8"
> +else
> + XZ=false
> +fi
And have a look at these test statements:
> + test -z "$verbose" || echo === Creating compressed initrd image
> - if test "`od -A n -c -N 2 $initrd`" = " 037 213"; then
> + if test "`xxd -p -l2 $initrd`" = "1f8b"; then
> + test -z "$verbose" || echo === $initrd is already gzip compressed
> + if test -n "$is_xz_supported" && test "$arch" != "prep"; then
> + test -z "$verbose" || echo === recompressing to xz
> + elif test "`xxd -p -l6 $initrd`" = "fd377a585a00"; then
> + test -z "$verbose" || echo === $initrd is already xz compressed
> + test -z "$verbose" || echo === assuming $initrd was not compressed
Notices that those tests are either
test string = otherstring
or are
test --option "$variable"
They here again a "test --option $variable"
and a strange looking single "test $variable"
>
> @@ -317,7 +334,11 @@
> WRAPPER=$objdir/wrapper
> vmlinuz=$work/vmlinuz.$arch
> if test -n "$initrd"; then
> - INITRD="-i $work/initrd.gz"
> + if test "$is_xz_supported"; then
> + INITRD="-i $work/initrd.xz"
> + else
> + INITRD="-i $work/initrd.gz"
> + fi
> fi
> $WRAPPER -c -o $vmlinuz -p $arch $INITRD -D $objdir -W $work $kernel
> else
Please use the more readable
test -n "$is_xz_supported"
Groeten
Geert Stappers
--
> And is there a policy on top-posting vs. bottom-posting?
Yes.
07-02-2012, 01:43 AM
Milan Kupcevic
Bug#549681: bug#549681: mkvmlinuz: use xz to compress vmlinuz-boxed initrd
On 07/01/2012 04:13 PM, Geert Stappers wrote:
>
>
> Please use the more readable
>
> test -n "$is_xz_supported"
>
Have a look at this:
test "$string"
test -n "$string"
[ "$string" ]
[ -n "$string" ]
They are just four different expressions of exactly the same thing. It
is hard to please everybody's taste.