OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | echo "Gateworks Ventana OpenWrt Boot script v1.01" |
2 | |||
3 | # set some defaults |
||
4 | # set some defaults |
||
5 | test -n "$fs" || fs=ext2 |
||
6 | test -n "$disk" || disk=0 |
||
7 | setenv nextcon 0 |
||
8 | setenv bootargs console=${console},${baudrate} |
||
9 | setenv loadaddr 10800000 |
||
10 | setenv fdt_addr 18000000 |
||
11 | |||
12 | # detect dtype and bootdev by looking for kernel on media the bootloader |
||
13 | # has mounted (in order of preference: usb/mmc/sata) |
||
14 | # |
||
15 | # This assumes the bootloader has already started the respective subsystem |
||
16 | # or mounted the filesystem if appropriate to get to this bootscript |
||
17 | # |
||
18 | # To Speed up boot set dtype manually |
||
19 | if test -n "$dtype" ; then |
||
20 | echo "Using dtype from env: $dtype" |
||
21 | else |
||
22 | echo "Detecting boot device (dtype)..." |
||
23 | if ${fs}load usb ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then |
||
24 | dtype=usb |
||
25 | elif ${fs}load mmc ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then |
||
26 | dtype=mmc |
||
27 | elif ${fs}load sata ${disk}:1 ${loadaddr} ${bootdir}/uImage ; then |
||
28 | dtype=sata |
||
29 | elif ubifsload ${loadaddr} ${bootdir}/uImage ; then |
||
30 | dtype=nand |
||
31 | fi |
||
32 | echo "detected dtype:$dtype" |
||
33 | fi |
||
34 | if test -n "$bootdev" ; then |
||
35 | echo "Using bootdev from env: $bootdev" |
||
36 | else |
||
37 | if itest.s "x${dtype}" == "xmmc" ; then |
||
38 | bootdev=mmcblk0p1 |
||
39 | else |
||
40 | bootdev=sda1 |
||
41 | fi |
||
42 | fi |
||
43 | |||
44 | if itest.s "x${dtype}" == "xnand" ; then |
||
45 | echo "Booting from NAND..." |
||
46 | # fix partition name |
||
47 | # OpenWrt kernel bug prevents partition name of 'rootfs' from booting |
||
48 | # instead name the partition ubi which is what is looked for by |
||
49 | # procd sysupgrade |
||
50 | mtdparts del rootfs && mtdparts add nand0 - ubi |
||
51 | echo "mtdparts:${mtdparts}" |
||
52 | setenv fsload ubifsload |
||
53 | setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs" |
||
54 | else |
||
55 | echo "Booting from block device ${bootdev}..." |
||
56 | setenv fsload "${fs}load ${dtype} ${disk}:1" |
||
57 | setenv root "root=/dev/${bootdev} rootfstype=${fs} rootwait rw" |
||
58 | fi |
||
59 | |||
60 | setenv bootargs "${bootargs}" "${root}" "${video}" "${extra}" |
||
61 | if ${fsload} ${loadaddr} ${bootdir}/uImage; then |
||
62 | if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then |
||
63 | echo Loaded DTB from ${bootdir}/${fdt_file} |
||
64 | test -n "$fixfdt" && run fixfdt |
||
65 | bootm ${loadaddr} - ${fdt_addr} |
||
66 | elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then |
||
67 | echo Loaded DTB from ${bootdir}/${fdt_file1} |
||
68 | test -n "$fixfdt" && run fixfdt |
||
69 | bootm ${loadaddr} - ${fdt_addr} |
||
70 | elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then |
||
71 | echo Loaded DTB from ${bootdir}/${fdt_file2} |
||
72 | test -n "$fixfdt" && run fixfdt |
||
73 | bootm ${loadaddr} - ${fdt_addr} |
||
74 | else |
||
75 | echo "Error loading device-tree" |
||
76 | fi |
||
77 | else |
||
78 | echo "Error loading kernel image" |
||
79 | fi |