]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Support booting Linux with isolinux
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 May 2014 11:01:15 +0000 (13:01 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 May 2014 11:01:15 +0000 (13:01 +0200)
isolinux configuration must be different for Linux and for Multiboot
kernels.

novaboot

index 7bec980ed84f5e06439b1ed10b85218eb0c17eb5..0c752261464a4b57fed34b9ea7eba40ca4424cf0 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -384,14 +384,24 @@ sub generate_syslinux_config($$$$)
     open(my $fg, '>', $filename) or die "$filename: $!";
     print $fg "LABEL $title\n";
     #TODO print $fg "MENU LABEL $human_readable_title\n";
-    print $fg "KERNEL mboot.c32\n";
 
-    my @append;
-    foreach (@$modules_ref) {
-       s|\brom://([^ ]*)|$rom_prefix$base$1|g; # Translate rom:// files - needed for vdisk parameter of sigma0
-       push @append, "$base$_";
+    my ($kbin, $kcmd) = split(' ', @$modules_ref[0], 2);
+
+    if (system("file $kbin|grep 'Linux kernel'") == 0) {
+       my $initrd = @$modules_ref[1];
+       die('To many "load" lines for Linux kernel') if (scalar @$modules_ref > 2);
+       print $fg "LINUX $base$kbin\n";
+       print $fg "APPEND $kcmd\n";
+       print $fg "INITRD $base$initrd\n";
+    } else {
+       print $fg "KERNEL mboot.c32\n";
+       my @append;
+       foreach (@$modules_ref) {
+           s|\brom://([^ ]*)|$rom_prefix$base$1|g; # Translate rom:// files - needed for vdisk parameter of sigma0
+           push @append, "$base$_";
+           print $fg "APPEND ".join(' --- ', @append)."\n";
+       }
     }
-    print $fg "APPEND ".join(' --- ', @append)."\n";
     #TODO print $fg "TEXT HELP\n";
     #TODO print $fg "some help here\n";
     #TODO print $fg "ENDTEXT\n";