]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Add support for uboot keyword in novaboot scripts
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 10 Sep 2014 11:30:25 +0000 (13:30 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 10 Sep 2014 11:30:25 +0000 (13:30 +0200)
README.md
contrib/novaboot-mode.el
novaboot

index 0ef9e89bdbf1a0edb01a932a83bb32c00456e998..a09d5f5845036a503e4043622de01cdb94cea94b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -448,6 +448,8 @@ can currently be accomplished by the following options: **--amt**,
     If the command contains string _$NB\_MYIP_ then this string is
     replaced by IPv4 address of eth0 interface.
 
+    See also `uboot` keyword in ["NOVABOOT SCRIPT SYNTAX"](#novaboot-script-syntax)).
+
 - --uboot-addr _name_=_address_
 
     Load address of U-Boot's `tftpboot` command for loading _name_,
@@ -546,6 +548,11 @@ for `load` keyboard except that the command's output is not
 redirected to a file. The ordering of commands is the same as they
 appear in the novaboot script.
 
+Lines starting with `uboot` represent U-Boot commands that are sent
+to the target if **--uboot** option is given. Having a U-Boot line in
+the novaboot script is the same as passing an equivalent
+**--uboot-init** option to novaboot.
+
 Example (Linux):
 
     #!/usr/bin/env novaboot
index 1be10a02207544d60bbe7864c30bf75a31de322d..fd068b05777d2a894ae90d2d6019bb6c0c7525d4 100644 (file)
@@ -49,7 +49,7 @@
      (2 font-lock-function-name-face))
     ("^load\\>.*?< \\(.*\\)"
      (1 font-lock-string-face))
-    ("^run\\>" . font-lock-keyword-face)
+    ("^\\(run\\|uboot\\)\\>" . font-lock-keyword-face)
     ("^\\([A-Z_]+\\)=" (1 font-lock-variable-name-face))
     ))
 
index ec60ffe0fe2c9e2b8ee3e160e1eac56465a00dd3..c28b7e28fe9c44e9bd2872747e5d3ae7044b4aa7 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -319,6 +319,12 @@ while (!$skip_reading && ($_ = <>)) {
        push @$generated, {command => $1};
        next;
     }
+    if (/^uboot (.*)/) {       # uboot line
+       # TODO: If U-Boot supports some interactive menud, it might
+       # make sense to store uboot lines per novaboot script.
+       push @uboot_init, $1;
+       next;
+    }
 
     die("novaboot: Cannot parse script '$last_fn' line $.. Didn't you forget 'load' keyword?\n");
 }
@@ -1584,6 +1590,8 @@ 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.
 
+See also C<uboot> keyword in L</"NOVABOOT SCRIPT SYNTAX">).
+
 =item --uboot-addr I<name>=I<address>
 
 Load address of U-Boot's C<tftpboot> command for loading I<name>,
@@ -1688,6 +1696,11 @@ for C<load> keyboard except that the command's output is not
 redirected to a file. The ordering of commands is the same as they
 appear in the novaboot script.
 
+Lines starting with C<uboot> represent U-Boot commands that are sent
+to the target if B<--uboot> option is given. Having a U-Boot line in
+the novaboot script is the same as passing an equivalent
+B<--uboot-init> option to novaboot.
+
 Example (Linux):
 
   #!/usr/bin/env novaboot