[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v3 01/11] More flexible handling of need-kernel-deb-$flavour host flag



From: Ian Campbell <ian.campbell@xxxxxxxxxx>

The current behaviour does not account for the need to apply this
workaround only for particular Debian releases, i.e. Midway will be
supported just fine in Jessie.

It also does not allow for kernels from alternative sources other than
backports (e.g. experimental, although that is hypothetical right
now).

The flavour name is actually irrelevant in practice (none of our
supported arch's need multiple kernel flavours at install time, which
is all we care about). So omit it from the new scheme.

The new scheme is "need-kernel-deb-$suite-$altsource", i.e.
need-kernel-deb-wheezy-backports. Possibly in the future e.g.
need-kernel-deb-jessie-experimental indicating that the experimental
kernel is needed on jessie.

mg-debian-installer-update is modified to download to the new name.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/Debian.pm          |  4 +++-
 mg-debian-installer-update | 22 +++++++++++-----------
 ts-host-install            | 14 +++++++++++---
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index c6ca159..7c652f7 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -860,7 +860,9 @@ END
     }
 
     foreach my $kp (keys %{ $ho->{Flags} }) {
-       $kp =~ s/need-kernel-deb-// or next;
+       # Backwards compatibility
+       $kp = "need-kernel-deb-wheezy-backports" if $kp eq 
"need-kernel-deb-armmp";
+       $kp =~ s/need-kernel-deb-$ho->{Suite}// or next;
 
        my $kern = "$d_i/$kp.deb";
        my $kurl = create_webfile($ho, "kernel", sub {
diff --git a/mg-debian-installer-update b/mg-debian-installer-update
index 4ff346f..f21f216 100755
--- a/mg-debian-installer-update
+++ b/mg-debian-installer-update
@@ -107,16 +107,16 @@ if [ $arch = armhf ]; then
     fetch "$site/$pkgfile" >initramfs-tools.deb
 
     set +e
-    echo >&2 "collecting armmp kernel"
+    echo >&2 "collecting backports kernel"
     # Be careful to pickup the actual kernel package from the 'linux'
     # source and not a meta package from 'linux-latest'
     pkgfile=`zcat Packages.gz | grep-dctrl -S linux | grep-dctrl -Pe 
^linux-image-.*-armmp$ -nsFilename | sort -n -r | head -n1`
     rc=$?
     set -e
-    if [ $rc != 0 ]; then fail "armmp kernel package not found"; fi
-    fetch "$site/$pkgfile" >armmp.deb
-    dpkg-deb -x armmp.deb x
-    cp x/boot/vmlinuz-* linux.armmp
+    if [ $rc != 0 ]; then fail "backports kernel package not found"; fi
+    fetch "$site/$pkgfile" >backports.deb
+    dpkg-deb -x backports.deb x
+    cp x/boot/vmlinuz-* linux.backports
     # 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.
@@ -142,12 +142,12 @@ if [ $arch = armhf ]; then
                          -path \*/kernel/drivers/usb/host/\* \) \
           |pax -x sv4cpio -s '%lib%/lib%' -d -w -M norm >../cpio; cd ..
     gzip -9nf cpio
-    mv cpio.gz armmp.cpio.gz
-    rm -rf dtbs/
-    mkdir dtbs/
-    mv x/usr/lib/linux-image-*-armmp/*.dtb dtbs/
-    tar --mtime=./x/usr/lib -cf dtbs.tar dtbs
-    gzip -9nf dtbs.tar
+    mv cpio.gz backports.cpio.gz
+    rm -rf backports-dtbs/
+    mkdir backports-dtbs/
+    mv x/usr/lib/linux-image-*-armmp/*.dtb backports-dtbs/
+    tar --mtime=./x/usr/lib -cf backports-dtbs.tar backports-dtbs
+    gzip -9nf backports-dtbs.tar
     rm -rf x
 fi
 
diff --git a/ts-host-install b/ts-host-install
index b73c7ff..2fea451 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -198,7 +198,9 @@ sub setup_pxeboot_firstboot($) {
     }
 
     foreach my $kp (keys %{ $ho->{Flags} }) {
-        $kp =~ s/need-kernel-deb-// or next;
+        # Backwards compatibility
+        $kp = "need-kernel-deb-wheezy-backports" if $kp eq 
"need-kernel-deb-armmp";
+        $kp =~ s/need-kernel-deb-$ho->{Suite}// or next;
         my $kern= "$ho->{Tftp}{Path}/$d_i/linux.$kp";
         if (stat $kern) {
             logm("using kernel from: $kern");
@@ -244,8 +246,14 @@ END
     }
 
     my $dtbs = "";
-    $dtbs = "fdtdir /$d_i/dtbs"
-       if -e "$ho->{Tftp}{Path}/$d_i/dtbs";
+    foreach my $kp (keys %{ $ho->{Flags} }) {
+       # Backwards compatibility
+       $kp = "need-kernel-deb-wheezy-backports" if $kp eq 
"need-kernel-deb-armmp";
+       $kp =~ s/need-kernel-deb-$ho->{Suite}// or next;
+
+       $dtbs = "fdtdir /$d_i/$kp-dtbs"
+           if -e "$ho->{Tftp}{Path}/$d_i/$kp-dtbs";
+    }
 
     file_simple_write_contents("$initrd_overlay.cpio", sub {
         contents_make_cpio($_[0], 'newc', "$initrd_overlay.d");
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.