Wednesday, 29 March 2017

Running Ubuntu with an Upstream Kernel on Intel Bay and Cherry Trail Devices



In the past Intel Atom based mini PCs with Bay Trail and Cherry Trail SOCs required customized kernels to provide HDMI audio. As of version 4.11 the mainline kernel will include support for HDMI audio on Intel Atom SoCs and early release candidates are already available. The latest mainline kernel also includes a number of other patches including AXP288, I2C and the latest anti-freeze patches. Canonical build upstream kernels based on these release candidates and they have just released 'deb' packages using the first Ubuntu version 4.11 kernel configuration file.

In anticipation that the v4.11 kernel will be included in Ubuntu 17.10 thereby removing the basic need for customized kernels, I am now providing an interim migration path that allows the latest v4.11 Ubuntu kernel build to be used with Ubuntu ISOs.



Using a script that I've developed you can respin an existing Ubuntu ISO so that you can boot it from a device with either a 32-bit bootloader or a 64-bit bootloader and optionally update it with the latest Canonical Ubuntu build of an upstream kernel.

Update: 
Linux Mint ISOs are now supported using the updated version of the script isorespin.sh

To respin an existing Ubuntu ISO you will need to use a Linux machine with 'squashfs-tools' and 'xorriso' installed (e.g. 'sudo apt install -y squashfs-tools xorriso') and a working internet connection with at least 10GB of free space. Having downloaded an ISO (for example 'ubuntu-16.04.2-desktop-amd64.iso' simply download my script isorespin.sh (see Update: below for the latest version) and run with the ISO as a parameter (e.g. './isorespin.sh ubuntu-16.04.2-desktop-amd64.iso'). Or to respin and update the kernel include a '-u' or '--update' option (e.g. './isorespin.sh --update ubuntu-16.04.2-desktop-amd64.iso'). Note: if you get the unexpected error 'File must be an Ubuntu ISO ... exiting.' when running the script on a non-Ubuntu platform then make the following one-off update to the script by running the command 'sed -i "49,53d;59d" isorespin.sh' which should then enable it to run without issue.

You can respin the latest available ISOs include the recently released 17.04 Beta 2 of any flavour including Ubuntu, Lubuntu, Xubuntu etc, as well as respinning earlier releases such as 16.04.2 or 14.04.5 for example.



As some wifi/bluetooth driver and userspace files are still required I've provided additional scripts to support RTL8723BS and various Broadcom chipsets as well as the ALSA UCM files for some audio chipsets used for headphones. The scripts can be run whilst using the ISO as a 'LiveCD' to provide wifi connectivity (assuming they have been previously downloaded and are accessed from USB or similar). Once an ISO has been installed the scripts can be run to install the additional functionality.

For the RTL8723BS chipset your first option is to download and run linuxium-install-rtl8723bs.sh which will build the wifi and bluetooth drivers from source and this requires a working internet connection. Alternatively you can download and run linuxium-install-rtl8723bs-binaries-for-4.11.0-rc4.sh (see Update: below for the latest version) which installs prebuilt binaries from the same source but does not require the internet. This second script only works for the Ubuntu built upstream kernel defined by the script name.

For Broadcom chipsets you can download and run linuxium-install-broadcom-drivers.sh which should get wifi and bluetooth working for most of the popular Broadcom chipsets (as I don't have the devices to do extensive testing unfortunately). If you run this script with an internet connection it will also update the Broadcom firmware with the latest upstream firmware from Google's ChromiumOS which may help for other Broadcom based devices.

Note that in both cases the bluetooth service requires 'systemd' (as used by 17.04 and 16.04) so earlier Ubuntu versions will need a manual configuration to run the service.

Finally for updating the UCM files where you have a headphone jack you will need an internet connection before downloading and running linuxium-install-UCM-files.sh which provides audio for devices with the 5640 and 5640 chipsets.

A new kernel release candidate is released each week prior to the final version and you can go to http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D to check the latest version which will be displayed first.

If you want to respin ISOs with a release candidate later than 'rc4' simply edit 'isorespin.sh' and change the first couple of lines
MAINLINE_BRANCH="v4.11-rc4"
MAINLINE_KERNEL_VERSION="4.11.0-rc4"
to match the required version.

Update:
Mainline kernel v4.11-rc5 includes a new patch for the RTL8723BS wifi driver that improves speed and reliability. So I've uploaded an updated version of my script isorespin.sh preconfigured for v4.11-rc5 together with a new script linuxium-install-rtl8723bs-binaries-for-4.11.0-rc5.sh which installs the prebuilt wifi and bluetooth binaries compiled for v4.11-rc5. This version of the script now additionally supports Linux Mint ISOs.

Finally if you find my work useful then please donate using the following link http://goo.gl/nXWSGf as everything helps with development costs.

90 comments:

  1. Thank you ! I was struggling with my broadcom bt driver last night so this post comes just at the right time.
    Some feedback here : in linuxium-install-broadcom-drivers.sh you're missing a check on 'unzip'. If it is not present on the system it will fail without an error.

    ReplyDelete
    Replies
    1. Thanks for the feedback. I designed it to fail without error to allow the script to install the Broadcom driver without an initial internet connection. Because it is a kind of 'chicken and egg' problem. After running the script you should get working wifi. However if the Broadcom wifi driver still doesn't work I recommend connecting to the internet (using a dongle if required) and re-running the script to see if the latest upstream Broadcom firmware fixes wifi.

      Delete
    2. Where can I find the latest broadcom firmwares ?

      Delete
    3. Running the 'linuxium-install-broadcom-drivers.sh' script whilst connected to the internet should download them or you can browse them at https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+/upstream/master/brcm/ but note that the corresponding '.txt' files are not included and you will have to copy the relevant one for your device from your Windows installation (the Windows driver file is stored in NVRAM and the file should look something like '/sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113' so you would copy it using 'cat /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 > /lib/firmware/brcm/brcm/brcmfmac43241b4-sdio.txt' substituting the actual NVRAM filename on your device and the correct *sdio.txt name for your driver).

      Delete
  2. This script seems to depend closely on specific versions of some utilities. Running it on debian testing fails with "File must be an Ubuntu ISO ... exiting". adding a "set -x" at the start of the file shows the problem :

    charpent@asus16-ec:~/Temporaire/Linuxium$ ./isorespin.sh ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    + MAINLINE_BRANCH=v4.11-rc4
    + MAINLINE_KERNEL_VERSION=4.11.0-rc4
    + MAINLINE_URL=http://kernel.ubuntu.com/~kernel-ppa/mainline
    + GET_ISO ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    + UPDATE_KERNEL=false
    + case $# in
    + case "$1" in
    + ISO=ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    ++ readlink -f ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    + ISO=/home/charpent/Temporaire/Linuxium/ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    + '[' '!' -f /home/charpent/Temporaire/Linuxium/ubuntu-gnome-17.04-beta2-desktop-amd64.iso ']'
    ++ file -b /home/charpent/Temporaire/Linuxium/ubuntu-gnome-17.04-beta2-desktop-amd64.iso
    + ISO_TYPE='DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 2814232, 4608 sectors'
    + '[' 'DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 2814232, 4608 sectors' '!=' 'x86 boot sector' ']'
    + echo './isorespin.sh: File must be an Ubuntu ISO ... exiting.'
    ./isorespin.sh: File must be an Ubuntu ISO ... exiting.
    + exit
    Any suggestions ?

    ReplyDelete
    Replies
    1. I bypassed the difficulty by commenting out the problematic test.

      I also had to install xorriso ; this should be mentioned in the post...

      Delete
    2. Thank you for your comments. I've updated the post with the requirement to have 'xorriso' installed ('sudo apt install -y xorriso').

      The unexpected error 'File must be an Ubuntu ISO ... exiting.' is because the 'file' command appears to return a different result when running the script on a non-Ubuntu platform. As an alternative to your solution I've updated the post with instructions to make a one-off update to the script by running the command 'sed -i "49,53d;59d" isorespin.sh' which should then enable it to run without issue.

      Delete
    3. I've now uploaded an updated version of the script to handle these eventualities: there is now no need to run the 'sed' command on non-Ubuntu platforms and the script now checks for package dependencies.

      Delete
    4. Well, I have problems on my Asus T102HA tablet-cum-keyboard (nice pocket machine, BTW).

      A while back, I installed the 17.04 beta1 image. Most things worked, with limitations on backlight controls (I had to run xrandr) and some unrecognized ACPI keys (e.g. sound keys, backlights keys).

      So, I respun various 17.04 beta2 images, and ended up installing an Ubuntu 17.04 beta 1 image. In the process, I lost the possibility to suspend successfully (the machine suspends, but won't wake-up : I have to force a hard shiudown by a looooong action on the power button). I also note that the sound drivers setup is unstable : I sometimes boot with no sound drivers visible in the "sound' panel of the system menu, but they happen to be activated (for unscrutable reasons..). I note that, when I see no sound drivers, I can't play Youtube videos (an image appears, but playing does no start).

      The dmesg is here : https://drive.google.com/file/d/0B1gfn4_V_wm3Mi1oblVFSUxaU2M/view?usp=sharing

      For comparison, when I boot on a 17.04 beta 1 usb, I get the folloing dmesg : https://drive.google.com/file/d/0B1gfn4_V_wm3Sy12VEFGUjRhUTQ/view?usp=sharing

      Lacking suspend on this pocket machine is a *huge* drawback for the intended use of this machine. Lacking sound is *also* a drawback.

      I think that I may have a drivers conflict ; I may benefit of blacklisting drivers or forcing the order of insertion of some drivers ; however, I have been unable to emit an hypothesis about this order.

      Any advice ?

      Delete
    5. I can only recommend weekly respinning the new official 17.04 release with the latest mainline kernel and hoping that an upstream patch fixes the problem as I don't have the hardware to investigate myself.

      Delete
  3. I installed Manjaro and the only thing not working was the broadcom bluetooth device. Are this scripts valid for arch based distros? and if not Are you going to add archs and rpms scripts?

    thanks for your work

    ReplyDelete
    Replies
    1. I've not tested them on distros other than Ubuntu so I can't answer whether they work or not.

      Delete
  4. Two things. First I found out that the hardware video encoding firmware is missing and that it can be downloaded from intels open source site 01.org
    ./tmp/kbl_guc_ver9_14.bin
    ./tmp/bxt_guc_ver8_7.bin
    ./tmp/kbl_huc_ver02_00_1810.bin
    ./tmp/bxt_huc_ver01_07_1398.bin
    ./tmp/skl_huc_ver01_07_1398.bin
    and moved into /lib/firmware.

    #2 Any reason your not using the drm-intel-next branch, and using the mainline. In my case the audio is still broken in the mainline.

    ReplyDelete
    Replies
    1. #1: Yes you can download the firmware if you choose but as per the FAQ on https://01.org/linuxgraphics/downloads/firmware the warnings on missing firmware can be safely ignored for BYT and CHT devices.

      #2: The reason is Canonical don't offer binaries based on the drm-intel-next branch but only mainline and this post is all about using distro and not customized software.

      Delete
    2. Once the kernel gets updated to the new version that uses the firmware, it will get included. I have both CHT and BYT.

      http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-next/2017-03-21/

      :)

      Also fyi I use xfce and but love the kde-connect ubuntu to android. Its tested and working on linuxium xen,yak,zes

      git clone https://github.com/Bajoja/indicator-kdeconnect.git


      (: Compiling kernels since 92, Its was not watching the paint dry. Its painting the house then watching the paint dry :)

      Delete
    3. But unfortunately the drm-intel-next branch config is still based on v4.10 so HDMI LPE audio isn't configured meaning to use drm-intel-next branch you would still need to manually compile the kernel (which equates to customized software as it is not directly provided by a distributor).

      Delete
  5. hello
    Audio in hdmi is broken.
    How to fix it?
    Anymone know?

    ReplyDelete
    Replies
    1. On what device (manufacturer, make and model number)?

      Delete
    2. in your iso`s:
      Aplay -l
      placa 0: Audio [Intel HDMI/DP LPE Audio], dispositivo 0: HdmiLpeAudio [Intel HDMI/DP LPE Audio]
      Subdispositivos: 1/1
      Subdispositivo #0: subdevice #0

      In lubuntu/ubuntu 17 no soudcard found.

      Delete
    3. Then don't use my ISOs but respin an official ISO.

      Delete
  6. First thanks for all this scripts, but on my case it does not work.

    As I am not a software engineer just a software user, not managed to install the OS on the tablet.

    Step that I proceed (On Ubuntu Mate Desktop, install Ubuntu Mate on Tablet)

    1. download Ubunut Mate 17.04 amd64 iso Image from official site
    2. download mentioned above isorespin.sh
    3. execute 'sed -i "49,53d;59d" isorespin.sh'
    4. install xoriso 'sudo apt install -y xorriso'
    5. run linuxium script (as exmple) './isorespin.sh ubuntu-16.04.2-desktop-amd64.iso'
    6. flash to USB the new image (as exmple) 'linuxium-ubuntu-16.04.2-desktop-amd64.iso'
    7. move to tablet,.. select BIOS boot form flash, boot to created live image, and install without success.

    Trying to respin and to flash the iso two times on USB and install for times(as one third time remain without battery) two without internet two with internet (with internet itakes ~2 hours each install before fail).

    Install fail "The 'grub-efi-ia32' package failed to install into /target/...."

    Any suggestion are welcomed

    ReplyDelete
    Replies
    1. The official ISOs require internet whilst performing an installation on devices with 32-bit bootloaders. Added to this is the issue that currently devices with RTL8723BS wifi seem to randomly loose wifi after about an hour although a patch is queued for upstream. I recommend you try the installation again using an external USB ethernet adaptor.

      Delete
    2. Ian, I switched to using refind to efi boot linux,win,android. I found that the wifi problems stopped. Before It would disconnect at a random interval under 5 mins.

      Delete
    3. Thanks Linuxium for pointing explicit the issue. I tried fifth time and I remain again without battery, but on 6 time it install successfully (in three hours). Probably the issue was on USB or ethernet improper connection on my ethernet dongle. In the end after 6 tries and in total of at least 10 hours with trying I succeed installing.
      After updating the kernel and trying to install the Wi-fi and bluetooth I mange to make the system to 'complete lock' after finishing the boot and login, so it need another install ... maybe in another day.

      Delete
    4. 2891, The issue I have is if I do not boot first with refind. It gets to the ldm and the system hard locks. I switched to using refind and the system will boot and not hard lock. If your system hard locks first switch back from the rc kernel to the 4.10.10 linuxium kernel.

      Delete
    5. Thanks for the tip, RC2 work OK but RC4 not, I will test rc6

      Delete
  7. I tried your WiFi/BT patch in 14.04.5 w/ Kernel 4.4.0-71-generic.
    WiFi installs correctly.
    For BT I had to install systemd, but it still does not load the BT service with error message:
    sudo systemctl start rtl8723bsbt.service
    Failed to issue method call: Unit rtl8723bsbt.service failed to load: No such file or directory. See system logs and 'systemctl status rtl8723bsbt.service' for details.

    ReplyDelete
  8. systemctl status rtl8723bsbt.service gives:

    Failed to issue method call: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/systemd1/unit/rtl8723bsbt_2eservice

    ReplyDelete
  9. The previous 4.4.0-67-generic kernel loads BT as a bonus from installing it in 3.16 kernel.

    ReplyDelete
  10. The reason I want this is because 4.4.0.xx recognises the sdcard reader.

    Last query:

    Do you have a pathc for the i915 audio for 4.4.0.xx at all? I can only get it from the Chestermills .debs specifically
    oem-audio-i915-baytrail-dkms_0.20150605_all.deb
    which are compile only for 3.16 kernel.

    ReplyDelete
  11. Forget about BT, systemd needed a hard reboot to load BT. So remains a patch for i915 audio if available for Kernel 4.4.0.xx

    ReplyDelete
  12. I found this git, it starts well the make process, but then chokes at the end.
    Intel driver (graphic and HDMI audio) for Baytray Cherrytrail chipsets https://01.org/ubuntu-hdmi
    oem-audio-i915-baytrail-0.20160401
    https://github.com/mariodebian/oem-audio-i915-baytrail-dkms

    As I am not a coder, I cannot fix this :(

    ReplyDelete
  13. It chokes on this file when compiling:
    /oem-audio-i915-baytrail-dkms/oem-audio-i915-baytrail-0.20160401/i915/intel_sprite.c

    ReplyDelete
    Replies
    1. Try compiling the code from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11-rc4/ with this patch https://patchwork.kernel.org/patch/6137291/ as it mentions the error you are getting.

      Delete
    2. You didn't get me, I wish to use 14.04.5 with Kernel 4.4.0-71 and the git is for HDMI audio as I lose audio without using Kernel 3.16.
      Using 4.4.0-71, I can get WiFi, BT with your mods, but no audio.
      The git I referred you to claims it can get HDMI audio with 4.4 kernels.
      But it gives errors with one of the files: intel_sprite.c
      I was hoping you could know how to correct the code.

      Delete
    3. The problem is that you want v4.4 as the SD card works but as your audio doesn't work you want to patch the v4.4 kernel however nobody is supporting the earlier HDMI audio patches primarily as an official patch is incorporated into v4.11 and you don't want to use v4.11 as the SD card works.

      I haven't looked at the patch you suggested because basically it is history and the code has moved on. I still recommend compiling the v4.11 kernel with the patch I suggested to see if this fixes the SD card as that way you get ongoing support for HDMI audio and only have to worry about one patch for the SD card compared to worrying about continually porting a whole module for each kernel ABI change.

      Delete
    4. I compiled the 4.11-RC4 with the patch you suggested.
      It worked the micro sdcard reader is recognised, and inserting a card shows up, so solved.
      Audio is native so that solved.
      No WiFi & no Bluetooth, I tried your sh script, it installs but cannot load either.
      Getting the kernel source code, patching, compiling, etc took a day, so I don't look forward to do this again for RC5.
      WiFi hadess doesn't work with RC4.
      Will your RC5 WiFi/BT script work for RC4?

      Delete
    5. The error I get for WiFi either with your script or hadess compilation is:
      modprobe: ERROR: could not insert 'r8723bs': Exec format error

      I had to modify your script because uname -r on compiled from source gives me: 4.11.0-rc2+

      Anyway neither WiFI nor BT get laodaed with your RC4, though I used
      git clone git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack v4.11-rc4
      from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11-rc4/
      followed the patch instructions
      then patched the irq8 corrective patch.

      Delete
    6. You should run 'linuxium-install-rtl8723bs.sh' which will build the wifi and bluetooth drivers from source because you have a custom kernel and a pre-built module will not load.

      You will require a working internet connection to run the script so you'll temporarily need to use an usb ethernet adapter or similar.

      If that is not feasible you will have to first download the sources, then copy them to the device with the custom kernel, then modify the script to omit downloading (comment the 'rm' and 'wget' after each 'Fetching' line) and pick up the new sources), then run the modified script.

      Delete
    7. The problem when installing new stuff is emplacement of the headers, when I compiled it from source, it expects them in /lib/modules/4.11.0-041100rc4-generic, but they were placed in /lib/modules/4.11.0-rc2+
      As this is temporary I will wait until the final commit of 4.11 is released.
      I might try to debug this in the meantime for RC4 in lib/modules/4.11.0-rc2+-
      I posted stuff on twitter about this on my handle @inabster & tagged you @linuxium

      Delete
    8. Installing on top of the already compiled RC4 kernel is successful, but since not patched, I have no microSD card reader detected.

      Trying to install on top of patched from source kernel RC2+ (which is RC4 in fact) leads to these errors:
      ./linuxium-install-rtl8723bs.sh: Installing RTL8723BS drivers ...
      ./linuxium-install-rtl8723bs.sh: Fetching RTL8723BS driver source code ...
      ./linuxium-install-rtl8723bs.sh: 11: cd: can't cd to rtl8723bs-master
      ./linuxium-install-rtl8723bs.sh: Compiling RTL8723BS wifi driver ...
      make: *** No targets specified and no makefile found. Stop.
      ./linuxium-install-rtl8723bs.sh: Installing RTL8723BS wifi driver ...
      cp: cannot stat 'rtl8723bs_bt.bin': No such file or directory
      cp: cannot stat 'rtl8723bs_ap_wowlan.bin': No such file or directory
      cp: cannot stat 'r8723bs.ko': No such file or directory
      ./linuxium-install-rtl8723bs.sh: Fetching RTL8723BS driver source code ...
      ./linuxium-install-rtl8723bs.sh: Compiling RTL8723BS bluetooth driver ...
      cc -c hciattach_rtk.c
      cc -o rtk_hciattach hciattach.c hciattach_rtk.o
      ./linuxium-install-rtl8723bs.sh: Installing RTL8723BS bluetooth driver ...
      ./linuxium-install-rtl8723bs.sh: Creating RTL8723BS bluetooth service ...
      ./linuxium-install-rtl8723bs.sh: 41: ./linuxium-install-rtl8723bs.sh: cannot open .././linuxium-install-rtl8723bs.sh: No such file
      ./linuxium-install-rtl8723bs.sh: Installing RTL8723BS bluetooth service ...
      cp: cannot stat 'rtl8723bsbt.service': No such file or directory
      ln: failed to create symbolic link '/etc/systemd/system/multi-user.target.wants/rtl8723bsbt.service': File exists
      ./linuxium-install-rtl8723bs.sh: Starting RTL8723BS bluetooth service ...
      Job for rtl8723bsbt.service failed because the control process exited with error code. See "systemctl status rtl8723bsbt.service" and "journalctl -xe" for details.
      ./linuxium-install-rtl8723bs.sh: Installation of RTL8723BS drivers finished.

      Delete
    9. This section explains well the problems I faced
      https://kernelnewbies.org/KernelHeaders
      So I need your next releases to include the irq8 patch which I just tested works.
      Would you like the dmesg of RC2+?

      Delete
    10. Solved I think, I forgot I needed a separate command to build the headers.
      In root tree of kernel source -
      sudo make headers_install INSTALL_HDR_PATH=/usr/include
      then your sh script installs.
      rebooting will show if real soved ;)

      Delete
    11. I ran the rtl8723bs script successfuly by adding the source compiled RC2+ headers, but no luck, no WiFi, no BT.
      Still error-
      modprobe: ERROR: could not insert 'r8723bs': Exec format error

      So I get the sdcard but lose BT & WiFi

      Delete
    12. I am pleased to say that I got myself a BBEN cherrytrail stick, as it is 64bit uefi, and they use only Intel drivers for BT, WiFi & audio, all problems are solved as opposed the Hannspree 32bit uefi.
      I posted dmesg on twitter @inabster & @menabster accounts.

      Delete
    13. Also the Intel wifi chip and driver are much better than the Realtek 8723BS chip and driver so you'll have a much better wifi experience as well.

      Delete
  14. Having some problems running your script on raspbian. Installing the offical ubuntu iso caused the system to freeze on a T100HA, attempting to run the script (on raspbian) and install xubuntu now.

    Errors on raspbian are:

    $ sudo ./isorespin.sh --update xubuntu-16.04-desktop-amd64.iso
    ./isorespin.sh: line 49: isoinfo: command not found
    ./isorespin.sh: Extracting ISO ...
    mkdir: missing operand
    Try 'mkdir --help' for more information.
    sudo: unsquashfs: command not found
    mv: cannot stat ‘squashfs-root’: No such file or directory
    ./isorespin.sh: Fetching mainline debs ...

    ISO compiles anyway. Testing if it will install without freeze.

    ReplyDelete
    Replies
    1. yea, that did not work. Installer doesn't even load. I will go back to the linuxium iso.

      btw, Is there a way to download from google with wget?

      Delete
    2. I would install the missing programs first as I don't think it will work based on your output. Key Ubuntu packages (with command used) include: dosfstools (mkdosfs), genisoimage (isoinfo), rsync (rsync), squashfs-tools (unsquashfs & mksquashfs), unzip (unzip), wget (wget) and xorriso (xorriso) but note that other distros might package the commands differently.

      Delete
  15. An updated version of the 'isorespin.sh' script has been uploaded which removes the need to edit the file when running on non-Ubuntu platforms and also checks for package dependencies prior to running.

    Also 4.11-rc5 binaries are now available so if you want to respin ISOs with the latest release candidate kernel then edit 'isorespin.sh' and change the first couple of lines to:

    MAINLINE_BRANCH="v4.11-rc5"
    MAINLINE_KERNEL_VERSION="4.11.0-rc5"

    ReplyDelete
    Replies
    1. Mainline kernel v4.11-rc5 includes a new patch for the RTL8723BS wifi driver that improves speed and reliability. So I've uploaded an updated version of my script 'isorespin.sh' preconfigured for v4.11-rc5 together with a new script 'linuxium-install-rtl8723bs-binaries-for-4.11.0-rc5.sh' which installs the prebuilt wifi and bluetooth binaries compiled for v4.11-rc5. See 'Update:' above for the links.

      Delete
    2. Hi,

      is it possible to get the Script work with Linux Mint ISOs. Linux Mint is an Ubuntu based system.
      Hylli

      Delete
    3. I'm toying with the idea.

      You could always use Ubuntu MATE in the interim and add Cinnamon from 'ppa' if you prefer (see http://www.omgubuntu.co.uk/2016/04/how-to-install-cinnamon-3-0-on-ubuntu).

      Delete
    4. Update: Linux Mint ISOs are now supported. Please see my new post http://linuxiumcomau.blogspot.com/2017/04/isorespinsh-now-with-mint-and-cinnamon.html for further details.

      Delete
  16. Hi Linuxium,

    My Chuwi Hi10 is quite usable with your modified 4.10 kernel aside from audio and touch screen. I tried 4.11rc4 and 4.11rc5 but both halt before getting to the desktop. Is there anything I can do to get 4.11 working? Do you think kernel 4.11 will solve the remaining problems or is it better to wait for the final release 4.11?

    Thanks!

    ReplyDelete
    Replies
    1. I suppose there is a slight possibility v4.11 will work for you assuming your problem requires a late included fix however it is probably more likely v4.12 might work as new functionality will be included. Or v4.13!

      Delete

    2. 4.13! That sounds so far off.

      What exactly is missing that is preventing the audio & touch from working? I assume that by now the Chuwis (chewy!), especially the Hi! series have been soundly investigated and employ only bog standard parts. I can't complain as at least I was able to ditch the highly unstable Windows 10 for an OS that has served me faithfully for years now on the desktop.

      Is there any information I could collect from my machine that could possibly assist you in finding a solution? I'm using your 17.04 Linuxium ISO.

      Thanks!

      Delete
    3. I was interested in exploring what might be required to get Linux working on the latest CHT/BYT laptops and tablets but it became apparent that as I don't have any devices, and because manufacturers and resellers don't want to provide them (at least to me when I've asked) for Linux development and testing, I was working blind.

      It was also important to me to promote mainline kernels rather than custom ones to ensure ongoing support and security. So I've currently focused my effort in that direction and left the kernel building on hold for the time being.

      Things change as well so whilst v4.13 seems a long way off a solution may come sooner.

      Delete
    4. Understood, and your efforts are greatly appreciated. I'm free of Windows now, and because of that, my focus is fully on Ubuntu/Linux now and my capabilities with it have improved significantly in just this short period. I'm already dispensing basic advice to others in need.

      Since you mentioned security concerns with customized ISOs and kernels, are there any we should be aware of?

      Delete
    5. Only that you either have to implicitly trust the source of the kernel binaries or go through the source code line by line and recompile it manually to guarantee a level of security against backdoors, malware or other nastinesses that could have covertly been included perhaps whilst wearing a tin foil hat and glancing over your shoulder!

      Or rather more commonly the issue with custom kernels is that they often will not receive security updates or patches which places the user at risk.

      Delete
  17. On a t100HA. I was mostly successful, both with the Unity 16.04 version and your Unity 17.04 version. If I run the broadcom script, being online via dongle, I get the Google code and wireless also runs. Sound appears to just work.

    The bluetooth is not recognized. I believe it is a 43241B DIO chipset. I get the following errors if I bring the service down and then back up using your script as a guide. Any ideas appreciated.

    Apr 4 22:08:54 ubuntu systemd[1]: Stopped Broadcomm Bluetooth daemon.
    Apr 4 22:08:54 ubuntu systemd[1]: Starting Load/Save RF Kill Switch Status...
    Apr 4 22:08:54 ubuntu systemd[1]: Started Load/Save RF Kill Switch Status.
    Apr 4 22:08:58 ubuntu systemd[1]: Starting Broadcomm Bluetooth daemon...
    Apr 4 22:08:58 ubuntu systemd[1]: Started Broadcomm Bluetooth daemon.
    Apr 4 22:09:00 ubuntu kernel: [ 788.366065] Bluetooth: hci1 command 0xfc45 tx timeout
    Apr 4 22:09:08 ubuntu kernel: [ 796.366846] Bluetooth: hci1: BCM: failed to write clock (-110)
    Apr 4 22:09:10 ubuntu kernel: [ 798.415259] Bluetooth: hci1 command 0x0c03 tx timeout

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Sorry for this off-topic comment.

    I was reading Your post 'Unofficial "official" Ubuntu on Intel Z3735F devices'. It is very useful to me right now.

    I am used to test various linux distros on different hardware, and everytime I can not use WiFi or ethernet, I use my android mobile as a "USB WiFi device" using usb tethering.

    Great posts. I'll read them soon.

    ReplyDelete
  20. Thanks for all your hard work. here is my experience
    Hardware: Tronsmart Ara-X5 (not plus)

    Respun both ubuntu 16.04 & lubuntu 16.04 with the --update option, the OS seems to install fine, however when i reboot the box with either OS the system simply goes into the BIOS.
    I installed the original OS without re spinning and the OS loads fine. I think there is an issue with the script.

    Secondly I am a bit lost about the respinning with and without the --update option, I thought the respinning is needed to add the updated kernel, if that is the case then what does the --update flag do additionally?

    ReplyDelete
    Replies
    1. update: the difference between the --update and without it is that with --update it will install the 4.11 rc5 kernel, and without the --update you will get 4.10.

      For me the updated kernel patch did not resolve the freeze problem on Ara-x5. I have tried all available options so far but I have been able to freeze both my Ara x5 boxes consistently.

      Delete
    2. Have you tried adding the 'intel_idle.max_cstate=1' boot command?

      Delete
  21. Excellent job! this worked out perfectly for me, thank you!

    ReplyDelete
  22. This patch works for the audio in a Chuwi LapBook?
    I tried it but I don't have any difference...
    Thanks!!

    ReplyDelete
    Replies
    1. Unfortunately I don't own the hardware to test myself.

      Delete
  23. When trying to respin, i get a permission denied error. What is the cause of this?

    ReplyDelete
    Replies
    1. You have got to make the script executable before respinning

      Delete
    2. Got it, thank you. I'm a beginner. I installed Ubuntu on the Minix Neo Z83-4 with linuxium's modifications and this worked great. I now have working Audio through HDMI, this is amazing!

      Delete
  24. Hello,

    How hard would it be to get this working for Ubuntu server?

    I tried removing the check for the ISO file and with both Ubuntu 16.04 and 16.10 and they both built and correctly installed and I got no errors from the script, except I don't know how to install the Wifi driver.

    Ubuntu server says it could not detect any network cards, and I can't seem to get it to autodetect the Wifi card...

    Any tips? I'm gonna run my own setup with X-server and Chromium for kiosk setup.

    ReplyDelete
    Replies
    1. An interesting question. When I get some time I'll take a look at the server ISOs. An interim solution would be to use a desktop ISO and then purge the desktop package but it might then wipe out the network commands you are familiar with meaning you would have to brush up on manually configuring networks.

      Delete
  25. Install both Lubuntu 17.04 daily and also 16.04.2 in both cases no audio and neither bluetooth with this scripts.
    Previous struggle with Ubuntu Mate install witch take a huge amount of time to install (if it is connected to internet) and in the end after 10 hours of struggling succeeded, but it locks after boot.

    The conclusion:
    - Half a year ago 16.04 linuxium images work perfect on tablet but no power level, audio, wi-fi and bluetooth.
    - latest linuxium images, have all power level (with no value update after boot), audio, wi-fi and bluetooth working, but screen out of sync on boot, and touchpad working little bad (because of mainline kernel)
    - using this scripts at least for lubuntu (I will try maybe others) no audio (ALC5640), no bluetooth (RTL8723BS), screen out of sync on boot, and tuchpad unusable with V4.11 RC5
    So in the end if touchpad is not working (RC5 is working like shit) tablet is almost useless, and I do not have any solution to make simultaneously the power level and others, as I can use linuxium premade images but power level is not updating, or I can use this scripts but no audio (witch is important) and bluetooth.
    So maybe I should wait couple of months, maybe a year and hope that I can have an os usable on my tablet, or I should switch back to windows as the os is far for being ok on tablet.

    ReplyDelete
    Replies
    1. Maybe a solution would be to stick with Windows but boot from USB as I've now rewritten my isorespin script to include persistence allowing you to use Linux occasionally just for the specific tasks you require.

      Delete
  26. Got errors during respin of ubuntu-16.04.2-desktop-amd64.iso:

    ./isorespin.sh: Installing mainline kernel ...
    cp: cannot stat ‘iso-chroot/boot/vmlinuz-4.11.0-*’: No such file or directory
    cp: cannot stat ‘iso-chroot/boot/initrd.img-4.11.0-*’: No such file or directory
    ./isorespin.sh: Spinning ISO ...
    chroot: failed to run command ‘dpkg-query’: Exec format error

    Image was created, but I believe 4.8 kernel is there.

    ReplyDelete
    Replies
    1. Did you run out of space when respinning the ISO as you require quite a lot (say 10GB) for it to run successfully? I would also retry using my rewritten script posted on http://linuxiumcomau.blogspot.com.au/2017/04/creating-personalized-ubuntu-mint-and.html just to be sure.

      Delete
    2. No, it was enough space. I was respinning on ubuntu 15.10 (never upgraded) and but for some reason script was not able to create mnt directory, after upgrade this problem gone, but other wierd errors come like: "cp: missing destination file operand after ...". Then I have installed ubuntu 16.4.2 and script worked well.

      Delete
  27. Just wanted to drop by and tell you how much I appreciate your work. I had almost given up on my Lenovo Miix 2 10" until I stumbled upon your project. I had tried installing multiple distributions with bootia32.efi but none supported the wireless drivers on the laptop. Today I found your modified .isos and the wifi works perfectly! I'll still have to keep dual-boot as brightness and sound do not work, but from now on I'll mostly be on Linux because the work I use the laptop for requires neither.

    Thank you.

    ReplyDelete
  28. The official Ubuntu 17.04 release is out, as of the 13th of this month. Is this working out of the box with these devices?

    ReplyDelete
    Replies
    1. 17.04 doesn't solve many if not any of the issues most mini PCs current experience. 17.10 or later however will be a different story.

      Delete
    2. Hi when trying to run the script ime getting the following error

      ./isorespin.sh: 33: ./isorespin.sh: Syntax error: "(" unexpected

      its at the line where it shows supported OS.. Any ideas? using mint 18.1

      Delete
  29. Seems Daniel Drake's patches fixed audio issues.
    Here is the link: https://bugzilla.kernel.org/show_bug.cgi?id=189261#c79

    ReplyDelete
  30. Hello,
    I am working on an up-board based device (http://www.up-board.org/up/specifications/) x5 z8350 Soc. All efforts so far did not solve a random system freeze.
    current installation:
    Lubuntu 16.04.2 Kernerl 4.11.1
    Grub Setting :GRUB_CMDLINE_LINUX="intel_idle.max_cstate=1"
    also we have set in sysctl kernel.panic = 60 to initiate a reboot if it freezes but this also is not working with the up freezes.

    We have tested it also with the Ubilinux-Kernel for this board same issue.

    Our Application is an mediaplayer for digital signage.

    Any more suggestions to overcome the freezing issue are very much apprechiated.

    ReplyDelete
  31. Hi,
    Unfortunately the Google Drive link for the RTL8723BS script (https://goo.gl/ShwVxZ) makes me ask for permission to download it. Could someone post a valid link to the TL8723BS script please?

    Thanks in advance!

    ReplyDelete