]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Expand $NB_PREFIX in U-Boot commands
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 10 Sep 2014 11:31:09 +0000 (13:31 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 10 Sep 2014 11:31:09 +0000 (13:31 +0200)
README.md
novaboot

index a09d5f5845036a503e4043622de01cdb94cea94b..0eff63b9fca965ba8738b7895eb60331c1dc325f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -446,7 +446,8 @@ can currently be accomplished by the following options: **--amt**,
     commands from each option novaboot waits for U-Boot _prompt_.
 
     If the command contains string _$NB\_MYIP_ then this string is
-    replaced by IPv4 address of eth0 interface.
+    replaced by IPv4 address of eth0 interface. Similarly _$NB\_PREFIX_ is
+    replaced with prefix given by **--prefix**.
 
     See also `uboot` keyword in ["NOVABOOT SCRIPT SYNTAX"](#novaboot-script-syntax)).
 
index c28b7e28fe9c44e9bd2872747e5d3ae7044b4aa7..9b2c3df2930414e52194c3069c077d6a4a868958 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1005,6 +1005,11 @@ if (defined $uboot) {
            $ip =~ s/\s*inet ([0-9.]*).*/$1/;
            $cmd =~ s/\$NB_MYIP/$ip/g;
        }
+       if ($cmd =~ /\$NB_PREFIX/) {
+           my $p = $prefix;
+           $p =~ s|/*$||;
+           $cmd =~ s/\$NB_PREFIX/$p/g;
+       }
        chomp($cmd);
        $exp->send("$cmd\n");
        $exp->expect(10, $uboot_prompt) || die "U-Boot prompt timeout";
@@ -1588,7 +1593,8 @@ booting them. This option can be given multiple times. After sending
 commands from each option novaboot waits for U-Boot I<prompt>.
 
 If the command contains string I<$NB_MYIP> then this string is
-replaced by IPv4 address of eth0 interface.
+replaced by IPv4 address of eth0 interface. Similarly I<$NB_PREFIX> is
+replaced with prefix given by B<--prefix>.
 
 See also C<uboot> keyword in L</"NOVABOOT SCRIPT SYNTAX">).