Sunday 31 December 2017

A brief look at the MINIX NEO N42C-4 running Windows 10 Pro


The MINIX NEO N42C-4 is a Pentium Apollo Lake mini PC featuring configurable RAM and storage. Displaying 4K video both at 30HZ (HDMI) and 60Hz (mini DisplayPort or Type-C) it also supports digital audio (HDMI, mini DisplayPort or S/PDIF) as well as analogue audio (3.5 mm jack). It includes USB ports (both 3.0 and a Type-C) together with connectivity through Gigabit Ethernet, Dual-Band WiFi and 4.1 Bluetooth:


The device features an Apollo Lake Pentium N4200 SoC and comes with 32GB of eMMC storage plus 4GB of RAM with Windows 10 Pro preinstalled and fully licensed. It also features a very quiet internal fan for cooling.

MINIX provided me with a device for review and it came in a presentation box complete with a power adaptor, VESA mount and a simple user guide pamphlet.


Looking at the detail specifications:


the first point to note as that the Type-C port only provides video output and not audio output and that there is no SD card reader. The RAM is configurable by having two SODIMM slots and the storage includes an optional M.2 slot.

The device is slightly larger than earlier MINIX models measuring 139mm (or around 5.5”) square by 30mm (or just over an inch) tall.

Once booted it sets up Windows which becomes fully activated after connecting to the internet:


with just under half the storage used by Windows:


Unfortunately the preinstalled Windows is version 1703:


meaning the large (over 3GB) Fall Creators Update is required which repeatedly failed when I tried to update:


The simple solution was to download the official Windows ISO from Microsoft and perform a fresh installation after which Windows automatically activated:


As I had removed the original partitions a new disk layout was created:


leaving just under half the storage available as free space.

So given that the basic hardware matches the specification:


running my standard set of benchmarking tools to look at performance under Windows:











confirms the performance to be as expected for an N4200 SoC and shows an improved eMMC performance because of using 5.1 compared with other Apollo Lake devices:


Note that to hear audio the correct device must be selected:


Looking at real-world Windows usage cases the first tested was watching a 4K video using Microsoft Edge which worked perfectly:


and similarly when watched using Google Chrome:


Running Kodi on Windows with a VP9 codec encoded video used software for decoding resulting in very high CPU usage:


compared with a H.264 codec encoded video which uses hardware to decode:


and similar for videos encoded with H.265 or HEVC:


however no issues were encountered playing the videos.

Power consumption for the device was measured as:
Power off – 0.6 Watts
Boot menu – 4.0 Watts
Idle – 4.3 Watts
4K video – 7.4 Watts
The BIOS has a reasonable selection of settings but does not include an option to select Linux as a boot OS:


As mentioned the device includes an internal fan:


which is both effective and quiet. It uses a 4-pin connector and being temperature controlled means it is not spinning continuously at a single speed.

Storage can be increased by adding an M.2 SSD. Officially described as a taking a 22mm wide 80mm long (2280) M.2:


I found though I was not restricted to just this size and could also insert both an 2260 and 2242 SSDs. However using the supplied spacer makes the 2242 slightly prominent:


compared with:


so a shorter spacer should be used to prevent the SSD touching the base of the device.

RAM can be added to the additional slot which enables dual-channel:


and obviously the amount is flexible up to the supported limit of 16GB.

So having added a 240GB M.2 and an additional 4GB RAM I booted up the device:



Performance of the M.2 was as expected:


I then wiped both drives and reinstalled Windows on the M.2 SSD:


and Windows auto-activated without issue:


confirming that the Windows license is valid use on the M.2 drive.

Power consumption was slightly increased to:

Power off – 0.6 Watts
Boot menu – 4.6 Watts
Idle – 5.1 Watts
4K video – 8.4 Watts

The elephant in the room is the price. At USD 299 it may seem that this device is not competitive with similar devices. However the reality is there are not that many comparable devices when you factor in the Pentium processor, faster eMMC, upgradeable RAM and storage and inclusion of Windows 10 Pro license which means it does provides value for money.

A review of how to install and performance under Linux will be published shortly.

Sunday 24 December 2017

Resize EFI partition


