warewulf-vnfs: update bootstrap patch to support centos
---- a/bin/wwbootstrap 2017-10-13 16:01:35.000000000 -0700
-+++ b/bin/wwbootstrap 2017-10-16 08:55:50.000000000 -0700
-@@ -153,8 +153,8 @@
+--- vnfs/bin/wwbootstrap 2017-09-06 16:18:10.000000000 -0500
++++ vnfs/bin/wwbootstrap 2017-10-30 08:33:05.000000000 -0500
+@@ -36,6 +36,7 @@
+ my $kversion;
+ my $config;
+ my $wwsh_bin;
++my $kernel_file = "";
+
+ my $help = "USAGE: $0 [options] kernel_version
+ SUMMARY:
+@@ -153,11 +154,19 @@
mkpath("$tmpdir/initramfs");
-if (! -f "$opt_chroot/boot/vmlinuz-$opt_kversion") {
- &eprint("Can't locate the boot kernel: ". $opt_chroot ."/boot/vmlinuz-$opt_kversion\n");
-+if (! -f "$opt_chroot/boot/Image-$opt_kversion") {
-+ &eprint("Can't locate the boot kernel: ". $opt_chroot ."/boot/Image-$opt_kversion\n");
- exit 1;
+- exit 1;
++# RHEL variants on aarch64 use vmlinuz, SUSE uses Image file - check for existence of either
++if ( -f "$opt_chroot/boot/Image-$opt_kversion") {
++ $kernel_file = "$opt_chroot/boot/Image-$opt_kversion";
++} elsif ( -f "$opt_chroot/boot/vmlinuz-$opt_kversion") {
++ $kernel_file = "$opt_chroot/boot/vmlinuz-$opt_kversion";
}
-@@ -308,9 +308,9 @@
- close MODCONFFILE;
- }
++if ( $kernel_file eq "") {
++ &eprint("Can't locate the boot kernel, expecting one of the following:\n");
++ &eprintf("--> ".$opt_chroot ."boot/Image-$opt_kversion\n");
++ &eprintf("--> ".$opt_chroot ."boot/vmlinuz-$opt_kversion\n");
++ exit 1;
++}
--# Attempt to gunzip the kernel, aarch64 kernels are compressed and iPXE can't boot gzip compressed kernels.
--# Note, if the kernel isn't a gzip, IO::Uncompress::Gunzip makes a direct copy of the file.
+
+ if ($config->get("drivers")) {
+@@ -310,7 +319,7 @@
+
+ # Attempt to gunzip the kernel, aarch64 kernels are compressed and iPXE can't boot gzip compressed kernels.
+ # Note, if the kernel isn't a gzip, IO::Uncompress::Gunzip makes a direct copy of the file.
-gunzip "$opt_chroot/boot/vmlinuz-$opt_kversion" => "$tmpdir/kernel" or die "gunzip of kernel failed: $GunzipError\n";
-+if( -e "$opt_chroot/boot/Image-$opt_kversion" ) {
-+ copy("$opt_chroot/boot/Image-$opt_kversion", "$tmpdir/kernel");
-+}
++gunzip "$kernel_file" => "$tmpdir/kernel" or die "gunzip of kernel failed: $GunzipError\n";
&nprint("Building and compressing bootstrap\n");
system("(cd $tmpdir; find . | cpio -o --quiet -H newc ) | gzip -c9 > $output");
