Friday 22 April 2022

Customizing Ubuntu ISOs: Documentation and examples of how to use 'isorespinner.sh'

 


isorespinner.sh

This script is a ​progression of 'isorespin.sh'. Whilst 'isorespin' was created to support Ubuntu and similar Linux distributions on mini PCs, some of the functionality that was developed is now unused. Additionally with ​Canonical now trialling a new ​Ubuntu ​desktop installer and the ISO using a new multi-layer filesystem, rather than hack the ​earlier code to coerce compatibility I'​ve​ developed a new script ​which I've called ​'isorespinner.sh' ​and provides the most useful features and ​addresses the functionality that is ​now relevant to​ ​respinning.

The syntax of the new script is as follows:

Usage: isorespinner.sh [ -h | -v | --check ]
       isorespinner.sh -i <ISO> [ -w <directory> | -u | -k <kernel> | --dist-upgrade | --upgrade | --interactive | --all | --disk | --debug | ...
       isorespinner.sh ... -b [ GRUB-32 | GRUB-64 ] | -g [ "" | "<kernel boot parameter> ... " ] | c "<cmd> ... " | ...
       isorespinner.sh ... --key "<repo> ... " | -r "<repo> ... " | -p "<pkg> ... " | -l "<pkg.deb> ... " | -e "<pkg> ... " | -f [ "<file> | <directory> ... " ]

with a lot of the options unchanged from their previous functionality as described here.

The primary significant difference between 'isorespin.sh' and 'isorespinner.sh' is that the new script no longer adds a GRUB 32-bit bootloader by default so ​the option '-b GRUB-32' ​should be used ​if ​it is ​required. Secondly along with removing redundant options, the GUI interface has been dropped so options can only be specified using the command line​. ​As a result ​all ​the previous functionality can be replicated using the current options. The prerequisite dependencies are the same as before and if not installed the script will identify any that are required.

The new script includes two new features​:

  1. The script tries to run using memory for the temporary files to alleviate continuous read/writes to storage ​and thereby​ reduce drive wear. ​However to exclude running in memory​ ​the option '--disk' ​should be specified ​especially if using the script for large and complex respins as currently it is possible to exceed the initial memory allocation ​which ​results ​in running out of 'virtual' space. 
  2. ​The other key new feature is the support for multi-layer filesystem ISOs such as the new canary Ubuntu Jammy 22.04 ISO. However due to the nature of how such ISOs uses layers, respinning becomes somewhat dependent and/or specific to the individual layers​.​ The default language layer is derived from the 'LANG' shell variable or ​set ​as 'English' if either ​the variable is unset or set to 'C.UTF-8'. A different language layer, assuming it is already​ ​supported​ by the ISO​, can be respun by prefixing the respin command with the required 'LANG' variable, so for Spanish for example, use 'LANG=es isorespinner.sh -i ...​'​. If all language layers require respinning​ then ​use the option '--all'. Currently only a 'normal' installation is supported as the 'minimal' installation has not ​yet ​been ​investigated.

Looking at invocation, a good example of why 'isorespinner.sh' is required is the back-porting of the Intel P-State driver fix for Intel Alder Lake processors. Currently the brand new Jammy ISO ships with Linux kernel version 5.15.25 which results in poor performance on Alder Lake due to ITMT support for with P and E core selection. However the Linux kernel version 5.15.35 includes this back-ported fix and this can be incorporated into a respun ISO by using the option '-k v5.15.35' which will then use the Canonical build of the Mainline Test tree prior to the kernel filtering through the kernel rollout process.

Whilst before it was possible to respin an ISO suitable for Intel Atom processors using the single '--atom' option, now the various components have to be first downloaded and respun as specific options e.g. '-b GRUB-32 -l rtl8723bs_4.12.0_amd64.deb -f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh -f linuxium-install-broadcom-drivers.sh -f wrapper-linuxium-install-broadcom-drivers.sh -c wrapper-linuxium-install-UCM-files.sh -c wrapper-linuxium-install-broadcom-drivers.sh' as the '--atom' option has been depreciated. For reference these are the 'atom' files:

rtl8723bt_4.12.0_amd64.deb (used when the linux-firmware package is at least version 1.169)
rtl8723bs_4.12.0_amd64.deb (used for earlier versions of the linux-firmware package)
linuxium-install-broadcom-drivers.sh
linuxium-install-UCM2-files.sh (used for ISOs 20.04 and up - rename as 'UCM' without the '2')

I​'ve​ also found that the new multi-layer filesystem ​ISO ​was too 'heavy' for very low-powered Intel mini PCs​. However with a minimum configuration of a Cherry Trail processor ​and 2GB memory​ and some​ specific respinning, both usage and installation was possible. Even then ​an Intel Compute Stick struggled ​but using ​a respun ISO with ​the options '-b GRUB-32 -g intel_idle.max_cstate=1 -g fsck.mode=skip -p lz4 -c "sed -i 's/^COMPRESS=zstd/COMPRESS=lz4/' /etc/initramfs-tools/initramfs.conf"' prevent​ed​ ​both ​freezing during installation and ​also ​running out of memory when creating a new 'initramfs'.

As this is the initial release inevitably there will be improvements required so please donate if you find the script useful using the following link http://goo.gl/nXWSGf as everything helps with development costs.


Canonical have announced the release of Ubuntu 22.04 LTS (Jammy Jellyfish)

For the last few years I've respun various ISOs to support running Ubuntu, Ubuntu flavours and Ubuntu-based distros on mini PCs by specifically addressing the issue of those devices that use restrictive bootloaders including 32-bit GRUB.

I've relied on donations to support my work and cover development and storage costs. Recently these have been few and far between indicating that the demand for such ISOs is not there.
As a result I'm reducing the number of ISOs I provide and only offer some examples of how my 'isorespinner.sh' script works.




With Canonical announcing the latest release of Ubuntu 22.04 LTS (Jammy Jellyfish) I’ve respun the desktop ISO to create an ISO which includes support for Intel Atom devices as well as any other 64-bit (x86-64/AMD64) PC:

linuxium-ubuntu-22.04-desktop-amd64.iso (-i ubuntu-22.04-desktop-amd64.iso -b GRUB-32 -l rtl8723bs_4.12.0_amd64.deb -f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh -f linuxium-install-broadcom-drivers.sh -f wrapper-linuxium-install-broadcom-drivers.sh -c wrapper-linuxium-install-UCM-files.sh -c wrapper-linuxium-install-broadcom-drivers.sh)




I've also respun Lubuntu:

linuxium-lubuntu-22.04-desktop-amd64.iso (-i lubuntu-22.04-desktop-amd64.iso -b GRUB-32 -l rtl8723bs_4.12.0_amd64.deb -f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh -f linuxium-install-broadcom-drivers.sh -f wrapper-linuxium-install-broadcom-drivers.sh -c wrapper-linuxium-install-UCM-files.sh -c wrapper-linuxium-install-broadcom-drivers.sh)




Finally for the adventurous few wanting to try the new Ubuntu desktop installer I've respun the desktop ISO (jammy-desktop-canary-amd64.iso version 20220418.1) with a set of options I found prevent​ed​ ​both ​freezing during installation and ​also ​running out of memory when creating a new 'initramfs' on Intel Atom devices:

linuxium-20220418.1-ubuntu-jammy-desktop-canary-amd64.iso (-i jammy-desktop-canary-amd64.iso -b GRUB-32 -g intel_idle.max_cstate=1 -g fsck.mode=skip -p lz4 -c "sed -i 's/^COMPRESS=zstd/COMPRESS=lz4/' /etc/initramfs-tools/initramfs.conf")


Downloading Note

After downloading an ISO file it is recommended to test that the file is correct and safe to use by verifying the integrity of the downloaded file. An error during the download could result in a corrupted file and trigger random issues during the usage of the ISO.

The program 'md5sum' is designed to verify data integrity using the MD5 (Message-Digest algorithm 5) 128-bit cryptographic hash. The MD5 calculation gives a checksum (called a hash value), which must equal the MD5 value of a correct ISO.

First open a terminal and go to the correct directory to check a downloaded ISO. Then run the command 'md5sum <ISO>' for example:

md5sum linuxium-ubuntu-22.04-desktop-amd64.iso

'md5sum' should then print out a single line after calculating the hash:

db4bc3918a95f54d6374f06d6d09316c  linuxium-ubuntu-22.04-desktop-amd64.iso

Compare the hash (the alphanumeric string on left) from your output with the corresponding hash below. If both hashes match exactly then the downloaded file is almost certainly intact. However if the hashes do not match then there was a problem with the download and you should download the file again.

ISO 'md5sum' hashes:

v1.0.0:
db4bc3918a95f54d6374f06d6d09316c  linuxium-ubuntu-22.04-desktop-amd64.iso
2512e8241cee853472bbad639b2cbc6e  linuxium-20220418.1-ubuntu-jammy-desktop-canary-amd64.iso
4743a3fb5fddfef89c981fcbfac7aee0  linuxium-lubuntu-22.04-desktop-amd64.iso
v1.0.1:
0bab6914628260917c70c79331e2e171  linuxium-lubuntu-22.04-desktop-amd64.iso


Please donate if you find these ISOs useful.

Thursday 7 April 2022

If things don't change, things will stay as they are.

 


The 'canary' ISO for Ubuntu 22.04 (Jammy Jellyfish) introduces the new Ubuntu Desktop installer which uses 'subiquity' as a backend and 'Flutter' for the UI.

Rather than hack 'isorespin.sh' to coerce compatibility I'm developing a new script which takes the most useful features and targets functionality that is more relevent to current usage.

Despite plus ça change, plus c'est la même chose (the more things change, the more they stay the same) I thought it best to give the script a new name: 'isorespinner.sh'.

More to come.


“If things don't change, things will stay as they are.” - John Englander 

"Plus ça change, plus c'est la même chose." - Jean-Baptiste Alphonse Karr