When installing respun Ubuntu or similar distros on Intel Apollo Lake devices using the '-b Linuxium'  option (or '--apollo') 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. Unfortunately this cannot be achieved through a simple command so I've written some instructions that whilst appearing somewhat complicated will achieve the required result.

Before embarking on using the instructions I highly recommend creating a backup image of your eMMC to use as recovery should the need arise.

The resizing process involves creating a 'Windows 10 installation and repair' USB, removing the existing EFI partition and then creating a new one using the 'repair' USB. If Ubuntu or similar was previously installed then additional steps are required to save and then restore the Ubuntu EFI files and to update the GRUB bootloader if used. You will need a working internet connection and two USBs (both minimum 8GB) and start by 'dd'ing an Ubuntu ISO to one of them.

Then to increase the EFI partition when only Windows is installed use the following instructions:


1. Boot Windows
REM right-click the Windows icon (bottom-left corner on the desktop) and select 'Disk Management'
REM right-click the Windows volume and then click 'Shrink Volume'
REM assume new EFI partition will be 150MB so enter '150' in the 'Enter the amount of space to shrink in MB' box and click 'Shrink'
REM when the shrink operation has completed an area of '150 MB Unallocated' space should appear

2. Boot from Ubuntu LiveUSB
# remove NVRAM entries for Windows
sudo efibootmgr -b $(efibootmgr -v | grep Windows | sed 's/\*.*//' | sed 's/Boot//' | head -1) -B
# delete EFI partition
DISK=$(blkid | grep -i "EFI System Partition" | sed 's/p.*//')
sudo sgdisk --delete=$(sudo gdisk -l ${DISK} | grep -i "EFI System Partition" | awk '{print $1}') ${DISK}



3. Still in Ubuntu create a 'Windows 10 installation and repair' USB
# go to 'https://www.microsoft.com/en-au/software-download/windows10ISO' in a browser
select 'Windows 10' and click 'Confirm'
select 'English International' and click 'Confirm'
select '64-bit Download' and click 'Confirm'
# wait for ISO to download
# confirm ISO has successfully downloaded
ls -ltr ~/Downloads | tail -1
# insert the other the USB
USB=$(ll /dev/disk/by-id/ | grep usb | head -1 | sed 's?.*/??')
# unmount any mounted partitions
sudo umount /dev/${USB}*
# initialize the USB
sudo sgdisk -Z /dev/${USB}
# create a single partition on the USB
sudo sgdisk --new=0:0:0 /dev/${USB}
# create a FAT32 file system on the USB
sudo mkfs.vfat /dev/${USB}1
# copy the Windows 10 ISO to the USB
sudo rm -rf /mnt/usb
sudo rm -rf /mnt/iso
sudo mkdir /mnt/iso /mnt/usb
sudo mount ~/Downloads/Win10_1709_EnglishInternational_x64.iso /mnt/iso
sudo mount /dev/${USB}1 /mnt/usb
sudo cp -dR --preserve=all --no-preserve=ownership /mnt/iso/* /mnt/usb
sudo sync
sudo sync
sudo umount /mnt/iso /mnt/usb
sudo rmdir /mnt/iso /mnt/usb





4. Boot from 'Windows 10 installation and repair' USB
REM choose 'Time and currency format'
REM select next
REM click 'Repair your computer'
REM click 'Troubleshoot'
REM click 'Advanced options'
REM click 'Command Prompt'
diskpart
list disk
REM select disk number of device (the other will be the USB)
sel disk 0
REM create new EFI partition (size 150MB)
REM if amount of space is not known simply enter 'create part efi' to use all available space
create part efi size=150
format quick fs=fat32
assign
list vol
REM note the drive letter for Wndows (e.g. C:) and the new EFI partition (e.g. F:)
exit
REM install Windows bootloader to new EFI partition
bcdboot C:\Windows /s F: /f UEFI
exit
REM click 'Turn off your PC'

You can now reboot into Windows to view the resized EFI partition or boot from the Ubuntu LiveUSB and install Ubuntu.

To increase the EFI partition when both Windows and Ubuntu or similar are installed use these instructions:

1. Boot from Ubuntu LiveUSB
# assumes Ubuntu partition is automatically loaded under '/media/<user name>/<UUID of Ubuntu partition>' where <user name> will be 'ubuntu' on a LiveUSB
cd /media/$(whoami)/$(blkid | grep ext4 | awk '{print $2}' | sed 's/^UUID="//' | sed 's/"$//')/boot
# save /boot/efi/EFI/ubuntu
sudo mount $(blkid | grep -i "EFI System Partition" | sed 's/:.*//') /mnt
sudo cp -a /mnt/EFI .
sudo umount /mnt
# remove NVRAM entries for Ubuntu and Windows
sudo efibootmgr -b $(efibootmgr -v | grep -i ubuntu | sed 's/\*.*//' | sed 's/Boot//' | head -1) -B
sudo efibootmgr -b $(efibootmgr -v | grep Windows | sed 's/\*.*//' | sed 's/Boot//' | head -1) -B
# delete EFI partition
DISK=$(blkid | grep -i "EFI System Partition" | sed 's/p.*//')
sudo sgdisk --delete=$(sudo gdisk -l ${DISK} | grep -i "EFI System Partition" | awk '{print $1}') ${DISK}
# shrink Ubuntu partition to allocate as new EFI partition
# click 'ignore' for any 'The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes' warnings
# for example new EFI partition will be 150MB so shrink Ubuntu partition by 150MB
sudo gparted
# note the amount of free space created

