]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Strip trailing spaces in novaboot script load/copy lines
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 26 Jan 2021 17:56:46 +0000 (18:56 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 26 Jan 2021 18:05:20 +0000 (19:05 +0100)
Trailing spaces break device tree detection in U-Boot support, because
the device tree is detected by \.dtb$ regex.

novaboot
tests/uboot.wv

index 5941b31174ef6433697ea1648018ce1f14dafe58..cf98db3f394f313f73d30586b4aa7baf82c2fac2 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -412,6 +412,7 @@ while (!$skip_reading && ($_ = <>)) {
            push @$generated, {filename => $1, command => $3};
            return "$1$2";
        }
+       s/\s*$//;               # Strip trailing whitespace
        return $_;
     }
     if (s/^load *//) {         # Load line
index f271a35b95796351f800b6d21db21dae8383e5dc..1e3d3ea76845aba947423e3e8cabbc202ab4724e 100755 (executable)
@@ -57,6 +57,20 @@ setenv bootargs console=ttyS0
 bootm ${kernel_addr_r} - ${fdt_addr_r}
 EOF
 
+WVSTART "Device tree with space at the end"
+WVPASS cp "$WV_BASE_DIR/uboot-sim" .
+WVPASS touch devicetree.dtb
+WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
+load kernel console=ttyS0
+load devicetree.dtb 
+EOF
+WVPASS diff -u - log <<'EOF'
+tftpboot ${kernel_addr_r} kernel
+tftpboot ${fdt_addr_r} devicetree.dtb
+setenv bootargs console=ttyS0
+bootm ${kernel_addr_r} - ${fdt_addr_r}
+EOF
+
 WVSTART "Ramdisk and device tree support"
 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
 WVPASS touch kernel ramdisk devicetree.dtb