Changes between Initial Version and Version 1 of newport/ubuntu

12/13/2017 01:49:57 AM (6 years ago)
Tim Harvey

initial page


  • newport/ubuntu

    v1 v1  
     3= Ubuntu on Newport =
     4This page is dedicated details regarding running Ubuntu on an Gateworks Newport Board.
     6See also:
     7 * the Gateworks Ventana [wiki:ventana#third_party_linux third party linux] page for more details on how to use other linux distro on Ventana.
     8 * [wiki:ubuntu Gateworks Ubuntu Page for general notes] 
     10See also:
     11 * [wiki:ubuntu Gateworks Ubuntu page]
     15== Root filesystem ==
     16A popular way to create an 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.
     19- Linux Ubuntu or Debian System with network connection and sudo permissions
     21Important notes:
     22 * we set and use '''target''' and '''distro''' env variables in step 2 and use those env variables in the remaining steps to make this tutorial more version-agnostic. Please be aware of this and do not deviate from the steps unless or until you completely understand what you are doing.
     251. Install pre-requisites:
     28sudo apt-get install qemu-user-static debootstrap binfmt-support
     312. Perform first stage install of minimal filesystem for {{{arm64}}} architecture:
     36sudo debootstrap --arch=arm64 --foreign $distro $target
     37# copy qemu-arm-static binary for the binfmt packages to find it and copy in resolv.conf from host
     38sudo cp /usr/bin/qemu-aarch64-static $target/usr/bin
     40 * See for a list of current Ubuntu releases: 16.10=yakkety (latest), 16.04=xenial (latest LTS), 15.04=vivid, 14.10=utopic (LTS), 14.04=trusty (LTS), 12.04=precise (LTS), 10.04=lucid (LTS).
     41 * this minimal rootfs can be considered about the same as an Ubuntu-core downloaded rootfs however it is still missing some core packages and configuration before it can be booted. These steps are taken care of in a 2nd stage install within a chroot shell
     42 * the chroot shell below will provide network support (inherited from the host)
     443. we now have a minimal Ubuntu rootfs - chroot to it and perform the 2nd stage install:
     47sudo chroot $target
     48# now we are in the chroot
     50export LANG=C
     51# setup second stage
     52/debootstrap/debootstrap --second-stage
     54 * this is the most minimal rootfs we would recommend
     564. (optional) add additional apt package repos:
     59cat <<EOT > /etc/apt/sources.list
     60deb $distro main restricted universe multiverse
     61deb $distro-updates main restricted universe multiverse
     62deb $distro-security main restricted universe multiverse
     65 * you may want to customize the above list, depending on your needs. See [#packages below] for more detail on Ubuntu package feeds
     675. (optional) update package database and setup locales (do not skip this step if you are needing to install any packages for the steps below or otherwise)
     70apt-get update
     71apt-get -f install # fixup missing package dependencies
     72apt-get install locales dialog
     73dpkg-reconfigure locales
     766. set hostname:
     79echo ${distro}-$(uname -m) > /etc/hostname
     827. set a root passwd so you can login
     87 - or consider adding a user via {{{adduser}}}:
     90adduser myuser
     91usermod -a -G tty myuser # add to tty group for tty access
     92usermod -a -G dialout myuser # add to dialout group for UART access
     93usermod -a -G sudo myuser # add to sudo group for root access
     968. (optional) configure networking:
     97 - wired ethernet with DHCP on eth0
     100cat <<EOF >> /etc/network/interfaces
     101allow-hotplug eth0
     102auto eth0
     103iface eth0 inet dhcp
     107 - or static IP:
     110cat <<EOF >> /etc/network/interfaces
     111allow-hotplug eth0
     112auto eth0
     113iface eth0 inet static
     120 - or wireless (requires ~3MB of additional packages):
     123apt-get install wpasupplicant iw
     124cat << EOF >> /etc/network/interfaces
     125# Wireless interface
     126auto wlan0
     127iface wlan0 inet dhcp
     128        wireless_mode managed
     129        wireless_essid any
     130        wpa-driver nl80211
     131        wpa-conf /etc/wpa_supplicant.conf
     134wpa_passphrase <myssid> <mypass> >> /etc/wpa_supplicant.conf
     1379. (optional) install some useful packages
     140apt-get install openssh-server # ssh server for remote access
     141apt-get install can-utils i2c-tools usbutils pciutils # cmdline tools for various hardware support
     143 * Note that by default root ssh access is disabled for security. See [#ssh below] for info on enabling it
     14510. install Gateworks pre-built kernel:
     147apt-get install wget
     148cd /
     150tar -xvf gateworks-linux-arm64-4.14.tar.bz2
     15311. exit the chroot shell and remove files we no longer need
     157sudo rm $target/usr/bin/qemu-arm-static
     16012. install to bootable media:
     161 * For a removable block storage device supported by your board such as a USB Mass Storage device, a microSD, an mSATA SSD the example below will create a single ext4 rootfs partition on a removable block storage device. Ensure you set DEVICE properly for your system. We use the 'udisks' application for mount/unmount so that the mount-point is obvious - if you know what your doing you could use standard mount/unmount as well:
     165# unmount all auto-mounted partitions for this device
     166sudo umount ${DEVICE}?
     167# partition disk - single ext partition
     168printf ",,L,,\n" | sudo sfdisk -uS ${DEVICE}
     170sudo mkfs.ext4 -L rootfs ${DEVICE}1
     171# mount partition (will mount to /media/rootfs/)
     172sudo udisks --mount ${DEVICE}1
     173# copy the root filesystem
     174sudo cp -rupv $target/*  /media/rootfs/
     175# unmount the disk
     176sudo udisks --unmount ${DEVICE}1