r4225 - in dists/trunk/utils/mkvmlinuz/mkvmlinuz: . debian

Sven Luther luther at costa.debian.org
Fri Sep 16 08:24:05 UTC 2005


Author: luther
Date: 2005-09-16 08:24:04 +0000 (Fri, 16 Sep 2005)
New Revision: 4225

Modified:
   dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/changelog
   dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/mkvmlinuz.sgml
   dists/trunk/utils/mkvmlinuz/mkvmlinuz/mkvmlinuz
Log:
Now autodetect if the initrd is compressed, as the kernel doesn't like doubly
compressed initramfs initrds :)


Modified: dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/changelog
===================================================================
--- dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/changelog	2005-09-15 15:56:40 UTC (rev 4224)
+++ dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/changelog	2005-09-16 08:24:04 UTC (rev 4225)
@@ -1,3 +1,12 @@
+mkvmlinuz (14) unstable; urgency=low
+
+  * Now autodetects if the initrd is gzip compressed. This will allow to do
+    the right thing for initrds (not compressed by default) and initramfs
+    (compressed by default), since the kernel was none too happy with doubly
+    compressed initramfs initrds :)
+
+ -- Sven Luther <luther at debian.org>  Fri, 16 Sep 2005 10:22:09 +0200
+
 mkvmlinuz (13) unstable; urgency=high
 
   * Added debconf magic to kernel-image postinst/postrm hooks.

Modified: dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/mkvmlinuz.sgml
===================================================================
--- dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/mkvmlinuz.sgml	2005-09-15 15:56:40 UTC (rev 4224)
+++ dists/trunk/utils/mkvmlinuz/mkvmlinuz/debian/mkvmlinuz.sgml	2005-09-16 08:24:04 UTC (rev 4225)
@@ -52,6 +52,7 @@
       <arg><option>-r <replaceable>release</replaceable></option></arg>
       <arg><option>-n</option></arg>
       <arg><option>-z</option></arg>
+      <arg><option>-u</option></arg>
       <arg><option>-v</option></arg>
       <arg><replaceable>release</replaceable> <arg><replaceable>kernel</replaceable></arg></arg>
     </cmdsynopsis>
@@ -220,10 +221,20 @@
       <varlistentry>
 	<term><option>-z</option></term>
 	<listitem>
-	  <para>Assume the initrd image file is already compressed.</para>
+	  <para>Assume the initrd image file is already compressed. The
+	  default is to autodetect if the initrd is compressed or not.
+	  </para>
         </listitem>
       </varlistentry>
       <varlistentry>
+	<term><option>-u</option></term>
+	<listitem>
+	  <para>Assume the initrd image file is not already compressed. The
+	  default is to autodetect if the initrd is compressed or not.
+	  </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
 	<term><option>-v</option></term>
 	<listitem>
 	  <para>Print progress messages, and echo commands as they are

Modified: dists/trunk/utils/mkvmlinuz/mkvmlinuz/mkvmlinuz
===================================================================
--- dists/trunk/utils/mkvmlinuz/mkvmlinuz/mkvmlinuz	2005-09-15 15:56:40 UTC (rev 4224)
+++ dists/trunk/utils/mkvmlinuz/mkvmlinuz/mkvmlinuz	2005-09-16 08:24:04 UTC (rev 4225)
@@ -12,6 +12,7 @@
     echo ' -r <release> - kernel release number'
     echo ' -n           - do not use an initrd'
     echo ' -z           - assume the initrd image file is already compressed'
+    echo ' -u           - assume the initrd image file is not compressed'
     echo ' -v           - verbose operation (print commands)'
 
     exit 0
@@ -40,6 +41,7 @@
 	a) arch=$OPTARG ;;
 	n) noinitrd="Yes" ;;
 	z) compressed="Yes" ;;
+	u) compressed="No" ;;
 	v) verbose="Yes" ;;
 	*) usage; exit 0 ;;
     esac
@@ -212,11 +214,22 @@
 if test -n "$initrd"; then
     test -z "$verbose" || echo === Creating compressed initrd image initrd.gz...
     if test -n "$compressed"; then
-	do_cmd cp -p $initrd $work/initrd.gz
-    else
-	do_cmd cp -p $initrd $work/initrd
-	do_cmd gzip $work/initrd
+        # Detect if the file was already compressed by gzip.
+    	if test "`od -A n -c -N 2 $1`" = " 037 213"; then 
+	    compressed="Yes"
+	else
+	    compressed="No"
+	fi
     fi
+    case "$compressed" in
+    	Yes)
+	    do_cmd cp -p $initrd $work/initrd.gz
+	    ;;
+    	No)
+	    do_cmd cp -p $initrd $work/initrd
+	    do_cmd gzip $work/initrd
+	    ;;
+    esac
 fi
 
 # create the raw ELF image file; this is not needed for the miBoot image




More information about the Kernel-svn-changes mailing list