2. Still in Ubuntu create a 'Windows 10 installation and repair' USB
# go to 'https://www.microsoft.com/en-au/software-download/windows10ISO' in a browser
select 'Windows 10' and click 'Confirm'
select 'English International' and click 'Confirm'
select '64-bit Download' and click 'Confirm'
# wait for ISO to download
# confirm ISO has successfully downloaded
ls -ltr ~/Downloads | tail -1
# insert the other USB
USB=$(ll /dev/disk/by-id/ | grep usb | head -1 | sed 's?.*/??')
# unmount any mounted partitions
sudo umount /dev/${USB}*
# initialize the USB
sudo sgdisk -Z /dev/${USB}
# create a single partition on the USB
sudo sgdisk --new=0:0:0 /dev/${USB}
# create a FAT32 file system on the USB
sudo mkfs.vfat /dev/${USB}1
# copy the Windows 10 ISO to the USB
sudo rm -rf /mnt/usb
sudo rm -rf /mnt/iso
sudo mkdir /mnt/iso /mnt/usb
sudo mount ~/Downloads/Win10_1709_EnglishInternational_x64.iso /mnt/iso
sudo mount /dev/${USB}1 /mnt/usb
sudo cp -dR --preserve=all --no-preserve=ownership /mnt/iso/* /mnt/usb
sudo sync
sudo sync
sudo umount /mnt/iso /mnt/usb
sudo rmdir /mnt/iso /mnt/usb

3. Boot from 'Windows 10 installation and repair' USB
REM choose 'Time and currency format'
REM select next
REM click 'Repair your computer'
REM click 'Troubleshoot'
REM click 'Advanced options'
REM click 'Command Prompt'
diskpart
list disk
REM select disk number of device (the other will be the USB)
sel disk 0
REM create new EFI partition (size 150MB)
REM if amount of space is not known simply enter 'create part efi' to use all available space
create part efi size=150
format quick fs=fat32
assign
list vol
REM note the drive letter for Wndows (e.g. C:) and the new EFI partition (e.g. F:)
exit
REM install Windows bootloader to new EFI partition
bcdboot C:\Windows /s F: /f UEFI
exit
REM click 'Turn off your PC'

4. Boot from Ubuntu LiveUSB
# assumes Ubuntu partition is automatically loaded under '/media/<user name>/<UUID of Ubuntu partition>' where <user name> will be 'ubuntu' on a LiveUSB
cd /media/$(whoami)/$(blkid | grep ext4 | awk '{print $2}' | sed 's/^UUID="//' | sed 's/"$//')/boot
# restore /boot/efi/EFI/ubuntu
sudo mount $(blkid | grep -i "EFI System Partition" | sed 's/:.*//') /mnt
sudo cp -a EFI/ubuntu /mnt/EFI
sudo umount /mnt
# add NVRAM entry for Ubuntu
DISK=$(blkid | grep -i "EFI System Partition" | sed 's/p.*//')
sudo efibootmgr -c -d ${DISK} -p $(sudo gdisk -l ${DISK} | grep -i "EFI System Partition" | awk '{print $1}') -l \\EFI\\ubuntu\\shimx64.efi -L ubuntu
# update /etc/fstab
sudo sed -i "s/$(grep '^UUID' ../etc/fstab | grep '/boot/efi' | awk '{print $1}' | sed 's/UUID=//')/$(blkid | grep -i 'EFI System Partition' | awk '{print $2}' | sed 's/"$//' | sed 's/.*"//')/" ../etc/fstab

