Utilite Linux Installation and Update Old Copy

From Utilite Wiki

Jump to: navigation, search

Contents

Overview

The procedure described below outlines the steps necessary to update or re-install Ubuntu Linux onto Utilite.

Installation target media

  • Utilite Value and Utilite Standard models use micro-SD card for O/S storage.
  • Utilite Pro model uses internal SSD for O/S storage.

Pre-installation setup requirements

  • Utilite with valid U-Boot boot-loader.
  • Display connected to the HDMI primary display output.
  • USB keyboard and mouse.
  • Power supply.
  • SD card with at least 4GB capacity.

Installation procedure prerequisites

  • Use a Linux workstation to download latest Utilite Linux Image.
  • root privileges are required for creating a bootable media.

Create a boot media

Micro-SD

Admolition note.png Any commercially available SD card of 4GB (or larger) may be used for the installation.

Insert the target micro-SD card into the host Linux workstation.
Define the following environment variables:

export ROOTFS_IMAGE=<path to the image directory>/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2
export BOOT_MEDIA=<SD card device as detected by the host Linux workstation - eg. /dev/sde or /dev/mmcblk0>

Unmount all boot media partitions

mount | awk -v boot=${BOOT_MEDIA} '{ if ($0~boot) { print "fuser -k "$3" ; umount "$1 } }' | sh -x

Clean up old disk layout:

dd if=/dev/zero of=${BOOT_MEDIA} bs=1M count=1

Re-read partition table:

hdparm -z ${BOOT_MEDIA}

Create partition table:

echo -e "n\np\n1\n\n+100M\na\n1\nt\nc\nn\np\n2\n\n\nw\neof\n" | fdisk ${BOOT_MEDIA}

Re-export BOOT_MEDIA variable:

Admolition note.png SD card can have either 'sdX' or 'mmcblkX' special file name. If a device named as an “mmcblkX” then “p” suffix will appear in the device partition's name after the disk layout has been created by “fdisk”. That is why the BOOT_MEDIA variable has to be reexported in order to meet the device name convention.
export BOOT_MEDIA=`awk -v boot=$BOOT_MEDIA 'BEGIN { if (boot~/mmcblk/) { printf("%s%s",boot,"p") } else { print boot } }'`

Format boot-partition:

mkfs.vfat -n boot ${BOOT_MEDIA}1

Format rootfs-partition:

mkfs.ext4 -O ^has_journal -E stride=2,stripe-width=1024 -b 4096 -L rootfs ${BOOT_MEDIA}2

Mount both partitions:

mkdir -p /media/rootfs && mount ${BOOT_MEDIA}2 /media/rootfs && mkdir -p /media/rootfs/boot && mount ${BOOT_MEDIA}1 /media/rootfs/boot
Admolition note.png Mounting order is important.

Extract the content of the root file system image onto the second partition mounted as /media/rootfs:

tar --numeric-owner -xjpf ${ROOTFS_IMAGE} -C /media/rootfs && sync

Fix up a known dbus-helper issue:

ROOTFS=/media/rootfs
DBUS_HELPER=${ROOTFS}/usr/lib/dbus-1.0/dbus-daemon-launch-helper
MESSAGEBUS_MODE=04754
MESSAGEBUS_GID=`awk '/messagebus/ { split($0,a,":") ; print a[3] }' ${ROOTFS}/etc/group`
chown root:${MESSAGEBUS_GID} ${DBUS_HELPER}
chmod ${MESSAGEBUS_MODE} ${DBUS_HELPER}

Unmount both boot media partitions:

umount ${BOOT_MEDIA}{1,2}

Booting Utilite with the newly created SD card

Insert the micro-SD card into the Utilite micro-SD socket and turn on the device.
Utilite will automatically boot into the O/S.

Internal SSD

Boot Utilite with the micro-SD card created as described above. Use USB flash disk or any other removable media to copy the downloaded Utilite Ubuntu image onto Utilite.

Define the following environment variables:

