Thursday, 24 May 2018

Introducing '' templates

Sometimes when respinning an ISO using '' you find yourself using the same combination of options. Typically each combination is to include a specific type of functionality. An example might be for someone with a Broadcom wifi device always having to load and move the NVRAM file to its required location.

I've now added functionality that can simply this through the introduction of 'templates'. Similar to how the processor options of 'atom' and 'apollo' work, a template is a list of options to be included when respinning.

Looking at the​ wifi example ​in more detail, ​the ​required ​options ​​might be​:​

-f nvram.txt \
-c "mv /usr/local/bin/nvram.txt /lib/firmwaee/brcm/brcm4330-stdio.txt"

​which can be save​d​ in a text file, say 'wifi.tpl',​ with the extension '.tpl' being used just to serve as a descriptive reminder of the file's contents. This file can then be used with the new '-t' o​r​ '--template' option when respinning, fo​r​ example: -i ubuntu-18.04-desktop-amd64.iso​ --atom -t wifi.tpl
Templates can ​also ​be combined. Another example might be when a spec​i​f​i​c set of packages is required such as for 'ssh' so if the template fi​l​e 'ssh.t​​p​l​' contained '-p "ssh openssh.server"' ​then respinning with both ​'​wifi​'​ and 'ssh' is as s​imp​le as: -i ubuntu18.04.desktop.iso --atom -t wifi.tpl -t ssh.tpl
There actually is no reason why the '--atom' option cannot be included within a template however it ​would ​make sense to call the template​ ​something ​​meaningful e.g. 'atom-wifi.tpl'.

Templates are also extremely useful for complex respins. To respin an ​ISO for the ​GPD Pocket device the ​current command is​:​ -i ​<​ISO​>​ \
​​-k v4.17-rc2 \
-e bcmwl-kernel-source \
-p "xfonts-terminus thermald tlp va-driver-all vainfo libva2 i965-va-driver gstreamer1.0-libav gstreamer1.0-vaapi vlc python-gi git python gir1.2-appindicator3-0.1" \
-f display/20-intel.conf \
-f display/30-monitor.conf \
-f display/35-screen.conf \
-f display/40-touch.conf \
-f display/40-trackpoint.conf \
-f display/console-setup \
-f display/monitors.xml \
-f display/adduser.local \
-f display/90-scale \
-f display/90-interface \
-f display/ \
-f audio/chtrt5645.conf \
-f audio/HiFi.conf \
-f audio/headphone-jack \
-f audio/ \
-f audio/ \
-f fan/gpdfand \
-f fan/gpdfand.conf \
-f fan/ \
-f fan/gpdfand.service \
-f fan/ \
-f network/99-local-bluetooth.rules \
-f network/brcmfmac4356-pcie.txt \
-f network/ \
-f power/ \
-c \
-c \
-c \
-c \
-c \
-g "" \
-g "i915.fastboot=1 i915.semaphores=1 fbcon=rotate:1 gpd-pocket-fan.speed_on_ac=0"

Whilst this can be stored as a template ​to simplify things further template​s​ can in turn contain templates so a com​p​lex respin ca​n​ both be easier t​o build and understand.
For​ example we ​could build ​a ​template​ ​f​o​r​ 'display' as '​gpd-display.tpl' containing:

--file gpd-pocket-ubuntu-respin/display/20-intel.conf
--file gpd-pocket-ubuntu-respin/display/30-monitor.conf
--file gpd-pocket-ubuntu-respin/display/35-screen.conf
--file gpd-pocket-ubuntu-respin/display/40-touch.conf
--file gpd-pocket-ubuntu-respin/display/40-trackpoint.conf
--file gpd-pocket-ubuntu-respin/display/console-setup
--file gpd-pocket-ubuntu-respin/display/monitors.xml
--file gpd-pocket-ubuntu-respin/display/adduser.local
--file gpd-pocket-ubuntu-respin/display/90-scale
--file gpd-pocket-ubuntu-respin/display/90-interface
--file gpd-pocket-ubuntu-respin/display/

