Thursday 29 June 2017

Ubuntu on the GPD Pocket using 'isorespin.sh'


Although the GPD Pocket has already started to ship the support for running Ubuntu on the device is currently still in development. This means anyone trying to run Ubuntu is faced with the usual hurdles of booting, wifi, screen rotation and all the other frequently encountered issues.

Not surprisingly you can't just download an official Ubuntu ISO and be up running problem free. However I thought it would be interesting to see if the fixes required could be incorporated into an ISO through respinning using my 'isorespin.sh' script.

I've used the solutions that chrisawcom has posted on reddit (https://www.reddit.com/r/GPDPocket/comments/6idnia/linux_on_gpd_pocket) and created a script that basically updates an official ISO with the required fixes allowing it to be respun.

The command I use to respin the ISO is:

isorespin.sh -i ubuntu-17.04-desktop-amd64.iso -u -p thermald -p "libproc-daemon-perl libproc-pid-file-perl liblog-dispatch-perl" -f linuxium-install-UCM-files.sh -f gpd_pocket -f gpd_pocket.sh -c gpd_pocket.sh -g "" -g "i915.fastboot=1 fbcon=rotate:1"

and I'll briefly cover each of the options as follows:

-i  ubuntu-17.04-desktop-amd64.iso uses an official Ubuntu desktop 64-bit ISO as the base ISO.
-u updates the kernel to the latest Ubuntu Kernel Team kernel build located at http://kernel.ubuntu.com/~kernel-ppa/mainline (current is v4.12-rc7). This is important as the proposed v4.12 kernel includes critical patches that fix many of the issues found when running Linux on an Intel Atom SOC including audio and wifi.
-p installs specific software packages required for thermal management and fan controls.
-f adds the scripts that I've written to specifically customize the ISO with audio, wifi and screen support together with the required files.
-g both removes the default kernel boot parameters and adds additional kernel boot parameters required for successfully booting the device related to screen handling.

Looking at the main configuration script (gpd_pocket.sh) in more detail this basically configures:

  • the internet access for the script
  • the Broadcom wifi driver
  • screen rotation
  • screen brighness
  • touchscreen  
  • fan

by implementing the solutions identified on reddit.

The key benefit is including all the fixes within an ISO that can then be repeatedly used for testing. Respinning the ISO produces the log file:


Script '/usr/local/bin/isorespin.sh' called with '-i ubuntu-17.04-desktop-amd64.iso -u -p thermald -p libproc-daemon-perl libproc-pid-file-perl liblog-dispatch-perl -f linuxium-install-UCM-files.sh -f gpd_pocket -f gpd_pocket.sh -c gpd_pocket.sh -g  -g i915.fastboot=1 fbcon=rotate:1' ...
Work directory 'isorespin' used ...
ISO '/home/linuxium/Documents/ubuntu-17.04-desktop-amd64.iso' respun ...
Kernel boot parameters 'i915.fastboot=1 fbcon=rotate:1' added ...
Initial kernel boot parameters 'quiet splash' deleted ...
Bootloader 'GRUB' added ...
Kernel updated with mainline kernel version '4.12.0-041200rc7-generic' ...
Package 'thermald' added ...
Package 'libproc-daemon-perl libproc-pid-file-perl liblog-dispatch-perl' added ...
File '/home/linuxium/Documents/linuxium-install-UCM-files.sh' added ...
Directory '/home/linuxium/Documents/gpd_pocket' added ...
File '/home/linuxium/Documents/gpd_pocket.sh' added ...
Command run ...
# gpd_pocket.sh
/usr/local/bin/gpd_pocket.sh: Configuring GPD Pocket ...
./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 
/usr/local/bin/gpd_pocket.sh: Installing Broadcom files ...
/usr/local/bin/gpd_pocket.sh: Reloading Broadcom driver ...
/usr/local/bin/gpd_pocket.sh: Installing rotation files ...
/usr/local/bin/gpd_pocket.sh: Installing brightness files ...
/usr/local/bin/gpd_pocket.sh: Installing touchscreen files ...
/usr/local/bin/gpd_pocket.sh: Installing fan service ...
Created symlink /etc/systemd/system/multi-user.target.wants/gpdfand.service -> /lib/systemd/system/gpdfand.service.
/usr/local/bin/gpd_pocket.sh: Starting fan service ...
Running in chroot, ignoring request.
/usr/local/bin/gpd_pocket.sh: Configuration of GPD Pocket finished.
Respun ISO created as 'linuxium-v4.12-rc7-ubuntu-17.04-desktop-amd64.iso'.