export ROOTFS_IMAGE=<path to the image directory>/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2
export BOOT_MEDIA=<SSD device as detected by Utilite - eg. /dev/sde>

Unmount all boot media partitions

mount | awk -v boot=${BOOT_MEDIA} '{ if ($0~boot) { print "fuser -k "$3" ; umount "$1 } }' | sh -x

Clean up old disk layout:

dd if=/dev/zero of=${BOOT_MEDIA} bs=1M count=1

Re-read partition table:

hdparm -z ${BOOT_MEDIA}

Create partition table:

echo -e "n\np\n1\n\n+100M\na\n1\nt\nc\nn\np\n2\n\n\nw\neof\n" | fdisk ${BOOT_MEDIA}

Format boot-partition:

mkfs.vfat -n boot ${BOOT_MEDIA}1

Format rootfs-partition:

mkfs.ext4 -L rootfs ${BOOT_MEDIA}2

Mount both partitions:

mkdir -p /media/rootfs && mount ${BOOT_MEDIA}2 /media/rootfs && mkdir -p /media/rootfs/boot && mount ${BOOT_MEDIA}1 /media/rootfs/boot
Admolition note.png Mounting order is important.

Extract the content of the root file system image onto the second partition mounted as /media/rootfs:

tar --numeric-owner -xjpf ${ROOTFS_IMAGE} -C /media/rootfs && sync

Fix up a known dbus-helper issue:

ROOTFS=/media/rootfs
DBUS_HELPER=${ROOTFS}/usr/lib/dbus-1.0/dbus-daemon-launch-helper
MESSAGEBUS_MODE=04754
MESSAGEBUS_GID=`awk '/messagebus/ { split($0,a,":") ; print a[3] }' ${ROOTFS}/etc/group`
chown root:${MESSAGEBUS_GID} ${DBUS_HELPER}
chmod ${MESSAGEBUS_MODE} ${DBUS_HELPER}

Unmount both boot media partitions:

umount ${BOOT_MEDIA}{1,2}

Booting Utilite with the newly created SSD disk

Remove the micro-SD card and reboot Utilite.

Post Install Procedure

Admolition note.png The CompuLab Ubuntu image has been released with a pre-installed openssh-server. As a part of the installation procedure the package postinstall script generates RSA, DSA and ECDSA keys for the board it was installed on. Preventing a security issue these keys have been whipped out from the Ubuntu image. In order to regenerate the keys with respect to a new board the openssh-server postinstall script has to be issued once again.

Boot up the Utilite using a created media. Login and issue:

dpkg-reconfigure openssh-server

Installation Using Script

Script location dep-procedure.sh.

Admolition note.png The script has to have executable permission.
# chmod 0744 ~/dep-procedure.sh

Micro-SD

The following command structure can be used to run the deployment (installation) script for MMC/SD card:

sudo SD=<SD card device as detected by Linux - eg. /dev/sde or /dev/mmcblk0> ROOTFS_IMAGE=<path to the image directory>/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2 <path to the script directory>/dep-procedure.sh

For example if the micro SD detected by Linux as /dev/mmcblk0, the root filesystem image is located in /tmp/ directory, and the dep-procedure.sh is located in the home directory, then the command should look like:

sudo SD=/dev/mmcblk0 ROOTFS_IMAGE=/tmp/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2 ~/dep-procedure.sh

Internal SSD (Utilite Pro)

The following command structure can be used to run the deployment (installation) script for internal SSD:

sudo SSD=<SSD device as detected by Linux - eg. /dev/sde> ROOTFS_IMAGE=<path to the image directory>/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2 <path to the script directory>/dep-procedure.sh

For example if the SSD detected by Linux as /dev/sda, the root filesystem image is located in /tmp/ directory, and the dep-procedure.sh is located in the home directory, then the command should look like:

sudo SSD=/dev/sda ROOTFS_IMAGE=/tmp/utilite_ubuntu-12.04.3_2013-12-11.tar.bz2 ~/dep-procedure.sh
Personal tools