5. Boot from Ubuntu
# update GRUB if used as a boot loader
sudo update-grub

Note that if a different distro to Ubuntu (or Ubuntu flavour) was previously installed then the above instructions might need to be modified to change the restore from 'EFI/ubuntu' to whatever directory is relevant and to create the label for the NVRAM entry that reflects the distro installed.  

If Ubuntu previously wasn't booting because the EFI partition was too small simply reboot from the Ubuntu LiveUSB and reinstall Ubuntu.

Both sets of instructions can be downloaded from:
Please donate if you find my work useful using the following link http://goo.gl/nXWSGf.



























Thursday 21 December 2017

Lenovo BIOS issues

Canonical has replaced the 17.10 ISO download button with a notice stating 'The download of Ubuntu 17.10 is currently discouraged due to an issue on certain Lenovo laptops. Once fixed this download will be enabled again'.

It looks like Ubuntu kernels since 4.13.0-19.22 and mainline kernel builds since v4.14-rc2 are affected as they are compiled with 'CONFIG_SPI_INTEL_SPI_PCI=m' which enables the Intel SPI serial flash controller and which comes with the ominous warning 'Say N here unless you know what you are doing. Overwriting the SPI flash may render the system unbootable.'

It looks like development Ubuntu kernels since 4.11.0-0.5 and Canonical mainline kernel builds since v4.11-rc4 are affected as they are compiled with 'CONFIG_SPI_INTEL_SPI=m' and 'CONFIG_SPI_INTEL_SPI_PLATFORM=m' which enables the Intel PCH/PCU SPI flash platform driver and which comes with the ominous warning 'Say N here unless you know what you are doing. Overwriting the SPI flash may render the system unbootable.'

The bug report has been updated to state "Bug may effect machines from any manufacturer that uses BIOS based on Insyde Software".

Currently Canonical are respinning the affected Ubuntu kernels with a patch to disable this setting and will no doubt respin the 17.10 ISOs that include the 4.13.0.19.22 Ubuntu-4.13.0-16.19 kernel with likely the replacement (fixed) kernel of Ubuntu-4.13.0-21.24. They are also respinning the affected Ubuntu HWE kernels so that they work with 16.04 etc. At this stage it is unclear whether they will respin the mainline kernel builds and it is most probable they won't.

The latest Canonical mainline build of v4.15-rc5 has been compiled without the Intel SPI drivers and is safe to use.

As a result I am removing all ISOs with the affected kernels. Note that the ISOs are provided as examples of using my 'isorespin.sh' so if a particular ISO is still required it can be easily recreated by following the documentation on the page where it was made available.

So if you are a Lenovo user have a device with a BIOS from Insyde Software 
I recommend you check the bug report and if you are about to try or install Linux using 'isorespin.sh' I would recommend you only respin a new Ubuntu/Ubuntu flavoured 17.10 ISO once available from Canonical and that if you are upgrading the kernel regardless of distro you only use a newly respun Ubuntu kernel of 4.13.0-21.24 or greater as they become available which is downloaded and installed as a package from  Canonical sources or a Canonical mainline build starting from v4.15-rc5.

