Changes between Version 28 and Version 29 of ventana/ubuntu


Ignore:
Timestamp:
02/14/2019 08:58:56 PM (6 years ago)
Author:
Tim Harvey
Comment:

updated debootstrap instructions with recommended gateworks pre-built 4.20 kernel

Legend:

Unmodified
Added
Removed
Modified
  • ventana/ubuntu

    v28 v29  
    1717Gateworks provides some pre-built Ubuntu firmware images for the Ventana Family:
    1818||= Name              =||= Size =||= Features =||
    19 || bionic-ventana 18.04 || ~1.2GB^^^1^^^ || console support - Ubuntu kernel/drivers ||
    20 || xenial-ventana 16.04 || ~1.2GB^^^1^^^ || console support - Ubuntu kernel/drivers ||
     19|| bionic-ventana 18.04 || ~1.2GB^^^1^^^ || console support - Gateworks kernel/drivers ||
     20|| xenial-ventana 16.04 || ~1.2GB^^^1^^^ || console support - Gateworks kernel/drivers ||
    2121|| trusty-ventana 14.04 || ~210MB  || console support - Gateworks kernel/drivers ||
    2222|| trusty-mm-ventana 14.04 || ~650MB^^^1^^^ || HW acclerated gstreamer/gstreamer-imx ||
     
    138138
    139139[=#kernel]
    140 == Kernel Updates ==
     140== Kernel Updates
     141
     142
     143=== Gateworks build kernel
     144Gateworks periodically updates their pre-built IMX6 kernel release and it is easy to install on a running system:
     145{{{#!bash
     146wget http://dev.gateworks.com/ventana/images/gateworks-linux-4.20.7.tar.xz
     147tar -C / -xvf gateworks-linux-4.20.7.tar.xz
     148rm gateworks-linux-4.20.7.tar.xz
     149}}}
     150
     151If you want to clean out old kernels no longer used, you can remove the directory of modules in /lib/modules/<kernel-version>
     152
     153
     154=== Ubuntu built kernel
    141155Ubuntu releases are based on a specific major kernel version. However over time the Ubuntu team releases new major kernel version updates for specific distro versions. An {{{apt-get install linux-image}}} will not change the kernel major version and you have to specifically install a new major version to switch to it.
    142156
     
    162176 - use {{{apt-get search linux-image}}} to determine what Ubuntu kernel versions are available
    163177
     178If you want to clean out old kernels no longer used you can use {{{apt list --instealled | grep linux}} to list installed packages and remove them (remove linux-headers, linux-image, linux-modules for example). For example if you want to remove the 4.15.0-42-generic packages:
     179{{{#!bash
     180apt purge linux-image-4.15.0-42-generic linux-modules-4.15.0-42-generic linux-headers-4.15.0-42
     181}}}
     182 - modify the above to remove the specific version(s) you want to remove
     183
     184
    164185== Root filesystem Sources ==
    165186There are several sources of pre-built root filesystems that are compatible with Ventana. As Ventana uses an i.MX6 SoC, you need to use something that is compatible with an ARMv7 instruction set. Many pre-built distributions will reference 'armhf' which means 'ARM hard-float' which is appropriate for the i.MX6 as it has hardware floating-point.
     
    339360
    34036111. install a kernel and kernel support (kernel+dtbs+modules+firmware+initrd). You have several options here:
     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
     365cd /
     366wget http://dev.gateworks.com/ventana/images/gateworks-linux-imx6-4.20.7.tar.xz
     367tar -xvf gateworks-linux-imx6-4.20.7.tar.xz
     368depmod $(ls /lib/modules/) # create module dependencies
     369rm 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))
    341374 a. Ubuntu Pre-built kernel (includes the most kernel drivers and is built by and supported by Ubuntu):
    342375{{{#!bash
     
    378411   - create a bootscript that uses the Ubuntu initrd appropriately for NAND/usb-storage (utilizing the 'dtype' var that is set by the default ventana bootscript):
    379412{{{#!bash
    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
     413wget https://raw.githubusercontent.com/Gateworks/linux-imx6/gateworks_4.20.7/gwventana_bootscript -O /boot/6x_bootscript-ventana.txt
     414mkimage -A arm -O linux -T script -n bootscript -d /boot/6x_bootscript-ventana.txt /boot/6x_bootscript-ventana
    452415}}}
    453416 a. Gateworks pre-built downstream vendor kernel: 3.14 kernel supporting full video input (which is not currently in upstream Linux) - ** use this if you are going to be using video input **