Changes between Version 28 and Version 29 of newport/ubuntu


Ignore:
Timestamp:
06/19/2020 01:53:56 PM (2 years ago)
Author:
Tim Harvey
Comment:

update for focal

Legend:

Unmodified
Added
Removed
Modified
  • newport/ubuntu

    v28 v29  
    1212== Gateworks pre-built Ubuntu Disk Image ==
    1313Gateworks provides a pre-built Ubuntu firmware images for the Newport Family:
    14  * [http://dev.gateworks.com/newport/images/bionic-newport.img.gz bionic-newport.img.gz] - '''(Recommended)''' Compressed Disk Image containing Firmware, Linux kernel, and Ubuntu 18.04 Bionic root filesystem.
     14 * [http://dev.gateworks.com/newport/images/focal-newport.img.gz focal-newport.img.gz] - '''(Recommended)''' Compressed Disk Image containing Firmware, Linux kernel, and Ubuntu 20.04 Focal root filesystem.
    1515  * To update the firmware on the eMMC see [wiki:newport/firmware#UpdateFirmwareviaSerialConsoleandEthernet]
    1616  * To update the firmware on a microSD card see [wiki:linux/blockdev#UsingaDiskImage]
    1717 * [http://dev.gateworks.com/newport/kernel/linux-newport.tar.xz linux-newport.tar.xz] - Compressed TAR archive of pre-built Linux kernel
    18  * [http://dev.gateworks.com/ubuntu/bionic/bionic-newport.tar.xz bionic-arm64.tar.xz] - Compressed TAR archive of Ubuntu 18.04 Bionic arm64 root filesystem (does not include kernel)([http://dev.gateworks.com/ubuntu/bionic/bionic-newport.manifest package manifest])
     18 * [http://dev.gateworks.com/ubuntu/focal/focal-newport.tar.xz focal-arm64.tar.xz] - Compressed TAR archive of Ubuntu 20.04 Focal arm64 root filesystem (does not include kernel)([http://dev.gateworks.com/ubuntu/focal/focal-newport.manifest package manifest])
    1919
    2020'''Login Information (default)'''
     
    71712. Perform first stage install of minimal filesystem for {{{arm64}}} architecture:
    7272{{{#!bash
    73 distro=bionic
     73distro=focal
    7474arch=arm64
    7575target=${distro}-${arch}
     
    7979sudo cp /usr/bin/qemu-${qemu_arch}-static $target/usr/bin
    8080}}}
    81  * See http://ports.ubuntu.com/ubuntu-ports/dists/ for a list of current Ubuntu releases: 18.04=bionic (latest LTS), 16.04=xenial
     81 * See http://ports.ubuntu.com/ubuntu-ports/dists/ for a list of current Ubuntu releases: oe 20.04=focal (latest LTS)
    8282 * this minimal rootfs 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
    8383 * the chroot shell below will provide network support (inherited from the host)
     
    8888sudo chroot $target
    8989# now we are in the chroot - setup env matching the distro above
    90 distro=bionic
     90distro=focal
    9191export LANG=C
    9292# setup second stage
     
    195195To create a tarball which is the most flexible storage format and can be used for a variety of future installation uses:
    196196{{{#!bash
    197 sudo tar --keep-directory-symlink -cvJf bionic-newport.tar.xz -C rootfs/ .
     197sudo tar --keep-directory-symlink -cvJf focal-newport.tar.xz -C rootfs/ .
    198198}}}
    199199 * '--numeric-owner' is required to store user/group as a number instead of a name, your specific use case may require this switch.
     
    213213{{{#!bash
    214214SIZEMB=1536 # 1.5GB - expandable later with resize2fs
    215 OUT=bionic-newport.ext4
     215OUT=rootfs.ext4
    216216# create a file of specific size
    217217truncate -s ${SIZEMB}M ${OUT}
     
    232232}}}
    233233
    234 For automatically resizing the rootfs on boot you can create a one-shot init script before you unmount the filesystem above:
    235 {{{#!bash
    236 cat << EOF > /etc/init.d/resize2fs_once
    237 #!/bin/sh
    238 ### BEGIN INIT INFO
    239 # Provides:          resize2fs_once
    240 # Required-Start:
    241 # Required-Stop:
    242 # Default-Start: 2 3 4 5 S
    243 # Default-Stop:
    244 # Short-Description: Resize the root filesystem to fill partition
    245 # Description:
    246 ### END INIT INFO
    247 
    248 . /lib/lsb/init-functions
    249 
    250 ROOT=\$(cat /proc/cmdline | sed -e 's/^.*root=//' -e 's/ .*\$//')
    251 
    252 case "\$1" in
    253   start)
    254     log_daemon_msg "Starting resize2fs_once" &&
    255     resize2fs \$ROOT &&
    256     update-rc.d resize2fs_once remove &&
    257     rm /etc/init.d/resize2fs_once &&
    258     log_end_msg \$?
    259     ;;
    260   *)
    261     echo "Usage: \$0 start" >&2
    262     exit 3
    263     ;;
    264 esac
    265 
    266 EOF
    267 chmod +x /etc/init.d/resize2fs_once
    268 systemctl enable resize2fs_once
    269 }}}
    270 
    271234Note that the pre-built Gateworks images create a minimal root filesystem as well as a partition table that assumes a specific size (matching the smallest eMMC device used on our boards). There is a script similar to the one above that runs on first-boot which expands the last partition to the extents of the device and grows the partition to fill it. See https://github.com/Gateworks/ubuntu-rootfs/blob/master/ubuntu-rootfs.sh and look for 'growpart' for details.
    272235