​and then similar templates for 'gpd-audio.tpl', 'gpd-fan.tpl' etc. together with a 'gpd.tpl' template containing:

​--template gpd-kernel.tpl
--template gpd-packages.tpl
--template gpd-display.tpl
--template gpd-audio.tpl
--template gpd-fan.tpl
--template gpd-network.tpl
--template gpd-power.tpl
--template gpd-grub.tpl​

So respinning ​U​b​u​ntu ​B​ionic for ​the GPD Pocket becomes​:​ -i ubuntu-18.04-desktop-amd64.iso​ -t gpd​.tpl​
Taken to an even further ​level the ISO can be specified as a template e.g. 'bionic​.tpl​' containing '-i ​ubuntu-18.04-desktop-amd64.iso'

So the ​final ​respin becomes​:
​ -t bionic.tpl -t gpd.tpl

To assist in building templates each time ​'​​'​ is ​successfully run a template file 'isorespin.tpl' ​is ​created containing the options used in respinning excluding the ISO option.

Fot the ​GPD Pocket example above the 'isorespin.tpl' file after respinning contains​:​

--kernel v4.17-rc2
--erase bcmwl-kernel-source
--package "xfonts-terminus thermald tlp va-driver-all vainfo libva2 i965-va-driver gstreamer1.0-libav gstreamer1.0-vaapi vlc python-gi git python gir1.2-appindicator3-0.1"
--file /<path>/gpd-pocket-ubuntu-respin/display/20-intel.conf
--file /<path>/gpd-pocket-ubuntu-respin/display/30-monitor.conf
--file /<path>/gpd-pocket-ubuntu-respin/display/35-screen.conf
--file /<path>/gpd-pocket-ubuntu-respin/display/40-touch.conf
--file /<path>/gpd-pocket-ubuntu-respin/display/40-trackpoint.conf
--file /<path>/gpd-pocket-ubuntu-respin/display/console-setup
--file /<path>/gpd-pocket-ubuntu-respin/display/monitors.xml
--file /<path>/gpd-pocket-ubuntu-respin/display/adduser.local
--file /<path>/gpd-pocket-ubuntu-respin/display/90-scale
--file /<path>/gpd-pocket-ubuntu-respin/display/90-interface
--file /<path>/gpd-pocket-ubuntu-respin/display/
--file /<path>/gpd-pocket-ubuntu-respin/audio/chtrt5645.conf
--file /<path>/gpd-pocket-ubuntu-respin/audio/HiFi.conf
--file /<path>/gpd-pocket-ubuntu-respin/audio/headphone-jack
--file /<path>/gpd-pocket-ubuntu-respin/audio/
--file /<path>/gpd-pocket-ubuntu-respin/audio/
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand.conf
--file /<path>/gpd-pocket-ubuntu-respin/fan/
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand.service
--file /<path>/gpd-pocket-ubuntu-respin/fan/
--file /<path>/gpd-pocket-ubuntu-respin/network/99-local-bluetooth.rules
--file /<path>/gpd-pocket-ubuntu-respin/network/brcmfmac4356-pcie.txt
--file /<path>/gpd-pocket-ubuntu-respin/network/
--file /<path>/gpd-pocket-ubuntu-respin/power/
--grub ""
--grub "i915.fastboot=1 i915.semaphores=1 fbcon=rotate:1 gpd-pocket-fan.speed_on_ac=0"

where '/<path>/' is the full path to the specified file.

Besides using t​h​e template file as a base for ​further ​individual templates yo​u​ can also simply recreate the last respun ​ISO​ by rerunning with the last generated template: -i <ISO> -t isorespin.tpl

Please​ donate if yo​u​ find this functionality and/or the script useful​ using the following link

Thursday, 26 April 2018

Upgrading an existing Ubuntu

Follow the steps in my guide Installing Ubuntu along side Windows (i.e. dual boot) or Installing Ubuntu on a new device (i.e. single boot) up to the 'Installation type' screen:

