Changes between Version 32 and Version 33 of ventana/ubuntu


Ignore:
Timestamp:
02/25/2019 06:46:14 PM (12 months ago)
Author:
Tim Harvey
Comment:

moved kernel section below rootfs section, moved ubuntu kernel details out of rootfs and into kernel section, updated recomendations

Legend:

Unmodified
Added
Removed
Modified
  • ventana/ubuntu

    v32 v33  
    151151
    152152
    153 [=#kernel]
    154 == Kernel Updates
    155 
    156 
    157 === Gateworks build kernel
    158 Gateworks periodically updates their pre-built IMX6 kernel release and it is easy to install on a running system:
    159 {{{#!bash
    160 wget http://dev.gateworks.com/ventana/images/gateworks-linux-4.20.7.tar.xz
    161 tar -C / -xvf gateworks-linux-4.20.7.tar.xz
    162 rm gateworks-linux-4.20.7.tar.xz
    163 }}}
    164 
    165 If you want to clean out old kernels no longer used, you can remove the directory of modules in /lib/modules/<kernel-version>
    166 
    167 
    168 === Ubuntu built kernel
    169 Ubuntu 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.
    170 
    171 For example the latest kernel release available for Ubuntu 16.04 (Xenial) LTS at the time of this writing is 4.15 and can be installed with the following:
    172 {{{#!bash
    173 apt-get update
    174 apt-get install linux-image-4.15.0-34-generic
    175 # install mkimage
    176 apt-get install u-boot-tools
    177 # create u-boot image for kernel
    178 mkimage -A arm -O linux -T kernel -C none \
    179   -a 0x10008000 -e 0x10008000 -n "linux" \
    180   -d /boot/vmlinuz-4.15.0-34-generic /boot/uImage
    181 # install device-tree blobs
    182 cp /lib/firmware/4.15.0-34-generic/device-tree/imx6*-gw*.dtb /boot
    183 #blacklist imx rtc driver, Gateworks board uses GSC RTC, and does not use imx RTC
    184 echo "blacklist rtc_snvs" > /etc/modprobe.d/blacklist-rtc.conf
    185 # create u-boot image for initrd
    186 mkimage -A arm -O linux -T ramdisk \
    187   -a 0x0 -e 0x0 -n "initrd" \
    188   -d /boot/initrd.img-4.15.0-34-generic /boot/uramdisk
    189 }}}
    190  - use {{{apt-get search linux-image}}} to determine what Ubuntu kernel versions are available
    191 
    192 If 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:
    193 {{{#!bash
    194 apt purge linux-image-4.15.0-42-generic linux-modules-4.15.0-42-generic linux-headers-4.15.0-42
    195 }}}
    196  - modify the above to remove the specific version(s) you want to remove
    197 
    198 
    199 == Root filesystem Sources ==
     153
     154[=#rootfs]
     155== Root filesystem Sources
    200156There 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.
    201157
     
    206162
    207163[=#linaro]
    208 === Linaro ===
     164=== Linaro
    209165The [https://releases.linaro.org/ Linaro] Developer Platform Team also creates Ubuntu flavored images.
    210166
     
    230186
    231187[=#debootstrap]
    232 === Build your own Ubuntu rootfs via debootstrap ===
     188=== Build your own Ubuntu rootfs via debootstrap
    233189The preferred way to create a Ubuntu root filesystem is to use the {{{deboostrap}}} utility on a Debian or Ubuntu host. This tool provides a 2-stage install where the second stage is within a chroot environment using qemu-arm.
    234190
     
    373329 * Note that by default root ssh access is disabled for security. See [#ssh below] for info on enabling it
    374330
    375 11. install a kernel and kernel support (kernel+dtbs+modules+firmware+initrd). You have several options here:
     33111. install a kernel and kernel support (kernel+dtbs+modules+firmware+initrd). You have several options here (see [#kernels above] for more details). Gateworks recomends using a Gateworks pre-built kernel:
    376332 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):
    377333{{{
     
    404360echo "blacklist rtc_snvs" > /etc/modprobe.d/blacklist-rtc.conf
    405361}}}
    406   * The default Ubuntu kernel supports booting a microSD/SATA rootfs directly, but lacks nand/ubifs/ubi/usb-storage support. If you need that (and have a large enough flash to boot from that) you will need to use the Ubuntu initrd:
    407    - add NAND/ubifs/usb-storage modules to the initrd:
    408 {{{#!bash
    409 cat << EOF >> /etc/initramfs-tools/modules
    410 # for NAND/ubi
    411 gpmi_nand
    412 ubi mtd=2
    413 ubifs
    414 
    415 # for usb-storage
    416 ci_hdrc_imx
    417 usb-storage
    418 EOF
    419 update-initramfs -u # press 'Enter' when prompted
    420 # create u-boot image for initrd
    421 mkimage -A arm -O linux -T ramdisk \
    422   -a 0x0 -e 0x0 -n "initrd" \
    423   -d /boot/initrd.img-*-generic /boot/uramdisk
    424 }}}
    425    - 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):
    426 {{{#!bash
    427 wget https://raw.githubusercontent.com/Gateworks/linux-imx6/gateworks_4.20.7/gwventana_bootscript -O /boot/6x_bootscript-ventana.txt
    428 mkimage -A arm -O linux -T script -n bootscript -d /boot/6x_bootscript-ventana.txt /boot/6x_bootscript-ventana
    429 }}}
    430362 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 **
    431363{{{
     
    473405  * For details on how to flash this onto NAND see [wiki:linux/ubi#uboot-ubifs]
    474406
    475 ==== version-specific notes ====
    476 ===== trusty (14.04) LTS =====
     407==== version-specific notes
     408===== trusty (14.04) LTS
    477409An extra step is needed for serial console configuration:
    478410{{{
     
    484416exec /sbin/getty 115200 ttymxc1
    485417EOT
     418}}}
     419
     420
     421
     422[=#kernel]
     423== Kernel
     424While a kernel is not specifically part of a root filesystem it usually resides on the root filesystem. There are several kernel sources you can choose from:
     425 * Gateworks pre-built 4.20 kernel (**recommended**)
     426 * Gateworks pre-built 3.14 kernel
     427 * Ubuntu built kernel
     428 * Kernel built by hand
     429
     430=== Gateworks build kernel
     431Gateworks periodically updates their pre-built IMX6 kernel release and it is easy to install on a running system:
     432{{{#!bash
     433wget http://dev.gateworks.com/ventana/images/gateworks-linux-4.20.7.tar.xz
     434tar -C / -xvf gateworks-linux-4.20.7.tar.xz
     435rm gateworks-linux-4.20.7.tar.xz
     436}}}
     437
     438If you want to clean out old kernels no longer used, you can remove the directory of modules in /lib/modules/<kernel-version>
     439
     440Benefits of using the Gateworks kernel:
     441 * contains all drivers 'static' required to boot off boot devices supported by Gateworks boards (ie NAND, SATA, MMC, USB Mass storage all static in kernel) removing requirement for an 'inital ramdisk' (initrd) that Ubuntu Built kernels require
     442 * contains kernel patches that may not be in mainline yet
     443 * tested and supported by Gateworks
     444
     445
     446=== Ubuntu built kernel
     447Ubuntu 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.
     448
     449It is recommended that you use the Gateworks kernel above for the following reasons:
     450 * Ubuntu built kernels can require initrd for some boot devices complicating things (ie NAND and USB Mass Storage are kernel modules)
     451 * Ubuntu built kernels may be configured in ways not appropriate for Gateworks boards (ie the DS1672 RTC driver is not static which complicates restoring system time on boot from the GSC provided RTC)
     452
     453If you wish to use an Ubuntu built kernel here are some notes but Gateworks can not support you if you run into issues as we don't maintain this kernel.
     454
     455To install a specific kernel image search for available packages and pick the version you want. For example if wanting the 4-15.0-34-generic kernel:
     456{{{#!bash
     457apt-get update
     458apt-get install linux-image-4.15.0-34-generic
     459# install mkimage
     460apt-get install u-boot-tools
     461# create u-boot image for kernel
     462mkimage -A arm -O linux -T kernel -C none \
     463  -a 0x10008000 -e 0x10008000 -n "linux" \
     464  -d /boot/vmlinuz-4.15.0-34-generic /boot/uImage
     465# install device-tree blobs
     466cp /lib/firmware/4.15.0-34-generic/device-tree/imx6*-gw*.dtb /boot
     467#blacklist imx rtc driver, Gateworks board uses GSC RTC, and does not use imx RTC
     468echo "blacklist rtc_snvs" > /etc/modprobe.d/blacklist-rtc.conf
     469# create u-boot image for initrd
     470mkimage -A arm -O linux -T ramdisk \
     471  -a 0x0 -e 0x0 -n "initrd" \
     472  -d /boot/initrd.img-4.15.0-34-generic /boot/uramdisk
     473}}}
     474 - use {{{apt-get search linux-image}}} to determine what Ubuntu kernel versions are available
     475
     476If 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:
     477{{{#!bash
     478apt purge linux-image-4.15.0-42-generic linux-modules-4.15.0-42-generic linux-headers-4.15.0-42
     479}}}
     480 - modify the above to remove the specific version(s) you want to remove
     481
     482If booting from boot media that requires kernel modules you need to create an initrd:
     483 * The default Ubuntu kernel supports booting a microSD/SATA rootfs directly, but lacks nand/ubifs/ubi/usb-storage support. If you need that (and have a large enough flash to boot from that) you will need to use the Ubuntu initrd:
     484   - add NAND/ubifs/usb-storage modules to the initrd:
     485{{{#!bash
     486cat << EOF >> /etc/initramfs-tools/modules
     487# for NAND/ubi
     488gpmi_nand
     489ubi mtd=2
     490ubifs
     491
     492# for usb-storage
     493ci_hdrc_imx
     494usb-storage
     495EOF
     496update-initramfs -u # press 'Enter' when prompted
     497# create u-boot image for initrd
     498mkimage -A arm -O linux -T ramdisk \
     499  -a 0x0 -e 0x0 -n "initrd" \
     500  -d /boot/initrd.img-*-generic /boot/uramdisk
     501}}}
     502
     503
     504You will need to create a boot script that sets kernel cmdline properly based on boot device and loads the Ubuntu initrd if needed. You can do this on the target board:
     505{{{#!bash
     506# The Gateworks bootscript is a good starting point
     507wget https://raw.githubusercontent.com/Gateworks/linux-imx6/gateworks_4.20.7/gwventana_bootscript -O /boot/6x_bootscript-ventana.txt
     508# re-enable ramdisk when its needed
     509sed -i 's/^setenv rd_addr$/#setenv rd_addr/' /boot/6x_bootscript-ventana.txt
     510mkimage -A arm -O linux -T script -n bootscript -d /boot/6x_bootscript-ventana.txt /boot/6x_bootscript-ventana
    486511}}}
    487512