]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - novaboot
Die in case of multiple initrds for the Linux kernel
[novaboot.git] / novaboot
index 8c0b41a37a2053d025541a003ccec893b393ae9c..0c5d539a6c0aeb2d532b73a662e356dd818b20c5 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -584,6 +584,7 @@ sub generate_grub2_config($$$$;$$)
     my $module_load_method = "module";
     if ($boot_method eq "linux") {
        $module_load_method = "initrd";
+       die('Too many "load" lines for Linux kernel') if (scalar(@$modules_ref) > 2);
     }
     foreach (@$modules_ref) {
        if ($first) {
@@ -1138,10 +1139,19 @@ if (defined $dhcp_tftp)
     open(my $fh, '>', 'dhcpd.conf');
     my $mac = `cat /sys/class/net/$netif/address`;
     chomp $mac;
-    print $fh "subnet 10.23.23.0 netmask 255.255.255.0 {
-                     range 10.23.23.10 10.23.23.100;
-                     filename \"bin/boot/grub/pxegrub.pxe\";
-                     next-server 10.23.23.1;
+    print $fh "
+subnet 10.23.23.0 netmask 255.255.255.0 {
+       range 10.23.23.10 10.23.23.100;
+       next-server 10.23.23.1;
+}
+class \"pxe-clients\" {
+     match option vendor-class-identifier;
+}
+subclass \"pxe-clients\"  \"PXEClient:Arch:00000:UNDI:002001\" {
+     option bootfile-name \"boot/grub/i386-pc/core.0\";
+}
+subclass \"pxe-clients\"  \"PXEClient:Arch:00007:UNDI:003016\" {
+     option bootfile-name \"boot/grub/x86_64-efi/core.efi\";
 }
 host server {
        hardware ethernet $mac;