Changes between Version 21 and Version 22 of ventana/ubuntu


Ignore:
Timestamp:
10/24/2018 03:36:53 PM (5 years ago)
Author:
Tim Harvey
Comment:

update bootscript to include mmc/sata and avoid dependence on bootloader bootscript

Legend:

Unmodified
Added
Removed
Modified
  • ventana/ubuntu

    v21 v22  
    378378cat << EOF > /tmp/bootscript
    379379
     380# the following env vars are assumed to be set:
     381#  dtype - nand|usb|mmc|sata
     382#  loadaddr - memory address for loading blobs
     383#  video - optional kernel cmdline args
     384#  extra - optional kernel cmdline args
     385#  fixfdt - optional script to execute prior to bootm
     386#
     387
     388echo "Gateworks Ubuntu Bootscript v1.10"
     389
    380390# calculate load addresses based off of loadaddr as the base
    381391# and allow 128KB for FDT and 64MB for kernel
     
    384394setexpr rd_addr \$linux_addr + 0x4000000 # allow 64MB for kernel
    385395
    386 # if nand|usb dtype use initrd - sata|mmc don't require initrd
     396# setup root and load options based on dev type
    387397if itest.s "x\${dtype}" == "xnand" ; then
    388398  echo "Booting from NAND/ubifs..."
    389   setenv bootargs "console=\${console},\${baudrate} root=ubi0:rootfs rootfstype=ubifs rootwait \${video} \${extra}"
    390   ubifsload \$fdt_addr boot/\$fdt_file ||
    391   ubifsload \$fdt_addr boot/\$fdt_file1 ||
    392   ubifsload \$fdt_addr boot/\$fdt_file2
    393   test -n "\$fixfdt" && run fixfdt
    394   ubifsload \$linux_addr boot/uImage
    395   ubifsload \$rd_addr boot/uramdisk
     399  setenv root "root=ubi0:rootfs rootfstype=ubifs rootwait"
     400  setenv fsload "ubifsload"
     401elif itest.s "x\${dtype}" == "xmmc" ; then
     402  echo "Booting from MMC..."
     403  setenv root "root=/dev/mmcblk0p1 rootwait"
     404  setenv fsload "ext4load \$dtype 0:1"
     405  setenv rd_addr # ramdisk not needed for IMX6 MMC
     406elif itest.s "x\${dtype}" == "xusb" ; then
     407  echo "Booting from USB Mass Storage..."
     408  setenv root "root=/dev/sda1 rootwait"
     409  setenv fsload "ext4load \$dtype 0:1"
     410elif itest.s "x\${dtype}" == "xsata" ; then
     411  echo "Booting from SATA..."
     412  setenv root "root=/dev/sda1 rootwait"
     413  setenv fsload "ext4load \$dtype 0:1"
     414  setenv rd_addr # ramdisk not needed for IMX6 AHCI SATA
     415fi
     416
     417# setup bootargs
     418setenv bootargs "console=\${console},\${baudrate} \${root} \${video} \${extra}"
     419
     420# load fdt/kernel/ramdisk
     421echo "Loading FDT..."
     422\$fsload \$fdt_addr boot/\$fdt_file ||
     423\$fsload \$fdt_addr boot/\$fdt_file1 ||
     424\$fsload \$fdt_addr boot/\$fdt_file2
     425echo "Loading Kernel..."
     426\$fsload \$linux_addr boot/uImage
     427if itest.s "x\${rd_addr}" != "x" ; then
     428  echo "Loading Ramdisk..."
     429  \$fsload \$rd_addr boot/uramdisk
     430fi
     431if itest.s "x\${dtype}" == "xnand" ; then
    396432  ubifsumount
     433fi
     434
     435# fdt fixup
     436test -n "\$fixfdt" && run fixfdt
     437
     438# boot
     439if itest.s "x\${rd_addr}" != "x" ; then
     440  echo "Booting ramdisk with "\$bootargs"..."
    397441  bootm \$linux_addr \$rd_addr \$fdt_addr
    398 elif itest.s "x\${dtype}" == "xusb" ; then
    399   echo "Booting from usb..."
    400   setenv bootargs "console=\${console},\${baudrate} root=/dev/sda1  rootwait \${video} \${extra}"
    401   ext4load usb 0:1 \$fdt_addr boot/\$fdt_file ||
    402   ext4load usb 0:1 \$fdt_addr boot/\$fdt_file1 ||
    403   ext4load usb 0:1 \$fdt_addr boot/\$fdt_file2
    404   test -n "\$fixfdt" && run fixfdt
    405   ext4load usb 0:1 \$linux_addr boot/uImage
    406   ext4load usb 0:1 \$rd_addr boot/uramdisk
    407   bootm \$linux_addr \$rd_addr \$fdt_addr
     442else
     443  echo "Booting with "\$bootargs"..."
     444  bootm \$linux_addr - \$fdt_addr
    408445fi
    409446EOF