Changes between Version 28 and Version 29 of newport/ubuntu
- Timestamp:
- 06/19/2020 01:53:56 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
newport/ubuntu
v28 v29 12 12 == Gateworks pre-built Ubuntu Disk Image == 13 13 Gateworks 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 Bionicroot 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. 15 15 * To update the firmware on the eMMC see [wiki:newport/firmware#UpdateFirmwareviaSerialConsoleandEthernet] 16 16 * To update the firmware on a microSD card see [wiki:linux/blockdev#UsingaDiskImage] 17 17 * [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]) 19 19 20 20 '''Login Information (default)''' … … 71 71 2. Perform first stage install of minimal filesystem for {{{arm64}}} architecture: 72 72 {{{#!bash 73 distro= bionic73 distro=focal 74 74 arch=arm64 75 75 target=${distro}-${arch} … … 79 79 sudo cp /usr/bin/qemu-${qemu_arch}-static $target/usr/bin 80 80 }}} 81 * See http://ports.ubuntu.com/ubuntu-ports/dists/ for a list of current Ubuntu releases: 18.04=bionic (latest LTS), 16.04=xenial81 * See http://ports.ubuntu.com/ubuntu-ports/dists/ for a list of current Ubuntu releases: oe 20.04=focal (latest LTS) 82 82 * 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 83 83 * the chroot shell below will provide network support (inherited from the host) … … 88 88 sudo chroot $target 89 89 # now we are in the chroot - setup env matching the distro above 90 distro= bionic90 distro=focal 91 91 export LANG=C 92 92 # setup second stage … … 195 195 To create a tarball which is the most flexible storage format and can be used for a variety of future installation uses: 196 196 {{{#!bash 197 sudo tar --keep-directory-symlink -cvJf bionic-newport.tar.xz -C rootfs/ .197 sudo tar --keep-directory-symlink -cvJf focal-newport.tar.xz -C rootfs/ . 198 198 }}} 199 199 * '--numeric-owner' is required to store user/group as a number instead of a name, your specific use case may require this switch. … … 213 213 {{{#!bash 214 214 SIZEMB=1536 # 1.5GB - expandable later with resize2fs 215 OUT= bionic-newport.ext4215 OUT=rootfs.ext4 216 216 # create a file of specific size 217 217 truncate -s ${SIZEMB}M ${OUT} … … 232 232 }}} 233 233 234 For automatically resizing the rootfs on boot you can create a one-shot init script before you unmount the filesystem above:235 {{{#!bash236 cat << EOF > /etc/init.d/resize2fs_once237 #!/bin/sh238 ### BEGIN INIT INFO239 # Provides: resize2fs_once240 # Required-Start:241 # Required-Stop:242 # Default-Start: 2 3 4 5 S243 # Default-Stop:244 # Short-Description: Resize the root filesystem to fill partition245 # Description:246 ### END INIT INFO247 248 . /lib/lsb/init-functions249 250 ROOT=\$(cat /proc/cmdline | sed -e 's/^.*root=//' -e 's/ .*\$//')251 252 case "\$1" in253 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" >&2262 exit 3263 ;;264 esac265 266 EOF267 chmod +x /etc/init.d/resize2fs_once268 systemctl enable resize2fs_once269 }}}270 271 234 Note 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. 272 235