-echo "Gateworks Ventana OpenWrt Boot script v1.01"
+echo "Gateworks Ventana OpenWrt Boot script v1.02"
# set some defaults
# set some defaults
setenv loadaddr 10800000
setenv fdt_addr 18000000
-# detect dtype and bootdev by looking for kernel on media the bootloader
+# detect dtype by looking for kernel on media the bootloader
# has mounted (in order of preference: usb/mmc/sata)
#
# This assumes the bootloader has already started the respective subsystem
fi
echo "detected dtype:$dtype"
fi
-if test -n "$bootdev" ; then
- echo "Using bootdev from env: $bootdev"
-else
- if itest.s "x${dtype}" == "xmmc" ; then
- bootdev=mmcblk0p1
- else
- bootdev=sda1
- fi
-fi
+echo "Booting from ${dtype}..."
if itest.s "x${dtype}" == "xnand" ; then
- echo "Booting from NAND..."
# fix partition name
# OpenWrt kernel bug prevents partition name of 'rootfs' from booting
# instead name the partition ubi which is what is looked for by
setenv fsload ubifsload
setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs"
else
- echo "Booting from block device ${bootdev}..."
setenv fsload "${fs}load ${dtype} ${disk}:1"
- setenv root "root=/dev/${bootdev} rootfstype=${fs} rootwait rw"
+ part uuid ${dtype} ${disk}:1 uuid
+ if test -z "${uuid}"; then
+ # fallback to bootdev
+ if test -n "$bootdev" ; then
+ echo "Using bootdev from env: $bootdev"
+ else
+ if itest.s "x${dtype}" == "xmmc" ; then
+ bootdev=mmcblk0p1
+ else
+ bootdev=sda1
+ fi
+ fi
+ setenv root "root=/dev/${bootdev}"
+ else
+ setenv root "root=PARTUUID=${uuid}"
+ fi
+ setenv root "$root rootfstype=${fs} rootwait rw"
fi
setenv bootargs "${bootargs}" "${root}" "${video}" "${extra}"