]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-debian-installer-update: Introduce $specialkernel
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 14 Dec 2017 15:37:25 +0000 (15:37 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Dec 2017 15:54:26 +0000 (15:54 +0000)
* In the first half of the backports kernel processing, set
  the new variable specialkernel to the string "backports".
  (This token occurs in the output .deb and kernel name, and
  is also referenced by hostflags of the form
     need-kernel-deb-<suite>-backports.)

* Break out the second half of the backports procesing into its
  own section, conditional on $specialkernel.

* Replace occurrences of the "backports" token, after that point,
  with $specialkernel.

Overall, this will allow other kinds of special kernel to be
introduced.  But there is, for now, no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
mg-debian-installer-update

index 37cec58f90e15539123b204755c35169028695da..4f318c1b67c62492f51995039849f1d642d80784 100755 (executable)
@@ -134,8 +134,11 @@ if [ x$bpok != x ]; then
     # source and not a meta package from 'linux-latest'
     fetch_debian_package $site Packages.gz -Pe ^linux-image-.*-${bpok}$ \
                   >backports.deb
-    dpkg-deb -x backports.deb x
-    cp x/boot/vmlinuz-* linux.backports
+    specialkernel=backports
+fi
+if [ "x$specialkernel" != x ]; then
+    dpkg-deb -x $specialkernel.deb x
+    cp x/boot/vmlinuz-* linux.$specialkernel
     # The full set of modules is pretty large and not that
     # useful. Just pull in the ones we need for our particular
     # preseed, which is basically disk, net, filesystems and LVM.
@@ -166,14 +169,14 @@ if [ x$bpok != x ]; then
                          -path \*/kernel/drivers/usb/host/\* \) \
           |pax -x sv4cpio -s '%lib%/lib%' -d -w -M norm >../cpio; cd ..
     gzip -9nf cpio
-    mv cpio.gz backports.cpio.gz
+    mv cpio.gz $specialkernel.cpio.gz
     if [ -d x/usr/lib/linux-image-*-${bpok}/ ] ; then
-        rm -rf backports-dtbs/
-        mkdir backports-dtbs/
+        rm -rf $specialkernel-dtbs/
+        mkdir $specialkernel-dtbs/
         find x/usr/lib/linux-image-*-${bpok} -name '*.dtb' -print0 | \
-             xargs -0r sh -ec 'mv -- "$@" backports-dtbs/' x
-        tar --mtime=./x/usr/lib -cf backports-dtbs.tar backports-dtbs
-        gzip -9nf backports-dtbs.tar
+             xargs -0r sh -ec 'mv -- "$@" '$specialkernel'-dtbs/' x
+        tar --mtime=./x/usr/lib -cf $specialkernel-dtbs.tar $specialkernel-dtbs
+        gzip -9nf $specialkernel-dtbs.tar
     fi
     rm -rf x
 fi