From: Michal Sojka Date: Sun, 17 Nov 2019 20:33:56 +0000 (+0100) Subject: Allow specifying /dev/null as load argument X-Git-Tag: 20201217~19 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/ec1d15d0807766479d4e28088e723cc4f105cd11 Allow specifying /dev/null as load argument This is useful if only kernel parameters are important, but kernel image is taken from somewhere else. --- diff --git a/novaboot b/novaboot index b86dba0..c5c9153 100755 --- 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, diff --git a/tests/novaboot.wv b/tests/novaboot.wv index f97088b..b2faa72 100755 --- a/tests/novaboot.wv +++ b/tests/novaboot.wv @@ -159,4 +159,12 @@ WVPASS make -C dir | WVPASS grep "Config OK" WVSTART "INTERACTION variable" WVPASS novaboot --remote-cmd=cat <<