and an ISO. Anyone interested can download my respun ISO 'linuxium-gpd-v4.12-rc7-ubuntu-17.04-desktop-amd64.iso' (ISO removed due to Lenovo BIOS issues) and write to a USB using the 'dd' command:

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

where '/dev/sdX' is the correct device for your USB (but first check using commands like 'df', 'blkid' or 'lsblk' to confirm its correct name).

If you want to respin the ISO yourself then download and unzip the file 'gpd_pocket.zip' which contains the required script and files together with 'linuxium-install-UCM-files.sh' for the ALSA UCM files. For the ISO you need to download an Ubuntu 64-bit desktop ISO (e.g. Ubuntu 17.04 from http://releases.ubuntu.com/17.04/ubuntu-17.04-desktop-amd64.iso or Ubuntu 16.04 from http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-desktop-amd64.iso) together with my 'isorespin.sh' script and then run the command above.

One additional option you might consider adding is '-s 200MB' to add persistence to your ISO as it means that you can retain your data, settings and any changes you make between reboots which is particularly useful when trying to get things to work.

More details about my 'isorespin.sh' script can be found here including full documentation including examples.

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





27 comments:

nerd65536 said...

I think gpd_pocket.zip is missing some files:

isorespin.log on a Kubuntu 17.04 .iso
(lightdm user errors are expected: Kubuntu doesn't use lightdm.)

/usr/local/bin/gpd_pocket.sh: Installing Broadcom files ...
cp: cannot stat '/usr/local/bin/gpd_pocket/brcmfmac4356-pcie.txt': No such file or directory
/usr/local/bin/gpd_pocket.sh: Reloading Broadcom driver ...
/usr/local/bin/gpd_pocket.sh: Installing rotation files ...
chown: invalid user: 'lightdm:lightdm'
cp: cannot stat '/usr/local/bin/gpd_pocket/monitors.xml': No such file or directory
chown: invalid user: 'lightdm:lightdm'
cp: cannot stat '/usr/local/bin/gpd_pocket/adduser.local': No such file or directory
chmod: cannot access '/usr/local/sbin/adduser.local': No such file or directory
/usr/local/bin/gpd_pocket.sh: Installing brightness files ...
/usr/local/bin/gpd_pocket.sh: Installing touchscreen files ...
/usr/local/bin/gpd_pocket.sh: Installing fan service ...
cp: cannot stat '/usr/local/bin/gpd_pocket/gpdfand': No such file or directory
chmod: cannot access '/lib/systemd/system-sleep/gpdfand': No such file or directory
cp: cannot stat '/usr/local/bin/gpd_pocket/gpdfand.service': No such file or directory
Failed to enable unit, file gpdfand.service: No such file or directory.

Linuxium said...

Oops! Thanks. Now fixed.

Shimshon said...

I am not able to run this from Arch Linux. I have the following log:

Script './isorespin.sh' called with '-i ubuntu-17.04-desktop-amd64.iso -l *.deb -p libproc-daemon-perl libproc-pid-file-perl liblog-dispatch-perl thermald va-driver-all vainfo libva1 i965-va-driver gstreamer1.0-libav gstreamer1.0-plugins-bad-faad gstreamer1.0-vaapi vlc -f 90x11-rotate_and_scale -f HiFi.conf -f chtrt56
45.conf -f brcmfmac4356-pcie.txt -f wrapper-fix-sound-wifi.sh -f wrapper-rotate-and-scale.sh -f gpdfand/gpdfand -f gpdfand/gpdfand.pl -f gpdfand/gpdfand.service -f wrapper-gpd-fan-control.sh -f monitors.xml -f adduser.local -f 20-intel.conf -f 99-local-bluetooth.rules -f 90-monitor.conf -c wrapper-rotate-and-scale.sh
-c wrapper-fix-sound-wifi.sh -c wrapper-gpd-fan-control.sh -g -g i915.fastboot=1 fbcon=rotate:1' ...
Work directory 'isorespin' used ...
ISO '/site/repo/gpd-pocket-ubuntu-respin/ubuntu-17.04-desktop-amd64.iso' respun ...
Kernel boot parameters 'i915.fastboot=1 fbcon=rotate:1' added ...
Initial kernel boot parameters 'quiet splash' deleted ...
Bootloader 'GRUB' added ...
Package 'libproc-daemon-perl' not found.

I've been discussing this with stockmind, who made gpd-pocket-ubuntu-respin to encapsulate all the steps needed, and he concluded that the problem is not with his wrapper, but with isorespin.sh itself. Any suggestions? I'd love to be able to respin my own ISOs rather than relying on others to create them.

Linuxium said...

So what happens when you run the script directly rather than through someone else's script? I tried and I didn't get any errors so it is not a problem with my script.

Anonymous said...

As stated in this comment:
http://linuxiumcomau.blogspot.com/2017/06/new-functionality-and-simplification-of.html?showComment=1497290747332&m=1#c5844976514914115629


To respin on Arch Linux without problems you should modify the PATH used:

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

Also this packages might be required:
sudo pacman -S cdrkit bc libisoburn squashfs-tools dosfstools

Unknown said...

Can you add support for android-x86 in isorespinsh?

Linuxium said...

No as the design and functionality provided by my script doesn't really align with Android based ISOs.

Unknown said...

I was looking at the GPD Pocket web site and it seems that the new kernel (4.13-rc1) "contains all the fixups and drivers you need to run the GPD with Linux"...

How this will affect the process of creating the iso of Ubunto LTS or I should use the mos recent Ubuntu?
I still need all the other files?

Thanks!!!

Linuxium said...

The problem will only be if the latest kernel 'v4.13-rc1' requires userspace files to support 'all the fixups and drivers you need to run the GPD with Linux'. The latest Ubuntu release or even daily build is likely to be missing these so you will have to look at what the fixes are and what userspace dependencies they have if any. Once know they can be included as part of the respinning similar to the above example.

Unknown said...

Would I go about this the same way if I wanted to try and install Kali Linux on the GPD? Any help would be appreciated, thanks!

Linuxium said...

My 'isorespin.sh' script no longer supports Kali due to Debian kernels being incompatible with Canonical's DMKS release for Intel Atom devices.

Unknown said...

Can you please add support for kali linux?

Linuxium said...

See my latest post 'Respinning security distros and upgrading packages' (http://linuxiumcomau.blogspot.com.au/2017/08/respinning-security-distros-and.html).

Isaiah R. said...

Thanks Linuxium,
I used your ISO image linked above. It installs fine and the OS mostly works, but the WiFi doesn't work ("No devices available" in the network menu). This is a critical problem for using the image. Any info on how to get this to work?

Linuxium said...

Hans de Goede mentions on his website (http://hansdegoede.livejournal.com/17445.html)
'If you kernel is new enough it will trip over a BIOS bug which causes the wifi chip to get disabled, you can "fix" the BIOS bug (if you do not have
the 20161118 BIOS) by changing the following BIOS setting: "Chipset" -> "South Bridge" -> "LPSS & SCC Configuration" -> "SCC SDIO Support"
to "Disabled"'. The patch to fix this is now in v4.13 rc kernels so if changing the BIOS doesn't work you can either respin the ISO (as the 'u' option with include the v4.13-rc4 kernel) or manually upgrade the kernel by downloading the binary files from 'http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13-rc4/' remembering you just want the three files which are linux-headers-4.13.0-041300rc4_*_all.deb and both the linux-*-4.13.0-041300rc4-generic_*_amd64.deb files and install using 'dpkg -i'.

Unknown said...

Thanks Linuxium,

I had the same probem with WiFi not working and my GPD Pocket doesn't have the right BIOS version to make changes there. So I followed your instructions to upgrade the kernel and bingo! The WiFi started working straight away. Fantastic.

Many thanks.

Linuxium said...

Great. That is good to hear.

Unknown said...
This comment has been removed by the author.
Unknown said...

Hello, sorry I am little bit new on linux and I am having trouble installing this on a Intel Baytrail on my company.
I have downloaded the file linuxium-v4.12-rc7-ubuntu-17.04-desktop-amd64 from the link provided.
I have used another linux distro to run dd and install it on a usb drive.
When I boot it on the baytrail I only get a minimal grub command line.
Is there anyway to run graphical interface to install it?

Isaiah R. said...

I recommend using etcher (https://etcher.io/) to make create your usb key.

Unknown said...

I get the same result using etcher, I am still using the same ISO linuxium-v4.12-rc7-ubuntu-17.04-desktop-amd64

Linuxium said...

Perhaps your download is corrupt. Try downloading 'linuxium-v4.12-rc7-ubuntu-17.04-desktop-amd64' again and writing it with 'dd'. If the problem persists what is your 'dd' command and do you select the correct option from the bootloader when you boot?

leledumbo said...

Hello, I'm trying to respin KDE Neon ISO for GPD Pocket. However, I don't know why it fails to replace the kernel in original ISO. Therefore, instead of the latest 4.14-rc5 I still end up with kernel 4.10 which has no proper support for GPD Pocket. Can you help?

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

Comment removed as contained a URL.

Graham Conroy Harris said...

Hi, I have been trying to find a way to use the touchscreen on an Onda v116w dual w8/android 4.4 tablet. Intel Atom Z3736F BayTrail quad core 1.33 GHz burst to 2.16 GHz, 2 GB DDR3L RAM 1333. Under android in a terminal window running lsmod produces this output:
127|u0_a93@inet-phone-32:/ $ lsmod
atomisp_css2400b0_v21 663007 0 - Live 0xf5ec1000
lm3642 14143 0 - Live 0xf5b4b000
lm3554 14139 0 - Live 0xf5ae2000
gc_class 42959 0 - Live 0xf5b3f000
ov 29534 0 - Live 0xf5b36000
ov2722 27079 0 - Live 0xf5b21000
gc2235 23145 0 - Live 0xf5aee000
imx1x5 160438 0 - Live 0xf5b60000
gt9xx_ts 40414 0 - Live 0xf5b2b000
atmel_mxt_ts 36777 0 - Live 0xf5af7000
vxd392 87745 0 - Live 0xf5b0a000
videobuf_vmalloc 13188 1 atomisp_css2400b0_v21, Live 0xf5add000
videobuf_core 24013 2 atomisp_css2400b0_v21,videobuf_vmalloc, Live 0xf5b03000
gslx68x_ts 826044 0 - Live 0xf5d63000
bcm_bt_lpm 13877 0 - Live 0xf5ac8000
hdmi_audio 39013 0 - Live 0xf5ad2000
8723bs 1518058 0 - Live 0xf5bef000 (O)
u0_a93@inet-phone-32:/ $

I created an iso using your script and it boots fine, and works with USB mouse and keyboard but the touch screen doesn't work. I was hoping that you might have some experience of what to try next. I used these parameters with your script:

-i /home/graham/os-image/peppermint/Peppermint-10-20191210-amd64.iso \
{I also tried basing on linuxmint-20.2-mate-64bit.iso- same result}
--atom \
-k v5.11 \
-r "deb http://archive.ubuntu.com/ubuntu trusty main universe" \
-p "python-wxversion" -p "python-wxgtk2.8" \
-p "openssh-client" -p "openssh-server" -p "sshfs" -p "sshpass" \
-p "meld" -p "dwdiff" -p "gparted" -p "spacefm" \
-l "/home/graham/systems/_template/autokey-common_0.95.10-0_all.deb" \
-l "/home/graham/systems/_template/autokey-gtk_0.95.10-0_all.deb" \
-f "/home/graham/bin/WikidPad-WikidPad-2-3-rc02.zip" \
-f "/home/graham/bin/freeplane_bin-1.9.7.zip" \
-f "/home/graham/wiki" \
-s 128MB

Linuxium said...

I don't have much experiene of touchscreens through lack of devices and what I know I've included under 'Touchscreen issues' in my documentation of 'isorespin' (see https://url.linuxium.com.au/isorespin-documentation).

As a side note, resulting from Google making changes to its products (e.g. Google+) and how they work (e.g. GDrive) several of the links in this blog no longer work. This includes the link 'gpd_pocket.zip' above.

However looking at what in 'gpd_pocket.zip' is relevant to the touchscreen shows that it simply added the parameters:

-f gpd_pocket.sh -c gpd_pocket.sh

to respinning and the relevant contents of 'gpd_pocket.sh' should include:

#!/bin/bash
# Linuxium's isorespin.sh abridged GPD Pocket configuration script based information from https://www.reddit.com/r/GPDPocket/comments/6idnia/linux_on_gpd_pocket/
echo "$0: Configuring GPD Pocket ..."
cd /usr/local/bin
# touchscreen
echo "$0: Installing touchscreen files ..."
echo "xinput set-prop 11 145 0 1 0 -1 0 1 0 0 1" | sudo tee /etc/X11/Xsession.d/99touchscreen > /dev/null 2>&1
echo "$0: Configuration of GPD Pocket finished."
rm -rf gpd_pocket.sh

Hope this helps.

Post a Comment