Wednesday, 21 June 2017

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

Update: This work is superseded ... see 'Customizing Ubuntu ISOs: Documentation and examples of how to use 'isorespinner.sh'' under 'Featured post'.



Normally Linux distribution ISOs work perfectly when written to a USB for booting as a 'Live USB' allowing both usage and installation of the distro. Unfortunately with the introduction of Intel Atom based mini PCs and tablets the issue of requiring a 32-bit bootloader to boot a 64-bit OS arose. Further complications were caused by the initial lack of 'mainline' support for HDMI audio and wifi/bluetooth resulting in either the need for custom kernels or for one of the more recent 'mainline' kernels. However because Ubuntu is not a 'rolling release' it is not possible to try the latest kernel or a specific kernel with a 'Live USB'. Now with the introduction of Intel Apollo Lake based mini PCs a new issue has arisen where GRUB simply fails to boot unless the device is one of the few with a BIOS option to select Linux as the OS. Whilst some Linux distros can work OOTB regardless of architecture and bootloader I found that for Ubuntu it wasn't that simple.

To solve the limitations of using a standard ISO I developed a script that allows an ISO to be respun and customized ("remastered") to create a new ISO. Being a script which you run locally it means you can both see and control how your ISO is respun. The script offers the ability to:
  • Add a GRUB 32-bit bootloader to allow ISOs to boot on the many Intel Atom devices limited by their BIOS.
  • Add functionality to boot ISOs on any Intel Apollo device regardless of the BIOS settings.
  • Upgrade the kernel to the latest mainline version or to a specific version to benefit from recent patch functionality e.g. for audio and wifi/bluetooth or to use a rolling (HWE) kernel.
  • Add (or remove) repositories, software packages, scripts and files to allow the installation of firmware and favourite programs.
  • Preseed or perform set-up commands and scripts and also change system defaults and kernel boot parameters.
  • Add persistence so that the ISO can retain data, installed software packages and settings across reboots.
  • Create a server ISO that works on both 32-bit and 64-bit bootloaders found on various low cost Intel Atom mini PCs or one that works on the more recent Apollo and Gemini Lake mini PCs.
