]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - novaboot
tests: Fix iprelay-cmd test to work on both Debian an NixOS
[novaboot.git] / novaboot
index b827f166656d573ce3426a441e5dadd77245aa75..5941b31174ef6433697ea1648018ce1f14dafe58 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1026,11 +1026,17 @@ if (defined $iso_image) {
     if (-f '/usr/lib/ISOLINUX/isolinux.bin') {
        # Newer ISOLINUX version
        @files = qw(/usr/lib/ISOLINUX/isolinux.bin /usr/lib/syslinux/modules/bios/mboot.c32 /usr/lib/syslinux/modules/bios/libcom32.c32 /usr/lib/syslinux/modules/bios/menu.c32 /usr/lib/syslinux/modules/bios/ldlinux.c32);
-    } else {
+    } elsif (-f '/usr/lib/syslinux/isolinux.bin') {
        # Older ISOLINUX version
        @files = qw(/usr/lib/syslinux/isolinux.bin /usr/lib/syslinux/mboot.c32 /usr/lib/syslinux/menu.c32);
+    } else {
+       # NixOS and maybe others
+       my $syslinux = `which syslinux` || die "Cannot find syslinux";
+       chomp $syslinux;
+       $syslinux =~ s,/bin/syslinux$,,;
+       @files = ("$syslinux/share/syslinux/isolinux.bin", "$syslinux/share/syslinux/mboot.c32", "$syslinux/share/syslinux/libcom32.c32", "$syslinux/share/syslinux/menu.c32", "$syslinux/share/syslinux/ldlinux.c32");
     }
-    system_verbose("cp @files isolinux");
+    system_verbose("cp @files isolinux && chmod +w isolinux/*");
     open(my $fh, ">isolinux/isolinux.cfg");
     if ($#scripts) {
        print $fh "TIMEOUT 50\n";
@@ -1385,7 +1391,7 @@ options. Understanding all these options is not always needed,
 depending on the used setup. The L<figure from the doc directory
 |https://github.com/wentasah/novaboot/blob/master/doc/typical-setups.svg>
 shows different setups that vary in how much effort is needed
-configure novaboot for them. The setups are:
+to configure novaboot for them. The setups are:
 
 =over 3