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   201 – 400 of 618   Newer›   Newest»
E said...

Hi,

Thanks for your work on this useful tool.

I am trying to boot Linux Mint 18.2 using Live USB on a Jumper Ezpad 6 Pro tablet with Apollo Lake Celeron N3450. I have tried respinning both with and without the --apollo flag, as well as just with -b rEFInd instead of --apollo. I have also tried updating the kernel to latest with -u flag. I can't get the tablet to boot.

When using rEFInd, it loads the menu but when I try to boot Linux Mint, it says "Invalid loader file, Error: not found while loading vmlinuz". The vmlinuz file is in /casper/vmlinuz on the Linux Mint image. It is the 64 bit image, so should be the right CPU architecture for the tablet.

Any ideas why it would be invalid or not found?

I can't get Grub to work either (just get the cursor in top left), even though some (such as this article [1]) have been able to boot Grub on Apollo Lake devices.

Would appreciate any suggestions.

[1]: https://www.cnx-software.com/2017/02/07/installing-ubuntu-17-04-on-chuwi-lapbook-14-1-apollo-lake-laptop/

E said...

Also, I should mention I was using Etcher. I will try with dd, but in my experience Etcher does the same thing as dd but with useful extra features like automatically verifying after writing the image and reporting errors in the media while writing.
Assuming Etcher is not a problem, I wonder if you want to add a recommendation in this documentation. It is very easy to use, works on Windows, Linux and Mac and adds features (such as those I already mentioned) over a low-level tool like dd to ensure quality of the write. https://etcher.io

Unknown said...

The grub behavior you stated happens when the UEFI / BIOS OS Slelect (prolly mispelled Select?) isn't set to Linux as per the article link you gave. Perhaps it has something to do with the UEFI / BIOS settings? Have you tried reading the article you linked, maybe that'll give hints?

E said...

Thanks for your reply. My UEFI settings doesn't have that "OS Slelect" setting on the boot page. Being mispelled, it looks like a custom setting that the manufacturer has added. I wonder what it does.
I found a OS setting on the South Bridge configuration page with lots of options including Android and Linux but that doesn't seem to change boot procedure for me.

Unknown said...

Hmm.. I assume you've done all necessary UEFI/BIOS configurations (fast boot, secure boot, etc.) since you can boot to GRUB, albeit with problems, also that you've already boot the plain iso (without isorespin modifications)? Were there any differences with the plain and modified iso?

Regarding rEFInd, Rod Smith has mentioned that many tablets come with 64-bit CPUs and 32-bit EFIs and that rEFInd can only boot like-bit-depth kernel[1] hence its probable that your rEFInd can't detect a fitting kernel for your current setup. Maybe you would like to try 32-bit isos? That is if you don't mind that.

Also, maybe you could try similar programs as Etcher like Rufus and the likes? Perhaps there are some differences?


[1] https://askubuntu.com/questions/958437/proper-installation-procedure-for-external-kubuntu-install-and-refind

Linuxium said...

I've not used 'Etcher' so I'll put it on my TODO list.

Linuxium said...

@E: Are you using a previously downloaded version of the rEFInd boot manager software or letting my 'isorespin.sh' script install it automatically? Also can you try some of the Apollo ISOs I've posted in recent posts to see if they work?

Linuxium said...

Building ISOs with 'rEFInd' version 0.11.1 (the current default) results in the error message 'invalid loader file!' when attempting to boot.

Version 0.11.0 works correctly and because my 'isorespin.sh' script first looks in the current directory for the 'rEFInd' boot manager files before downloading them from the internet if not found it means a specific version can first be downloaded and used automatically when the script is run.