On that screen this time select 'Upgrade' and continue by clicking 'Install Now'.

A release upgrade can also be performed through the command line. ZDNet have written a short article which summarises the steps involved.

Please donate if you find this guide useful using the following link

Installing Ubuntu on a new device (i.e. single boot)

First insert the Ubuntu 'LiveUSB' into the device and after powering on immediately start the boot menu. This is normally achieved by 'mashing' the F7, F10 or F11 or another function key depending on you device.

Select the option to boot as the USB's first partition:

On booting from the ISO you will see a screen similar to this:

The top two options can be both be used for installing Ubuntu however the top option also allows running Ubuntu in 'live' mode which is similar to running it in a sandbox except that you can still access internal storage and any attached devices.

Having selected the first option above you will get the Ubuntu desktop displayed:

As mentioned it is possible to run commands in this 'live' mode for example to look at the current disk usage.

Using the 'df' command it can be seen that the disk is empty:

To perform the installation you can either click on the installation icon on the top left or double click the 'Install Ubuntu 18.04 LTS' icon:

Installation is menu driven with the small dots across the bottom indicating where you are in the menu cycle. First you must select the keyboard layout although the defaults are normally sufficient in most cases:

and then chose the what applications you would like to install. This release offers a new smaller and consequently quicker installation using the 'Minimal' option which is shown below. Again if in doubt just go with the defaults:

You should then obviously choose the 'Erase disk and install Ubuntu':

as this will partition the entire disk space to Ubuntu.

Alternatively if you had selected 'Somthing else' in the 'Installation type' menu you can specify in more detail the how the installation should be performed with more granualr control over disk space and partitions to use for the file system. Beginners should initially ignore this option unless comfortable with the following screen:

Once you've clicked 'Install Now' you will again get a warning message that you can typically safely ignore:

by clicking 'Continue' to move to the next menu. If you are connected to the internet the installer will try and determine you current location otherwise you can change this by clicking anywhere on the map with the effect being to set your timezone to what ever is appropriate to that location:

Next enter details about who you:

The first word of your name will automatically be suggested as your username and the computer name will become the 'host' name. Edit or accept them as appropriate:

Then enter your password. It will tell you how secure it thinks your password is:

Then enter your password again to reconfirm it. Note that if you chose a password longer than nine characters when entering it again you'll temporarily get a misleading 'Passwords do not match' message:

Just ignore this and carry on typing you password out for the full length:

After clicking 'Continue' the installation starts:

During which you will see some slides explaining key features of Ubuntu:

Don't worry about messages saying 'Removing packages' as this is normal:

Eventually it completes and waits for you next action which is convenient as you can leave the installation unattended:

As the displayed message suggests you can either carry on using the sandboxed 'live' Ubuntu by clicking 'Continue Testing' or reboot to try your newly installed Ubuntu. 

If you chose the 'Normal' installation it should look like the following:

There is also a brief introductory slide show highlighting the basics of the new GNOME desktop, whether to set up Livepatch (to automatically keep updated without rebooting), whether to send crash reports to Canonical and a brief introduction to popular applications that are available for installation:

Clicking on the icon on the bottom left shows the applications currently installed:

or for the 'Minimal' installation like this (including the brief introductory slide show):

with a smaller subset of applications installed:

A nice cosmetic touch is to try out the 'community theme' I wrote about here which changes the icons in the 'Normal' installation to look like:


or like this for the 'Minimal' installation:

One thing you may encounter early on is a message about updates. For example using a minimal installation as an example you might get the following message:

which if you click on 'Install Now' will prompt you for your password and then starts installing the updates:

and may require a reboot if the kernel has been updated:

Packages (as applications are known) can be installed through clicking on the 'Ubuntu Software' icon on the left or can be manually installed though the command line. For example installing 'gparted':

also automatically creates and icon. So before the installation it looked like:

and afterwards like:

Running 'gparted' shows the entire disk is allocated to Ubuntu:

There are plenty of guides on how to use Ubuntu and if you get stuck you should look at:
Please donate if you find this guide useful using the following link