Whilst the issue has been reported as affecting Lenovo users there is a are now similar reports from a Dell user others using Acer, Toshiba and Dell devices. It may affect machines from any manufacturer that uses a BIOS from Insyde Software. If in doubt the best advice at this stage would be to avoid any kernel compiled with  'CONFIG_SPI_INTEL_SPI_PCI'  'CONFIG_SPI_INTEL_SPI' or  'CONFIG_SPI_INTEL_SPI_PLATFORM set.

The bug report has now been updated with:
Fix: The issue was fixed in Kernel Version 4.13.0-21. But previous affected machines still suffered from a broken BIOS.
Repair: Boot Linux and Install Kernel Version 4.14.9. Reboot into Linux and BIOS should be restored to a working state.
My analysis shows that any mainline kernel build after (and including) 4.14.3 should work as a repair kernel as they include the patch 'spi-nor: intel-spi: Fix broken software sequencing codes' (commit 9d63f17661e25fd28714dac94bdebc4ff5b75f09 upstream). Equally Ubuntu-4.14.0-11.13 and later should also repair the BIOS as they include the same patch.

The repair & fix process is not particularly obvious however I would:
  1. Install both the 'fix' and 'repair' kernels whilst booted from the currently running kernel
  2. Purge all kernels except the currently running kernel, 'fix' and 'repair' kernels
  3. Reboot the device to the 'repair' kernel
  4. Purge the previously run kernel (termed 'currently running kernel' above)
  5. Reboot the device to the 'fix' kernel 
  6. Purge the 'repair' kernel
This should just leave the 'fix' kernel as the new currently running kernel.

If the 'repair' kernel doesn't then Canonical have now created another kernel package which includes a new patch and can be installed from:

http://people.canonical.com/~ypwong/lp1734147/linux-image-4.15.0-041500rc6-generic_4.15.0-041500rc6.201712312330+20170103+1_amd64.deb


