]> rtime.felk.cvut.cz Git - novaboot.git/blob - tests/uboot.wv
Merge branch 'feat/pxe-boot'
[novaboot.git] / tests / uboot.wv
1 #!/usr/bin/env bash
2
3 cd $(dirname $0)
4 . wvtest.sh
5
6 WVPASS tee uboot-sim <<'EOF'
7 #!/usr/bin/env bash
8
9 rm -rf log
10
11 echo "Hit any key to stop autoboot:"
12 read -r
13
14 while true; do
15       echo -n "uboot> "
16       read -r CMD
17       echo "$CMD" >> log
18 done
19 EOF
20 WVPASS chmod +x uboot-sim
21
22 WVSTART "Basic U-Boot support"
23 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
24 WVPASS touch kernel
25 WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<<'load kernel console=ttyS0'
26 WVPASS diff -u - log <<'EOF'
27 tftpboot ${kernel_addr_r} kernel
28 setenv bootargs console=ttyS0
29 bootm ${kernel_addr_r} -
30 EOF
31
32 WVSTART "Ramdisk support"
33 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
34 WVPASS touch kernel ramdisk
35 WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
36 load kernel console=ttyS0
37 load ramdisk
38 EOF
39 WVPASS diff -u - log <<'EOF'
40 tftpboot ${kernel_addr_r} kernel
41 tftpboot ${ramdisk_addr_r} ramdisk
42 setenv bootargs console=ttyS0
43 bootm ${kernel_addr_r} ${ramdisk_addr_r}
44 EOF
45
46 WVSTART "Device tree support"
47 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
48 WVPASS touch kernel devicetree.dtb
49 WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
50 load kernel console=ttyS0
51 load devicetree.dtb
52 EOF
53 WVPASS diff -u - log <<'EOF'
54 tftpboot ${kernel_addr_r} kernel
55 tftpboot ${fdt_addr_r} devicetree.dtb
56 setenv bootargs console=ttyS0
57 bootm ${kernel_addr_r} - ${fdt_addr_r}
58 EOF
59
60 WVSTART "Device tree with space at the end"
61 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
62 WVPASS touch devicetree.dtb
63 WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
64 load kernel console=ttyS0
65 load devicetree.dtb 
66 EOF
67 WVPASS diff -u - log <<'EOF'
68 tftpboot ${kernel_addr_r} kernel
69 tftpboot ${fdt_addr_r} devicetree.dtb
70 setenv bootargs console=ttyS0
71 bootm ${kernel_addr_r} - ${fdt_addr_r}
72 EOF
73
74 WVSTART "Ramdisk and device tree support"
75 WVPASS cp "$WV_BASE_DIR/uboot-sim" .
76 WVPASS touch kernel ramdisk devicetree.dtb
77 WVPASS novaboot --remote-cmd="./uboot-sim" --uboot="uboot> " <<'EOF'
78 load kernel console=ttyS0
79 load devicetree.dtb
80 load ramdisk
81 EOF
82 WVPASS diff -u - log <<'EOF'
83 tftpboot ${kernel_addr_r} kernel
84 tftpboot ${fdt_addr_r} devicetree.dtb
85 tftpboot ${ramdisk_addr_r} ramdisk
86 setenv bootargs console=ttyS0
87 bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
88 EOF