The script is called 'isorespin.sh' and works with all official desktop 64-bit Ubuntu (http://releases.ubuntu.com) and Ubuntu flavoured ISOs (https://www.ubuntu.com/download/ubuntu-flavours), Linux Mint ISOs (https://www.linuxmint.com/download.php), KDE neon ISOs (https://neon.kde.org/download), elementary OS ISOs (https://elementary.io), Peppermint OS (https://peppermintos.com/) and BackBox Linux (https://backbox.org/). And whilst Kali is not directly supported the Kali Metapackages (https://tools.kali.org/kali-metapackages) can be added when respinning an ISO.

It can be run using either the shell CLI (command line interface) in a the terminal or using its GUI (graphical user interface). Not only will it generate a new ISO but it will also produce a log file which includes the options used when respinning the ISO and serves to document the respun ISO.


Before you start

It is a given that most people only read the manual page or documentation for a command either when they can't work out how to use it or somethings goes wrong after using it. And it is also much easier to post a question than read the documentation or understand an error message. However try and get through the following quick start guide first as it is designed to help.


Quick start guide to using 'isorespin.sh'

1. Open a terminal session on a host device running Ubuntu (or similar) e.g. your main PC
2. Download my 'isorespin.sh' script (click on the link)
3. Make the script executable by entering:
        sudo mv isorespin.sh /usr/local/bin
        sudo chmod 755 /usr/local/bin/isorespin.sh
4. Install the packages required for running (some will already be installed):
        sudo apt -y install p7zip-full bc klibc-utils iproute2 genisoimage dosfstools  
        sudo apt -y install squashfs-tools rsync unzip wget findutils xorriso bsdutils
5. Download the ISO you want to respin (for example as 'ubuntu-16.04.3-desktop-amd64.iso')
6. Either run the script with GUI:
        isorespin.sh
    or run the script with options. Commonly used options include:
        Add a 32-bit bootloader
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso
        Respin the ISO suitable for booting on Intel Atom devices
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso --atom
        Respin the ISO suitable for booting on Intel Apollo Lake devices
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso --apollo
        Update the ISO with the latest mainline kernel
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso -u
        Update the ISO with a specific kernel version
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso -k v5.7-rc2
        Create a server ISO

        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso --server
    A new ISO prefixed with 'linuxium' as a minimum will be created. For example the command
        isorespin.sh -i ubuntu-18.04.4-desktop-amd64.iso -k v5.7-rc2 --apollo
    creates the ISO:
        linuxium-apollo-v5.7-rc2-ubuntu-18.04.4-desktop-amd64.iso
    To get a list of all available options enter:
        isorespin.sh -h
    Note the script runs several commands as 'sudo' so you will be asked for your password
        [sudo] password for <username>:
7. Insert a USB and make a note of which device it is (use 'df', 'blkid' or 'lsblk' to confirm)
8. Unmount any files systems auto mounted from the USB
        sudo umount /dev/<USB device>*
9. Write the respun ISO to USB
        sudo dd if=<respun ISO> of=/dev/<USB device> bs=4M
        (e.g. sudo dd if=linuxium-apollo-v5.7-rc2-ubuntu-18.04.4-desktop-amd64.iso of=/dev/sdx bs=4M)
10. Boot the USB on your target device e.g. your mini PC

The following sections explain each of the steps in more detail together with an issues section, how to report errors and how to donate.


Dependencies

Although it is expected to run the script on a Linux machine typically running 64-bit Ubuntu or a 64-bit Ubuntu based OS it also works on a Linux virtual machine on Windows (see below for further details). You will need certain packages like 'squashfs-tools' and 'xorriso' installed (use 'sudo apt-get install -y squashfs-tools xorriso' to install them) plus 'zenity' if you want to use the GUI. As different Linux distros have different packages installed by default the script will first check and notify you if any other packages are required. You will also need at least 10 GB of free space but this can be on external storage (e.g. a USB) as it can be specified as a location different to where the script is run from. For some options (such as updating the kernel) you will need a working internet connection as the script needs to download software. Also the script needs to be executable which can be achieved using the 'chmod' command ('sudo chmod 755 isorespin.sh'). As the script runs some commands (e.g. mount/umount) which require root access using the 'sudo' command you will initially be prompted for your password and must already have 'sudo' privileges. Finally some restrictions: you cannot respin an ISO that is EOL (End Of Life); you cannot respin an ISO on an OS that doesn't support 'systemd' when using the '--apollo' or the '-b Linuxium' options; you also cannot respin an ISO if the ISO doesn't support 'systemd' when using the '--atom', '--apollo' or '-b Linuxium' options.


Invocation

Running the script is really quite simple even though there are quite a lot of features or options making it look rather complex.


Usage: /usr/local/bin/isorespin.sh [ -h | -v | --check | --rolling-list ]
       /usr/local/bin/isorespin.sh -i <ISO> [ [ -u | -k <kernel> ] | [ --dist-upgrade | --upgrade ] | ...
       /usr/local/bin/isorespin.sh ... [ --rolling-release | --rolling-release-hwe | --rolling-release-hwe-edge | --rolling-proposed | --rolling-proposed-hwe | --rolling-proposed-hwe-edge | ...
       /usr/local/bin/isorespin.sh ... --rolling-testing | --rolling-testing-hwe | --rolling-testing-hwe-edge | --rolling-unstable | --rolling-unstable-hwe | --rolling-unstable-hwe-edge ] | ...
       /usr/local/bin/isorespin.sh ... -b [ GRUB | GRUB-32 | GRUB-64 | rEFInd | Linuxium ] | -g [ "" | "<kernel boot parameter> ... " ] | -s [ <size>MB | <size>GB ] | -w <directory> | ...
       /usr/local/bin/isorespin.sh ... --key "<repo> ... " | -r "<repo> ... " | -p "<pkg> ... " | -l "<pkg.deb> ... " | -e "<pkg> ... " | -d "<pkg> ... " | -f [ "<file> | <directory> ... " ] | ...
       /usr/local/bin/isorespin.sh ... -c "<cmd> ... " | -o [ "<file> | <directory> ... " ] | -t <template configuration file> | --apollo | --atom | --server | --interactive | --debug ]


Respinng an ISO is controlled by either running the script with flags and arguments (CLI) or selection options and values (GUI) and briefly these are as follows:
-h or --help will display the 'usage' message. 
-v or --version displays the version of the script. 
--check if the version of the script is the latest or can be upgraded.    
-i or --iso must be specified and is the name (including the full or relative path) of the ISO to be respun. 
-u or --update will update the kernel to the latest Ubuntu Kernel Team kernel builds located at http://kernel.ubuntu.com/~kernel-ppa/mainline
-k or --kernel replaces the kernel with the version specified by the argument or value which can be any of the Ubuntu Kernel Team kernel builds located at http://kernel.ubuntu.com/~kernel-ppa/mainline and is passed as the directory or folder name without the trailing '/' (e.g. '--kernel v4.11-rc7').
--rolling-list shows what new kernels are available for the kernel types of release, proposed, testing and unstable and which can be installed using the '--rolling-' option.
--rolling-release will update the kernel to the latest kernel for that specific release. 
--rolling-release-hwe updates the kernel to the latest HWE (Hardware Enablement) or LTS Enablement Stack kernel for an LTS release. 
--rolling-release-hwe-edge updates the kernel to the upcoming HWE Stack kernel if available. 
--rolling-proposed updates the kernel to the proposed next release kernel from the proposed repository if available. 
--rolling-proposed-hwe updates the kernel to the proposed next LTS HWE kernel from the proposed repository if available. 
--rolling-proposed-hwe-edge updates to the proposed next upcoming LTS HWE kernel from the proposed repository if available. 
--rolling-testing updates the kernel with the latest kernel from the pre-release and test kernel repository if available. 
--rolling-testing-hwe updates the kernel with the latest LTS HWE kernel from the pre-release and test kernel repository if available. 
--rolling-testing-hwe-edge updates the kernel with the latest upcoming LTS HWE kernel from the pre-release and test kernel repository if available. 
--rolling-unstable updates the kernel with the latest kernel from the unstable repository. 
--rolling-unstable-hwe updates the kernel with the latest LTS HWE kernel from the unstable repository if available. 
--rolling-unstable-hwe-edge updates the kernel with the latest upcoming LTS HWE kernel from the unstable repository if available. 
-r or --repository adds the specified repository to the respun ISO. 
-p or --package will install a single package or a set of packages (if enclosed in quotes) that are available to the ISO and would typically be installed using the 'apt-get install <package>' command. This option is very useful in preseeding your ISO with packages you always normally install immediately after booting and will help resolve the issue of the ISO running out of space as a result of multiple installations. For example I typically include "ssh openssh-server inxi" when respinning an ISO for personal use.
-l or --local allows local Debian binary packages to be installed within the respun ISO. Care must be taken in specifying the order of multiple packages to preserve any dependencies and of course all dependencies must be met for the packages to be successfully installed. 
-f or --file will copy either the specified files or directories to the respun ISO under '/usr/local/bin'. Although intended to allow local binaries or shell scripts to be saved on the respun ISO there is no limitation on the actual type of file that can be added. 
-s or --storage adds a specified amount of persistent storage to the respun ISO. A size must be specified although there is some flexibility on how much is allocated. The minimum size is 128MB which keeps the size of the ISO down but means that once a USB is created the persistence partition needs to be manually resized for normal usage. Alternatively a larger size can be specified to avoid the immediate need to resize as this can always be performed later. It is recommended to use a realistic amount somewhere between 1GB and 2GB to maintain the balance between a practical but usable ISO. When creating a respun ISO with persistence the rEFInd boot manager will automatically be selected for booting the ISO although it will also need to be selected through the '-b' option if requiring the ISO to also install rEFInd. When using the GUI the persistence partition size can be defined using the slider which limits the size between 128MB and 2048MB.
-b or --boot will add either the 32-bit GRUB boot loader (which is added by default) the rEFInd boot manager or a Linuxium bootscript which currently is required for booting on a lot of the current Intel Apollo Lake devices. To leave the default 64-bit GRUB boot loader unchanged the 'GRUB-64' parameter value should be specified.
-w or --work-directory is used to specify where the ISO will be respun. This is primarily for overcoming the lack of space associated with mini PCs and allows the respinning to be run on temporarily connected external storage media such as a drive or USB. Once the storage has been connected and mounted it can be passed as a parameter. Likewise if a directory is then created on the mounted storage this can be passed as the argument or value for this option to ensure there is sufficient space (i.e. at least 10 GB) for the script to run.
-d or --download will download Debian binary packages from the respun ISO using the 'apt-get download' command and save them under '/usr/src'. If combined with the '-o' option the Debian binary package will be accessible after respinning the ISO. 
-e or --erase will remove Debian binary packages from the respun ISO using the 'apt-get purge' command. 
-c or --command will execute the supplied argument as a 'bash' command. Care must be taken when embedding single or double quotes within the argument as they are subject to interpretation. For more complex commands it is often both advisable and easier to write a simple shell script and use the '-c' option to execute it as part of respinning. If the command includes an 'update-initramfs' then the ISO's boot kernel and/or initramfs will be updated to the latest currently installed versions on the ISO. This advanced functionality allows a kernel and/or initramfs to be both updated and then booted using commands rather than through kernel package installation requiring the use of '-u', '-k', '-p', '-l' or '--rolling' options. 
-o or --output will save either the specified files or directories to an output directory called 'isorespin'. This is very useful when wanting to extract files or packages that have been created or downloaded as part of respinning the ISO. 
-g or --grub will add the specified kernel boot parameters both to the GRUB/rEFInd boot menu and to the default GRUB settings or if an empty ("") argument is specified then the the ISO's initial kernel boot parameters will be removed.  
-t or --template will add the contents of the specified file as respinning options. 
--atom include the flags, packages, scripts and commands that I recommend when respinning an ISO for a device with an Intel Atom (Bay Trail or Cherry Trail) processor and mirrors the manual invocations of  '-l rtl8723bX_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'.
--apollo include the flags, packages, scripts and commands that I recommend when respinning an ISO for a device with an Intel Apollo Lake processor and mirrors the manual invocations of '-b Linuxium -p binutils -f update-modules'.
--server creates a pseudo server ISO by removes the 'ubuntu-desktop' task and installing 'ubuntu-server' as well as creating 'ubuntu' as the default user without a password and downloading the latest version of 'linservin.sh' to '/usr/local/bin' for convenience when installing. The '--server' option is only supported with Ubuntu 18.04 and 20.04 desktop ISOs at the moment and as a CLI option. 
--key adds GPG keys to the APT keyring on the respun ISO. Only available as a CLI option.
--upgrade performs an 'apt-get upgrade' on the ISO's packages. Only available as a CLI option.
--dist-upgrade performs an 'apt-get dist-upgrade' on the ISO's packages. Only available as a CLI option.
--interactive allows you to manually enter commands to modify the ISO. Only available as a CLI option.
--debug redirects the output from executing the commands behind an option to the log file. Only available as a CLI option.
The script can either be run as a local script or it can be installed by copying the script to '/usr/local/bin' where it will be accessible for all users after the script has been made executable using the 'chmod' command ('sudo chmod 755 isorespin.sh'). Depending on the options and their complexity the respinning will take quite a few minutes and the script provides updates on its progress whilst running. The respun ISO is created with a new name derived from the original ISO name and includes indicators of the options used like 'persistence' or the kernel version for example with full details being written to the log file.

Once the ISO has been respun it can be written to a USB using the standard 'dd' command.

The examples below illustrate the various options through scenarios and provide a basic tutorial to using the script. They are based on the script being installed to '/usr/local/bin':


The script's help is displayed using the command:

isorespin.sh -h


The version of the script can either be displayed by entering:

isorespin.sh -v


or it can be seen from the top of the script's 'main' menu:


or 'advanced' menu:


The script can be run using the CLI by specifying options with arguments in any order. If the script is started without any parameters it first checks to see if it can run the GUI and if so starts with the main selection menu where all required options should be selected. As seen above the GUI uses two menus with the first being a main menu of most frequently used options and an optional additional menu of the more advance options. For each option selected, a sub-menu will appear to allow the choice or value to be entered.


Respinning an ISO

The simplest usage is to respin an ISO which will automatically add the GRUB 32-bit bootloader allowing the respun ISO to boot on Intel Atom devices e.g.:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso

or by invoking the GUI:





Upgrading the kernel

To respin the ISO with the latest kernel the command would be:

 isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -u

or



If a specific kernel was required for example 'v4.11.6' then the '-k' option would be used:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -k v4.11.6

or



Booting the ISO on Intel Atom or and Intel Apollo Lake devices

If you want to use the ISO on an Intel Atom or an Intel Apollo Lake device then simply add either the '--atom' or '--apollo' option respectively when respinning the ISO. This is further explained under the section 'Target processors' below and uses functionality explained in the next section. Finally once you have respun your ISO you need to write it to a USB which is explained under the section 'Creating a LiveUSB' with booting explained under 'Booting your respun ISO'.



Adding local packages and running scripts

A more complex scenario of respinning an ISO is when you want to add packages and run scripts to fix functionality like wifi/bt and audio.

Due to current limitations of the official ISOs I've previously created scripts to add wifi/bt firmware and also add the ALSA UCM audio files:

rtl8723bs_4.12.0_amd64.deb
rtl8723bt_4.12.0_amd64.deb
linuxium-install-broadcom-drivers.sh
linuxium-install-UCM-files.sh

These can be incorporated when respinning an ISO. For the scripts you first add the file using the '-f' option and then execute the script using the '-c' option.

When I wrote the above scripts I originally intended them to be run post installation rather than as part of respinning an ISO. As a result they produce warnings and also need to be executed in the correct directory. Rather than writing a complex '-c' parameter to run them correctly it is simpler to write a further script (which I call a 'wrapper') which controls how the script is run. These 'wrappers' can then be included as part of respinning an ISO:

wrapper-linuxium-install-broadcom-drivers.sh
wrapper-linuxium-install-UCM-files.sh

For example the following command will respin the Ubuntu 17.04 ISO and upgrade the kernel to the latest version (which includes the RTL8723BS driver) installs the required RTL8723BS wifi/bt firmware and both adds and runs a script to include the UCM files for audio:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -u -l rtl8723bs_4.12.0_amd64.deb
-f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh
-c wrapper-linuxium-install-UCM-files.sh


While the script is running progress updates are displayed:


until it finally completes:


producing a log file which shows how the script was run:



A similar example but respinning the daily snapshot Ubuntu 17.10 (Artful) ISO and using the GUI starts by selecting the required options:


and then entering the values starting with the ISO. When selecting the ISO a 'file manager' styled window will be presented but only files ending with a '.iso' suffix will be displayed:


For the kernel upgrade option the choice is to upgrade to the latest mainline version:


Local packages are selected using the 'file manager' which only displays '.deb' files. To allow multiple entries you will be asked after each selection is made whether a further addition is required:



Next the two scripts are added using the 'file manager':





And finally the 'advanced' menu is displayed and after selecting the option to add a command:


the command is entered as a text string:


Now that all the selected options have been entered a confirmation screen is be displayed which shows the full command as it would look if the script had been run manually:


Having selected 'yes' the script runs and displays its progress:





until it finishes:


Similarly a log file is produced that shows how the script was run:



For a more complex example of using the script see Compiling your own kernel using 'isorespin.sh'.


Server


To simplify the creation of a server ISO by respinning an Ubuntu desktop ISO you can use the option '--server'. This option is compatible with existing options so you can create a server ISO that works on both 32-bit and 64-bit bootloaders found on various low cost Intel Atom mini PCs or one that works on the more recent Apollo and Gemini Lake mini PCs.


Invocation is as simple as adding '--server' to your 'isorespin.sh' command. For example to create a 'vanilla' server ISO from an Ubuntu 18.04.4 desktop ISO enter:
isorespin.sh -i ubuntu/ubuntu-18.04.4-desktop-amd64.iso --server
The '--server' option is only supported with Ubuntu 18.04 and 20.04 desktop ISOs at the moment. This is because whilst removing the 'ubuntu-desktop' task essentially creates the base for a server ISO, it still leaves a small number of residual packages that need purging. This new option removes the bulk of these and those that are left are really insignificant.

The option creates 'ubuntu' as the default user without a password, similar to how the standard desktop ISO works. It also downloads the latest version of 'linservin.sh' to '/usr/local/bin' for convenience when installing.

My 'Linuxium server install' script 'linservin.sh' can be run with options:
linuxium@LINUXIUM:~$ linservin.sh -hUsage: /usr/local/bin/linservin.sh [ OPTIONS ]where OPTIONS include '-h' for 'help''-v' for 'version''-c' for 'check' (version)'-y' run automatically with best guessed values (dangerous)linuxium@LINUXIUM:~$
which are self explanatory.

The script determines the most appropriate values for the variables it will use for the installation which it presents as defaults allowing you to either accept or enter your own value as required:


Importantly the installer will detect whether the bootloader is 32-bit for 64-bit and install GRUB accordingly. Or if my 'Linuxium bootscript' or 'rEFInd' boot manager was selected when respining the server ISO then these will be installed as appropriate.

The installation progress is recorded in a logfile 'linservin.log' which is also copied to the installed filesystem and is available under '/var/log/installer'.


Persistence

Adding persistence to an ISO is useful as it means that you can retain your data, installed software packages and settings between reboots. Persistence can be added as part of any ISO respinning simply by adding the '-s' option and defining the size of the storage to be permanently allocated in the ISO. As previously mentioned there is a balance between making it small and therefore resulting in a small ISO that requires resizing once booted (see below) verses a larger size and a corresponding larger ISO.

The following example respins the standard Ubuntu 17.04 ISO with the latest kernel and create a 2 GB persistence partition:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -u -s 2GB

Using the GUI it is created by:








As can be seen from looking at the size of the resulting ISO that it is large at around 3.8 GB but not too large to be totally impractical.


Kernel boot parameters

The following is an example showing both the removal of the default kernel boot parameters (quiet splash) and the inclusion of two new kernel boot parameters:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -g "" -g "i915.fastboot=1 fbcon=rotate:1"

The default kernel boot parameters are first removed by selecting the delete option:


and the new kernel boot parameters are then added:


as text strings:



Once the script is running it will update the kernel boot parameters:


with the exact details being recorded in the log file:



Rolling kernels

The need for rolling kernels is primarily to address the shortfall that existing ISO kernels typically don't have the hardware support required for the latest devices. They ship with the 'kernel of the day' whereas the latest hardware tends to require, well, the latest kernel to fully work. Ubuntu have in part addressed this through their LTS Enablement Stacks. Another alternative to get 'newer' kernels is to enable the proposed repository however there is also a pre-release and test kernel repository together with the unstable repository where mainline kernels are migrated into Ubuntu as well as the upstream mainline kernels.


I've added an option '--rolling-list' to keeping track of what new kernels are available where with options to easily incorporate them when respinning an ISO. I've termed the kernel types as release, proposed, testing and unstable to reflect the repositories they are drawn from as described above. And if it is not abundantly obvious but any kernel other than the formally released ones are not encouraged for anyone needing a stable system or anyone who is not comfortable running into occasional or even frequent breakage.


Target processors


Respinning an ISO for a target processor includes the flags, packages, scripts and commands that I recommend for the ISO to work on devices and mirrors the manual invocations of:

For '--atom': -l rtl8723bX_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

For '--apollo': -b Linuxium -p binutils -f update-modules

The files are automatically downloaded from the internet if they are not found as part of the command invocation and this should simplify respinning for those looking something quick and easy. The '--atom' option requires that you have the 'p7zip-full' package installed prior to running the respin script however the script will check and warn you if it is missing.

The options have been included in the GUI:






Templates

Templates are similar to how the processor options of 'atom' and 'apollo' work in that a template is a list of options to be included when respinning are useful when 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.

For example 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:
isorespin.sh -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:
isorespin.sh -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​:​

isorespin.sh -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/wrapper-display.sh \
-f audio/chtrt5645.conf \
-f audio/HiFi.conf \
-f audio/headphone-jack \
-f audio/headphone-jack.sh \
-f audio/wrapper-audio.sh \
-f fan/gpdfand \
-f fan/gpdfand.conf \
-f fan/gpdfand.py \
-f fan/gpdfand.service \
-f fan/wrapper-fan.sh \
-f network/99-local-bluetooth.rules \
-f network/brcmfmac4356-pcie.txt \
-f network/wrapper-network.sh \
-f power/wrapper-power.sh \
-c wrapper-audio.sh \
-c wrapper-display.sh \
-c wrapper-fan.sh \
-c wrapper-network.sh \
-c wrapper-power.sh \
-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/wrapper-display.sh
--command wrapper-display.sh

​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​:​
isorespin.sh -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​:
​isorespin.sh -t bionic.tpl -t gpd.tpl


To assist in building templates each time ​'​isorespin.sh​'​ 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/wrapper-display.sh
--command wrapper-display.sh
--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/headphone-jack.sh
--file /<path>/gpd-pocket-ubuntu-respin/audio/wrapper-audio.sh
--command wrapper-audio.sh
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand.conf
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand.py
--file /<path>/gpd-pocket-ubuntu-respin/fan/gpdfand.service
--file /<path>/gpd-pocket-ubuntu-respin/fan/wrapper-fan.sh
--command wrapper-fan.sh
--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/wrapper-network.sh
--command wrapper-network.sh
--file /<path>/gpd-pocket-ubuntu-respin/power/wrapper-power.sh
--command wrapper-power.sh
--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:
isorespin.sh -i <ISO> -t isorespin.tpl




Interactively updating an ISO

Sometimes trying to respin an ISO using complex option combinations fails as typically the consequences of running certain commands or their effect on the ISO are not fully known or easily predictable. In these circumstances respinning interactively would be easier and hence the option '--interactive'. This option simply drops you into a 'root' shell where you can manually enter commands to modify the ISO:


Simply press 'control-D' when finished to return to respinning the ISO. This option uses the 'script' command to record the interactive session so that it can be included in the log file in full if the '--debug' option is used in conjunction or manipulated to just show a summary of the commands entered for inclusion into the default log file. This command summary is also included in the 'README.isorespin' file that is added to the respun ISO. As a result 'isorespin.sh' now depends on the package 'bsdutils' being installed which should already be the case in most situations. Because 'script' makes a typescript of everything displayed on the terminal it also includes temporary progress text together with cursor movement control codes and colour control codes which may become visible depending on how the log file is viewed. This may not be ideal in every circumstance however it is a compromise believed to be worthwhile considering the functionality gained.

For example respinning an ISO and first performing an ''apt update' and then installing the 'ethtool' package interactively:



the 'cat' command displays the log file created using the '--debug' option without distractions:


Because when performing the 'apt update' command various 'source' files are needed to be downloaded which result in progress text temporarily being displayed on the screen, when the command 'more' is used to display the log file it interprets the 'script' text in the log file differently and shows this colour-highlighted progress text:



Using the command 'view' to examine the log file shows all the text and all the control characters so consequently may not be the best way to view the log file:


For this particular example the summary of the '--interactive' commands that is also included in README.isorespin:


is similar to how this '--interactive' option is documented in the default log file without an additional '--debug' option:



Upgrading an ISO vs 'dist-upgrade'

The difference between '--upgrade' and '--dist-upgrade' options is best described by the 'man' entry for the commands used by the two options:

upgrade
upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. ...

dist-upgrade
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. ...
To illustrate the difference we can look at respinning an ISO (Ubuntu 18.04.3) first with the '--upgrade' option together with the '--debug' option which shows that the kernel meta packages are held back:


However using the '--dist-upgrade' option with the '--debug' options shows that new kernel packages will be installed as a result of upgrading the kernel meta packages:


This example again highlights the usefulness of the '--debug' option in understanding what happens as part of respinning an ISO.


Kali Metapackages

Kali offers Kali Metapackages which 'give you the flexibility to install specific subsets of tools based on your particular needs'. If the GPG key of 'ED444FF07D8D0BF6' is added (using the option '--key "adv --keyserver keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6") and the Kali repository is added (using the option '--repository "deb http://http.kali.org/kali kali-rolling main contrib non-free") these metapackages can be added as packages when respinning an Ubuntu ISO:


There are some restrictions/limitations. Unity isn't supported and I've found adding a GPG key to a 17.04 or 17.10 release fails. Additionally adding the 'kali-linux-full' package results in dependency issues. However it is possible to respin the recently released Ubuntu GNOME 16.04.3 and add 'kali-linux' and 'kali-linux-top10':

Script '/usr/local/bin/isorespin.sh' called with '-i ubuntu-gnome-16.04.3-desktop-amd64.iso --atom -u --key adv --keyserver keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6 --repository deb http://http.kali.org/kali kali-rolling main contrib non-free -p kali-linux -p kali-linux-top10' ...
Work directory 'isorespin' used ...
ISO '/home/linuxium/ubuntu-gnome-16.04.3-desktop-amd64.iso' respun ...
Bootloader 'GRUB' added ...
Kernel updated with mainline kernel version '4.13.0-041300rc3-generic' ...
Key 'adv --keyserver keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6' added ...
Repository 'deb http://http.kali.org/kali kali-rolling main contrib non-free' added ...
Package 'kali-linux' added ...
Package 'kali-linux-top10' added ...
Local package '/home/linuxium/isorespin/rtl8723bs_4.12.0_amd64.deb' added ...
File '/home/linuxium/isorespin/linuxium-install-UCM-files.sh' added ...
File '/home/linuxium/isorespin/wrapper-linuxium-install-UCM-files.sh' added ...
File '/home/linuxium/isorespin/linuxium-install-broadcom-drivers.sh' added ...
File '/home/linuxium/isorespin/wrapper-linuxium-install-broadcom-drivers.sh' added ...
Command run ...
# wrapper-linuxium-install-UCM-files.sh
./linuxium-install-UCM-files.sh: Extracting UCM files ...
./linuxium-install-UCM-files.sh: Installing UCM files ...
./linuxium-install-UCM-files.sh: Reloading UCM driver ...
./linuxium-install-UCM-files.sh: Installation of UCM finished 
# wrapper-linuxium-install-broadcom-drivers.sh
./linuxium-install-broadcom-drivers.sh: Extracting Broadcom files ...
./linuxium-install-broadcom-drivers.sh: Installing Broadcom files ...
./linuxium-install-broadcom-drivers.sh: Reloading Broadcom driver ...
./linuxium-install-broadcom-drivers.sh: Installing Broadcom bluetooth service ...
Created symlink /etc/systemd/system/multi-user.target.wants/brcmbt.service, pointing to /lib/systemd/system/brcmbt.service.
./linuxium-install-broadcom-drivers.sh: Starting Broadcom bluetooth service ...
Running in chroot, ignoring request.
./linuxium-install-broadcom-drivers.sh: Installation of Broadcom finished 
Respun ISO created as 'linuxium-v4.13-rc3-ubuntu-gnome-16.04.3-desktop-amd64.iso'.

Lubuntu is also supported:


and by adding 'kali-desktop-lxde' additional LXDE packages are included (note 'Other'):



Debugging respinnning issues

Most of the options don't include their interaction with the ISO when being executed either on the screen or in the log file. For example when adding the package 'ethtool' the log merely includes a line stating that the package has been added:


The '--debug' option redirects the output from executing the commands behind an option to the log file. Using the same example the complete output from installing the package is now included in the log file:


While including the output from successful option execution may be interesting the key benefit of using '--debug' is when a command run as part of an option fails. Having the full output including the actual error messages in the log file is invaluable for debugging respinning issues.


Creating a LiveUSB

Once your respun ISO has been created you can write it to a USB using 'dd'. For example if your USB is '/dev/sdb' then enter:

dd if=linuxium-v4.12-rc6-ubuntu-17.04-desktop-amd64.iso of=/dev/sdb bs=4M

Make sure you select the correct device for the USB and always check first using commands like 'df', 'blkid' or 'lsblk' to confirm. ISOs can also be written to a USB using 'Rufus' on Windows if preferred.


Booting your respun ISO


Having created the USB with your respun ISO the following information may be useful when booting and running.

To boot your device select the USB's UEFI partition from the device's boot menu:


Normally you will then see a standard GRUB menu:



If the 'rEFInd' boot manger was installed (either through selection or automatically due to persistence) the following screen will be displayed for 64-bit bootloader devices:



otherwise for 32-bit bootloader devices the normal the GRUB menu screen is displayed and after selection a black screen with the following message is briefly displayed:

error: no suitable video mode found.
Booting in blind mode

before the normal Ubuntu splash screen appears and the device fully boots. This 'error' can safely be ignored.

Wifi issues

If your device uses a Broadcom wifi chip and wifi isn't working even after adding the firmware using my script then it may be missing an SDIO file. By running the command 'dmesg' immediately after booting and looking at the output if you see messages showing that the wifi firmware 'txt' file is missing it is possible to use the copy from the Windows driver that is stored in NVRAM. The file should look something like '/sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113' and you actually copy it using 'cat /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 > /lib/firmware/brcm/brcmfmac43241b4-sdio.txt' substituting the actual NVRAM filename on your device and the correct *sdio.txt name for your driver.

Bluetooth issues

On booting if bluetooth fails to work automatically and the firmware was installed using one of my scripts then the service can be manually started with the command:

sudo systemctl start rtl8723bsbt.service

or

sudo systemctl start brcmbt.service

depending on device's chip. If bluetooth is always required then the command could be included in '/etc/rc.local' to avoid this step. Note that this uses 'systemd' so earlier ISO releases without 'systemd' cannot use my scripts to provide bluetooth.


Resizing the persistence partition

After respinning an ISO using the '-s' option when booting it for the first time you can use the 'gparted' command to resize the persistence partition. You will initially be prompted to fix the GPT to use all the available space so click 'Fix'


and then continue with the resizing:


NVRAM sync issues

Sometimes after installing your device only boots to a black screen.  Typically this happens when the NVRAM and ESP are out of sync. This can be easily fixed by performing the following:

1. Start with the device switched off.
2. Connect your LiveUSB.
3. Power on the device and press the relevant function key or key sequence to boot from the LiveUSB.
4. Open a terminal windows and enter:
type efibootmgr 
5. If the 'efibootmgr' is not installed enter:
sudo apt-get update && sudo apt-get install -y efibootmgr
6. Next remove any boot entries that may have been created through the earlier installs by entering:

      for BOOTENTRY in 0 1 2 3 4 5 6 7 8 9
      do
          sudo efibootmgr -b ${BOOTENTRY} -B
      done

7. Now create an Ubuntu boot entry by entering:
sudo efibootmgr -c -d /dev/mmcblk0 -p 1 -l \\EFI\\ubuntu\\grubx64.efi -L Ubuntu
8. Remove the LiveUSB and reboot from the newly created Ubuntu entry.

Note: If you have a dual boot installation then the ESP partition may be the second partition so modify the '-p 1' in the command above to '-p 2' or to whatever the ESP partition is. Likewise for some devices the eMMC is '/dev/mmcblk1' and not '/dev/mmcblk0' so again modify the command as appropriate. If your device uses a 32-bootloader then use 'bootia32.efi' rather than 'grubx64.efi' in the command. It also sometimes doesn't work first time and requires all the steps to be repeated which should then fix the issue.

Intel Apollo Lake devices not booting after installation

When installing respun Ubuntu or similar distros on Intel Apollo devices using the '--apollo'  option (or '-b Linuxium') one issue that might be encountered is where the EFI partition isn't large enough to store the bootable EFI file. Some Windows installations only create a 60MB partition which after installing the Windows EFI files leaves only around 30MB free. With the later Linux kernel releases the size and number of modules have increased and the generated bootable EFI file is now quite large (over 50MB) and if there is insufficient space for it the resultant installation will not boot. The solution is to increase the size of the EFI partition by following the instructions posted here.

Additional information regarding the script

Minimizing repeated downloads

The rEFInd boot manager (http://www.rodsbooks.com/refind) can be downloaded from https://sourceforge.net/projects/refind/files into the same directory as the script is run from to prevent unnecessary repeated downloads if this is a concern and will make processing quicker.

Avoiding new windows opening when respinning

To prevent the file manager opening a window each time the script mounts a temporary file system I have run the command 'gsettings set org.gnome.desktop.media-handling automount-open false' first on my system.

Lock file

The script creates a lock file '.isorespin.sh.lock' in the directory where it is run from in order to ensure exclusive access to the run-time environment. If the script or machine crashes this lock file may need to be removed in order to rerun the script and you will be prompted should this occur. However it is not recommended to run the script in parallel from multiple directories as it is both CPU and I/O intensive and severe performance degradation would occur.

Permissions

If when running the script you get the error:

bash: ./isorespin.sh: Permission denied

it means that the script needs to be made executable which can be achieved using the 'chmod' command ('sudo chmod 755 isorespin.sh').

Restrictions

You cannot respin an ISO on an OS that doesn't support 'systemd' if you want to use either the '--apollo' or the '-b Linuxium' options. Also you cannot respin an ISO if it doesn't support 'systemd' when using the '--atom', '--apollo' or '-b Linuxium' options:

linuxium@LINUXIUMONE:~$ isorespin.sh -i ubuntu-14.04.5-desktop-amd64.iso --atom
Extracting ISO ...
Parallel unsquashfs: Using 4 processors
166333 inodes (175651 blocks) to write

[===========================================================/] 175651/175651 100%

created 105294 files
created 16104 directories
created 60921 symlinks
created 82 devices
created 0 fifos
/usr/local/bin/isorespin.sh: The '--atom' option is only compatible with an ISO that uses 'systemd'.
linuxium@LINUXIUMONE:~$ 

You cannot respin an ISO that is EOL (End Of Life):

linuxium@LINUXIUMONE:~$ isorespin.sh -i ubuntu-17.04-desktop-amd64.iso --atom
Extracting ISO ...
/usr/local/bin/isorespin.sh: ISO is EOL.
linuxium@LINUXIUMONE:~$ 

You cannot run the script on a 32-bit OS:

linuxium@LINUXIUMONE:~$ isorespin.sh -i ubuntu-17.10.1-desktop-amd64.iso --apollo
/usr/local/bin/isorespin.sh: This script can only be run on a 64-bit (amd64 or x86_64) OS.
linuxium@LINUXIUMONE:~$

Running the script on Windows

First download and install Oracle's VirtualBox on Windows and then create a Linux VM from a standard Ubuntu 64-bit desktop ISO and install to a VDI of fixed size (minimum 20GB). Start the new Ubuntu VM and install 'Oracle VM VirtualBox Extension Pack'. You can then download my 'isorespin.sh' script to respin the Ubuntu-based ISO of choice. By installing the extension pack you will also be able to write the respun ISO to a USB using 'dd' from within the Ubuntu VM. Unfortunately 'Bash on Ubuntu on Windows' using 'Windows Subsystem for Linux' does not support 'loop' devices which are required by my script so an Ubuntu VM is the only working alternative at this time.

Running the script on Arch Linux

Running the script on Arch Linux requires a modified PATH. The simplest way is to run the script as follows:

PATH=/usr/sbin:/sbin:/bin:$PATH ./isorespin.sh

Additionally to install the required packages it may be necessary to run:

sudo pacman -S cdrkit bc libisoburn squashfs-tools dosfstools

or similar depending on which packages are missing from you environment.


Miscellaneous issues not directly related to the script

The Linux mainline kernel

It is worth noting that certain releases of the mainline kernel include specific core functionality:

v4.9 includes the eMMC v5.0 driver required for accessing the internal storage in many devices.
v4.11 includes the HDMI audio driver.
v4.12 includes the RTL8723BS driver although you will still need the wifi/bt firmware.

Kernel freezes

Well known and well documented without a permanent fix or so it seems. Kernels after v3.16 seem to include something that caused them to randomly freeze on Intel Atom devices and then the whole system hangs. Subsequently an accepted workaround was recommended to limit the processor (CPU) to a certain power state or 'C-state' and if freezes are encountered then to pass 'intel_idle.max_cstate=1' as a boot parameter. Later kernels have included patches and the current state seems to be reliable enough to ignore the workaround. If however freezes still occur the easiest way to implement the workaround on an installed system is to edit the file '/boot/grub/grub.cfg' and modify to look like:


GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"

Alternatively the following command can be entered:
sudo sed -i 's/\(GRUB_CMDLINE_LINUX=\)""/\1"intel_idle.max_cstate=1"/' /etc/default/grub
followed by:
sudo update-grub
and then a reboot as the change only needs to be made once typically following installation.

Micro SD card issues

Whilst micro SD cards have worked on Intel Atom Bay Trail devices it is only since the v4.7.2 kernel that Intel Atom Cherry Trail devices have had any form of success.

The typical error encountered is:

        mmc1: error -110 whilst initialising SD card
        mmc1: card never left busy state

and although most Class 10 and below cards from any manufacturer except Sandisk work now without problem some UHS cards still fail. I've found Samsung UHS Speed Class 3 and UHS Speed Class 1 work whereas similar Sandisk cards fail crashing the device sometimes when inserting or removing the card.

No sound from headphones or internal speakers

It may be necessary to first use the speaker controls to select the audio output before sound works. For audio on Lubuntu this will also require installing the package 'pavucontrol':

sudo apt-get install -y pavucontrol

and then using it to select the audio output e.g. HDMI. Unfortunately some devices still require additional audio drivers or specific device quirks that have not been incorporated into the mainline kernel so sound may only work over HDMI and not through internal speakers or via the headphone jack even though the UCM files have been added. This is part of ongoing Linux development and future kernel releases hopefully will include the drivers required for currently non-working devices.

Installing without an internet connection on devices with a 32-bit boot loader

Unfortunately the standard Ubuntu ISO requires an internet connection when installing on devices with a 32-bit boot loader otherwise the following error is encountered:
The 'grub-efi-ia32' package failed to install into /target/. Without the GRUB boot loader, the installed system will not boot.
My script solves this for Ubuntu ISOs as it will now add the required GRUB packages allowing the installation to successfully complete. However other Ubuntu ISOs including the Ubuntu flavours and distros based on Ubuntu (such as Linux Mint) etc. their installation without the internet on 32-bit devices is with varying success. In part it depends on the original ISO installation capability on 64-bit devices without the internet. For example as Lubuntu 17.04 cannot be installed on 64-bit devices without internet as the ISO does not contain '/pool' with required packages so likewise after respinning its installation on 32-bit devices is not possible. However Lubuntu 16.04.2 can be installed on both 64-bit and 32-bit devices after respinning (see http://cdimage.ubuntu.com/lubuntu/releases/16.04.2/release/lubuntu-16.04.2-desktop-amd64.list and http://cdimage.ubuntu.com/lubuntu/releases/17.04/release/lubuntu-17.04-desktop-amd64.list for detailed package information). Also for non-Ubuntu ISOs it depends on the availability of archived package versions as some ISOs are created with earlier GRUB package versions to those currently available. For example with Elementary OS the earlier packages are not available and it is not known where (or if) an archive copy is maintained so installing without the internet on 32-bit devices is not possible.

Suspend/Hibernate/Sleep issues

Suspend in general has been problematic on Intel Atom devices and while new patches are continually being applied to the mainline kernel it is currently not working or incorrectly working on a number of devices.

Brightness issues

Unfortunately as I don't have a tablet I cannot advise on the various screen related issues some users experience using Ubuntu. The best command appears to be 'xrandr' although its use is device specific. Many people have commented in previous posts with their solutions and I've included some of these below.

Most brightness suggestions include:

xrandr --output [device_name] --brightness floating_pvalue (0 <= x <= 1.0)

where you can determine your device by entering:

xrandr -q | grep "connected"

with the primary one being your device.

For example:

xrandr --output DSI-1 --brightness .${BRIGHTNESS}

where the variable BRIGHTNESS can take a value between 3 and 9.

Rotation issues

Some examples that users have posted include:

xrandr --output DSI-1 --rotate right
xinput set-prop <Device Touchscreen> 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1

and

xrandr -o right
xinput set-prop 'Goodix Capacitive TouchScreen' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1

Also others have reported that screen rotation during boot works with 'fbcon=rotate:1'.

Touchscreen issues

These seem to be related to rotation issues and another example of a solution includes:

xinput set-prop "Silead GSLx680 Touchscreen" "Coordinate Transformation Matrix" 1 0 0 0 -1 1 0 0 1

which can also be set when matching InputClass section in 'xorg.conf' with:

Option "TransformationMatrix" "1 0 0 0 -1 1 0 0 1"

Installation on Intel Apollo Lake Devices

On Intel Apollo Lake devices you will need to include either the '--apollo' or '-b Linuxium' or '-b rEFInd' option when respinning the ISO to enable booting having first ensured sufficient space is available in the EFI partitions (see Resize EFI partition). Note that the  '-b Linuxium' option requires that the package 'bintuils' is installed so if in doubt use the '--apollo' or include the package as another option (i.e. use '-b Linuxium -p binutils').


Reporting issues

Comments are welcome but when discussing an issue please include the name of your device and use 'pastebinit' or similar to post a URL to a copy of the output from 'dmesg' (which is basically a log of kernel messages).

To use the 'pastebinit' command (see https://help.ubuntu.com/community/Pastebinit) first install the command by entering 'sudo apt-get install -y pastebinit' and then to share the kernel messages log enter 'dmesg | pastebinit'. This will paste a copy of the output from 'dmesg' to Ubuntu's Pastebin and provide a URL to access it.

So when reporting an issue please include:
  • Outline of issue
  • Name of device
  • URL from pastebin (e.g. http://paste.ubuntu.com/23646692/)

Donate

Please donate if you find the script useful using the following link http://goo.gl/nXWSGf as everything helps with development costs.

618 comments:

«Oldest   ‹Older   401 – 600 of 618   Newer›   Newest»
wildcowboy said...

Hello, I can't figure out how to add grub boot option

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"

Do I need to type the version of kernel before? What if I don't know which version is the most recent at the moment?

kmerhack said...

Hello. Sorry for this time.
The problem was that i was using 32bit Ubuntu.

Now i have respun Ubuntu 16.04.01 but it is not working here i leave you some details.

Manufacturer: Shenzhen X&F Technology
Model: ST106
Made in China
Motherboard: Cherry trail
CPU: Intel atom x5 Z8350 1.44Ghz x 4

Android or Win8.1+ can be installed (in Option)

When i boot the usb disk in the GRUB shows i can choose "try before install" or "install" but every option doesn't show any error instead stuck in a magenta screen with no text at all.

If there is others informations you need just ask. Now the current system is Windows 10.
Thanks in advance

Linuxium said...

Thanks. I've fixed the '-s 2 GB' typo to '-s 2GB' above. Also the order for the '-s' and '-b' options (or any option) doesn't matter as the script sorts out any requirements and dependencies and always runs the options in a predefined order.

Linuxium said...

For bluetooth there are some new patches coming (hopefully) to the v4.17 kernel which should get it working on most devices so once the first release candidate comes out it might be worth trying to see if it helps.

For the 'intel_idle.max_cstate=1' you can pass this when respinning using the '-g' option (i.e. add '-g "intel_idle.max_cstate=1"' when respinning your ISO) or you can update your existing installation using the command:

sudo sed -i 's/\(GRUB_CMDLINE_LINUX=\)""/\1"intel_idle.max_cstate=1"/' /etc/default/grub

following by the command:

sudo update-grub

and a reboot will then pick up the change.

Linuxium said...

You can try respinning with the '-g nomodeset' option just to see if it will boot however you might find then other things don't work so well.

Wild Rose said...

Hello Linuxium
I have a suggestion to add this information the c-state bug to your documentation.

https://askubuntu.com/questions/803640/system-freezes-completely-with-intel-bay-trail#803649

If you want me to create a pull request please send me a link to your got repo.

kmerhack said...

Hi i managed to install ubuntu on my notebook.
But now i have a fews problems.

First there is no sound
The system boot only if i set boot parameters to nomodeset and intel_idle.cstate_max=1 but then graphics is bad. as there is no driver at all. And the screen horizontally oriented.

When installing the video is good but can't rotate, battery is managed, wifi is working but no audio.
When installed no audio, no video, no power management

Here is a pastebin of lshw

https://pastebin.com/WAmaFNkj

Raymond Day said...

On my nuvision-tw801 tablet I had Ubuntu desktop on it. It said there was a big update. Because I have not booted it in a long time. The "do-release-upgrade" Said it would take 2 hours. It did take about that long. Now it just has a purple blank disktop that I can just move the mouse around on.

So I wanted to make a new isorespin but I don't get why when I do the command it just comes back with ">" and stays there.

Don't know what is wrong.

I do this command:

./isorespin.sh -i ubuntu-17.10.1-desktop-amd64.iso -u --upgrade --atom -p "ssh openssh-server inxi lamp-server^

CTRL-C get back to the prompt.

listing is like this:

ls -l
total 1472704
-rwxr-xr-x 1 root root 5371239 Mar 19 12:54 isorespin.sh
-rw-r--r-- 1 root root 87666 Mar 29 02:22 rtl8723bs_4.12.0_amd64.deb
-rw-r--r-- 1 root root 1502576640 Mar 29 02:06 ubuntu-17.10.1-desktop-amd64.iso
-rw-r--r-- 1 root root 205 Mar 29 02:23 wrapper-linuxium-install-UCM-files.sh

Why don't it work?

Thank you.

-Raymond Day

Raymond Day said...

sorry I had a "ssh I deleted the " and got it making a .iso now.

Linuxium said...

You should add a " to the end of the command as in:

./isorespin.sh -i ubuntu-17.10.1-desktop-amd64.iso -u --upgrade --atom -p "ssh openssh-server inxi lamp-server^"

Wild Rose said...

Hi, so respun Ubuntu Budgie 18.04 iso with -g intel_idle.max_cstate=1 but still experiencing random freezes in Live USB mode. The line in grub config looks correct however I am not sure if respin.sh updates grub after adding it. Usually grub-update fails when in Live USB mode.
Any ideas ?

Wild Rose said...

I think the script only works on a Debian based system. It fails on OPENSUSE when trying to install .deb packages. Maybe that is because OPENSUSE uses RPM packages? Anyways I could never make it work on suse however it ran smooth on Debian 9. Just thought I would share this with you. It might worth adding a note on this in the documentation.

Linuxium said...

Wouldn't it just duplicate my section 'Kernel freezes' in the above documentation?

Linuxium said...

Using '-g' will include the kernel parameter when booting the LiveUSB so there is no need to do a further 'grub-update'.

The earlier kernels have been known to be particularly susceptible to kernel freezes so perhaps respin your ISO with the latest kernel?

Linuxium said...

Do you think the 'Dependencies' in the documentation above where it states 'it is expected to run the script on a Linux machine typically running Ubuntu or an Ubuntu based OS' needs to be reworded then?

Linuxium said...

Just FYI I've now put a check in a new version of 'isorespin.sh' to prevent the earlier 32-bit error.

For the sound issue can you use 'pastebinit' to post links to your 'isorespin.log' and 'dmesg' after booting?

wildcowboy said...

Hello Linuxium,

Please see my comments below.

>>>Creating a LiveUSB

I have noticed that ISOs without persistence written on a USB drive using the 'dd' command don't boot properly on my box (pipo x7s). They boot into grub command line instead. However they boot well if I write them in ISO mode using Rufus on Windows.
ISOs with persistence is another story. You can't write them in ISO mode using Rufus since it suggests 'dd' mode only for them. They boot well when written using either 'dd' or Rufus.
It might make sense to add a comment on this into the documentation.
Also, is there a way to write an ISO image on USB in 'ISO' mode on Linux?

>>>Intel Apollo Lake devices not booting after installation.

This also applies to some Intel Atom devices. In particular, I had to resize the ESP partition on my pipo x7s which is Intel Atom Z3736F which is Atom.


>>>Kernel freezes
>>>Wouldn't it just duplicate my section 'Kernel freezes' in the above documentation?

I think a short list of the processors affected by that bug will help.
There is one here:
https://askubuntu.com/questions/803640/system-freezes-completely-with-intel-bay-trail#803649


>>>Using '-g' will include the kernel parameter when booting the LiveUSB so there is no need to do a further 'grub-update'.
>>>The earlier kernels have been known to be particularly susceptible to kernel freezes so perhaps respin your ISO with the latest kernel?

Here is how the line looks like in my liveUSB: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1 persistence"
The kernel is 4.16 rc6. Looks like I am not alone: https://askubuntu.com/questions/1002850/ubuntu-16-04-freeze-randomly-not-solved
I will keep looking for a solution.

>>>Do you think the 'Dependencies' in the documentation above where it states 'it is expected to run the script on a Linux machine typically running Ubuntu or an Ubuntu based OS' needs to be reworded then?

There is a section on Arch Linux in the documentation so I assumed it will work on openSUSE too.
However, as you know, openSUSE does not have some paths required to run the script in sudoers.
Also, I think openSUSE cannot install .deb packages into the ISO. Maybe it is because SUSE uses RPM packages?

Unknown said...

Hey Linuxium thanks for your great work. Could you support debian images for apollo lake cpus?

Linuxium said...

WRT:
1. Creating a LiveUSB: If a 'dd'ed USB is not booting on the Pipo X7S but a Rufus one is then it must be specific to the Pipo device as 'dd' should always work.
2. Intel Apollo Lake devices not booting after installation: The reason for resizing the ESP partition on Apollo Lake devices is to create room to store the boot image when using the '--apollo' option. Again it must be device (Pipo X7S) specific if on your Atom device the default ESP partition is too small to include the required GRUB files.
3. Kernel freezes: I think the definitive reference point would be the actual bug log (https://bugzilla.kernel.org/show_bug.cgi?id=109051) which I've referred to in past rather than an interpretation of it in answer on 'askubuntu' (note the bug is also referenced in the answer by clicking on 'c-state bug').
4. 'Dependencies': I included Arch Linux in the documentation as someone had successfully ran the script on that distro. It is not meant to detract from the statement 'it is expected to run the script on a Linux machine typically running Ubuntu or an Ubuntu based OS'. If there are other non-Ubuntu based distros that can run the script with minor configurations then I can add them when notified about them. openSUSE will not be one of them as you rightly point out it uses a different package manager.

Linuxium said...

My script is specifically for Ubuntu and Ubuntu flavours or Ubuntu based distros primarily as kernel upgrades come from Canonical and are compiled for Ubuntu.

Unknown said...

Thanks, this is a nice script.

I am trying to load my custom dsdt table and it appears that the kernel was compiled with "CONFIG_ACPI_TABLE_UPGRADE=y" so I thought I should be able to override acpi tables using the grub bootloader but I am having trouble getting it to load.

I use the standard 01_acpi script and run update-grub2 and update-initramfs, place my custom table into /boot/dsdt.aml and it does not load. I tried entering acpi /boot/dsdt.aml into grubs emacs-like editor and it wont load that way either.

Any ideas? I do not want to compile it into the kernel.

thanks.

Linuxium said...

This is out-of-scope for my 'isorespin.sh' script. However AFAIR the approach you outline is depreciated and you have to compile 'into' the kernel.

Unknown said...

My process crashed with the error "Th '--atom' option is only compatible with an ISO that uses 'systemd'.

But I 'm using 'ubuntu-16.04.4-desktop-amd64.iso' which I thought used 'systemd'.??

Linuxium said...

'My process crashed' ... or as I like to term it 'My process gracefully exited'!

Can you clarify what OS you are using (as in running the script on) and what OS you are respinning (as in the value of the '-i' option).

Prime said...

I've used this to install Ubuntu on my old Unbranded Windows tablet and it works great. Any suggestions on what to do with the currently useless Windows button now?

Unknown said...

Hi, I am trying to make the RTL8723BS WiFi working with my Intel Atom based tablet. I have made a USB with latest 32bit XenialPup 7.5. It boots up fine, but no WiFi. How can I get it working knowing the fact that I have a Windows 10 64bit system and can use Hyper-V to get a Ubuntu VM. If you don't mind and have spare time, can you provide instructions on spinning XenialPup 32bit ISOs? Thank you

Linuxium said...

The 'Windows button' can be used in shortcut key combinations where it is known as the 'Super' key (see 'https://help.ubuntu.com/stable/ubuntu-help/shell-keyboard-shortcuts.html').

Linuxium said...

I don't support any 32-bit ISOs or Puppy Linux ISOs as I only support official desktop 64-bit Ubuntu (http://releases.ubuntu.com) and Ubuntu flavoured ISOs (https://www.ubuntu.com/download/ubuntu-flavours), Linux Mint ISOs (https://www.linuxmint.com/download.php), KDE neon ISOs (https://neon.kde.org/download), elementary OS ISOs (https://elementary.io), Peppermint OS (https://peppermintos.com/) and BackBox Linux (https://backbox.org/) ISOs.

Unknown said...

Hi! I used

isorespin.sh -i ubuntu-16.04-desktop-amd64.iso -u -l rtl8723bs_4.12.0_amd64.deb
-f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh
-c wrapper-linuxium-install-UCM-files.sh

for my Linx tablet. Now it turns off each 30seconds. Any fix please for that? Thanks!

Linuxium said...

I would use the latest point release for the 16.04 ISO and the '--atom' option for ease of use:
'isorespin.sh -i ubuntu-16.04.4-desktop-amd64.iso -u --atom'. If that keeps turning off then try the latest stable kernel as in: 'isorespin.sh -i ubuntu-16.04.4-desktop-amd64.iso -k v4.16.4 --atom'.

Pedro said...

Can you add support for ubuntu server (says its not an ubuntu flavor) and lubuntu (gives an error abou squashfs)

Linuxium said...

Unfortunately I won't be adding support for Ubuntu server ISOs anytime soon however Lubuntu desktop is supported.

Ben Straton said...

Trying to make an ubuntu 18.04 respin and still getting the errror:

./isorespin.sh: Local package 'rtl8723bt_4.12.0_amd64.deb' failed to install correctly.

Anything I can try? Im on the newest isorespin.sh (according to --check)

Linuxium said...

Can you post your 'isorespin.log' as I am not getting any problems running 'isorespin.sh -i ubuntu-18.04-desktop-amd64.iso --atom'.

Jingjok said...

Hello,

first let me say I am really grateful for what you have done, your work has helped me tremendously to set up Ubuntu on some obscure Windows 8 Atom tablets ( CSC Wisebook AU891T ) I have inherited.

I have respun the Ubuntu 16.04.4 --atom and most of the stuff (Graphics, Sound, WiFi, SD card reader, suspend) worked immediately, with the important exceptions being the touchscreen and Bluetooth. Both are basically showstoppers for my intendend application.

I was able to make the touchscreen (Silead) work by extracting the firmware from the Windows driver and copying it to the appropriate folder, then calibrating the touchscreen using xinput-calibrator.

For Bluetooth it seems I have to recompile the kernel with some change in rfkill-gpio.c, as the Bluetooth controller is not found at all, which I am trying now.

If the customized kernel fixes my issues, is it possible to run the isorespin.sh with an option to use my custom kernel deb files, instead of the -u or -k which download a kernel ?

Linuxium said...

You should use the '-l' option and pass the deb files with relative or full paths (if not in same directory) as either in a quote or with separate options for each.

Make sure you have any dependencies resolved first and that files are passed in dependency order.

E.g. (somewhat simplified):
isorespin.sh -i -l "linux-header.deb linux-image.deb"
or
isorespin.sh -i -l linux-header.deb -l linux-image.deb

Jingjok said...

Thanks ...

Bluetooth still does not work after 2 days trying to find a solution, I am aware this is not related to isorespin.sh, but I was hoping you could point me somewhere.
I have checked in Windows, where Bluetooth works, the controller is a RTL8723BS.

When I run :
user@wisebook:~$ sudo systemctl status rtl8723bsbt.service
rtl8723bsbt.service - RTL8723BS Bluetooth daemon
Loaded: loaded (/lib/systemd/system/rtl8723bsbt.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-04-29 19:19:51 +07; 9min ago
Process: 939 ExecStart=/usr/sbin/rtk_hciattach -n -s 115200 ttyS4 rtk_h5 (code=exited, status=1/FAILURE)
Process: 868 ExecStartPre=/bin/bash -c grep -qm 1 r8723bs /proc/modules (code=exited, status=0/SUCCESS)
Main PID: 939 (code=exited, status=1/FAILURE)

Apr 29 19:19:50 wisebook systemd[1]: Starting RTL8723BS Bluetooth daemon...
Apr 29 19:19:51 wisebook systemd[1]: Started RTL8723BS Bluetooth daemon.
Apr 29 19:19:51 wisebook rtk_hciattach[939]: Can't open serial port: No such file or directory
Apr 29 19:19:51 wisebook rtk_hciattach[939]: Can't initialize device: No such file or directory
Apr 29 19:19:51 wisebook systemd[1]: rtl8723bsbt.service: Main process exited, code=exited, status=1/FAILURE
Apr 29 19:19:51 wisebook systemd[1]: rtl8723bsbt.service: Unit entered failed state.
Apr 29 19:19:51 wisebook systemd[1]: rtl8723bsbt.service: Failed with result 'exit-code'.

The output seems to suggest that for some reason the serial port used for the Bluetooth module does not exist, but when I use

user@wisebook:~$ dmesg | grep -i tty
[ 0.000000] console [tty0] enabled
[ 2.446603] 00:02: ttyS0 at I/O 0x3f8 (irq = 26, base_baud = 115200) is a 16550A
[ 3.103993] tty tty51: hash matches
[ 6.186704] 80860F0A:00: ttyS4 at MMIO 0x90b1b000 (irq = 16, base_baud = 2764800) is a 16550A
[ 6.186937] serial serial0: tty port ttyS4 registered
[ 6.208549] 80860F0A:01: ttyS5 at MMIO 0x90b1d000 (irq = 17, base_baud = 2764800) is a 16550A
[ 6.208710] serial serial1: tty port ttyS5 registered

It shows that ttyS4 has been registered. There are no messages starting with 'bluetooth' in dmesg though, i.e dmesg | grep -i bluetooth does not return anything.

I have tried with different kernels up to 4.16.6, same issue with Bluetooth.

It seems the Kernel does not identify the serial Bluetooth adapter and does not load the Bluetooth module..

I would be grateful for any hints or ideas.

Linuxium said...

This is a known issue on some hardware. What device are you using?

Mece said...

Hello Linuxium,

I have a problem with the WiFi, simply doesn't work. I used your respined ISOs Ubuntu 16.04 and Bionic. I respined my own ISOs with this commands:

/home/john5/Descargas/isorespin.sh -i xubuntu-18.04-desktop-amd64.iso --atom -k daily \
-f 4345r6nvram.txt \
-c "mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt" \
-f MINIX-Z83-4_usr_share_alsa_ucm_chtrt5645_HiFi.conf \
-f wrapper-linuxium-install-UCM-files.sh

but the result is the same. I have one Minix Neo Z83-4. Can you help me?

Jingjok said...
This comment has been removed by a blog administrator.
Linuxium said...

@Jingjok: Unfortunately I have a policy:

"I've not verified the link or the external software so the comment has been removed as editing is not possible."

where I remove comments that include links to binaries even though your contribution is appreciated. Can you re-post without the final section that includes links to debs and the blog link?

Jingjok said...

Hi,

OK, I did not know that links to binaries should not be posted, so here my post without these :

My tablet is a Baytrail CSC Wisebook AU891T, it seems to be similar to the Chuwi Vx8 3G, but has a higher resolution screen.

I eventually got the Bluetooth working !

I have outlined the Bluetooth solution below, it may help some other users.


Now my two remaining issues are the 3G Modem (a Fibocom H350 with supposedly a Conexant CX20548-11Z chip) and, less important, the microphone does not work.

The 3G modem is recognized by the Kernel as a USB modem, it shows up in dmesg :
[ 9.424079] usb 1-2: new high-speed USB device number 10 using xhci_hcd
[ 9.578776] usb 1-2: New USB device found, idVendor=8087, idProduct=0911
[ 9.578782] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9.578786] usb 1-2: Product: PRODUCT_MODEM
[ 9.578789] usb 1-2: Manufacturer: FIBOCOM
[ 9.578792] usb 1-2: SerialNumber: 003580023000167
[ 9.653753] usbcore: registered new interface driver cdc_ncm
[ 9.660521] usbcore: registered new interface driver cdc_wdm
[ 9.713845] cdc_mbim 1-2:1.0: setting rx_max = 16384
[ 9.714601] cdc_mbim 1-2:1.0: cdc-wdm0: USB WDM device
[ 11.040248] cdc_mbim 1-2:1.0 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-2, CDC MBIM, da:f4:7f:50:16:27
[ 11.040337] usbcore: registered new interface driver cdc_mbim
[ 11.045694] cdc_mbim 1-2:1.0 wwp0s20u2: renamed from wwan0

Weirdly, there is a usb device with that vendor and product listed in lsusb as 'Intel Corp.' :
Bus 001 Device 010: ID 8087:0911 Intel Corp.

But it does not show up as a device when I select 'Mobile Broadband' in 'Network Connections'

Any ideas ?


Regarding the Bluetooth, the solution is that the Bluetooth part of the RTL8723BS requires two kernel patches in addition to the drivers you provided with the --atom options. Actually only one patch is required for kernel versions up to 4.14, but I was using 4.15, starting for this kernel version a second patch is needed. I found this here :
https://github.com/mongonta0716/portabook/blob/master/patch/portabook_kernel_4.15.patch

From the patches there only the patches in
/drivers/acpi/scan.c (only needed for kernel > 4.14)
and
/net/rfkill/rfkill-gpio.c
are needed for Bluetooth.

After patching, compiling the kernel and installing it, Bluetooth works reliably !

Now if I could make the 3G modem and microphone work... I would be grateful for any hints on what to try next.

Unknown said...

Thank you.
Can you help me?
How update installed kernel?

Mece said...


Hello Linuxium,

I have a problem with the WiFi, simply doesn't work. I used your respined ISOs Ubuntu 16.04 and Bionic. I respined my own ISOs with this commands:

/home/john5/Descargas/isorespin.sh -i xubuntu-18.04-desktop-amd64.iso --atom -k daily \
-f 4345r6nvram.txt \
-c "mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt" \
-f MINIX-Z83-4_usr_share_alsa_ucm_chtrt5645_HiFi.conf \
-f wrapper-linuxium-install-UCM-files.sh

but the result is the same. I have one Minix Neo Z83-4. Can you help me?

Linuxium said...

Your question is too broad to reply here as there are various ways for different circumstances. But basically it is 'apt' for a distro kernel or 'dpkg' for a downloaded mainline kernel however 'GRUB' configuration may influence the outcome as well.

Linuxium said...

Can you try locating a Linux version of the Conexant Modem CX20548-11Z driver?

Linuxium said...

What does the 'isorespin.log' file say?

cana said...

Hi, i have a bricked intel compute stick, i can boot it to ubuntu from the USB stick but obviously things like wifi arent working. I cannot reinstall windows and wanted to make some use of it using the above method. I don't have another ubuntu machine, is there any way i can respin an iso without already having an internet connected ubuntu machine? if not, is there any way some kind person could respin an iso and provide a download link, similar to the way Ian used to do with 14.04.3 (i'd even be happy just to get a link to that old ISO but i can't find it anywhere) I don't need a lot of functionality, just an internet connected browser. Thanks, cana

Linuxium said...

Try the 'atom' one from: http://linuxminipcs.com/ubuntu-18-04-lts-bionic-beaver

Mece said...

Script '/home/john5/Descargas/Minix/isorespin.sh' (version: 8.1.6) called with '-i /home/john5/Descargas/Minix/xubuntu-18.04-desktop-amd64.iso --atom -u -c "/home/john5/Descargas/isorespin.sh -i xubuntu-18.04-desktop-amd64.iso --atom -k daily \ -f 4345r6nvram.txt \ -c "mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt" \ -f MINIX-Z83-4_usr_share_alsa_ucm_chtrt5645_HiFi.conf \ -f wrapper-linuxium-install-UCM-files.sh"' ...
Work directory 'isorespin' used ...
ISO '/home/john5/Descargas/Minix/xubuntu-18.04-desktop-amd64.iso' respun ...
Bootloader 'GRUB' added ...
Kernel updated with mainline kernel version '4.17.0-041700rc4-generic' ...
Local package '/home/john5/Descargas/Minix/isorespin/rtl8723bt_4.12.0_amd64.deb' added ...
File '/home/john5/Descargas/Minix/isorespin/linuxium-install-UCM-files.sh' added ...
File '/home/john5/Descargas/Minix/isorespin/wrapper-linuxium-install-UCM-files.sh' added ...
File '/home/john5/Descargas/Minix/isorespin/linuxium-install-broadcom-drivers.sh' added ...
File '/home/john5/Descargas/Minix/isorespin/wrapper-linuxium-install-broadcom-drivers.sh' added ...
Command run ...
# /home/john5/Descargas/isorespin.sh -i xubuntu-18.04-desktop-amd64.iso --atom -k daily \ -f 4345r6nvram.txt \ -c mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt \ -f MINIX-Z83-4_usr_share_alsa_ucm_chtrt5645_HiFi.conf \ -f wrapper-linuxium-install-UCM-files.sh
/usr/local/bin/4345r6nvram.txt: /home/john5/Descargas/isorespin.sh: No such file or directory
# wrapper-linuxium-install-UCM-files.sh
./linuxium-install-UCM-files.sh: Extracting UCM files ...
./linuxium-install-UCM-files.sh: Installing UCM files ...
./linuxium-install-UCM-files.sh: Installation of UCM files finished
Respun ISO created as 'linuxium-atom-v4.17-rc4-xubuntu-18.04-desktop-amd64.iso'.

Linuxium said...

You seem to have embedded your respin command in the middle of another respin command. Just enter:

/home/john5/Descargas/isorespin.sh -i xubuntu-18.04-desktop-amd64.iso --atom -k daily -f 4345r6nvram.txt -c "mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt" -f MINIX-Z83-4_usr_share_alsa_ucm_chtrt5645_HiFi.conf -f wrapper-linuxium-install-UCM-files.sh"

Werner said...

Hallo,
a year ago I installed your finished linuxium-kubuntu-17.04-desktop-amd64.iso on my mini PC - CSL Narrow Box Ultra HD Compact with Intel® Celeron® N3450 and the sound worked over hdmi. Now I tested kubuntu 18.04, edited with isorespin.sh -i kubuntu-18.04-desktop-amd64.iso -atom (--apollo) from a usb-stick but with both versions no sound. What could I do?
Best regards Werner

Steve Abrahart said...

Can I make a 64bit unbuntu that actually boots on an old Mac book air 1,1 using respin? If anyone can manage to do this please email me. Steve@abrahart.com

Unknown said...

I do not understand how it works, but it does. I tested it on Beelink BT3 with x64 BIOS and Lubuntu 18.04.

After install I had to add "/etc/X11/xorg.conf" containing:
"Section "Device"
Identifier "Intel"
Driver "intel"
EndSection"
to stop the mouse freezing at the left of the screen.

Linuxium said...

Comment notification failed recently so I have a backlog of comments to read and reply to hence the delay with this response.

Have a look at this post 'http://linuxiumcomau.blogspot.com/2018/03/fixing-broken-hdmi-audio-again.html' and see if it helps.

Jacceko said...

I try few times to respin proper iso of Linux Mint 19 (Tara - 18.04 based) for Atom (Bay Trail), in the same scenerio as before for Linux Mint 18.3. On 18.3 all work ok, on Mint 19 I can boot iso, but when I install Mint it fail on installing grub and boot tools, and say that stop instalation because without grub you cant use it (I can't finish installation).

I Try simple: isorespin.sh -i mint.iso --atom
and other more complicated scenarios.

Please refer is it problem with isorespin or with mint 19 itself. Can you modify isorespin.sh for Mint 19 or is it bug in Mint 19 itselt?
(I try on the same machine with Xubuntu 18.04 too, and all work ok, the problem is only with Mint 19).

Jacceko

Jacceko said...

After many test server tests on Linux Mint I found out that:

# ISO Respin v.8.1.6
sudo ./isorespin.sh -i linuxmint-18.3-xfce-64bit.iso - OK
sudo ./isorespin.sh -i linuxmint-19-xfce-64bit.iso - can boot, but failed during Mint installation error: Calling: apt-install grub-efi-ia32 failed

# ISO Respin v.8.2.3
sudo ./isorespin.sh -i linuxmint-18.3-xfce-64bit.iso - can boot, failed during Mint installation error: Calling: apt-install grub-efi-ia32 failed
sudo ./isorespin.sh -i linuxmint-19-xfce-64bit.iso - can boot, failed during installation error: Calling: apt-install grub-efi-ia32 failed

Jacceko

Linuxium said...

I'll need some time to look into this and will post as soon as I have diagnosed the issue.

Unknown said...

My respin of Linux Mint 19 Tara crashes on the install of grub2 to the efi partition on my Linx 1010 and therefore, the machine will not boot up after the install. All I get is a black screen with a bare minimum grub. Live boots up fine and most things work well, with the exception of audio which worked with the 18.3 respin. I was able to upgrade from 18.3 to 19 with no issues, but in an effort to get sound working, I thought a fresh install of 19 might do the trick. Clearly it won't as the sound does not work from the Live boot. I've respun Mint 19 a few times and tried different USB stick all with the identical result. I will go back and install 18.3 and upgrade to 19 again.

Linuxium said...

This has been posted on the 'Release Notes for Linux Mint 19 Xfce':

"EFI installation - failure to install Grub
An issue in the package ubuntu-system-adjustments prevents EFI installations from completing successfully when the computer is connected to the Internet. This issue was fixed in the repositories but it still affects the ISO installation images.

Until new ISO installation images are made, please perform the installation offline (i.e. do not connect to the Internet from the live session or from the installer)."

This is also explained in their monthly news for July 'https://blog.linuxmint.com/?p=3620'.

Can you try the installation either using a respin of the newly fixed ISO (if they have now posted it) or try an offline installation with your existing respun ISO and see if it works?

Linuxium said...

This has been posted on the 'Release Notes for Linux Mint 19 Xfce':

"EFI installation - failure to install Grub
An issue in the package ubuntu-system-adjustments prevents EFI installations from completing successfully when the computer is connected to the Internet. This issue was fixed in the repositories but it still affects the ISO installation images.

Until new ISO installation images are made, please perform the installation offline (i.e. do not connect to the Internet from the live session or from the installer)."

This is also explained in their monthly news for July 'https://blog.linuxmint.com/?p=3620'.

Can you try the installation either using a respin of the newly fixed ISO (if they have now posted it) or try an offline installation with your existing respun ISO and see if it works?

Jacceko said...

After many respins and installs again if found out that:

Linux Mint 19 xfce 64bit - OFFline - FAILED on grub
Linux Mint 19 xfce 64bit - OFFline v2 - FAILED on grub
Linux Mint 18.3 xfce 64bit - OFFline - FAILED on grub
BUT:
Linux Mint 19 xfce 64bit - ONLINE v2 - OK
Linux Mint 18.3 xfce 64bit - ONLINE - OK

It is look like that after respin Mint 18.3 64bit and Mint 19 64bit don't have proper grub-efi-32 package, but when download it from repository all is OK. Can you check how to make proper iso for offline installation?

Linuxium said...

If the original Mint ISO doesn't support offline installation similar to the behaviour with Lubuntu then respinning won't alter the ISO structure to support the required packages leaving online the only way to perform the installation.

Manu said...

Hi!

I'm wondering: what is the binary taking up most of the filesize?

Linuxium said...

Can you be more specific and specify the name of the binary and its size?

Manu said...

Hi, sorry to be so vague.

I'm referring to the large number of lines following the last script line. (After line 4067)

Linuxium said...

They are the minimum set of bootloader files used by the script to support booting on Atom and Apollo devices.

Unknown said...

Hi Linuxium,

I was previously able to run this script on a raspberry pi successfully, however, your latest version that I have tried requires me to have a 64-bit (amd64 or x86_64) OS.

Is it possible to download an older version which does not have this requirement? or is it possible to remove this requirement?

Cheeeers

HKGCITY said...

lubuntu-18.04-alternate-amd64.iso' does not contain a 'squashfs' file system.。。。。。

sad

宁静致远 said...

I executed this command, but always happen wrong.
sudo isorespin.sh -I ubuntu-16.04.2-desktop-amd64.iso -u -l rtl8723bs_4.12.0_amd64.deb -f linuxium-install-UCM-files.sh -f wrapper-linuxium-install-UCM-files.sh -c wrapper-linuxium-install-UCM-files.sh
cp: cannot stat 'grub_bootia32.efi': No such file or directory
cp: cannot stat 'efi_bootia32.efi': No such file or directory
/bin/bash: line 12 gdebi: command not found
/usr/local/bin/isorespin.sh: Local package 'rtl8723bs_4.12.0_amd64.deb' failed to install correctly.
My internet not stable. That's why I failed to install ?

Unknown said...

Hi, thanks for the work.

I suceeded installing Linux Mint in my Intel STCK1A32WFC

Things work well in general except for the bluetooth

Here is a print of systemctl status rtl8723bsbt.service:

rtl8723bsbt.service - RTL8723BS Bluetooth daemon
Loaded: loaded (/lib/systemd/system/rtl8723bsbt.service; enabled; vendor pres
Active: failed (Result: exit-code) since Sun 2018-08-05 20:39:44 CEST; 12min
Process: 848 ExecStart=/usr/sbin/rtk_hciattach -n -s 115200 ttyS4 rtk_h5 (code
Process: 808 ExecStartPre=/bin/bash -c grep -qm 1 r8723bs /proc/modules (code=
Main PID: 848 (code=exited, status=1/FAILURE)

ago 05 20:39:43 ferranb-STCK1A32WFC systemd[1]: Starting RTL8723BS Bluetooth dae
ago 05 20:39:44 ferranb-STCK1A32WFC systemd[1]: Started RTL8723BS Bluetooth daem
ago 05 20:39:44 ferranb-STCK1A32WFC rtk_hciattach[848]: Can't open serial port:
ago 05 20:39:44 ferranb-STCK1A32WFC rtk_hciattach[848]: Can't initialize device:
ago 05 20:39:44 ferranb-STCK1A32WFC systemd[1]: rtl8723bsbt.service: Main proces
ago 05 20:39:44 ferranb-STCK1A32WFC systemd[1]: rtl8723bsbt.service: Failed with

Carnage Effects said...

Hello

I have respun the newest Lubuntu iso and it installed ok. Boots fine. I have wifi and audio - but no bluetooth, touchscreen or rotation. Here is the dmesg log. http://paste.debian.net/1037001

Any pointers would be great!

Thanks,

Matt

Linuxium said...

I don't maintain earlier versions of the script and the current version is designed only for Ubuntu and Ubuntu flavoured or based 64-bit distros.

Linuxium said...

That ISO is not supported.

Linuxium said...

Your command does not look right. Can you provide a 'pastebinit' link or similar to your 'isorespin.log' and also what machine, OS and version you are running the script on?

Linuxium said...

Try 'systemctl restart rtl8723bsbt.service' instead.

Linuxium said...

Which Lubuntu ISO as I've found 'cosmic' to be unstable still.

Unknown said...

Hi, thanks for investigating on this.

I've tried both the command mentioned and sudo systemctl start brcmbt.service

However when I enter the bluetooth manager in the UI it keeps saying no bluetooth adapters found..

Linuxium said...

There is a patch series that should go into v4.19-rc1 which will be available in two weeks time which fixes the issue.

In the interim you can compile the new v4.18 kernel merged with bluetooth-next to get working bluetooth.

Alternatively you can respin the latest 18.04.1 ISO with my kernel debs (http://bit.ly/linux-headers-4_18_0-linuxium_4_18_0_bluetooth_next_amd64_deb and http://bit.ly/linux-image-4_18_0-linuxium_4_18_0_bluetooth_next_amd64_deb) using the command:

isorespin.sh -i ubuntu-18.04.1-desktop-amd64.iso --atom -l linux-headers-4.18.0-linuxium_4.18.0~bluetooth~next_amd64.deb -l linux-image-4.18.0-linuxium_4.18.0~bluetooth~next_amd64.deb

and then once booted copy the BT .bin and .config files (sudo cp /lib/firmware/rtl_bt/rtlbt_fw /lib/firmware/rtl_bt/rtl8723bs_fw.bin and sudo cp /lib/firmware/rtl_bt/rtlbt_config /lib/firmware/rtl_bt/rtl8723bs_config-OBDA8723.bin) and reload the BT modules (sudo rmmod hci_uart && sudo rmmod btrtl and sudo modprobe hci_uart && sudo modprobe btrtl) to fix bluetooth.

Carnage Effects said...

Hi

Its "bionic"

Thank you for the reply, and apologies for my slow response.

It is a random Chinese tablet, unfortunately it is very generic on the outside, no model numbers etc.

As I said previously, It boots Lubuntu very quick, however no BT,touch or rotation.

https://www.youtube.com/watch?v=ny1-VuqC-Aw

Thank you for your efforts in enabling Linux users to rid these tablets of their horrid Wind0ws OS.

Linuxium said...

For BT try the solution I posted above and for touch screen etc see the pointers in my documentation.

Raymond Day said...

I have a old Dell netbook and it came with Ubuntu but could not update it because no room left on the small SSD. I think it was only 4GB in size. Any way I put a 64GB in it and install Ubuntu from it's restore CD it came with. Then I could update it and it took a long time rebooting a lot. But only updated to Ubuntu 8.04.2 hardy 32-bit.

I thought use isorespin.sh but need 32-bit and looks like they stop making 32-bit. So I did " btdownloadcurses --max_upload_rate 10 ubuntu-16.04.5-desktop-i386.iso.torrent" and downloaded But when I ran "./isorespin.sh -i ubuntu-16.04.5-desktop-i386.iso -u --upgrade --atom -p "ssh openssh-server inxi lamp-server^" it just says "is not a 64-bit (amd64 or x86_64) ISO."

So I guess there is no way to update this. It has a lot of SSH or https it don't like in this old Ubuntu 8.04.2 hardy 32-bit.

-Raymond Day

Raymond Day said...

Installed the ubuntu-16.04.5-desktop-i386.iso with out running isorespin.sh on it and all looked good but when I went to reboot it will not boot up. But sound/Wi-Fi and they touch pad looked like it all worked. Just don't boot. I guess this is what isorespin.sh would fix.

Raymond Day said...

Looked it up to make sure it is just a 32bit and it is at this link shows it:

https://ark.intel.com/products/36331/Intel-Atom-Processor-N270-512K-Cache-1_60-GHz-533-MHz-FSB

Wikipedia shows some info on it too:

https://en.wikipedia.org/wiki/Dell_Inspiron_Mini_Series
Wickapeda

So no way can install 64-bit on it.

Unknown said...

I respun the ISO following your indications and it worked!

Now I have a fully functional computer with ubuntu in my stick.

Thanks for your help

Unknown said...

Hello,

When I try "isorespin.sh -i ubuntu-16.04.1-desktop-amd64.iso --atom", it just print "Extracting ISO ...".
But if I don't use the flag "--atom", it can run normally.
What's the problem?

Linuxium said...

I can't reproduce this problem using version 8.2.4. Are you using the latest version of 'isorespin.sh'?

Linuxium said...

You could try Linux Mint as they have released a 32-bit version of their latest Linux Mint 19 Tara.

Raymond Day said...

Thank you started to download a Linux mint going slow over 10 hours it says. Hard to know what server to pick but did do a USA one were I am.

Unknown said...

is it support 32bit iso??? my Cherry Trail device only support 32bit....

Linuxium said...

It supports a 32-bit bootloader which is what your Cherry Trail device most likely uses. Cherry Trail per se uses a 64-bit instruction set.

Unknown said...

Hi, i'm having some trouble with my Asus E200HA (x5 z8350 Cherry Trail) with Conexant cx2072x. I have no audio. I tried Ubuntu 18.04.1 and respun with your lastest script with -atom options but no luck. I see in your post https://linuxiumcomau.blogspot.com/2017/03/ubuntu-16042-and-ubuntu-1704-beta-1.html made a comment about cx2072x support but no in this post. Do i have to add something? Is there any parameter that i missing? Thanks for your work and help, sorry for my bad english.

Linuxium said...

Can you try with the latest kernel? Try respinning with the command (and downloaded links) with the command posted here: http://linuxiumcomau.blogspot.com/2018/04/installing-ubuntu-on-new-device-ie.html?showComment=1535514445103#c1777636528630185596

If still no sound then post a dmesg using pastebinit after booting the new ISO so I can look at the audio messages.

Unknown said...

So... I've been trying to build this for the last 48 hours and continue to have the same error. I've followed your instructions to a T. I am using Ubuntu 16.04 LTS in a Hyper-V VM(64-bit). I have tried both Ubuntu 16.04lts and Mint 18.3 ISOs but both have resulted in the same issue. I make sure I am using "sudo" before the command and all of the files are under /usr/local/bin. I have ran apt-get install on all of the necessary dependencies and when I do apt-get -f install there are no dependencies that need updated. I have even tried to run apt-get upgrade and let it go through. The same error occurs every time.

"This package is uninstallable 9%"
"Failed to satisfy all dependencies (broken cache)"
"Reading state information... Done"
"/usr/local/bin/isorespin.sh: Local package 'rtl8723bs_4.12.0_amd64.deb' failed to install correctly

Every. Dang. Time.

Please help!




Linuxium said...

Can you use 'pastebinit' or similar to post a link to the contents of 'isorespin.log'?

Unknown said...

Sure thing. Here is one.

https://pastebin.com/CUVWLdST

I realize that's the Debian fix script ... I have tried with the regular isorespin.sh several times and it records the same log, here is one of those.

https://pastebin.com/TciJwhCN

I've also tried downloading the rtl files and using -l commands to install them locally.

I have it connected to the internet the whole time during the process. I've tried a good 20 times so far with slight variations to attempt to determine the cause.

I think I might just need to try it in VirtualBox or on a live USB unless you have any suggestions. Thanks!

Linuxium said...

The userland for your ISO (i.e. Linux Mint 18.3) doesn't support the upgrading to the latest kernel as dependencies are not being met (e.g. linux-base). I've added error reporting for when kernel upgrades fail so you can see now exactly what the issue is. You can see this if you download the latest 'isorespin.sh' version (from the link in the post above) and respin the same ISO.

However the newer Linux Mint 19 "Tara" - Cinnamon (64-bit) ISO is available and this can be upgraded with the latest mainline kernel.

Unknown said...

Thank you for this script,
if you are running this on a compressed filesystem (f.ex. ZFS) "du -s" will report the amount of disk-space used (not the size of the files, as we them), to make your script work i had to change this:


SIZE_OF_ISO_REFIND=$(du --apparent-size -s iso-refind | awk '{printf("%d\n",1024+$1)}')


if you search on that variable you will notice too that you might use this variable before it is set.

Linuxium said...

Thanks for your comment. I'll leave the 'du' line as is so anyone using ZFS can then edit the line as per your comment. However I've fixed up the (long standing) typo you pointed out and that will be available in the next release.

Raymond Day said...

I have a STK1AW32SC that one with Atom 4 core and USB 3.0 and 2.0 on the side. I installed Ubuntu desktop on it and the Plex and it works real good playing 1080 MP4 or MPV videos.

I have a home run box so can get TV but downloading it's guide has not got past 26% I am thinking a server will be better on it then a desktop.

So if I did a command like this:

./isorespin.sh -i ubuntu-18.04.1-live-server-amd64.iso -u --upgrade --atom -p "ssh openssh-server inxi lamp-server^"

Would it work on this Intel stick?

-Raymond Day

Raymond Day said...

I did try it but it comes back with:

./isorespin.sh: '/media/256GB-USB-Costco/isorespin/ubuntu-18.04.1-live-server-amd64.iso' must be an Ubuntu (or Ubuntu flavour), Linux Mint, neon, elementary, BackBox or Peppermint desktop ISO.

To bad it don't work.

-Raymond Day

Raymond Day said...

I just put the ubuntu-18.04.1-live-server-amd64.iso on a USB stick and it don't see it. I put it on a DVD I have a USB DVD drive and it still don't see it. I guess this is why no one installed a server on this stick. Have to use your isorespin.sh but it will not work with a server.

-Raymond Day

Raymond Day said...

Wow I did not know this it don't work with 32 bit ether.

./isorespin.sh -i ubuntustudio-18.04-dvd-i386.iso -u --upgrade --atom -p "ssh openssh-server inxi lamp-server^" Extracting ISO ...
./isorespin.sh: ISO '/media/256GB-USB-Costco/isorespin/ubuntustudio-18.04-dvd-i386.iso' is not a 64-bit (amd64 or x86_64) ISO.

That old net book I have after I install Linux it don't know how to boot. So I thought this my work. But I think I can just install it with out using isorespin.sh

-Raymond Day

Linuxium said...

If you want a 'server' you can first install the desktop and then use 'tasksel' to remove the desktop and install the server as you cannot respin a server ISO.

Unknown said...

Hi,

Thanks for this great script - I was able to spin the lubuntu-18.04.1-desktop-amd64.iso for my Intel gen-1 18ALFC (1G RAM/8G flash). I verified the iso works as expected by booting/running it under a VM. I then made sure the BIOS on my compute stick had USB boot enabled and used F10 to boot into my USB device, at which point I got the familar GRUB menu options. However, this is where things turned odd.

Selecting "try Lubuntu" gave me a Unity desktop instead of the LXDE desktop I was expecting. Additionally, looking at /etc/*-release shows that it's running ubuntu 14.04 (what's on the flash partition) instead of lubuntu 18.04.1. Selecting "install Lubuntu" errors out with a "this recovery medium requires ubuntu" (or something similar), again with a Unity desktop.

It seems that things are getting munged between the USB lubuntu system and the ubuntu on the flash, but I can't figure out how to disentangle them. Any thoughts?

Linuxium said...

It looks like GRUB is picking up the recovery partition instead of the USB partition. You can manually start Lubuntu through GRUB (use 'google' as too long for a comment) or 'nuke' your eMMC once booted by zapping the GPT table (try a 'sgdisk -Z /dev/mmcblk0).

Raymond Day said...

Wow that's neat just one command to easy make a desktop a server. Last time I went here to do it: https://plus.google.com/+IanMORRISON/posts/ivGrFG57CWM takes a wile but that seems to work too.

Unknown said...

That was it!

One other thing - I had to manually copy the bluetooth files to the appropriate location (documented in a later blog) to get my BT working. Also, I currently don't have sound, but I think I know the problem.

Thanks for your help!

Unknown said...

Hi,

Thanks for your great work...
...i try to install Ubuntu on a Apollo tablet...

...but there is a problem with mainline kernel v4.19...

isorespin with parameter -u will load v4.19 and than...
> Extracting isorespin files ...
> Processing bootloader/bootmanager ...
> Fetching mainline kernel packages ...
> Installing mainline kernel packages ...
> dpkg: dependency problems prevent configuration of linux-headers-4.19.0-041900-generic:
> linux-headers-4.19.0-041900-generic depends on libssl1.1 (>= 1.1.0); however:
> Package libssl1.1 is not installed.
>
> dpkg: error processing package linux-headers-4.19.0-041900-generic (--install):
> dependency problems - leaving unconfigured
/etc/kernel/postinst.d/dkms:
> Error! Bad return status for module build on kernel: 4.19.0-041900-generic (x86_64)

Is there a option to fix it and upgrade the libssl before the installation of the new mainline kernel?

PS. -k v4.18.16 works...

Regards

Linuxium said...

Mainline kernel v4.19 depends on libssl1.1 which is available in bionic as minimum so your options are to either fist respin installing libssl1.1 (and sorting out all the dependencies) followed by respinning the resultant ISO and upgrading the kernel or respinning a bionic/cosmic ISO and upgrade the kernel if you really want mainline kernel v4.19.

Unknown said...

Does is possible to make Linux Lite 4 compatible with ISORESPIN?

Linuxium said...

It is already on my 'TODO' list!

Ciberciccio said...

I anticipate I'm not skilled with linux. I could manage to respin and install ubuntu mate 18.04 on a Minix Z83-4, but I cannot fix the following issues :

- Bluetooth connected audio device give alterated sound (no usable).
- SD Card reader not working

are these two issues common to other users or I'm doing something wrong?

I tried updating the kernel to the latest release with UUKU with the hope to fix these issues, but last kernel seems not working on Minix Z83-4 bios v1.7 so I had to revert to kernel installed with the distribution.

Andy Lavr said...
This comment has been removed by a blog administrator.
Linuxium said...

I have a policy:

"I've not verified the link so the comment has been removed as editing is not possible."

where I remove comments that include links.

Linuxium said...

Minix provides an Ubuntu ISO for the Z83-4 which you could try (https://theminixforum.com/index.php?threads/neo-z83-4-ubuntu-18-04-01-build.227/).

Oursgentil said...

I post if someone could help me.
I am trying to install Mint 19 or Xubuntu 18.04 on a box PC (Cenovo PC1 - CPU Intel Z3735F baytrail - GPU Intel HD - eMMC 4.5 of 32 Go - Wifi Realtek RTL8723BS)

But at the moment, I have not even managed to have a session on a functional live USB key. At best, I managed to have a wallpaper, and the ability to launch the browser via a right click on the screen. But no icons on the desk or spot bar .... I tried Mint 19 Mate, Mint 19 Xfce, Xubuntu 18.04, all with linuxium patch, with or without kernel upgrade in v4.19.4 (instead of 4.15). On some web pages, I read nomedset, i915.fastboot = 1, ....

Anyway I can not do it

Anonymous said...

Hello, everytime I try to access the bios for Stick STCK1A8LFC it goes into grub. Is there a way to get into the bios so I can boot the usb?

Linuxium said...

Pressing 'F2' (typically multiple times) after power-on gets you into the BIOS on the STCK1A8LFC.

Zsolex said...

Hi,
I would like to respin Ubuntu(16/18) image on Ubuntu 16, but I got:

created 112666 files
created 16997 directories
created 27412 symlinks
created 7 devices
created 0 fifos
Extracting isorespin files ...
Processing bootloader/bootmanager ...
cp: failed to preserve ownership for 'mnt/efi/boot/bootx64.efi': Operation not permitted
cp: failed to preserve ownership for 'mnt/efi/boot/grubx64.efi': Operation not permitted
cp: failed to preserve ownership for 'mnt/efi/boot': Operation not permitted
cp: failed to preserve ownership for 'mnt/efi': Operation not permitted
Installing local packages ...
/bin/bash: line 12: gdebi: command not found
/usr/local/bin/isorespin.sh: Local package 'rtl8723bt_4.12.0_amd64.deb' failed to install correctly

I am using latest 8.2.6 version and I have already installed gdebi.
/isorespin.sh -i ubuntu-16.04.5-desktop-amd64.iso --atom -u /

Zsolex said...

Hi,
is it possible to get older script that can be run on Ubuntu 16?

Linuxium said...

What host OS are you using (i.e. on what OS are you using the isorespin.sh script)?

Linuxium said...

The current (latest) version of the script supports Ubuntu 16.04 LTS.

David said...

I'm getting a blank screen trying to use Xubuntu 18.10 on an RCA Cambio W101SA23T2. I get the GRUB bootscreen and then after that I get some scrolling text, the screen turns off, then comes back on and doesn't have anything displayed. I've tried the fbcon=rotate:1 and the video=efifb boot parameters. If I *don't* include the --atom option when generating the ISO I just get an EFI console trying to boot the image.

Interestingly enough if I try the Debian multiarch net installer ISO directly imaged to the USB drive without isorespin I can get to the graphical installer with no issues but didn't proceed since I really wanted to get a Ubuntu image working.

Any ideas?

Linuxium said...

You could try the 'nomodeset' boot parameter to see if it gets you further. Simply edit the boot command when you see the GRUB bootscreen and add the parameter like you likely did with 'fbcon=rotate:1'.

ximo said...

Hi,

Firstly, thx for ur great job!

I have tried both the ubuntu 16.04 and 18.04 isos on a onda v919 air (baytrail) tablet i had lying around. both worked but ive actually kept 16.04 as this one has internal audio working, 18.04 doesnt. Ive had to moove away from gnome3 ir unity anywyas as theyre too heavy for a 2gb device, system would hang coz memory would fill up so i installed mate and problem solved.

Anyways, None of the two isos have the battery stats warking, just says pluged in. Do you know any work around for this?

Linuxium said...

You could try:
1. respinning using the '-u' option to get the latest kernel that may resolve the issue
2. manually upgrade your existing kernel to the same latest kernel (download from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.0-rc4/) and see if it works.

ximo said...

well -u didnt work, it used a 5.0 krnel which didnt boot from the usb stick, got stuck in the ubuntu loading screen. ive respined it with a 4.18 kernel which i read might work (someone with fedora 29 said it did). im recharging the battery now so ill test later on.

David said...

So I can use nomodeset during boot to get to the xfce desktop at full resolution but once I get to the XFCE desktop I can't rotate the screen. The display properties say Rotation: None and the dropdown has no other options. I tried using the xrandr rotation command ("xrandr --output default --rotate right" and it says "xrandr: output default cannot use rotation "right" reflection "none"") Any ideas? I assume there's a video driver issue somewhere and am going to dig into it more, and will let you know if I find anything.

Unknown said...

Hi Yall,

Trying respin for mint on chuwi Hi8, isorespin won't run on Mint 19.1 Cinnamon without a small tweek ...

Replace line:
function CHECK_INTERNET_ACCESS {
if ( ! ping -q -w 1 -c 1 $(ip r | grep default | cut -d ' ' -f 3 | head -1) > /dev/null 2>&1 ); then
DISPLAY_MESSAGE "${0}: Access to the internet is required for downloading files."
CLEAN_EXIT
fi

With this line:

function CHECK_INTERNET_ACCESS {
if ( ! ping -q -w 1 -c 1 $(ip r | grep default | cut -d ' via ' -f 3 | head -1) > /dev/null 2>&1 ); then
DISPLAY_MESSAGE "${0}: Access to the internet is required for downloading files."
CLEAN_EXIT
fi

Otherwise it will bomb out saying you need internet, this is because the 'ip r' returns 'default via ' not 'default ' on this Version of Mint

Hope this Helps !!!

Citizen99 said...

Report on respin of xubuntu-19.04-desktop-amd64.iso by isorespin.sh Version 8.2.8
------------------------------------------------------

JFYI. Thanks for the great work :-) .

If using '--atom' the respin failed with the message:-
The '--atom' option is only compatible with an ISO that uses 'systemd'
However,
isorespin/iso-chroot/usr/lib/systemd/boot/efi/linuxx64.efi.stub
does exist.

So I replaced '--atom' by the explicit group of switches, and the respin completed successfully, PROVIDED that I did not use the '-u' switch.

If using the '-u' switch, it failed with "Cannot find mainline kernel."
(Situation as on 20 April 2019. I've no knowledge of what should happen at the Ubuntu server, so won't speculate).

Lucidream said...

On ubuntu 19.04 there's a problem after executing script: It says it can't detect EOL and doesn't execute.

Citizen99 said...

(Re-submitted to correct typo)
Did you use Version 8.2.8 of isorespin.sh (please see my posting title above) ? That version is adapted to (*)ubuntu 19.04 and addressed the EOL issue successfully for me.

Frazer said...

Hi there, does this method deal with the reached target shutdown issue that many are facing?

Linuxium said...

Can you expand on what the issue is or point to some documentation on it to explain it further?

DH said...

Hi thank you for this tool, I have managed to re-spin a couple of ISO files (18.04); I have a question about Ubuntu 19.04 when I try to re-spin this I have a message "unable to find ESO2 the process aborts at this point. 18.04 re-spins fine and I have updated my machine to 19.04 just wondering what this might be?

Linuxium said...

Check your version (isorespin.sh -v) and make sure you are using the latest version (8.2.8). You can also use 'isorespin.sh --check'.

Anonymous said...

Why doesn't it work with EOL ISO's? I don't see any technical reason for it to work one day and not the next, so shouldn't this be a warning rather than an error?

Linuxium said...

From memory EOL ISOs do not have their packages in the same location as normal ISOs so respinning breaks when trying to add things.

Hark said...

Respinning seems to have some issues...

isorespin.sh -i ubuntu-18.04.2-desktop-amd64.iso --atom
Extracting ISO ...
grep: mnt/.disk/info: No such file or directory
/usr/local/bin/isorespin.sh: ISO '/home/hark/iso/ubuntu-18.04.2-desktop-amd64.iso' is not a 64-bit (amd64 or x86_64) ISO.
umount: mnt: not mounted

isorespin.sh --check
/usr/local/bin/isorespin.sh: Version: 8.2.8 is the latest version.

Script is run on "Ubuntu 16.04.6 LTS".

Hark said...

Also:

md5sum -c MD5SUMS
ubuntu-18.04.2-desktop-amd64.iso: OK

Linuxium said...

I would re-download your ubuntu-18.04.2-desktop-amd64.iso ISO and try again as it looks like it is corrupt in some way.

Hark said...

Checksum is OK so..

Strange, but respin works on CentOS 7, local FS.

Seems probably the issue was that respinning wasn't working over NFS mount...

Hark said...

However, on CentOS 7 doesn't work because xorriso isn't compiled with libjte. Arrrgh!

EuReKa-LoS said...

Hello everyone :)

So with isorespin i was able to create a custom iso uBuntu 18.4.2 for Irulu Walknbook 3 Model W21 with kernel v4.20 (wich is supporting Z3735F processor)

To boot the USB key i need to enter "nomodeset" on grub command.
The installation work well without any issue but to boot properly the uBuntu i need to enter again "nomodeset".

Without "nomodeset" i had a blank screen, when i rotate the tablet i see a flahs of the screen wich is mean the rotation works.

The oinly issue i had is the blank screen but the tablet boot properly.
Here is the dmesg:
https://termbin.com/vr7i

I try several command grub like "nomodeset, i915.modeset=0, noacpi etc.." without succes to make the intregrated screen works.

If someone had any idea aobut this ?

Afsal said...

Will isorespin.sh work for BionicPup (puppy linux ) ?

Linuxium said...

No. You can only respin Ubuntu (or Ubuntu flavour), Linux Mint, neon, elementary, BackBox or Peppermint desktop ISOs.

Curran said...

Just want to let you know that I found this fix for the headphone jack issue on Cherry Trail devices https://bugs.launchpad.net/bugs/1824259 (search for "quirks" in there).

In summary, this fix worked for me to restore working headphones:

sudo echo “options snd_soc_rt5645 quirk=0x21” > /etc/modprobe.d/hacksound.conf

Helio said...

I'm facing this error when I use the -u flag:

dpkg: dependency problems prevent configuration of linux-headers-5.3.0-050300rc2-generic:
linux-headers-5.3.0-050300rc2-generic depends on libssl1.1 (>= 1.1.0); however:
Package libssl1.1 is not installed.

Linuxium said...

Which ISO were you trying to respin?

Mad Mod said...

Hi there!

I know this is a bit old, and there may well have been a change in the Ubuntu (and variant) ISOs that is causing this, but I've been trying to use the isorespin script (8.2.8) in the following cases:

Working from an Ubuntu 19.04 VM:
Respin Ubuntu Desktop 19.04 AMD64 iso to work with Atom (3 times from bash terminal, once from GUI isorespin)
Respin Plasma-Mobile (KDE Neon modified over Bionic) the same way, just once from bash terminal.

Working from freshly-installed (for this specifically) Ubuntu 19.04 AMD64 on a laptop:
Respin Plasma-Mobile (KDE Neon modified over Bionic) from bash.

Each time, I'm using the same options: -i "nameofiso" -u --atom.

Everything appears to go just fine until the very end, at which point it just deletes the created 'isorespin' folder, and presumably the new ISO along with it. In the case of trying the GUI, there was no outward indication that anything went wrong, and it confirmed success. The isorespin.log file also confirms success each time.

The only indication I have of what's happening is looking at the stdout from bash, for which the last few lines are:

xorriso 1.4.8 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:../../linuxium-atom-v5.3-rc4-neon-pm-devedition-gitunstable-20190218-1231-amd64.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 268g free
xorriso : WARNING : -volid text problematic as automatic mount point name
xorriso : WARNING : -volid text is too long for Joliet (28 > 16)
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Added to ISO image: directory '/'='/home/modvavet/Downloads/respin/isorespin/iso-directory-structure'
xorriso : UPDATE : 583 files added in 1 seconds
xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/home/modvavet/Downloads/respin/isorespin/isohdpfx.bin'
xorriso : UPDATE : 583 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
chown: cannot access '../linuxium-atom-v5.3-rc4-neon-pm-devedition-gitunstable-20190218-1231-amd64.iso': No such file or directory
/usr/local/bin/isorespin.sh: Respun ISO created as 'linuxium-atom-v5.3-rc4-neon-pm-devedition-gitunstable-20190218-1231-amd64.iso' ... see logfile 'isorespin.log' for details.

I don't know whether I just missed something, or what the issue may be.

Linuxium said...

For some reason it seems that the file 'isohdpfx.bin' is missing which is temporarily created each time you run the script. Can you check that you have both 'coreutils' installed and that the command 'base64' works and that you have 'unzip' installed and it also works.

Unknown said...

Thank you so much for this! It worked perfectly installing KDE Neon on an Intel Gemini-Lake N4100 Quad Core laptop.

DanielG said...

Hi,

Great tool. I've installed Ubuntu 19.04 on Schneider SCT101CTM. No need for --atom option as wifi, bt and audio works out of the box. Touchscreen and sd card not working though.

To port the touchscreen firmware for ubuntu it is required the firmware file from the stock windows installation (the windows touchscreen driver should work also). This file is named GSL_TS_CFG.h (or similar) or SileadTouch.fw. This can be done with https://github.com/onitake/gsl-firmware. Unfortunately I've deleted the stock installation

Could possibly someone with the stock installation send me this file (or the windows driver) and I'll convert the firmware for linux

Thanks and regards

Unknown said...

This was kinda my last effort to have a go at using (l)ubuntu on my Acer Switch SW5-111 baytrail crapbook. Previous attempts (using other methods) failed on audio and sometimes wifi. I respun the Lubuntu 18.04.3 desktop amd64 iso. It worked and took me about one hour to prepare and install. Though I need to tweak audio control to have the volume go up or down and I might run into other things. This small laptop is good to go for enjoying media on the web. It'll be useful for a couple more years, I hope. Good job !

DH said...

Hello. Cannot get list of available mainline kernels. What can I do please?

Linuxium said...

Go to this URL: https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=M;O=D

Valid kernels start with a 'v' without the trailing '/' e.g. 'v5.3.9' or 'v4.19.82'. See '-k or --kernel' above for further information.

gosa said...

Waking up a really old thread...

Would the respin work with the Ubuntu "Mini iso"? Lately I've been experimenting with a very bare basic system running openbox which works fine on my desktop computer (prefer a really slim system no matter how powerful the computer - leaving more resources for prooductivity). I would like to try this on my Asus T100HA, but would probalby need this script for that...

Linuxium said...

The script will not work on a 'mini iso' as it must be an Ubuntu (or Ubuntu flavour), Linux Mint, neon, elementary, BackBox or Peppermint desktop ISO.

Interestingly only a couple of lines need changing to get support for the (live) Server install image for 64-bit PC (ubuntu-18.04.3-live-server-amd64.iso) however I haven't tested any resultant respun ISOs. What options would you run the script with for specific Asus T100HA support?

Paul said...

Hey Linuxium. built a most simple iso with your script. just the iso kernel and atom updates.

seemed to go well and almost started. then i got this error.

https://ibb.co/jWjHrnn

I am sure that i am missing something simple. is my thumb drive not formatted correctly? or am i missing a setting?

Linuxium said...

Post a link to your 'isorespin.log' file so I can see what you respun. If you want more detail in that log file then respun again and add the (new and somewhat undocumented) '--debug' option.

Paul said...

So, I posted an issue getting Lubuntu up on a x5-8500. I was able to get it working with persistence and rotating kernels. I wonder if there is any optimization for the atom processor.

Linuxium said...

You can respin with the '--atom' option which automatically includes the packages, scripts and commands I recommend for a device with an Intel Atom (Bay Trail or Cherry Trail) processor. It mirrors the manual invocations of '-l rtl8723bX_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'. Note that this option requires the 'curl' package to be installed.

Unknown said...

Thanks for perfect job! But I have this issue. Pls help.

pro 14 14:48:51 t4 kernel: Couldn't get size: 0x800000000000000e
pro 14 14:48:51 t4 kernel: i2c_designware 808622C1:00: controller timed out
pro 14 14:48:51 t4 kernel: i2c i2c-0: i2c read 2 bytes from client@0x36 starting at reg 0x0 failed, error: -110
pro 14 14:48:51 t4 kernel: i2c_designware 808622C1:00: controller timed out
pro 14 14:48:51 t4 kernel: i2c i2c-0: i2c read 6 bytes from client@0x35 starting at reg 0x35 failed, error: -110
pro 14 14:48:51 t4 kernel: i2c_designware 808622C1:00: controller timed out
pro 14 14:48:51 t4 kernel: i2c_designware 808622C1:00: controller timed out
pro 14 14:48:51 t4 kernel: ACPI Error: No handler for Region [REGS] (0000000049d468c3) [UserDefinedRegion] (20190816/evregion-127)
pro 14 14:48:51 t4 kernel: ACPI Error: Region UserDefinedRegion (ID=143) has no handler (20190816/exfldio-261)
pro 14 14:48:51 t4 kernel: ACPI Error: Aborting method \_SB.PCI0.I2C7.PMI5.GET due to previous error (AE_NOT_EXIST) (20190816/psparse-529)
pro 14 14:48:51 t4 kernel: ACPI Error: Aborting method \_SB.PCI0.SHC1._PS0 due to previous error (AE_NOT_EXIST) (20190816/psparse-529)
pro 14 14:48:52 t4 kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
pro 14 14:48:53 t4 kernel: i2c_designware 808622C1:00: controller timed out

Linuxium said...

That looks like a kernel bug (or at least a limitation) with your hardware. I'd try respinning the latest Ubuntu ISO (maybe even Focal) and upgrading the kernel to the latest available (v5.5-rc1) and see if the problem is fixed. If not I'd respin the latest released Ubuntu ISO (Eoan or 19.10) with the latest released kernel (v5.4.3 mainline or Ubuntu 5.3.0-25.27 proposed or Ubuntu 5.3.0-24.26 updates) then make a note of the error from 'dmesg' (like above) and raise a bug report (see https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html and in particular https://bugzilla.kernel.org/) and hope that someone has time to look at it. What hardware was this on?

PharcydeWolf said...

Hi.

First of all, congratulations on your work on isorespin.sh and your research on linux and mini pc's.

I have recently come across your site after acquiring an ACEPC W5 Pro (Intel PC Stick, further details here https://www.iacepc.com/acepc-w5pro/). I installed ubuntu 18.04 and later tried ubuntu 19.04. On both installs, Wi-Fi was unavailable. However, Bluetooth and Sound were detected.

After this, I followed your instructions and used isorespin.sh to modify the ubuntu 18.04 distro including the options for Atom processors (--atom). I installed it and Wi-Fi ended up as unavailable.

I was wondering if you have had experience with this particular PC Stick or if further information has come up on getting Wi-Fi working.

Any information would be much appreciated. Thank you.

Linuxium said...

Do you know what wifi chip your device is using? There's a chance it is using a Broadcom one as other ACEPC devices are know to use these chips. If it is a Broadcom one then look at the section 'Wifi issues' in the documentation above and see if that helps. If you are not sure which wifi chip your device uses then boot your device and use 'pastebinit' to post a link to the 'dmesg' immediately after booting.

Moi même said...

Wooo, no offenses Sir, but what a headache for really basic linux users like i'm... Nothing simple really ? And please not to DL on MEGA because this website try to force you to install an app on your computer to DL a small 2 Go iso file. I've got neither such an issu on Distrowatch just to say. Thanks anyway i know you're doing your very best. Peace, salam, paix, shalom �� .

Linuxium said...

I have now moved my ISOs to Google drive which should make it easier for you to download.

You can find the latest Ubuntu ISO on https://linuxiumcomau.blogspot.com/2020/02/canonical-have-announced-new-point.html or on http://www.linuxium.com.au/isos.

Unknown said...

Hi and thank you for your work. How can I use isorespin with Pop_Os? It's based on Ubuntu but I tried and didn't work

Anonymous said...

Still working great in 2020, thanks!

Linuxium said...

It may be based on Ubuntu but the ISO doesn't follow the Ubuntu ISO format exactly so 'isorespin.sh' would have to be modified to support Pop!_OS. Unfortunately there isn't the demand for this at the moment.

Unknown said...

Thank you very much!

mkiss said...

Dear Linuxium,
I'm trying to respin an elementary OS iso with atom option, on Elementary. The catch is that the whole operation is offline, and I have no way of connecting it to the internet.
I tried the obvious things, and downloaded all your rtl drivers, and modified the script to get to these where I put them. But things stil don't work out. The bootia32.efi fails to cp, and the rtl things still fail.
Is there a workable procedure for offline re-spinning for atom? (even if it involves me manually modifying locations of dowloaded items?)
Thank you for all your hard work!

Linuxium said...

I am unsure as to why you are trying to respin the ISO offline. As you obviously have access to the internet given you have downloaded drivers why not use that machine to perform the respin? If it is a Windows machine then look at the section above called 'Running the script on Windows' where it outlines how you can use VirtualBox to create an Ubuntu environment for respinning. Alternatively install my ISO suitable for Intel Atom devices from 'http://linuxiumcomau.blogspot.com/search/label/ISOs' on the device you are trying to respin on and that should give you internet and Ubuntu where you can then respin the elementary OS ISO. If neither of these options are applicable then what exactly are your circumstances and what hardware/software do you have access to?

Unknown said...

I'm seeing errors where the EFI partition in the ISO rubs out of space:

Parallel unsquashfs: Using 4 processors
209815 inodes (221967 blocks) to write

[====================================================================================================/] 221967/221967 100%

created 180440 files
created 26430 directories
created 29335 symlinks
created 9 devices
created 0 fifos
cp: error writing 'mnt/efi/boot/bootx64.efi': No space left on device
cp: error writing 'mnt/efi/boot/mmx64.efi': No space left on device
cp: error writing 'mnt/efi/boot/bootia32.efi': No space left on device

This happens whether I use Ubuntu 18.04 or 20 04 iso files.

Is there something I can do to just allow them to grow? This will be on a 32GB USB drive so I have no space concerns. (the building box had 22GB of free space when I ran this).

Thanks for any advice!

Linuxium said...

Which version of 'isorespin.sh' are you using and what ISO are you trying to respin (as in the exact ISO so I can try and replicate)?

Unknown said...

isorespin 8.4.5 on Ubuntu 20.04 respinning the iso for Ubuntu 20.04. It seems like it was something to do with running the process on ZFS. I ended up inserting an EXT4 formatted USB drive and respinning it there and it didn't have that error.

One other question though - any way to test if a created image will boot using vmware or qemu or some such? By default they seem to not work even if I enable EFI. I am tuning to get things working smoothly on an old iMac and would like to reduce the cycle time by emulating things on my Ubuntu host.

Keep up the great work!

Guillaume said...

Hello,

I'm looking to add EFI support to the xubuntu-18.04.4-desktop-i386.iso, in order to be able to install it on a macmini1,1 (https://everymac.com/systems/apple/mac_mini/specs/mac_mini_cd_1.66.html) which doesn't support 64bits OSes but requires 32bit EFI to boot.
Could your script do the trick? That would be brilliant, I'm struggling to find solutions to this! :)
Thank you.

Linuxium said...

I'm not sure what the issue with ZFS is as I only use ext4. If I get a chance I'll try and look into it at some point.

I've always found QEMU too slow (probably my underpowered hardward) however when booting on VirtualBox I had to ensure that the boot option for UEFI was selected in order to boot. Does VMware have a similar setting?

Linuxium said...

You can try my suggestion from here: https://linuxiumcomau.blogspot.com/2018/03/ubuntu-16044-for-intel-atom-and-apollo.html?showComment=1583403636813#c4727645105022754410 and the subsequent couple of replies. I'd be interested in hearing how you get on.

Guillaume said...

Thank you for this suggestion.

I'm not sure I was able to follow the mentioned instructions properly. I ignored these errors running the patched script:
"
Extracting isorespin files ...
Adding 32-bit GRUB packages ...
Processing bootloader/bootmanager ...
grep: iso-directory-structure/boot/grub/grub.cfg: No such file or directory
du: cannot access 'iso-directory-structure/boot/grub/efi.img': No such file or directory
mount: //isorespin/mnt: special device iso-directory-structure/boot/grub/efi.img does not exist.
cp: cannot stat 'mnt/efi': No such file or directory
umount: mnt: not mounted.
cp: cannot stat 'efi': No such file or directory
Spinning ISO ...
"

I am able to start the resulting ISO using this procedure https://studyblast.wordpress.com/2011/08/14/guide-mac-os-x-lion-how-to-boot-a-linux-live-system-from-a-usb-drive-how-to-update-any-ocz-ssds-firmware/, ie formatting a FAT key, then putting inside a /efi/boot/ folder the available bootIA32.efi and the ISO resulting from your script, renamed as boot.iso. I then use rEFInd to boot from the key. (I haven't otherwise been able to get a key to be recognized at "Alt" press on startup.)

Anyway, launching the ISO leads me to this error:
"
efi : EFI_MEMMAP is not enabled
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown block (0,0)
CPU: 1 PID: 1 Comm: swaper/0 Not tainted 5.3.0_28-generic #30~18.04.1-Ubuntu
"

Thank you.

Linuxium said...

The error messages from respinning look correct in this instance.

Can you boot the respun ISO from the GRUB menu that you hopefully end up in if trying to boot the ISO? Use 'ls' to see the various drives - it should return output like (hd0) (hd0,gpt1) (hd1) (hd1,gpt1). Use 'ls' on each, for example 'ls (hd1,gpt1)' and find which one shows the directory 'casper' along with others - I think it should be (hd1,gpt1) but it is worth checking. Now boot by entering the commands:
set root=(hd1,gpt1)
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper
initrd /casper/initrd

Guillaume said...

If I boot the ISO from rEFInd (or at least boot the USB Key, I don't know how far I'm getting), I end up with the kernel panic I mentioned earlier. I never end up in the GRUB menu.

Using a "combined" ISO following the instructions on this AskUbuntu answer (https://askubuntu.com/questions/392719/32-bit-uefi-boot-support/715843#715843), I'm able to get to the GRUB menu. My USB Key is listed as (hd1,msdos1). I then enter these commands:

set root=(hd1,msdos1)
linux /casper/vmlinuz file=/preseed/xubuntu.seed boot=casper
initrd /casper/initrd

I don't know what these commands do, though. If they did something, I don't know what it is, I had no output. The last command ends and leaves me at the GRUB prompt.

Linuxium said...

What happens if you take the respun ISO from the 'patched' script above, 'dd' it to a USB and then boot from the USB without any other modifications? You should either get a GRUB menu or a 'grub>' prompt.

Guillaume said...

Using
sudo dd if= of=/dev/sdc1 bs=4M
I get this behavior:
- USB Key is not recognized by "Alt-boot" (pressing Alt/Option key on startup)
- it gets listed as "Boot legacy OS from unknown volume" in rEFInd
- if I try and run it, I just get a blinking underscore top left of the screen
(I get the same behavior with other rEFInd entries "Boot legacy OS from whole disk volume" and "Boot Windows (Legacy) from Untitled", and from the "Windows" Alt-boot entry. I'm still able to run Snow Leopard from the Alt-boot Mac entry, and from the the "Boot macOS from Mac OS X" rEFInd entry. Also able to run Windows from the "Boot Windows (Legacy) from BOOTCAMP" rEFInd entry.)

Linuxium said...

It seems your device is not booting from UEFI.

As one last attempt try the following.

1. Download a copy of my latest 'isorespin.sh' script (i.e. version 8.5.0).
2. Cut and paste the following text into a file 'isorespin.patch.sh':
sed -i '4164 s?EFI_CURRENT_SIZE+EFI_GRUB_SIZE?2*EFI_GRUB_SIZE?' isorespin.sh
sed -i '4174 s?sudo?sudo mkdir -p mnt/efi/boot \&\& sudo?' isorespin.sh
sed -i '4178 s?sudo?sudo mkdir -p iso-directory-structure/EFI/BOOT \&\& sudo?' isorespin.sh
sed -i 's/amd64/i386/g' isorespin.sh
sed -i 's/refind_x64.efi/refind_ia32.efi/' isorespin.sh
sed -i 's/bootx64.efi/bootia32.efi/' isorespin.sh
sed -i 's/drivers_x64/drivers_ia32/' isorespin.sh
sed -i 's/shimx64.efi/bootia32.efi/' isorespin.sh
sed -i '3911 a \
sudo cat <<+ | sudo tee -a iso-directory-structure/boot/grub/grub.cfg > /dev/null \
if loadfont /boot/grub/font.pf2 ; then \
set gfxmode=auto \
insmod efi_gop \
insmod efi_uga \
insmod gfxterm \
terminal_output gfxterm \
fi \
\
set menu_color_normal=white/black \
set menu_color_highlight=black/light-gray \
\
menuentry "Try Ubuntu without installing" { \
set gfxpayload=keep \
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --- \
initrd /casper/initrd \
} \
+' isorespin.sh
3. Make the 'isorespin.patch.sh' executable by entering:
chmod 700 isorespin.patch.sh
4. Run the 'isorespin.patch.sh' to patch 'isorespin.sh' with:
./isorespin.patch.sh
5. Respin your i386 ISO with the '-b refind' option:
./isorespin.sh -i ubuntu-16.04.6-desktop-i386.iso -b refind
6. Write the resultant ISO to a USB using 'dd':
dd if=linuxium-rEFInd-ubuntu-16.04.6-desktop-i386.iso of=/dev/sdX bs=4M
where X is the drive letter of your USB
7. Boot the USB and select 'LINUXIUMISO' from the rEFInd menu

Hopefully this will boot the ISO allowing you to then complete an installation.

Guillaume said...

Thank you again.

Alas, I didn't see any LINUXIUMISO entry in the rEFInd menu.
One entry gave me hope as it showed the Tux penguin. It was labelled "Boot EFI\boot\grub.efi from 8 MiB FAT volume", but loading quickly led to this error:
rEFInd - Booting OS
Starting grub.efi
Using load options ''
Welcome to GRUB!
error: no such partition.
Entering resucde mode...
grub rescue> _

Another entry showed an image with three colored circles (green, blue and fushia), and was labelled "Boot fallback boot loader from 8 Mib FAT volume". When choosing this one, it stopped at what I believe was a REFInd error, showing this message very briefly:
Error: load error while (re)opening our installation volume
Error: Media changed while scanning the EFI\boot\drivers_IA32 directory

I had to run it several times to be able to see the error completely, but I don't see how any "media" could have changed. My USB key seems to have worked consistently recently...

Thanks a lot for your investment though. This one's a tough one for me, I'll report here if I manage to get through!

Linuxium said...

Getting to 'grub rescue>' is a success as now you should be able to boot after using a combination of the 'ls' command, 'set root' command, 'linux' and 'initrd' commands as explained in my comment above (19 April 2020 at 20:00) and finally the 'boot' command to boot.

Guillaume said...

Success indeed!

I hadn't even tried the 'boot' command the first time I accessed the GRUB prompt, I didn't know it was needed. :)
The GRUB rescue prompt didn't recognize the 'linux' or 'initrd' commands. Or are they files that can only ran from the right directory, and I was somewhere else? Dunno. Anyway, I first tried to use the 'combined' ISO mentioned in an earlier comment, as that had got me to a (not rescue) GRUB prompt. It started to boot but got stuck at "/init: line 7: can't open /dev/sr0: No medium found" and "(initramfs) unable to find a medium containing a live file system". I tried some of the pointers from this page, to no avail: https://bugs.launchpad.net/ubuntu/+bug/500822.
Then I saw on this page some instructions that might help me get through the GRUB rescue prompt: https://www.linux.com/training-tutorials/how-rescue-non-booting-grub-2-linux/.

But long story short, trying your rEFInd respun iso again offered me the GRUB menu "Try Ubuntu without installing". Yay!

Even though it displayed "no suitable video mode found / Booting in blind mode" during boot, I landed on the Xubuntu desktop and am able to launch the install process.
I'm now searching the web for more info on how to properly do the install, because I already have four partitions on /dev/sda (one EFI, one HFS+ with Snow Leopard, one NFTS with WinXp and one last NTFS that I used to use for data, big enough to hold Xubuntu). I read somewhere that there were limitations on the number of partitions that could be recongnized by I-can't-remember-which important boot program... And also about installed Linuxes on Mac that still weren't recognized at boot time.

One big step though, thank you very much. Gonna head over that Donate button sometime soon! Bear with me, I'm not rich ;)

Linuxium said...

I missed the 'insmod' command when explaining from memory and really should have both looked up and refered you to https://help.ubuntu.com/community/Grub2/Troubleshooting#grub_rescue.3E-1

Anyway I'm glad the rEFInd respun ISO booted as this is what I'd hoped for. Also I'd be very careful with installation and almost certainly use manual partitioning and maybe replacing GRUB with rEFInd when installed to obviate the need for a '40_custom'.

Guillaume said...

Choosing "Other" during install, I now plan on avoiding to delete any existing partition, just selecting /dev/sda3 for install and formatting it to ext4. Too bad for /swap/ partition, I read it's not mandatory anymore. this way I hope to move as few things as I can to the way partitions are right now. I see there's a /sys/firmware/efi directory in the "file system" of my live boot.
Manual partitioning page during install states it's gonna install Xubuntu's "boot program" to /dev/sda. Is there a risk it's gonna mess with the /dev/sda1 partition currently called EFI? I'm afraid of managing to install but losing the rEFInd boot choices at the same time. Is this what you're referring to when suggesting to replace GRUB with rEFInd?

Linuxium said...

For swap you can create a 'swapfile' using 'fallocate' on your Xubuntu's filesystem after installation and then use 'mkswap' and then add it to your '/etc/fstab' or use 'swapon' to manually activate it.

I'd also take a copy of your EFI partition (/dev/sda1) just to be safe however installing GRUB should just create or update an 'ubuntu' directory on it. At least if you have a backup you can always see what has changed later if nothing boots.

Finally depending on how GRUB detects your various OS across the partitions you might want to additionally install rEFInd as the main boot manager if GRUB fails to detect and boot some of your OS. I'm only suggesting this as I don't know how well GRUB and Mac OS X (as you are on Snow Leopard) play together.

Guillaume said...

Victory. :)

I backed up /dev/sda1 as suggested, then ran the install without any issues. The GRUB menu misses Windows Xp though, but I don't think I'm gonna do anything about it, unless I ever need to see the Xp logo again. :) I'm reporting in case this ever helps someone else. The Apple "Alt-boot" still shows Mac OS X and Windows entries, but fails to load Windows.

Thank you again!

Linuxium said...

Installing rEFInd as the main boot manager may fix the Windows XP boot issue. Equally if you don't need Windows XP for the time being it may be safer to leave things as they are. Many thanks for the donation.

Zamana said...

Hi!

I'm struggling for a few days, trying to use isorespin.sh to build an Ubuntu 16.04 ISO (it need to be this version) for an "alien" mini pc called Braview BP-01. It's an ATOM thing.

The problem is that the version of grub-efi-ia32* searched for is never found... I already tried all the 7 releases of the version 16.04 (from the original to the .6), and none of them works...

Is there something that I can change in order to get those packages installed?

Thanks.
Regards.

Linuxium said...

First I need some clarification. Does respinning 'ubuntu-16.04.6-desktop-amd64.iso' work (i.e. respinning works) but it then fails to install properly (as the version of grub-efi-ia32* searched for is never found)?

toomuchtv said...

Thank you for this tool. Please note that it seems liblz4-tools no longer supports unlz4 and the script will error out. I did a find and replace on the script to replace 'unlz4' with 'lz4 -d' and it works like a charm.

Linuxium said...

Whilst the package 'liblz4-tool' now selects 'lz4' it still includes 'unlz4'. However I do note that the 'synopsis' says when writing scripts it is recommended to always use lz4 with appropriate arguments (lz4 -d) instead of the name unlz4 etc. so I'll update my script accordingly.

RealLinuxRookie said...

Hi Lunixium thank you for this! It works perfectly on my Lenovo Yoga Tablet 10' 2 running windows on a z3735f atom chip. I followed all of your instruction and get a Lubuntu working like a charm!

«Oldest ‹Older   401 – 600 of 618   Newer› Newest»

Post a Comment

All comments now moderated so that spam can be deleted.