I recommend downloading the file 'refind-bin-0.11.0.zip' from 'https://sourceforge.net/projects/refind/files/0.11.0' in the directory where you are running 'isorespin.sh' ('wget https://sourceforge.net/projects/refind/files/0.11.0/refind-bin-0.11.0.zip/download -O refind-bin-0.11.0.zip' and unzip it ('unzip refind-bin-0.11.0.zip'). Then remove the downloaded file ('rm refind-bin-0.11.0.zip') so that it does not create a conflict when running the script. Check that you just have a directory called 'refind-bin-0.11.0' containing the 'rEFInd' boot manager files. Then run the 'isorespin.sh' script (either as './isorespin.sh' or '/usr/local/bin/isorespin.sh') with the required options to respin your ISO as required.

Unknown said...

A little research and my tablet has Clover Trail, which won't work with Linux

Unknown said...

And it's 32-bit

Linuxium said...

Unfortunately I can't help with Clover Trail devices as I don't have any for development and testing.

Unknown said...

Hello Linuxium,

I "respinned" a Lubuntu ISO for notebook YEPO 737S.

All works except sound.

I read an old post and installed

https://github.com/plbossart/UCM/tree/master/bytcht-nocodec
sudo cp -rf ../bytcht-nocodec /usr/share/alsa/ucm

and set proper permission
sudo chmod a+xr /usr/share/alsa/ucm/bytcht-nocodec

Now I have a new audio profile (bytcht-nocodec) in sound settings, but after many test no sound to hear :-(


dmesg says:
http://paste.ubuntu.com/25866922/

aplay -L
http://paste.ubuntu.com/25867060/

inxi -Frmxx
http://paste.ubuntu.com/25867080/

In windows 10 sound works...

I hope these info can be usefull for solving sound problems

these are the Windows 10 driver settings:
-------------------------------------
-------------------------------------
-------------------------------------
Intel SST Audio Device (WDM)
-------------------------------------
property values:

Device instance path:
ACPI\808622A8\1

Capabilities:
VALUES
00000030
CM_DEVCAP_UNIQUEID
CM_DEVCAP_SILENTINSTALL

-------------------------------------
Power data:
Current power state
D0
power capabilities
00000099
PDCAP_D0_SUPPORTED
PDCAP_D3_SUPPORTED
PDCAP_WAKE_FROM_D0_SUPPORTED
PDCAP_WAKE_FROM_D3_SUPPORTED
-------------------------------------
Power state mapping

S0 -> D0
S1 -> D1
S2 -> D2
S3 -> D3
S4 -> D3
S5 -> D3
-------------------------------------
Hardware Ids
ACPI\VEN_8086&DEV_22A8
ACPI\808622A8
*808622A8
-------------------------------------
Status

0180200A
DN_DRIVER_LOADED
DN_STARTED
DN_DISABLEABLE
DN_NT_ENUMERATOR
DN_NT_DRIVER
-------------------------------------
-------------------------------------
-------------------------------------

Linuxium said...

See my suggestions in 'http://linuxiumcomau.blogspot.com.es/2017/10/fixing-broken-hdmi-audio.html'?

Unknown said...

Hi,

First thank you for all your work. I have been struggling 24 hours to make your isorespin script work but i can't pass that error:

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
/bin/bash: line 12: gdebi: command not found

I searched and found one of your reply to that error

sudo sed -i 's?if \[ -f \(iso-chroot/etc/resolv.conf[^ ]*\) ]; then?if \[ -f \1 -o -h \1 ]; then?' isorespin.sh

and did the command a dozen time, even changing the location of the script just to see but it still happen. I tried with Ubuntu 17.10 iso but also with 16.04 so i'm kinda lost here.

Thx

Unknown said...

Hi,

I can't get wifi working on my device(Jumper Ezpad 6). I already tried running manually ./isorespin with --atom, without it, tried your live distros and still no wifi.

There is the dmesg : https://pastebin.com/WdTadxz9


Can you help me please ? thanks

Vondr said...

Hi,

I can't create bootable image. Tried refind-bin-0.11.2, refind-bin-0.11.0. Ubuntu-17.10, 16.04.3. It seems lacking partition table.
Your linuxium-apollo-ubuntu-17.10-desktop-amd64.iso booting well.

What I do:
./isorespin.sh -i ubuntu-16.04.3-desktop-amd64.iso --apollo
https://pastebin.com/9YydMnyE

Sam302 said...

I'm having an issue in hoping someone can help me with. I successfully created a respun iso and created a USB with dd. When I try to boot from the USB after the Lubuntu splash screen it drops back to the installed Ubuntu recovery partition. I can't use the live USB at all. I can't seem to figure out a way to capture any error messages and or logs. Any ideas?

Sam302 said...

Update: I realized I could close the splash screen to see what's going on. The only potential issue I can see is an error saying grep: /root/cdrom/preseed/lubuntu.seed: no such file or directory. Not sure how to resolve that.

Wild Rose said...

Hello,

I am wondering if there is a documentation on how to run linuxium-install-broadcom-drivers.sh post installation. I tried copying the scipt to the home directory and execute but all I got were errors "brcmfmac43241b4-sdio.txt file not found" etc.

Wild Rose said...

Also, here is the list of files from https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+archive/upstream/master/brcm.tar.gz:
bcm4329-fullmac-4.bin brcmfmac43143.bin brcmfmac43241b0-sdio.bin brcmfmac43242a.bin brcmfmac43340-sdio.bin brcmfmac43362-sdio.bin brcmfmac43455-sdio.bin brcmfmac4354-sdio.bin brcmfmac4356-sdio.bin brcmfmac43602-pcie.ap.bin brcmfmac4371-pcie.bin
bcm43xx-0.fw brcmfmac43143-sdio.bin brcmfmac43241b4-sdio.bin brcmfmac4329-sdio.bin brcmfmac4334-sdio.bin brcmfmac4339-sdio.bin brcmfmac4350c2-pcie.bin brcmfmac43569.bin brcmfmac43570-pcie.bin brcmfmac43602-pcie.bin
bcm43xx_hdr-0.fw brcmfmac43236b.bin brcmfmac43241b5-sdio.bin brcmfmac4330-sdio.bin brcmfmac4335-sdio.bin brcmfmac43430-sdio.bin brcmfmac4350-pcie.bin brcmfmac4356-pcie.bin brcmfmac4358-pcie.bin brcmfmac4366b-pcie.bin

and here is the list of files the script accessing:

sudo cp -n brcmfmac43241b4-sdio.txt /lib/firmware/brcm
sudo cp -n brcmfmac43340-sdio.bin /lib/firmware/brcm
sudo cp -n brcmfmac43340-sdio.txt /lib/firmware/brcm
sudo cp -n BCM43341B0.hcd /lib/firmware/brcm
sudo cp -n brcmfmac4330-sdio.txt /lib/firmware/brcm
sudo cp -n brcmfmac43430-sdio.bin /lib/firmware/brcm
sudo cp -n brcmfmac43430-sdio.txt /lib/firmware/brcm
sudo cp -n brcm/* /lib/firmware/brcm
They don't much. Am I missing something?

Linuxium said...

Did you follow the section 'Wifi issues' above to copy across the 'brcmfmac43241b4-sdio.txt' file from your Windows installation?

Linuxium said...

Try following the section 'Wifi issues' above.

Linuxium said...

Which version of 'isorespin.sh' are you using? Enter 'isorespin.sh -v' if unsure.

Linuxium said...

What does the 'isorespin.log' contain?

Linuxium said...

Your devices uses the Broadcom wifi chipset so try following the section 'Wifi issues' in my documentation (see link above top right).

Linuxium said...

Post a link (pastebinit) to your 'isorespin.log' file so I can see how you have respun the ISO.

Wild Rose said...

>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.

Does that mean that rEFInd simply not working on 32-bit bootloader devices and grub being used instead? Or that is still rEFInd but it is just not graphical?

Linuxium said...

No it just means that my script only uses the 64-bit rEFInd driver where required.

Unknown said...

Hi there, are versions older than ubuntu 16.04 supported?
I need to use ubuntu 14.04 or older.
I've tried 4 versions: 12.04.5, 14.04.4, 14.04.5 & 16.04.3 with the same command
./isorespin -i ubuntu-X.iso -u --atom
12.04.5 failed with error on installing mainline kernel.
Both 14.04.4 and 14.04.5 failed at installing with error and redirect me to liveUSB boot.
Inside the booted linux of 14.04.4, it won't log me in. It shows the desktop for a brief moment before asking me for the password again. I tried with 'ubuntu' username and blank password.
As for 14.04.5, I can login fine but the installation is not responding, whether I double click the icon at the desktop or the menu. Nothing happens.
Only 16.04.3 works, the version 17.10 downloaded from one of your post works too.

By the way the hardware I'm using is Beelink z83-ii with the processor Atom z8350.

Unknown said...

Thanks for a great tool, but . . .

I used respin on a Mint 18.2 Mate .iso --without the -u option -- and the install seemed to work fine until it asked me for name, id, password, etc. Then it kept telling me to shutdown. No way around it, and it's repeatable.

So I tried "isorespin.sh -i ~/1-downloads/ubuntu-17.04-desktop-amd64.iso -u"
No error messages, and the install got as far as "Installing the grub2 package" and then froze. Activity wheel stopped spinning. Also it never asked for the wifi password, and didn't connect. Running it live seems OK, apart from network and sound.

Don't know what to try next.

[This is an ASUS X205TA. I opted to overwrite the whole SSD and use LVM.]

Kadir Tuncer said...

Hi,

i have installed lubuntu 17.04 on the WFC model and all is working well, except if I don't attach it to an HDMI display (also if attach it to a DVI display with an adapter) I don't have a frame buffer. Any idea how i can enable it manually? Thanks!

--Kadir

Kadir Tuncer said...

I have managed to enable the frame buffer (using KMS), but that still didn't solve my actual problem: Videos won't play correctly. They either don't start at all, or just fast forward. Have you ever tried to play a video (like on youtube) on a headless compute stick?

Unknown said...

Got the ASUS X205TA netbook working with Lenuxium's excellent software. Can't thank you enough. Using Ubuntu 17.04 Mate.
Only the sound and the wifi are not working. Any ideas?
This is the command I used . . .
/home/weyland/0-lenb/exec/isorespin.sh Version 7.3.5
--iso "/home/weyland/1-downloads/ubuntu-mate-17.04-desktop-amd64.iso"
--update (v4.14)
--local-package "/home/weyland/1-downloads/rtl8723bs_4.12.0_amd64.deb"
--file "/home/weyland/1-downloads/linuxium-install-UCM-files.sh"
--file "/home/weyland/1-downloads/wrapper-linuxium-install-UCM-files.sh"
--command "wrapper-linuxium-install-UCM-files.sh"

Unknown said...

All of those information for linux users. But what about Windows users? I just need a lubuntu iso to try my atom z3735 pc. But I don't even linux command prompt. This is really annoying :(

Linuxium said...

This isn't a limitation of my 'isorespin.sh' script but an issue in that you are trying to use the latest kernel with an outdated user space. You will need to update the X stack as well if you want to use a later kernel. See 'https://wiki.ubuntu.com/Kernel/LTSEnablementStack' for more information.

Linuxium said...

LVM has in the past been problematic even with an official ISO. I'd first try installing without LVM and only once everything is working look at LVM having first confirmed it works using an official ISO.

Linuxium said...

Try without the UCM files and see if audio then works (i.e. just try respinning with '-u' option and ignore --atom or rtl8723bs and UCM) as I've seen a recent comment suggesting that the UCM files stop audio working on your particular device.

For wifi are you sure it is the RTL8723BS chip and not a Broadcom one?

Linuxium said...

I've post example ISOs which can be downloaded and tried by both Windows, Linux and indeed any user. Unfortunately I don't have the bandwidth to host every ISO with every respin option. Fortunately respinning an ISO is quite simple and can be done using a LiveUSB running from one of the posted example ISOs.

If you need an example Lubuntu ISO for your Atom device then take a look at '
http://linuxiumcomau.blogspot.com.au/2017/09/artful-aardvark-beta-1-and-mainline.html' just to get you started.

Linuxium said...

There is an official Intel firmware update that allows the WFC model to be booted headless. Are you then using VNC or similar to attached to the device to view videos?

Unknown said...

Already tried that and nothing. For wifi i bought a adapter and solved the problem.

Now the thing is audio, any tips on how to get it ? already tried all your solutions from your posts and couldn't managed to get it working

Thanks

Linuxium said...

I missed that your device is using 'brcmfmac43430a0-sdio.bin' firmware. You will need to find this file from your Windows installation and copy it to the '/lib/firmware/brcm' directory on Ubuntu.

Linuxium said...

If that doesn't work try respinning with the '-u' option and the '--atom' option as I've just modified the UCM script and the change may help with audio on your device.

Unknown said...

That's what I'm searching for. Thank you :)

Unknown said...

Thanks, Linuxium. I've now got the wifi working by doing this (from 'ubuntuforums'):

[Sat 2017-11-25 16:49:11]~>> ls /sys/firmware/efi/efivars | grep nvram
nvram-74b00bd9-805a-4d61-b51f-43268123d113

sudo cp /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 /lib/firmware/brcm/brcmfmac43340-sdio.txt

Reboot.

I'm a bit reluctant to try your latest UCM suggestion in case it breaks the wifi solution. Way out of my depth here.

Unknown said...

Hi again,

Almost everything works flawlessly. But I'cant change update source from my country, Turkey to Main server. The server select menu doesn't select what I click and thick boxes doesn't clickable. I can't change what is selected. Is it a known bug?

Linuxium said...

Try editing '/etc/apt/sources.list' manually and then running 'apt update'.

Linuxium said...

If you respin with the '-u' and '--atom' options the '--atom' will include the wifi firmware and also allow you to try my modified UCM script to see if it fixes audio. You can try it from the LiveUSB rather than installing it.

Unknown said...

Hi,
Tried your version 8.0.1 of this script on Linux mint, to build a Ubuntu 17.10 and got this error:

cmd: ./isorespin.sh -i ubuntu-17.10-desktop-amd64.iso --atom -u

..
Installing local packages ...
/bin/bash: line 12: gdebi: command not found
./isorespin.sh: Local package 'rtl8723bt_4.12.0_amd64.deb' failed to install correctly.
..

I also tried your fix-isorespin script, and ran with the deepin-isorespin, and I got the same error.

I have curl installed.

Running the line from within the script:

wget --timeout=10 "https://drive.google.com/uc?export=download&id=$(sudo curl -I https://goo.gl/Sb4zG7 2> /dev/null | grep '^Location' | sed 's?.*/??' | sed 's?.$??')"


Results in a downloaded file. But the name of the file is:
Saving to: 'uc?export=download&id=0B99O3A0dDe67X1BhcV9IVmdaWDA’

Any ideas?

Linuxium said...

Maybe it is something to do with how Linux Mint is configured as I've just run the exact same respin on Ubuntu and it worked. What do you get from running:
ls -l /etc/resolv.conf
and
cat /etc/resolv.conf
If the file '/etc/resolv.conf' does not exist can you enter:
echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
and then try running the script again?
Regardless of whether that worked if '/etc/resolv.conf' previously did not exist can you then enter:
sudo rm /etc/resolv.conf
just to put things back as they were.

Linuxium said...

Now I'm confused. You have a machine you originally ran the 'isorespin.sh' script on and created a LiveUSB and you have a machine (ASUS X205TA netbook) which you then booted with the LiveUSB? I'm suggesting on the original machine you respin your ISO with option '-u' and '--atom' and create a new LiveUSB and use to boot your ASUS X205TA netbook.

Unknown said...

Hi again,
So I switched to Ubuntu 17 instead of Mint - same error.

So I also tried downloading all the items from above, and ran this :

./isorespin.sh -i ubuntu-17.10-desktop-amd64.iso -u -l rtl8723bt_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

And surprisingly, this has the same fault! So it doesn't appear to be the downloading/curl issue. Looks like the rtl deb package isnt happy being inserted into 17.10 (or 17.10 wont accept it)

Linuxium said...

I don't know what is causing your error however respinning 'ubuntu-17.10-desktop-amd64.iso' with '-u' and '--atom' works. What is the output from the commands I asked about? Are you behind a proxy server or direct internet connection?

Unknown said...

From your commands, I did not have a resolve.conf (all is supplied from my dhcp server)

I downloaded the links you provided manually with no problem. My dns server is working, but I will add google and try again.

I ran a simple: ./isorespin.sh -i ubuntu-17.10-desktop-amd64.iso -u

This worked fine. It has downloaded the latest kernel and created an ISO.

Side question: Can I now use the newly created "linuxium-v4.14-ubuntu-17.10-desktop-amd64.iso" to try to apply the --atom flag to? (just to save on time downloading and processing the kernel part really?)

Linuxium said...

I'm not suggesting changing your DNS server but just creating the '/etc/resolv.conf' file temporarily as a work around for the script to try and resolve the 'gdebi' issue.

Unknown said...

The ubuntu 14.04.5 I downloaded included LTS already though?

Unknown said...

Note: Base OS = **17.10** and using the 17.10 ISO as the 'donor'

Hi Linuxium. So I checked out the script a bit more, and now I realise its a chroot jail. So, okay I know what should be happening now.

First, all the atom items are downloaded fine (deb/scripts etc - outside jail).
Then, /etc/resolv.conf is copied into chroot. My resolv.conf would normally be "nameserver 10.X.X.53" and "search mydom.tld"

So changing that and confirming it works outside chroot is fine. (nslookup google.com)

However, I still cannot get network (or most likely DNS) inside the jail. I've experienced this in the past, and the most making /etc/hosts /etc/hostname /etc/resolv.conf is usually more than sufficient. (modifications to /etc/apt/sources.conf repos aside)

I found a 'zilla : https://bugs.launchpad.net/cubic/+bug/1723568

And this : https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1712283

So, when I have a moment I may try again - but it looks like someone was trying to be a little clever by using 127.0.0.'53' to identify something and various static links are not 'correct'.

Unknown said...

I tried this command but the result won't boot. The BIOS appears and I select USB for Boot, but it just goes to the system already installed . . .

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

Unknown said...

I tried this command but it won't boot. The BIOS appears and I select USB for Boot, but it just goes to the system already installed.
isorespin.sh -i ubuntu-mate-17.04-desktop-amd64.iso -u --atom

Unknown said...

I tried this command but it won't boot. The BIOS appears and I select USB for Boot, but it just goes to the system already installed.
isorespin.sh -i ubuntu-mate-17.04-desktop-amd64.iso -u --atom

Linuxium said...

If you don't have a '/etc/resolv.conf' do you have a '/run/systemd/resolve/resolv.conf' and if so can you temporarily copy it to '/etc/resolv.conf' and run the script to see if it has any effect?

Alternatively if that doesn't work try creating an '/etc/resolv.conf' file containing 'nameserver 127.0.0.53' in it (see '/lib/systemd/system/systemd-resolved.service.d/resolvconf.conf') and see if that works.

Unknown said...

I did that, but it will not boot.

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

Unknown said...

Hi there,
thanks a lot for this really cool script. Works great with Ubuntu 17.10. I use it for minicomputers with Kodi. Do you think you can also adapt it for LibreELEC?
Thanks for your good work, Edi

Unknown said...

So I decided to dive into the chroot, and see what was properly going on:
Its permissions -

https://www.imgpaste.net/image/Cox4v
https://www.imgpaste.net/image/CoT9i
https://www.imgpaste.net/image/CoyuI
https://www.imgpaste.net/image/Co4h6
https://www.imgpaste.net/image/CoYs4

I will find time to download and spin up a 16.04 and do it from there. Obviously (well of course obviously) 17.10 is not ready as a base OS!

(I did what you suggested - but I just fixed the links for resolv as per the bugzilla)

Unknown said...

I've replied here several times, and it tells me the replies were published, but they don't appear.

Kadir Tuncer said...

Hi,

so i found out that it wasn't related to the video driver at all, but rather audio. After turning the internal stereo output off, videos are playing at normal speed again.
I have the stick attached to a projector and i use Teamviewer to control it remotely. The audio is output via an external bt dongle, the internal one won't pair with the speakers.

Kadir Tuncer said...

Hi,

so it was the audio driver, that was causing videos to not play correctly. After turning off the internal stereo output, videos are working correct again.
The stick is attached to a projector, which I control with Teamviewer. And the audio is output via an external bt dongle, as the internal one wouldn't pair with the speakers.

Kadir Tuncer said...

Hi,

replying to the comment wouldn't work, so I am posting it here again, just in case someone else has the same problem:

so it was the audio driver, that was causing videos to not play correctly. After turning off the internal stereo output, videos are working correct again.
The stick is attached to a projector, which I control with Teamviewer. And the audio is output via an external bt dongle, as the internal one wouldn't pair with the speakers.

Linuxium said...

You need to click on 'Load more...' at the bottom of the page (several times on some pages) to display all the comments.

I've just uploaded a revised version of my script that should fix you boot issue. You will need to download my 'isorespin.sh' script again (from the top of the page) and respin your ISO.

Linuxium said...

I've just uploaded a revised version of my script that should fix you boot issue. You will need to download my 'isorespin.sh' script again (from the top of the page) and respin your ISO.

Linuxium said...

Kernel version and X stack compatibility is probably a question you should ask on Ubuntu forums to get a definitive answer.

Linuxium said...

No because LibreELEC is not an Ubuntu flavour or derivative and so is incompatible with my script.

Linuxium said...

What happens when you temporarily create the file '/etc/resolv.conf' with the contents of 'nameserver ' just to run the respin?

Linuxium said...

Your reply worked but you maybe didn't see it as you need to click on 'Load more...' at the bottom of the page (several times on some pages) to display all the comments.

As audio is over HDMI when running headless it won't be possible. Does respinning with '-g "modprobe.blacklist=snd_hdmi_lpe_audio' help at all?

Linuxium said...

As audio is over HDMI when running headless it won't be possible. Does respinning with '-g "modprobe.blacklist=snd_hdmi_lpe_audio' help at all?

DigitalSignageMY said...

Hi,
The isorespin.sh script will generate an iso with the necessary modules. Does it mean that it can be generated on any machine and not necessary the actual device? Also may I know once I have installed on the device, how do I upgrade my kernel in the future? Will upgrading the kernel using app like Ukuu break the modules?

Unknown said...

Hi,
Anybody got this script 'linuxium-32bit-patch.sh'. I have installed linux on my T02 but I am learning linux. I just want to learn how 32 bit grub was installed. Any help in this regards will be highly appreciated.

Thanks

Linuxium said...

That script has been superseded by my 'isorespin.sh' script so it is no longer available as it is not supported.

GRUB for either a 32-bit or 64-bit architecture is installed using standard packages supplied with the distro using the package manager 'apt'.

Entering 'apt search grub-efi' will show packages suitable for an EFI installation including both the 64-bit (amd64) and 32-bit (ia32) versions. The command 'apt depends ' will further show package dependencies required for installation.

I recommend you read 'https://help.ubuntu.com/community/Grub2' which provides good documentation on GRUB and includes links on installation etc.

Linuxium said...

Yes you typically run 'isorespin.sh' on a host machine and respin an ISO for a target machine. You can upgrade your kernel using any method you prefer.

Bob Zangief said...

Thank you so much for your work on this.

However, I'm hoping you can help me with a small problem...

I'm building a Linux Mint 18.3 MATE iso with the '--atom' and kernel update arguments, and everything goes completely smoothly, and the system boots fine.

Furthermore, everything SEEMS to be working perfectly. However, when I try to connect to my wifi network, the system refuses to do so and asks me for my password again as if the WPA password was incorrect. I've checked and reentered the password dozens of times... it's definitely correct... would you possibly have any suggestions on how to proceed? I'm a bit desperate...

Linuxium said...

I'd need to know what device you are using and a copy of a 'dmesg' would also help in diagnosing the issue.

Bob Zangief said...

Of course... thank you so much. The device is called a GPD Win equipped with an Intel Atom X7-8750.

dmesg output is extremely long, but I'll send a copy to your e-mail at linuxium@linuxium.com.au.

Linuxium said...

You are missing the wifi firmware for the GPD Win. Respin your ISO and add 'https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+/f151f016b4fe656399f199e28cabf8d658bcb52b/brcm/brcmfmac4356-pcie.txt' to '/lib/firmware/brcm' as part of your respinning (download the file first then add to your respun ISO using the '-f' option and move to the correct location using a '-c' option).

Bob Zangief said...

You are an FOSS saint, sir! Thank you so much!

Bob Zangief said...

I'm so sorry to bother you again, but I've been at this for a few days now... I can get the brcmfmac4356-pcie.txt into the /usr/local/bin/ directory, but the -c script file I'm using to move it into the /lib/firmware/brcm directory is failing... It should just be a -c to an sh file with an mv command to move it, correct? As in:

isorespin.sh -i linuxmint-18.3-mate-64bit.iso --atom -f brcmfmac4356-pcie.txt -c "movefile.sh"


mv /usr/local/bin/brcmfmac4356-pcie.txt /lib/firmware/brcm/brcmfmac4356-pcie.txt

Correct?

aburni said...

The respin method has been nothing but a hassle for me. I don't understand why you didn't leave up a functional ISO for download, while making this an optional method for those who want to make their own. It may have been outdated, but it was still more recent than what comes on these devices.

I'm very thankful for your work, please don't misunderstand. I just wish you had left some of us with a simpler option.

Unknown said...

Hey, @linuxium. i was trying to install ubuntu on my bay trail based tablet(z3537f telecast x80h). When booting up, the system will turn to black screen if i don't use the nomodeset parameters. (if i used it the graphic acceleration will not work.) I tried lots of methods to fix this problem like patch the kernel, or install a older version of ubuntu. None of them work. I can't figure out what caused this problem.

Linuxium said...

Unfortunately I don't have the bandwidth to host every ISO with every respin option as everyone wants something slightly different.

And with the latest issue (see http://linuxiumcomau.blogspot.com.au/2017/12/lenovo-bios-issues.html) I've had to remove even the few examples I had posted.

Try to persevere respinning your own ISO and ask questions if totally stuck or you can't understand my documentation (see http://linuxiumcomau.blogspot.com.au/2017/06/customizing-ubuntu-isos-documentation.html).

Linuxium said...

Try 'isorespin.sh -i linuxmint-18.3-mate-64bit.iso --atom -f brcmfmac4356-pcie.txt -c "mv /usr/local/bin/brcmfmac4356-pcie.txt /lib/firmware/brcm"'. Note the double quotes (") around the '-c' option are required but the single quotes (') around the whole command are not.

Linuxium said...

Which kernel version are you adding to the respin?

Unknown said...

I didn’t add any kernel. I download the original iso from Ubuntu site and burn it in a usb disk. Then replaced the 32 UEFI boot file. It’s was successful loaded grub. But after the Ubuntu logo showed, it turned to a black screen. Can you recommend some kernel for Bay Trail chips? Thanks!

Linuxium said...

OK which ISO did you respin with what command? Can you post the log file?

Unknown said...

Hello,

Thanks for this work. I have tried respinning a 17.10 iso several times with mixed results. but now i am unable to run isorepin.sh due

"/usr/local/bin/isorespin.sh: Lock file exists ... wait for running instance of isorespin.sh to complete or remove '.isorespin.sh.lock' and restart."

conceptually confused about lock files. any help would be much appreciated
robert

Linuxium said...

In principle the lock file is to prevent multiple respins being run concurrently as you should only run one respin at a time. If you are getting a message about the lock file existing it either means that you are trying to respin in parallel (normal warning) or it means that something has seriously gone wrong whilst respinning an ISO and your system may be in an unstable state (exception warning).

I recommend you reboot and then go back to the directory you are running 'isorespin.sh' from and see if the lock file is still there (enter 'ls -l .isorespin.sh.lock). If the lock file still exists then remove it with the command 'sudo rm .isorespin.sh.lock' and then you can run 'isorespin.sh' again.

VPS Hoster said...

Hi,
The file linuxium-install-broadcomm-drivers.sh (529.5Kb) appears to have extraneous lines at the end, following:
sudo rm -rf broadcom
echo "$0: Installation of Broadcom finished "
exit

Is this correct, as it appears it may be binary code, not shell script?

Linuxium said...

Yes it is a script and what you are seeing are the Broadcomm wifi firmware files the script installs.

VPS Hoster said...

Embedded binaries in bash scripts makes me think of hacked php files. :-/ If it is as intended then I can live with that. :-)
Thanks for all your work!

Sven Meyer said...

I own a Yepo 737A Notebook with N3450 CPU (Celeron Apollo Lake)which came with Windows 10.
I respun Ubuntu 17.10 with options for Apollo, Kernel update and boot install ... andit worked liked a charm!

Script '/usr/local/bin/isorespin.sh' called with '-i ubuntu-17.10-desktop-amd64.iso -u --apollo' ...
Work directory 'isorespin' used ...
ISO '/home/sum/DOWNLOAD/ISO/ubuntu-17.10-desktop-amd64.iso' respun ...
Bootscript 'Linuxium' added ...
Kernel updated with mainline kernel version '4.15.0-041500rc5-generic' ...
File '/home/sum/DOWNLOAD/ISO/isorespin/update-modules' added ...
Respun ISO created as 'linuxium-apollo-v4.15-rc5-ubuntu-17.10-desktop-amd64.iso'.

I could boot from USB and installed Ubuntu in a separate Partion with the idea to end up with a dual boot system.

Problem:
When I boot from the internal SSD, no grub shows up, it boots directly into windows.
Even if I select the Ubuntu partition within the BIOS as a first boot device, it boots into Windows right away.

How can I fix it?

Linuxium said...

Embedded binaries as binaries probably isn't the nicest of ways so I've changed them to be embedded as text.

Linuxium said...

Does 'Intel Apollo Lake devices not booting after installation' (see above) apply to you?

randombloggeruser said...

Hello,
I try to run latest Ubuntu 16.04.03 LTS on my Goclever Insignia 1010 Win (Intel Atom Z3735G).

I created the ISO and copied it to USB:
sudo isorespin.sh -i ubuntu-16.04.3-desktop-amd64.iso --atom
sudo dd if=linuxium-atom-ubuntu-16.04.3-desktop-amd64.iso of=/dev/sdb bs=4M

Grub starts (version 2.02~beta3), but for any entry I get:
error: invalid magic number
error: you need to load the kernel first

Any idea what can be the problem?

Unknown said...

I was trying to respin a lubuntu 17.10 ISO but got stuck with the script throwing me various error messages:

# uname -a
Linux notebook 4.14.12-041412-generic #201801051649 SMP Fri Jan 5 17:00:41 UTC 2018 i686 athlon i686 GNU/Linux

# isorespin.sh -i lubuntu-17.10-desktop-amd64.iso -u --atom
Extracting ISO ...
Parallel unsquashfs: Using 2 processors
110152 inodes (115171 blocks) to write

[=========================================================/] 115171/115171 100%

created 86818 files
created 13955 directories
created 23301 symlinks
created 7 devices
created 0 fifos
Extracting isorespin files ...
Updating bootloader/bootmanager ...
Fetching mainline kernel packages ...
Installing mainline kernel packages ...
umount: /home/dplasa/Downloads/isorespin/iso-chroot/dev: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
rm: cannot remove 'iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove 'iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove 'iso-chroot/dev/shm': Device or resource busy
rm: cannot remove 'iso-chroot/dev/pts': Device or resource busy
/usr/sbin/isorespin.sh: Cannot find mainline kernel.
rm: cannot remove '/home/dplasa/Downloads/isorespin/iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove '/home/dplasa/Downloads/isorespin/iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove '/home/dplasa/Downloads/isorespin/iso-chroot/dev/shm': Device or resource busy
rm: cannot remove '/home/dplasa/Downloads/isorespin/iso-chroot/dev/pts': Device or resource busy
root@notebook:/home/dplasa/Downloads# isorespin.sh -i lubuntu-17.10-desktop-amd64.iso --atom
/usr/sbin/isorespin.sh: Work directory 'isorespin' already exists.
root@notebook:/home/dplasa/Downloads# rm -rf isorespin
rm: das Entfernen von 'isorespin/iso-chroot/dev/mqueue' ist nicht möglich: Das Gerät oder die Ressource ist belegt
rm: das Entfernen von 'isorespin/iso-chroot/dev/hugepages' ist nicht möglich: Das Gerät oder die Ressource ist belegt
rm: das Entfernen von 'isorespin/iso-chroot/dev/shm' ist nicht möglich: Das Gerät oder die Ressource ist belegt
rm: das Entfernen von 'isorespin/iso-chroot/dev/pts' ist nicht möglich: Das Gerät oder die Ressource ist belegt

After that I cannot remove the temporary isorespin folder and have to reboot. Thankful for any bit of advice :)

Lundan said...

Would it be possible to add Linux-Lite as a supported distro? It's an Ubuntu-based distro and I think it would run well on the Compute-Stick.

Linuxium said...

Can you run just 'isorespin.sh -v' and check that the version is the latest at 8.0.5. If not download the script again and respin your ISO as this looks like a bootloader issue.

Linuxium said...

I'll put it on my TODO list to take a look at it.

Linuxium said...

Try running the script again but make sure you let it finish before doing anything else (e.g. in another window) as it looks like another process might have interfered with the respinning.

Unknown said...

I'm on 8.0.5 - I let it run and didn't touch the keyboard at all. Still nothing. But threw some line numbers today ;-) maybe this will help you!

$ sudo id
uid=0(root) gid=0(root) Gruppen=0(root)

$ isorespin.sh -i lubuntu-17.10-desktop-amd64.iso -u--atom
/usr/sbin/isorespin.sh: line 866: /dev/null: Permission denied
/usr/sbin/isorespin.sh: Cannot create logfile 'isorespin.log'.

Linuxium said...

What OS and version are you running the script on? And where are you running the script from and do you have write permission for that directory?

Pu241 said...

Hi Linuxium

I've respun mate 17.10 and it's almost perfect on my little teclast x3 plus, which doesn't seem fussed about the bios bug. I'm struggling with touchscreen drivers though and I see they're baked into your kernels/ISO's. Or were till the bios bug surfaced.
I've been trying without success so far. You haven't got a script up your sleeve to add the silead drivers, or just some sage advice to reproduce that element please? It'll likely save me a bunch more time/breaking stuff! Or have I missed something already in your guides about that?

Any help would be really appreciated!

Unknown said...

$ cat /etc/issue
Ubuntu 16.04.3 LTS

I ran the script in ~/Downloads. I also ran it with sudo, that should give me perfectly fine permissions.

However after I run the script (with errors) I cannot reomve the respin temp folder and I also have to reboot the computer since almost every command (like du, ls, ...) will trigger a burst of error messages (something with ssh-askpass !?)

Jiemeb said...

Hello,
I installed on my BT3 Pro various linux using your script but I never sound on hdmi.
Can you tell if the mesg on dmesg "[drm] HDaudio controller not detected, using LPE audio instead" is normal and what drivers must be present for the sound to work
thank you for your help
http://paste.ubuntu.com/26368523/

Unknown said...

Is anyone experiencing audio or video issues with Lubunto 17.10 on an Intel Compute Stick?
I'm not terribly Linux savvy, but I was able to use isorespin.sh to create linuxium-atom-lubuntu-17.10-desktop-amd64.iso from lubuntu-17.10-desktop-amd64.iso, and to install it on two flavors of Intel Compute Stick. One is an Intel Pocket PC, Atom Quad-core AtomTMZ3735F 1.33GHz, 2Gb memory, 32Gb SD storage and 2 USB 2.0 ports, originally with Windows 10 Home installed. The second is a STK1AW32SC, similar, but with one USB 2.0 and one USB 3.0. When I boot up the former connected to an Element HD TV, it seems to think there are two screens connected (no task bar displayed on the visible "screen") and audio has an echo, as though two audio sources are trying to play. When I boot the latter, it does not have the dual monitor issue (task bar is displayed), but there is no audio. I don't know if this is a bios issue on each stick, or something else.
Any suggestions for troubleshooting and resolving either issue are greatly appreciated.

boonhau1608 said...

I was a happy user of the Intel® Compute Stick STK1A32SC (Atom Z8300 Cherrytrail) with your previous Ubuntu Mate 16.04 Linuxium image till 3 days ago when I did the kernel upgrade via the Software Updater GUI to 17.03. After the upgrade, no USB keyboard or mouse will work. Curiously USB thumb drive appears to still be detected.

Anyway, I'm back to Linuxium and see that it's now moved to the 'isorespin.sh' method. I created an ISO using the Linux Mint 18.3 MATE edition, choosing only the Atom (Baytrail & Cherrytrail) and upgrade to mainline kernel options. Then I wrote the ISO on to a USB thumb drive and installed it on the Compute Stick.

Unfortunately, the audio is not working. It looks like it should as Sound Preferences show that the Intel HDMI Audio hardware is detected. But no matter what settings I select, there is no audio output at all.

Can I get some pointers on where I might have gone wrong? Thanks a bunch!

Linuxium said...

You can try 'sudo modprobe -r silead' followed by 'sudo modprobe silead' and then check your 'dmesg' for any issues like missing firmware which Google will solve.

Linuxium said...

The only issue I can think of is some 'locale' issue. If you set 'export LC_ALL=C' and then run the script does it work?

Linuxium said...

That message is fine as you want to use the Intel HDMI/DP LPE Audio driver on your device. Have you looked at 'https://linuxiumcomau.blogspot.com.au/2017/10/fixing-broken-hdmi-audio.html'?

Linuxium said...

Have you looked at 'https://linuxiumcomau.blogspot.com.au/2017/10/fixing-broken-hdmi-audio.html'?

Linuxium said...

Have you looked at 'https://linuxiumcomau.blogspot.com.au/2017/10/fixing-broken-hdmi-audio.html'?

Unknown said...

Thank you, that was it! Also, I was able to resolve the multi screen / one monitor issue with the xrandr utility.
xrandr --query to see what is active and then
xrandr --output {good} --auto --primary --output {bad} --off
Now, when I run a nodejs electron app that looks for available monitors, it finds the single monitor once, not twice.

Linuxium said...

Great. Good to hear.

boonhau1608 said...

Many thanks, that has gotten the audio working! Strangely in Sound Preferences -> Hardware, the HDMI Audio device no longer appears but the audio still works.
A side question here, if it's not too much trouble, is there a way to configure a 2.1 speaker? The guide from above seems like it is for stereo only.

Pu241 said...

Hi and thanks for your reply.

I appreciate this isn't an isorepsin issue but I was thinking it might be one you've come across since I note you say you've used some of Hans de Goede's patches in kernels you've posted in your isos.

The first complaint in dmesg is:

[ 6.318209] iwlwifi 0000:01:00.0: enabling device (0000 -> 0002)
[ 6.324213] silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply vddio not found, using dummy regulator
[ 6.324234] silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply avdd not found, using dummy regulator

And the internet seems to suggest that Hans de Goede patches are possibly the answer:

https://patchwork.kernel.org/patch/9531463/

Which I think means I need to be compiling the kernel locally in order to use that patch now your isos are down due to the bios bug cockup.

Am I probably barking up the wrong tree again here?

Linuxium said...

Try making sure that 'HDMI' audio is selected in 'Sound Preferences' and not 'Analogue' before making the 'sink' change to ensure you are picking up the full UCM file.

Linuxium said...

The 'dmesg' entries you show above are not significant on their own and do not indicate an issue for which the patch you reference fixes. Post your full 'dmesg' using 'pastebinit' or similar so the actual issue can be diagnosed.

Unknown said...

Hello,

I run the following command:
>./isorespin.sh -i elementaryos.iso -u --apollo
> unmount /dev/sdb/
> dd if= of=/dev/sdb bs=4m

I put the usb stick on my Ezbook 3 pro (with refind bootloader) and choose the elementary os entry.

But doesn't start the graphical installer, after some cli lines (like Linux startup) start a terminal interface like:
> (initramfs)

What's wrong? Thanks for replies.

Linuxium said...

The '--apollo' doesn't use rEFInd so when you boot your USB with the respun ISO you should bring up the device's BIOS bootloader and select booting from the USB. Having said that your 'dd' command doesn't include an input file so is that just a typo?

Pu241 said...

Thanks again for your time. Very generous indeed.
I did a clean install to make sure there's no noise in there. Dmesg piped into pastebinit as you suggested:

http://paste.ubuntu.com/26432415/

The machine is a teclast x3 plus.

Hope it makes some sense to you!

Unknown said...

Hello,
when I try to respin an Ubuntu iso for atom in GUI when I insert for kernel update v14.14 I have a msg error that it is not found in the list.Instead for v.14 it is ok.
The kernel is on the index and is the last stable kernel.
Why the request don't work ?
Thanks

Linuxium said...

You need to get the 'mssl1680.fw' firmware from 'https://github.com/edward-p/mssl1680-firmware' and apply using the instructions from there.

Linuxium said...

Are you specifying the kernel as 'v4.14.14' as 'v14.14' is not map to a valid kernel?

Pu241 said...

Thanks - I got no cigar yet though. I'd been trying various firmware files off github but with no success so far.

The dmesg from your suggestion is as below:
http://paste.ubuntu.com/26465584/

You got any more ideas?

Pu241 said...

And dmesg fie with firmware extracted from my win10 install by same method:

http://paste.ubuntu.com/26466128/

Pu241 said...

Had another go at that and it's break through. I've extracted a file from my windows firmware and I've got uncalibrated touch!

Thanks

Linuxium said...

Well done!

Eric said...

isorespin.sh is supposed to work for Mint, but I tried:
/usr/local/bin/isorespin.sh -i /tmp/linuxmint-17.3-cinnamon-64bit.iso -u --atom
And got the error:
Selecting previously unselected package rtl8723bs.
(Reading database ... 198686 files and directories currently installed.)
Preparing to unpack rtl8723bs_4.12.0_amd64.deb ...
Unpacking rtl8723bs (4.12.0) ...
dpkg: dependency problems prevent configuration of rtl8723bs:
rtl8723bs depends on systemd; however:
Package systemd is not installed.

dpkg: error processing package rtl8723bs (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
rtl8723bs

I also tried without the -u option, same error.

Linuxium said...

Linux Mint 17.3 (Rosa) is based on Ubuntu Trusty which is 'init' based rather than 'systemd' so the wifi package ('rtl8723bs_4.12.0_amd64.deb') cannot install as it has a dependency on 'systemd'. You can either respin Linux Mint 18 (Sarah) or later or drop the '--atom' option and manually add the WiFi/BT userland files if required.

Unknown said...

I may be a little misguide in where I'm asking for this advice, but I've spun an ideal image with this script and now want to clone it to other Intel Compute Sticks.

I successfully cloned the image and then restored Clonezilla's backup to another compute stick. The stick would not boot (no bootable device found), so I ran Ubuntu Live and to run boot-repair which allowed the stick to boot.

Now I'm not sure if this process is the easiest way to achieve the clone process.

Does anyone know an easier method?

Unknown said...

Hi,
First thank for your amassing job.
I'm trying to install a linux on Lenovo MIIX 310-10ICR. I'll try to ".isorespin -i *.iso -u --atom" on all debian distribution...(ubuntu, linuxmint...) but I've never have sound and card reader support.
Which version can I try ?

Autor said...

Hello,
I tried to create an iso image yesterday using your 'isorespin.sh' script on live cd ubuntu

('isorespin.sh -i lubuntu-17.10.1-alternate-amd64 -u -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 –atom').

Failed due to lack of free space :/

Today I prepared the second pendrive to mount but when I tried to install the required packages (isoinfo mkdosfs etc.) I saw 'unable to locate package' with each package.

I made sure that all the repositories were added (main, universe, restricted, multiverse), then I used 'sudo apt-get update' but it did not help.

I tried on VirtualBox and Hyper-V but the same. I do not know what is wrong :(

Could you create and share me the latest Lubuntu (alternate) for STK1AW32SC?

I would be very grateful :)

Linuxium said...

I'm not sure how the Clonezilla's backup handles the NVRAM entries so you might need to recreate using 'efibootmgr' on each device first. Alternatively 'dd' the whole eMMC from one device to another and then if required randomize the UUIDs, device name and of course update the NVRAM entries.

Linuxium said...

It is not a device I have any experience with however I recommend you check your device community and support channels as there has been discussions on BIOS issues and Ubuntu compatibility for this device in the past.

Linuxium said...

What version of Ubuntu is your LiveUSB?

Autor said...

I tried Ubuntu 16.04.3, Lubuntu 16.04.1, Lubuntu 16.04.3, Lubuntu 17.10.1, Mint 13 and Kali (I do not remember the exact version). Most of them, apart from live cd, were installed.

Autor said...

I also tried a live cd with persistence. Do you have any solution?

Unknown said...

Hello, and thanks for your script. I found your blog after posting this distress message on StackExchange, https://unix.stackexchange.com/questions/422879/debian-install-on-an-intel-apollo-lake-cpu. I used isorespin with 'isorespin -i kubuntu-16.04.3-desktop-amd64.iso --apollo -u', which completed successfully; the new iso image booted correctly, and I installed Kubuntu without a hitch, but on reboot I get kicked to the usal ash shell of busybox with the following error message:

mce: [Hardware Error] CPU 0: Machine Check: 0 Bank: 4 e600000000 020408
mce: [Hardware Error]: TSC 0 ADDR fef5d340
mce: [hardware Error]: PROCESSOR 0:506c9 TIME 1518170874 SOCKET 0 APIC 0 microcode ic

Do you have a suggestion? Thank you

Autor said...

Ok, I fixed it

Unknown said...

Hi, can you share the emmc 5.0 patch you used for making the kernel detect the Intel Compute's internal storage?
Thanks

Javier said...

Hello!
Your tool (isorespin) seems like a great way to take Linux everywhere!
I have tried to generate an ISO image from Manjaro and Ubuntu, without success.
Apparently the image is generated correctly until the end, when this message ends the process: ./isorespin.sh: cannot update bootloader/bootmanager.
Can you give me a clue how to solve it?

Thank you!

Unknown said...

great job i probe it this procedure and works thanks a lot
you are a genius

Linuxium said...

OK. Good to hear.

Linuxium said...

Have you checked for this 'https://linuxiumcomau.blogspot.com.au/2017/12/resize-efi-partition.html'?

Linuxium said...

I've not used any patch for "Intel Compute's internal storage" so can you explain in more detail what you mean?

Linuxium said...

Manjaro isn't supported. If you get any errors respinning an Ubuntu ISO can you include the log file and 'isorespin.sh' version number so I can understand the issue better?

Javier said...

Of course!
Same problem on Ubuntu and Kde neon
All packages required for running are installed.

isorespin.sh: Version: 8.0.7

isorespin.log
Script './isorespin.sh' called with '-i neon-devedition-gitstable-20180207-1057-amd64.iso' ...
Work directory 'isorespin' used ...
ISO '/tmp/neon-devedition-gitstable-20180207-1057-amd64.iso' respun ...
Cannot update bootloader/bootmanager.

Unknown said...

I know this is an old thread, so I hope someone can help! I am trying to install this on a Nuvision tablet but it won't detect my USB drive at all unless I try to install rEFInd, and then it will only put me in a GRUB rescue prompt. Any ideas? That prompt doesn't seem to do much and I can't exit it or anything.

Linuxium said...

KDE neon have changed their default compression format and no longer use the same as Ubuntu et al ISOs. I may drop neon support given the effort to fix won't match the demand for neon. As a workaround try running the following 'sed -i "3307s/Packages.gz/Packages.bz2/" /usr/local/bin/isorespin.sh' before respinning your neon ISO.

Linuxium said...

I am not sure where you are getting your install list from as they are the commands and not the actual packages. Try 'sudo apt -y install bc curl klibc-utils iproute2 genisoimage dosfstools' followed by 'sudo apt -y install squashfs-tools rsync unzip wget findutils xorriso'.

Linuxium said...

This is actually the current 'isorespin.sh' documentation thread and is still very much 'active'.

Was the Nuvision tablet affected by the Intel SPI driver bug (affecting Ubuntu 17.10) and what ISO have you tried respinning and with what options?

Linuxium said...

It is just the lock file preventing you from installing new packages probably because it is checking what needs to be upgraded in the background. Try installing again/later or look at what process is using the lock file and either wait for it to finish or forcibly terminate it if appropriate.

Anonymous said...

Hi, Thank you for your work. When I try to run isorespin.sh I am getting the message:

Please ensure package 'xorriso' or equivalent for your distro is installed.

I was unable to install xorriso with apt-get, but downloaded it directly and installed. I also updated my PATH.

Do you have an idea how to resolve this? I would be happy to install with your iso that you already respun, but can't seem to find it.

Thanks in advance!

Linuxium said...

I've uploaded a new version of my script (isorespin.sh: Version: 8.0.8) that should fix the issue with 'neon' ISOs.

Linuxium said...

Unless your package sources are too restricted you should be able to simply download 'xorriso' with 'apt-get install xorriso'.

If you want to try my latest respun ISOs take a look at 'http://linuxiumcomau.blogspot.com.au/2018/02/second-look-at-ubuntu-1804-or-bionic.html'.

Unknown said...

Thanks for the help! I was respinning ubuntu-16.04.3-desktop-amd64.iso and using the -u and --atom flags. When I did that, the bios would not detect the USB as being installable at all. I could get into the UEFI shell from the bios, and even detect at least some partition on the USB drive once in the UEFI shell (I know because the light would blink when I changed directory to the right partition) but could not mount the file system in order to run the efi boot file. The only efi boot file I could run was the Windows one that booted me into plain old Windows 10.

So I tried respinning it with persistence, and later on with the -b rEFInd flag. In both of those cases, the bios DID see the USB and make it look like a valid boot option, but when I selected to boot from it it went to the GRUB rescue prompt (I wish I could remember the exact words, but I think it said it could not find a file system or partition).

It's super befuddling. Any suggestions?

Linuxium said...

Check your BIOS to see if 'Secure Boot' is set/enabled as this may be preventing you from booting the USB.

Unknown said...

Hi. What error?:
Isorespin.sh: line 3304 [: too many arguments
Sorry for my english..

Linuxium said...

Have you got some other files or directories that start with 'refind-bin-' in the directory you are running 'isorespin.sh' from that include spaces in their names? If so move them somewhere else as my script sees them and tries to process then or alternatively run my script from a different directory. 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. However if there are multiple copies or files/directories with similar names then my script may get confused in trying to work out whether any are the latest version of the rEFInd boot manager. Therefore it is best just to have the latest version if required otherwise run the script from a directory that doesn't include files/directories starting with 'refind-bin-'.

Unknown said...

What about Android X86?

Linuxium said...

The script is for customizing Ubuntu based ISOs however Android X86 is not Ubuntu based so it is not supported.

Coddy said...

This deepin fix ('https://goo.gl/mXd3vM') saved my ass on Debian (I guess Deb9, running under OMV4), I was stuck but now it seems it is going well, slow but going.
Also I was isospin from the latest link you've put in the documentary!

Linuxium said...

I haven't rolled the Deepin fix into isorespin.sh as I didn't want it to break for other distros. I'll put it on the TODO list however.

kmerhack said...

Hi i have an error trying to respin ubuntu-16.04.01
Here is the error

root@Missra:/home/jefcolbi# ./isorespin.sh -i /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso --atom -u
Extracting ISO ...

7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)

Processing archive: /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso

Extracting casper/filesystem.manifest

Everything is Ok

Size: 65649
Compressed: 1512263680
Parallel unsquashfs: Using 2 processors
186066 inodes (199983 blocks) to write

[===================================================================|] 199983/199983 100%

created 121649 files
created 16917 directories
created 64309 symlinks
created 80 devices
created 0 fifos
Extracting isorespin files ...
Updating bootloader/bootmanager ...
chroot: failed to run command 'apt-cache': Exec format error
chroot: failed to run command 'apt-cache': Exec format error
mv: cannot stat 'iso-chroot/usr/src/grub-efi-ia32-bin*.deb': No such file or directory
mv: cannot stat 'iso-chroot/usr/src/grub-efi-ia32*.deb': No such file or directory
chroot: failed to run command 'apt-cache': Exec format error
chroot: failed to run command 'apt-cache': Exec format error
Fetching mainline kernel packages ...
Installing mainline kernel packages ...
umount: /home/jefcolbi/isorespin/iso-chroot/dev: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
rm: cannot remove 'iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove 'iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove 'iso-chroot/dev/shm': Device or resource busy
rm: cannot remove 'iso-chroot/dev/pts': Device or resource busy
./isorespin.sh: Cannot find mainline kernel.
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/shm': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/pts': Device or resource busy

Thanks

Linuxium said...

There was an issue with '7z' earlier which looks like it might be the root cause of your issue and the latest version of the script fixes this. Looking at the 'dev: target is busy' error messages I recommend you reboot your machine. Once rebooted can you install 'p7zip-full'? Then download the latest version of 'isorespin.sh' (v8.1.2 from the link at the top of the post) and try respinning your ISO again.

Bob Zangief said...

No luck... looks like a lost cause. Thanks for the help anyway...

Linuxium said...

I looked at your 'dmesg' again and saw you also have the error 'Direct firmware load for brcm/brcmfmac4356-pcie.clm_blob failed with error -2'. There is a patch (brcmfmac: fix CLM load error for legacy chips when user helper is enabled) that went into the v4.15 kernel which may fix this for you. Therefore I recommend trying the following respin: 'isorespin.sh -i linuxmint-18.3-mate-64bit.iso --atom --rolling-unstable-hwe-edge -f brcmfmac4356-pcie.txt -c "mv /usr/local/bin/brcmfmac4356-pcie.txt /lib/firmware/brcm"'. I'm not sure how long 'rolling-unstable-hwe-edge' will stay at '4.15.0-12' so if you don't get the v4.15 kernel then change the '--rolling-unstable-hwe-edge' option to '-k v4.15.10'.

kmerhack said...

I have done as you say. Now here is the result

root@Missra:/home/jefcolbi# ./isorespin.sh -v
./isorespin.sh: Version: 8.1.2
root@Missra:/home/jefcolbi# ./isorespin.sh -i /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso --atom -u
./isorespin.sh: Access to the internet is required for downloading files.
root@Missra:/home/jefcolbi# ./isorespin.sh -i /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso --atom -u
Extracting ISO ...
./isorespin.sh: Access to the internet is required for downloading files.
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/efi.img': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/font.pf2': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/grub.cfg': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/loopback.cfg': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/acpi.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/adler32.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/ahci.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/all_video.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/aout.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/appleldr.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/archelp.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/ata.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/at_keyboard.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/backtrace.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/bfs.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/bitmap.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/bitmap_scale.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/blocklist.mod': Read-only file system
rm: cannot remove '/home/jefcolbi/isorespin/mnt/boot/grub/x86_64-efi/boot.mod': Read-only file system

there are others lines but it is the same that these ones

kmerhack said...

And also every times i have the error that i must be connected to internet but i am already connected. I have tried connecting via 3G and VPN. the previous version 8.1.1 that i was, taken sometimes the new version nothing

kmerhack said...

So it seems that you are checking the internet by pinging the DEFAULT GATEWAY but this won't work in my situation so i have commented the test now there is no internet access error.
But the result is the same

root@Missra:/home/jefcolbi# ./isorespin.sh -i /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso --atom -u
Extracting ISO ...

7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)

Processing archive: /media/jefcolbi/Data/jefcolbi/ubuntu-16-64.iso

Extracting casper/filesystem.manifest

Everything is Ok

Size: 65649
Compressed: 1512263680
Parallel unsquashfs: Using 2 processors
186066 inodes (199983 blocks) to write

[===================================================================\] 199983/199983 100%

created 121649 files
created 16917 directories
created 64309 symlinks
created 80 devices
created 0 fifos
Extracting isorespin files ...
Updating bootloader/bootmanager ...
chroot: failed to run command 'apt-cache': Exec format error
chroot: failed to run command 'apt-cache': Exec format error
mv: cannot stat 'iso-chroot/usr/src/grub-efi-ia32-bin*.deb': No such file or directory
mv: cannot stat 'iso-chroot/usr/src/grub-efi-ia32*.deb': No such file or directory
chroot: failed to run command 'apt-cache': Exec format error
chroot: failed to run command 'apt-cache': Exec format error
Fetching mainline kernel packages ...
Installing mainline kernel packages ...
umount: /home/jefcolbi/isorespin/iso-chroot/dev: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
rm: cannot remove 'iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove 'iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove 'iso-chroot/dev/shm': Device or resource busy
rm: cannot remove 'iso-chroot/dev/pts': Device or resource busy
./isorespin.sh: Cannot find mainline kernel.
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/hugepages': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/mqueue': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/shm': Device or resource busy
rm: cannot remove '/home/jefcolbi/isorespin/iso-chroot/dev/pts': Device or resource busy

My guess is that in the script there is a command that use iso-chroot/dev folder when umount is executed.
And the error "cannot find mainline kernel is absurd" because i have listed the isorespin folder while the script is downloading files from internet and i can see various files like the 3 kernel files and your others custom scripts.

Linuxium said...

What OS and version are you running when using the script?

Wild Rose said...

Hello, thanks for sharing the script. I was wondering if I need to download anything besides the actual script or I can just run 'isorespin.sh -i myiso.iso -u --atom' and the script will download the .deb files, etc. itself.

Also I wonder if it is possible to make the script more verbose. I do see messages like "installing local packages" but I would like to see what exactly is being downloaded and installed at the moment if possible.

Wild Rose said...

I got these messages in my logfile:
---
Command run ...
# wrapper-linuxium-install-UCM-files.sh
bash: wrapper-linuxium-install-UCM-files.sh: command not found
# wrapper-linuxium-install-broadcom-drivers.sh
bash: wrapper-linuxium-install-broadcom-drivers.sh: command not found
---
I am on openSUSE Tumbleweed KDE. I think instead of running "wrapper-linuxium-install-UCM-files.sh" the script should have ran "/full/path/to/file/wrapper-linuxium-install-UCM-files.sh" Is there a way to modify the script to make it work on openSUSE?

Linuxium said...

The path is set by the ISO you are respinning so
'/full/path/to/file' would already be set up. Can you 'pastebinit' a URL to your full 'isorespin.log' file?

wildcowboy said...

Could not find my previos post here.
Here is the log:
"Script '/home/user/isorespin.sh' called with '-i linuxmint-18.3-xfce-64bit.iso -u --atom' ...
Work directory 'isorespin' used ...
ISO '/home/user/linuxmint-18.3-xfce-64bit.iso' respun ...
Bootloader 'GRUB' added ...
Kernel updated with mainline kernel version '4.16.0-041600rc6-generic' ...
Local package '/home/user/isorespin/rtl8723bs_4.12.0_amd64.deb' added ...
File '/home/user/isorespin/linuxium-install-UCM-files.sh' added ...
File '/home/user/isorespin/wrapper-linuxium-install-UCM-files.sh' added ...
File '/home/user/isorespin/linuxium-install-broadcom-drivers.sh' added ...
File '/home/user/isorespin/wrapper-linuxium-install-broadcom-drivers.sh' added ...
Command run ...
# wrapper-linuxium-install-UCM-files.sh
bash: wrapper-linuxium-install-UCM-files.sh: command not found
# wrapper-linuxium-install-broadcom-drivers.sh
bash: wrapper-linuxium-install-broadcom-drivers.sh: command not found
Respun ISO created as 'linuxium-atom-v4.16-rc6-linuxmint-18.3-xfce-64bit.iso'."
As you see it downloads the wrappers as /home/user/script.sh but tries to run them as just script.sh without the full path. This way never works on my system. Even if I cd to the directory where the script is e.g. /home/user and than trying to run it by calling script.sh e.g. isorespin.sh I always get the error "bash: myscript.sh: command not found" However calling it by /home/user/script.sh e.g. /home/user/isorespin.sh works.
Any suggestions?
I tried running "export PATH=$PATH:/home/user/isorespin" or export PATH=$PATH:/home/user" before launching the script but it did not work

Linuxium said...

What version of the script are you running? Check with 'isorespin.sh -v'.

Can you also enter 'echo $PATH' and post the results as maybe the default path on your OS (openSUSE Tumbleweed KDE) doesn't include '/usr/local/bin'?

wildcowboy said...

Sorry I can't figure out where Blogger puts the newest messages.

>> What version of the script are you running? Check with 'isorespin.sh -v'.

Can you also enter 'echo $PATH' and post the results as maybe the default path on your OS (openSUSE Tumbleweed KDE) doesn't include '/usr/local/bin'?

Version: 8.1.3

echo $PATH
/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin:/home/user:/home/user/isorespin

Linuxium said...

Interesting. The PATCH is correct.

Do you also have a '/etc/environment' file and if so what does it contain?

BTW what files are also in the '/home/user' directory?

Can you try creating a new empty directory say 'test' then after changing directory to 'test' run '../isorespin.sh -i ../linuxmint-18.3-xfce-64bit.iso -u --atom' and see what happens?

wildcowboy said...


>>>Interesting. The PATCH is correct.
Do you also have a '/etc/environment' file and if so what does it contain?

I do have the file.
Here is what it contains:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on seperate lines
#


>>>> BTW what files are also in the '/home/user' directory?

/home/user contains the isorespin.sh I think I added the PATH to .bashrc myself when was trying to troubleshoot the error with runnung the script.

>>>Can you try creating a new empty directory say 'test' then after changing directory to 'test' run '../isorespin.sh -i ../linuxmint-18.3-xfce-64bit.iso -u --atom' and see what happens?

user@linux-qmze:~> mkdir test
user@linux-qmze:~> cd test
user@linux-qmze:~/test> '../isorespin.sh -i ../linuxmint-18.3-xfce-64bit.iso -u --atom'
bash: ../isorespin.sh -i ../linuxmint-18.3-xfce-64bit.iso -u --atom: No such file or directory
user@linux-qmze:~/test> ../isorespin.sh -i ../linuxmint-18.3-xfce-64bit.iso -u --atom
[sudo] password for root:
Extracting ISO ...

It is respinning now... I will post results in few minutes

wildcowboy said...

>>> It is respinning now... I will post results in few minutes

The result is exactly the same:

"Script '/home/user/isorespin.sh' called with '-i linuxmint-18.3-xfce-64bit.iso -u --atom' ...
Work directory 'isorespin' used ...
ISO '/home/user/linuxmint-18.3-xfce-64bit.iso' respun ...
Bootloader 'GRUB' added ...
Kernel updated with mainline kernel version '4.16.0-041600rc6-generic' ...
Local package '/home/user/isorespin/rtl8723bs_4.12.0_amd64.deb' added ...
File '/home/user/isorespin/linuxium-install-UCM-files.sh' added ...
File '/home/user/isorespin/wrapper-linuxium-install-UCM-files.sh' added ...
File '/home/user/isorespin/linuxium-install-broadcom-drivers.sh' added ...
File '/home/user/isorespin/wrapper-linuxium-install-broadcom-drivers.sh' added ...
Command run ...
# wrapper-linuxium-install-UCM-files.sh
bash: wrapper-linuxium-install-UCM-files.sh: command not found
# wrapper-linuxium-install-broadcom-drivers.sh
bash: wrapper-linuxium-install-broadcom-drivers.sh: command not found
Respun ISO created as 'linuxium-atom-v4.16-rc6-linuxmint-18.3-xfce-64bit.iso'."

When the scripts lauches '-c wrapper-linuxium-install-broadcom-drivers.sh' is that possible to change it to '-c /full/path/wrapper-linuxium-install-broadcom-drivers.sh' ?

Linuxium said...

s/PATCH/PATH/

Linuxium said...

Can you post the log from running this command in the 'test' directory:

../isorespin.sh -i linuxmint-18.3-xfce-64bit.iso -c 'echo $PATH'

Note the 'single quotes' around the option for '-c' need to be included.

wildcowboy said...

>>> Can you post the log from running this command in the 'test' directory:
../isorespin.sh -i linuxmint-18.3-xfce-64bit.iso -c 'echo $PATH'
Note the 'single quotes' around the option for '-c' need to be included.

Script '../isorespin.sh' called with '-i ../linuxmint-18.3-xfce-64bit.iso -c echo $PATH' ...
Work directory 'isorespin' used ...
ISO '/home/user/linuxmint-18.3-xfce-64bit.iso' respun ...
Bootloader 'GRUB' added ...
Command run ...
# echo /usr/sbin:/usr/bin:/sbin:/bin
/usr/sbin:/usr/bin:/sbin:/bin
Respun ISO created as 'linuxium-linuxmint-18.3-xfce-64bit.iso'.

Linuxium said...

Finally, can you just run the following command, first as yourself, and then as root (i.e. after elevating your permissions using 'sudo su -'):

grep PATH /etc/profile /etc/profile.local /etc/profile.d/* ~/.bashrc ~/.bash_login ~/.bash_profile ~/.profile

Lastly what is the output from:

sudo cat /etc/sudoers

wildcowboy said...

>>>Finally, can you just run the following command, first as yourself, and then as root (i.e. after elevating your permissions using 'sudo su -'):
grep PATH /etc/profile /etc/profile.local /etc/profile.d/* ~/.bashrc ~/.bash_login ~/.bash_profile ~/.profile


https://pastebin.com/2yQTfarT

wildcowboy said...

>>> Lastly what is the output from:
sudo cat /etc/sudoers

https://pastebin.com/kWPXHF0Q

Linuxium said...

So this is the cause. There is now a choice:

1. Keep system as is and not use options like '--atom' with 'isorespin.sh' but instead use a combo of '-f' and '-c' with your own modified scripts.

2. Edit '/etc/sudoers' and update the path to include '/usr/sbin:/usr/bin'. Note: this is obviously contrary to the philosophy of your distro so you should consider the implications of such a change. To change '/etc/sudoers' check the distro's documentation as this is an important file and should only be modified with the appropriate commands.

wildcowboy said...

>>>So this is the cause. There is now a choice:

1. Keep system as is and not use options like '--atom' with 'isorespin.sh' but instead use a combo of '-f' and '-c' with your own modified scripts.

2. Edit '/etc/sudoers' and update the path to include '/usr/sbin:/usr/bin'. Note: this is obviously contrary to the philosophy of your distro so you should consider the implications of such a change. To change '/etc/sudoers' check the distro's documentation as this is an important file and should only be modified with the appropriate commands.


Thank you very much for investigating on this.
I will take a look at your scripts and will see if I can modify them in order to make them work on my machine.

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

Comment removed as unrelated to my script.

Unknown said...

Aw, Good on Ya, Mate ! You've let me tell Micro Softie to go bugger from another device (AZW "Z83-II"). Sent a couple Foster's your way via PayPal.
Two tiny nit-picks -- somewhere in section on Persistence, you give example ' -s 2 GB ' -- I think should be ' -s 2GB ' (no spaces in parameter, right ?). A minor point, but should be easy edit
ALSO on Persistence -- if I follow, necessitates rEFInd bootloader, even if using Grub (32-bit) Boot Manager (if I have terms right). So does this mean bootloader -b has to be declared BEFORE -s Persistence switch in the Isorespin Command Line ?? I wasn't clear on this -- I wanted rEFInd (64-bit) so used ' -b rEFInd -s 1GB ' as last two switches ending my respin command, and I did get the ISO with options as I wanted. Just not clear if order of switches matters (other than installing packages/dependencies, as you DO point out).
It all worked for me -- just curious

wildcowboy said...

I tried this command:
isorespin.sh -i ubuntu-budgie-18.04-beta1-desktop-amd64.iso -u --atom -r ppa:team-xbmc/ppa -p 'kodi ubuntu-restricted-extras vlc intel-microcode ssh openssh-server inxi' -s 1GB

but it failed here:

Adding repositories ...
gpg: keybox '/tmp/tmpp0g73tm4/pubring.gpg' created
gpg: key 6D975C4791E7EE5E: 2 signatures not checked due to missing keys
gpg: /tmp/tmpp0g73tm4/trustdb.gpg: trustdb created
gpg: key 6D975C4791E7EE5E: public key "Launchpad PPA for XBMC for Linux" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK
[Errno 2] No such file or directory: 'S.gpg-agent.extra'
/home/user/Downloads/isorespin.sh: Adding repository 'ppa:team-xbmc/ppa' failed.

Any ideas on how to solve this?

wildcowboy said...

Looks like Kodi does not work on Bionic yet. I respun it without kodi for now.
However I can't make bluetooth work. I used sudo systemctl start rtl8723bsbt.service and sudo systemctl start brcmbt.service (the second one fails) but it did not change anything.
dmesg output:
https://pastebin.com/9xQMwmsp

Any ideas?

wildcowboy said...

I tried:
sudo systemctl start rtl8723bsbt.service

or

sudo systemctl start brcmbt.service

but bluetooth does not work.
dmesg:
https://pastebin.com/9xQMwmsp
any ideas?

«Oldest ‹Older   201 – 400 of 618   Newer› Newest»

Post a Comment

All comments now moderated so that spam can be deleted.