Update: This work is superseded by my 'isorespin.sh' script which can respin an official ISO suitable for use on Intel Atom devices.
Although the earlier versions of my 'isorespin.sh' script provided flexibility in creating an ISO by allowing the addition of packages, if a package was only accessible from a specific repository then it could not be added when respinning an ISO. To provide this functionality I've re-written the script to include both adding repositories to the ISO and adding packages that are dependent on such repositories. Unfortunately the flags I had previously used to control the various options required changing to accommodate this functionality. Additionally an issue I've encountered several times is not having sufficient space to respin an ISO so using a temporary directory such as an external disk or USB for the temporary work files was needed. Therefore I've added a new flag '-w' to specify a 'work directory' which should resolve most instances when space becomes an issue.
With the new flags the invocation whilst providing flexibility can become somewhat complex. Coupled with this is some users are not comfortable using a command line interface so I decided to add a graphical user interface. It is rather simplistic but it takes you through the options and makes argument selections somewhat easier.
The examples below illustrate the various options through scenarios and provide a basic tutorial to the new version of the script.
The first scenario starts by respinning an Ubuntu 17.04 ISO and upgrades the kernel, add a repository, packages and files (scripts), downloads packages required by the scripts, and creates an ISO with persistence.The script was run on a mini PC which just had the required storage with only 11GB free on the root file system. All the local packages and files to be installed on the ISO had been previously downloaded and copied to the 'Downloads' directory. Also to prevent the file manager opening a window each time the script mounts a temporary file system I ran the command 'gsettings set org.gnome.desktop.media-handling automount-open false' first. Finally I had 'installed' the script by copying it to '/usr/local/bin' so that it was available regardless of the current directory.
When the script is started without any parameters it checks to see if it can run the GUI which then starts with the main selection menu where all required options are to be selected.
For each option (i.e. flag) selected, a sub-menu will appear to allow the choice (i.e. argument) to be entered. When selecting the ISO to be respun a file manager styled window will be presented but only files ending with a '.iso' suffix will be displayed.
When the kernel upgrade option is chosen the next choice is either to upgrade to the latest mainline version or a further window will open allowing a specific version to be typed in (which can be any of the Ubuntu Kernel Team kernel builds located at
http://kernel.ubuntu.com/~kernel-ppa/mainline and is the name of the directory or folder name without the trailing '/' as in '--kernel v4.11-rc7' noting that earlier kernels will probably not work well if at all).
The new 'repo' option allows a repository to be added in either the form of a ppa or as a line to be added to '/etc/apt/sources.list'.
When any option requiring a text entry is added a further option is displayed to ask whether a further entry needs to be added.
Packages can be added as text entries either singularly or as multiples.
Local packages are added using the file manager which only displays '.deb' files.
Any packages that are specified for download will be placed in '/usr/src'. This can be a useful for example when later installing the ISO to a 32-bit bootloader device as by downloading the required GRUB packages they are readily available without the need for an internet connection during a manual installation.
There are no restrictions on the type of files added to the ISO and they will be stored under '/usr/local/bin'.
Selecting persistence will automatically pre-select the rEFInd bootmanager and the size of the persistence partition can be defined using the slider which with the GUI limits the size between 128MB and 2048MB.
Once all the options have been entered a confirmation screen will be displayed which shows the options as they would have been entered if the script had been manually run.
Then as the script runs its progress is displayed both in the terminal and on the screen.
When the script finishes a notification message is displayed.
A log file is produced while running the script which contains details of what was used in producing the ISO.
The script can still be run manually as before but note the renamed flags.
In the second scenario an attempt is made to run the script manually however there is insufficient space on the hard drive.
By specifying a work directory the script can run on external devices instead of locally.
In this example a USB is used.
Once an ISO has been respun it can be written to a USB using the 'dd' command.
Booting the ISO from the first scenario on an Intel Compute Stick shows how useful installing a local package can be. In this example the local package was 'rtl8723bs_4.11.0-041100_amd64.deb' which is a package I created to install an externally compiled wifi and bluetooth module together with firmware. Wifi automatically becomes available after booting (although in the example the device was also connected to the internet using an external USB adapter). The package 'inxi' was installed as part of the ISO respin and shows the kernel is now v4.11 and 'df' shows the persistence partition mounted as '/media/ubuntu/casper-rw'.
The package 'gnome-encfs-manager' which could only be installed once the repository 'ppa:gencfsm/ppa' had been added can now be run from the ISO as can be the additional files etc.
The
new latest version of the script can be downloaded from '
isorespin.sh' and it is designed to work on desktop 64-bit Ubuntu/Ubuntu flavoured ISO although Linux Mint,
LDME, Debian 'Live install', KDE neon, elementary OS
and Kali ISOs can also be used (
with the limitation that Debian kernels cannot be upgraded with only v3.16 kernels updated with HDMI audio and wifi DKMS modules).
Any issues or improvement suggestions are welcome.
Please donate if you find the script useful using the following link
http://goo.gl/nXWSGf as everything helps with development costs.