| 362 | a. **(recommended)** Gateworks Pre-built kernel (includes the same kernel drivers typically found on Ubuntu kernels including video capture/display and is built by Gateworks): |
| 363 | {{{ |
| 364 | #!bash |
| 365 | cd / |
| 366 | wget http://dev.gateworks.com/ventana/images/gateworks-linux-imx6-4.20.7.tar.xz |
| 367 | tar -xvf gateworks-linux-imx6-4.20.7.tar.xz |
| 368 | depmod $(ls /lib/modules/) # create module dependencies |
| 369 | rm gateworks-linux-imx6-4.20.7.tar.xz |
| 370 | }}} |
| 371 | * the {{{depmod}}} trick above is to run depmod with the exact kernel version (which will be the subdir in /lib/modules). An alternative is to run {{{depmod}}} after the first boot |
| 372 | * this kernel is recommended over the Ubuntu built kernel because it a) enables some drivers/features that Ubuntu leaves out, such as video capture b) may have patches for features that are not yet in mainline linux c) enables everything needed to boot from a Gateworks board static so that you do not need an initrd. |
| 373 | a. Build your own kernel and install it as above with proper bootscript - see [wiki:linux/kernel#building] for more info (you can do this on a development host with a cross-toolchain or even even install development tools via the '''build-essential''' meta-package and build and install sources such as the kernel below (adds appx 180MB)) |
380 | | cat << EOF > /tmp/bootscript |
381 | | |
382 | | # the following env vars are assumed to be set: |
383 | | # dtype - nand|usb|mmc|sata |
384 | | # loadaddr - memory address for loading blobs |
385 | | # video - optional kernel cmdline args |
386 | | # extra - optional kernel cmdline args |
387 | | # fixfdt - optional script to execute prior to bootm |
388 | | # |
389 | | |
390 | | echo "Gateworks Ubuntu Bootscript v1.10" |
391 | | |
392 | | # calculate load addresses based off of loadaddr as the base |
393 | | # and allow 128KB for FDT and 64MB for kernel |
394 | | setexpr fdt_addr \$loadaddr |
395 | | setexpr linux_addr \$fdt_addr + 0x20000 # allow 128KB for FDT |
396 | | setexpr rd_addr \$linux_addr + 0x4000000 # allow 64MB for kernel |
397 | | |
398 | | # setup root and load options based on dev type |
399 | | if itest.s "x\${dtype}" == "xnand" ; then |
400 | | echo "Booting from NAND/ubifs..." |
401 | | setenv root "root=ubi0:rootfs rootfstype=ubifs rootwait" |
402 | | setenv fsload "ubifsload" |
403 | | elif itest.s "x\${dtype}" == "xmmc" ; then |
404 | | echo "Booting from MMC..." |
405 | | setenv root "root=/dev/mmcblk0p1 rootwait" |
406 | | setenv fsload "ext4load \$dtype 0:1" |
407 | | setenv rd_addr # ramdisk not needed for IMX6 MMC |
408 | | elif itest.s "x\${dtype}" == "xusb" ; then |
409 | | echo "Booting from USB Mass Storage..." |
410 | | setenv root "root=/dev/sda1 rootwait" |
411 | | setenv fsload "ext4load \$dtype 0:1" |
412 | | elif itest.s "x\${dtype}" == "xsata" ; then |
413 | | echo "Booting from SATA..." |
414 | | setenv root "root=/dev/sda1 rootwait" |
415 | | setenv fsload "ext4load \$dtype 0:1" |
416 | | setenv rd_addr # ramdisk not needed for IMX6 AHCI SATA |
417 | | fi |
418 | | |
419 | | # setup bootargs |
420 | | setenv bootargs "console=\${console},\${baudrate} \${root} \${video} \${extra}" |
421 | | |
422 | | # load fdt/kernel/ramdisk |
423 | | echo "Loading FDT..." |
424 | | \$fsload \$fdt_addr boot/\$fdt_file || |
425 | | \$fsload \$fdt_addr boot/\$fdt_file1 || |
426 | | \$fsload \$fdt_addr boot/\$fdt_file2 |
427 | | echo "Loading Kernel..." |
428 | | \$fsload \$linux_addr boot/uImage |
429 | | if itest.s "x\${rd_addr}" != "x" ; then |
430 | | echo "Loading Ramdisk..." |
431 | | \$fsload \$rd_addr boot/uramdisk |
432 | | fi |
433 | | if itest.s "x\${dtype}" == "xnand" ; then |
434 | | ubifsumount |
435 | | fi |
436 | | |
437 | | # fdt fixup |
438 | | test -n "\$fixfdt" && run fixfdt |
439 | | |
440 | | # boot |
441 | | if itest.s "x\${rd_addr}" != "x" ; then |
442 | | echo "Booting ramdisk with "\$bootargs"..." |
443 | | bootm \$linux_addr \$rd_addr \$fdt_addr |
444 | | else |
445 | | echo "Booting with "\$bootargs"..." |
446 | | bootm \$linux_addr - \$fdt_addr |
447 | | fi |
448 | | EOF |
449 | | mkimage -A arm -O linux -T script -n "bootscript" \ |
450 | | -d /tmp/bootscript /boot/6x_bootscript-ventana |
451 | | rm /tmp/bootscript |
| 413 | wget https://raw.githubusercontent.com/Gateworks/linux-imx6/gateworks_4.20.7/gwventana_bootscript -O /boot/6x_bootscript-ventana.txt |
| 414 | mkimage -A arm -O linux -T script -n bootscript -d /boot/6x_bootscript-ventana.txt /boot/6x_bootscript-ventana |