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:
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:
- 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.
- 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:
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')
wrapper-linuxium-install-broadcom-drivers.sh
wrapper-linuxium-install-UCM-files.sh
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"' prevented 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.