Whilst the v4.14.9 included the commit '9d63f17661e2' ('spi-nor: intel-spi:
Fix broken software sequencing codes') and recovered many systems it doesn't repair all, specifically where WREN was not in effect. Mika Westerberg has created this new patch 'spi-nor: intel-spi: Prefer WREN over other write enables' (commit 9c50107a6560bb4997a34007f23fbe754009a86d) which prefers WREN over other write enable preopcodes.

Most recent update: 

An update to linux kernel on Ubuntu 17.10 that enabled the Intel SPI drivers results in a serial flash that is read only in Intel Broadwell and Haswell machines with serial flashes with SPI_NOR_HAS_LOCK set.

Symptoms:

 * BIOS settings cannot be saved
 * USB Boot impossible
 * EFI entries read-only

Fix:

The issue was fixed in kernel version 4.13.0-21 by configuring the kernel so it is not compiled with Intel SPI support. But previous affected machines still suffered from a broken BIOS.

Repair:

 If you still can boot into Ubuntu, you can recover your BIOS with the following steps:

1. Boot into Ubuntu
2. Download http://people.canonical.com/~ypwong/lp1734147/linux-image-4.15.0-041500rc6-generic_4.15.0-041500rc6.201712312330+20170103+1_amd64.deb
3. Install the downloaded package:
  $ sudo dpkg -i linux-image-4.15.0-041500rc6-generic_4.15.0-041500rc6.201712312330+20170103+1_amd64.deb
4. Make sure the kernel is installed without any error. Once installed, reboot.
5. At grub, choose the newly installed kernel. You can choose the "recovery" mode.
6. Reboot and go to BIOS settings to confirm your BIOS has been recovered.
7. In case your BIOS is not recovered, reboot to the new kernel, then reboot *once again* to the new kernel, do not enter BIOS settings before the reboot. After the second reboot, check BIOS.
8. If your BIOS issue remains, download another kernel from http://people.canonical.com/~ypwong/lp1734147/linux-image-4.15.0-041500rc6-generic_4.15.0-041500rc6.201712312330+clear+debug_amd64.deb, and use dpkg to install it, then repeat steps 4 to 6.

After your BIOS is fixed, the kernel packages you just installed are no longer needed, you can remove it by running 'sudo dpkg -r linux-image-4.15.0-041500rc6-generic'.

Affected Machines:

Lenovo B40-70
Lenovo B50-70
Lenovo B50-80
Lenovo Flex-3
Lenovo Flex-10
Lenovo G40-30
Lenovo G50-30
Lenovo G50-70
Lenovo G50-80
Lenovo S20-30
Lenovo U31-70
Lenovo Y50-70
Lenovo Y70-70
Lenovo Yoga Thinkpad (20C0)
Lenovo Yoga 2 11" - 20332
Lenovo Z50-70
Lenovo Z51-70
Lenovo ideapad 100-15IBY
Acer Aspire E5-771G
Acer Aspire ES1-111M-C1LE (fixed following your new instruction (thank you))
Acer TravelMate B113
Acer Swift SF314-52 (Fixed by 4.14.9)
Toshiba Satellite S55T-B5233
Toshiba Satellite L50-B-1R7
Toshiba Satellite S50-B-13G
Dell Inspiron 15-3531
Mediacom Smartbook 14 Ultra M-SB14UC
Acer Aspire E3-111-C0UM
HP 14-r012la

/Most recent update 


If you want to respin the previously released Ubuntu 17.10 ISO (or similar) and replace the Ubuntu-4.13.0-16.19 kernel with the newly 'corrected' Ubuntu-4.13.0-21.24 kernel then use the following command:
isorespin.sh -i ubuntu-17.10-desktop-amd64.iso \
-e "linux-image-4.13.0-16-generic linux-headers-4.13.0-16" \
-p "linux-generic linux-signed-generic"
This will create an ISO 'linuxium-ubuntu-17.10-desktop-amd64.iso'. You can then use this as the ISO for further respinning or add additional options to the above command (e.g. '--atom' to make the ISO suitable for booting on Intel Atom (Bay Ttail and Cherry Trail) devices.

The respinning will update (as taken from the file system manifest):
linux-generic   4.13.0.16.17
linux-headers-4.13.0-16 4.13.0-16.19
linux-headers-4.13.0-16-generic 4.13.0-16.19
linux-headers-generic   4.13.0.16.17
linux-image-4.13.0-16-generic   4.13.0-16.19
linux-image-extra-4.13.0-16-generic     4.13.0-16.19
linux-image-generic     4.13.0.16.17
linux-signed-generic    4.13.0.16.17
linux-signed-image-4.13.0-16-generic    4.13.0-16.19
linux-signed-image-generic      4.13.0.16.17
to
linux-generic 4.13.0.21.22
linux-headers-4.13.0-21 4.13.0-21.24
linux-headers-4.13.0-21-generic 4.13.0-21.24
linux-headers-generic 4.13.0.21.22
linux-image-4.13.0-21-generic 4.13.0-21.24
linux-image-extra-4.13.0-21-generic 4.13.0-21.24
linux-image-generic 4.13.0.21.22
linux-signed-generic 4.13.0.21.22
linux-signed-image-4.13.0-21-generic 4.13.0-21.24
linux-signed-image-generic 4.13.0.21.22
Please donate if you find my work useful using the following link http://goo.gl/nXWSGf.

Friday 8 December 2017

Unity: I'm back and bionic

Ubuntu 18.04 daily ISO respun with unity

By now the future of Ubuntu without unity is a reality for anyone using the daily builds of Ubuntu 18.04 LTS otherwise know as Bionic Beaver. However as reported by OMG! UBUNTU! there is a growing Ubuntu community who would like to use the Unity 7 desktop by default. An initial proposal to create a new community Ubuntu flavour as Ubuntu Unity has been knocked back pending further clarification of development support not only for the unity packages but also for compiz, gtk, nux and all the other dependencies especially as some may be deprecated both now or maybe soon.

Whilst an Ubuntu Unity Remix may be the next step the project team have already built a PPA for the experimental packages for the Unity 7 desktop together with an updated ISO for testing. Currently this ISO is also available along with all the Bionic Beaver testing ISOs from the tester-wiki.

If you are interested in the project I recommend you look at their Ubuntu Community Hub.

Ubuntu 18.04 daily ISO with default GNOME

If you want to try but your hardware won't boot the testing ISO it is possible to use my 'isorespin.sh' script to respin it suitable for Intel Atom and Intel Apollo Lake devices.

Alternatively you can respin the current daily Bionic Beaver ISO and replace GNOME with Unity by adding their PPA. An example command is:

isorespin.sh -i bionic-desktop-amd64.iso -e gdm3 \
-r ppa:unity7maintainers/unity7-desktop -p ubuntu-unity-desktop
which creates the ISO 'linuxium-bionic-desktop-amd64.iso'. Likewise you can also add additional respin options for example '--apollo' to make a bootable ISO for Intel Apollo Lake devices. See my documentation for a complete explanation of the options and how they work.

Please donate if you find my ISO script useful using the following link http://goo.gl/nXWSGf.




Friday 1 December 2017

Linux on MINIX NEO Z83-4 and Z83-4 Pro

(update)

The final piece of the jigsaw is now in place for running Linux on the MINIX NEO Z83-4 and Z83-4 Pro devices with the mainline kernel now patched to support wifi, audio and bluetooth.

It has been an interesting kernel journey with:

v4.9 including the eMMC v5.0 driver required for accessing the internal storage
v4.11 including the HDMI audio driver.
v4.12 recognizing the BCM43455 wifi driver but suffered a regression with the release of v4.13
v4.13.2/v4.14 including a fix for BCM43455 wifi driver
v4.14 including a fix for the headphone audio driver
v4.15-rc1 now includes a fix for the bluetooth driver

However to run fully working Ubuntu on either device still requires additional steps.

Previously: The Canonical v4.15-rc1 mainline build was built using a patched config using default settings and does not include the changes required for including Intel ASoC Audio Drivers or the Serial Device Bus with serial drivers.

(previously)

So first it is necessary to create a new config and compile the kernel.

Update: The latest development kernel for Bionic ('unstable') now includes the required config changes and is available in the 'daily' Canonical build.

Then it is just respinning the official Ubuntu ISO using my 'isorespin.sh' script to add this kernel the compiled packages providing the latest kernel, the required UCM files and missing wifi firmware.

Unfortunately the most recent UCM file for the headphone audio driver isn't compatible so I've had to modify it specifically to work with these devices.

Also the wifi firmware file first needs to be extracted from the Windows installation where it is located at 'C:\Windows\System32\drivers\4345r6nvram.txt'.

Two additional files are required and they can be downloaded from:
and then rename 'MINIX-Z83-4_wrapper-linuxium-install-UCM-files.sh' as 'wrapper-linuxium-install-UCM-files.sh' and make it executable ('sudo chmod 755 wrapper-linuxium-install-UCM-files.sh').

Once everything is prepared the following respin command was used to create the Ubuntu ISO as shown above:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -l "linux-headers-4.15.0-rc1-linuxium_4.15.0~rc1~linuxium_amd64.deb linux-image-4.15.0-rc1-linuxium_4.15.0~rc1~linuxium_amd64.deb" -f "linuxium-install-broadcom-drivers.sh wrapper-linuxium-install-broadcom-drivers.sh" -c wrapper-linuxium-install-broadcom-drivers.sh -f 4345r6nvram.txt -c "mv /usr/local/bin/4345r6nvram.txt /lib/firmware/brcm/brcmfmac43455-sdio.txt" -f HdmiLpeAudio.conf -c "mv /usr/local/bin/HdmiLpeAudio.conf /usr/share/alsa/cards" -f MINIX-Z83-4-chtrt5645.conf -c "mv /usr/local/bin/MINIX-Z83-4-chtrt5645.conf /usr/share/alsa/ucm/chtrt5645/chtrt5645.conf" -f MINIX-Z83-4-chtrt5645-HiFi.conf -c "mv /usr/local/bin/MINIX-Z83-4-chtrt5645-HiFi.conf /usr/share/alsa/ucm/chtrt5645/HiFi.conf"

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

At this stage it is still very early in the release cycle and there is still work to be undertaken to simplify the respinning of ISOs for these devices.

However the key point is that the mainline kernel now supports MINIX NEO Z83-4 and Z83-4 Pro devices. Meaning over time as various distros and OS migrate to the v4.15 kernel and later versions they should work flawlessly on them.

Please donate if you find my work useful using the following link http://goo.gl/nXWSGf.