]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Allow specifying /dev/null as load argument
authorMichal Sojka <michal.sojka@cvut.cz>
Sun, 17 Nov 2019 20:33:56 +0000 (21:33 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 17 Nov 2019 20:39:11 +0000 (21:39 +0100)
This is useful if only kernel parameters are important, but kernel
image is taken from somewhere else.

novaboot
tests/novaboot.wv

index b86dba0b3adedd1d60f6ee667234c2434188b7ec..c5c9153a0fbf836b3024db9377ae5e066a582d87 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -995,7 +995,7 @@ foreach my $script (@scripts) {
            $hostname = "";
        }
        my $files = join(" ", map({ ($file) = m/([^ ]*)/; $file; } ( @$modules, @bootloader_configs, @$copy)));
-       map({ my $file = (split)[0]; die "Not a file: $file: $!" if ! -f $file; } @$modules);
+       map({ my $file = (split)[0]; die "Not a file: $file: $!" if ! -e $file || -d $file; } @$modules);
        my $istty = -t STDOUT && ($ENV{'TERM'} || 'dumb') ne 'dumb';
        my $progress = $istty ? "--progress" : "";
        if ($files) {
@@ -1246,7 +1246,7 @@ if (defined $uboot) {
        @$modules = map { if (/\.dtb$/) { $dtb=$_; (); } else { $_ } } @$modules;
        my $initrd = shift @$modules;
 
-       if (defined $kbin) {
+       if (defined $kbin && $kbin ne '/dev/null') {
            die "No '--uboot-addr kernel' given" unless $uboot_addr{kernel};
            $exp->send("tftpboot $uboot_addr{kernel} $prefix$kbin\n");
            $exp->expect(15,
index f97088bad6ff3d71fee58fca992221723dd7e52c..b2faa72299471f9a797babc8e117e7f22d38fd4c 100755 (executable)
@@ -159,4 +159,12 @@ WVPASS make -C dir | WVPASS grep "Config OK"
 WVSTART "INTERACTION variable"
 WVPASS novaboot --remote-cmd=cat <<<INTERACTION=0
 
+WVSTART "Do not accept directories"
+WVPASS mkdir -p tftproot
+WVFAIL novaboot --server=tftproot <<<"load $PWD"
+
+WVSTART "Accept /dev/null file"
+WVPASS mkdir -p tftproot
+WVPASS novaboot --server=tftproot <<<"load /dev/null"
+
 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))