Page 1 of 1

Ubuntu Bionic for OpenFrame

Posted: Tue Aug 13, 2019 1:14 pm
by roobarb!
________________________________________________________________

Ubuntu Bionic for OpenFrame

Ubuntu Bionic for OpenFrame (Development Version with Kernel 5.2)


Follow the instructions on this page for installing to external media,
or use the Reflashing Tool to install to internal memory.

________________________________________________________________


I've recently had the need to run Ubuntu Bionic on most of my OpenFrames and I've spent some time (far too much time!) tidying up my efforts into something which I'm happy to release for everybody. Given that this probably the last Ubuntu LTS to support 32-bit hardware I thought it was worth a bit of polish. :)

This single image works for both internal and external storage for OpenFrame 1 (Joggler) and OpenFrame 2 devices.

There are a few things which are a bit different to previous images; most notably this is a command line only image, created to be as 'vanilla' as possible. This means you can use instructions available for any Ubuntu Bionic system to install whichever GUI environment you might like. Or none at all if you just want a single-use system.

I also needed to add Bluetooth to my OpenFrames and tried out a bunch of combination adapters. I eventually found this EZCast WiFi 2.4/5 GHz + Bluetooth 4.2 Adapter for £10 from Amazon. You can easily remove the plastic housing (though not strictly necessary) and replace the old internal Ralink 2770F card.


Highlights
  • Single image for any OpenFrame.
  • Built for size; about 430 MB space used initially.
  • Fully working audio and OpenGL with kernel drivers.
  • Automating scripts for completing common tasks (eg. installing X.Org Server).
  • Support for the Realtek 8821CU combined 5 GHz WiFi and Bluetooth 4.2 module.
  • Simple before-boot wireless network configuration.

Scripts
  • of-allsudo - Allow all users to use the sudo command with no password. Nice security hole puncher there.
  • of-autologin <user> - Enable automatic login for a given user account.
  • of-expand - Expand the root partition to fill the space available.
  • of-getip - Output all IP addresses and their interfaces.
  • of-install-build - Fetch kernel headers and install build-essential packages.
  • of-install-xorg - Installs the X.Org Server
  • of-netplan - Apply new network settings and restart interfaces.

Installation and Setup

Follow the instructions from one of the pages linked at the top (I'll create a proper page for this eventually). Boot the system and log in with:

Username: root
Password: joggler

If you're not installed to an OpenFrame 1's internal memory, run the comand of-expand to increase the root partition size to fill the whole volume (will reboot). Give it at least 10 minutes to complete - while it's running there'll be a file called 'expand' in the /root directory and there'll be a lot of drive activity.

Run passwd root to change the default root password. Use adduser <username> to add new user accounts and usermod -aG sudo <username> to give your user the right to run commands with sudo. Don't use the of-allsudo script unless you're developing something. In fact, I should probably remove that one.

If you need to save more space you could certainly uninstall some packages; the trick was balancing size and functionality. You can install a complete X.Org Server system with OpenGL running and a basic desktop within 1 GB, which was a loose aim when I was developing the image.

To save drive space, all apt package lists are stored in RAM. The OpenFrame has 512 MB RAM and half of this will be used when you've run apt update. If you install anything using apt, reboot to clear the package lists afterwards or you'll run into low memory issues. If you have plenty of drive space, remove or comment out the two lines related to apt lists in /etc/fstab. You should be left with only /var/log and /tmp mapped to tmpfs. I may automate this in of-expand. Don't remove the lines if you're running from internal memory!

Issues

If you're using an OpenFrame 2 the wireless connection does work... sort of. Performance is absolutely terrible and I've not been able to do anything about it. Maybe it's my OF2 which is at fault, but feedback would be appreciated. We're using the brcmsmac driver; the b43 was worse and broke Bluetooth for me. The broadcom-wl driver might do the trick, but there are licensing issues, so I can't distribute it. Good luck!


Autobuilder

Because I wanted to experiment with automated image creation, Ubuntu Bionic for OpenFrame is built without user intervention on one of my servers. Every time a new version of the 3.16 kernel is released the build system will automatically fetch, patch and compile it, along with all support modules, then create a new image. You can tell if it's an automated build as the kernel version will be, for example, 3.16.71op (no number at the end).

Individual builds are not tested, so please post here if there's something obviously broken.

If you want to see the build log for the last run, they're all here.


Waffle

This was really an experiment in producing an end-to-end, intervention-free process for creating operating system images which could be applied to any system, starting with kernel source code and working up from there. It's not quite as hardcore as compiling the entire OS a la Gentoo Linux, but there was still a decent learning curve. We're cross-compiling everything in a 32-bit schroot environment on a 64-bit server, using the headers from the kernel we've built to compile external modules and then building and updating the entire OS from the Ubunutu base system into an image file, without ever touching a real OpenFrame device.

I was particularly pleased to be able to add support for a decent 5 GHz wireless adapter with Bluetooth, even though it required a lot of work to find suitable drivers which could be 'encouraged' into compiling for kernel 3.16, plus the added work of automatically recompiling them for every new kernel. I did try to get the drivers working for the original Openpeak OS, but there's no way it was worth the effort for me; I'm no driver programmer and I think there's a lot that would need modifying. Someone prove me wrong! ;)

Anyone wanting to investigate any of this for themselves, all of the code is here:

https://github.com/andydvsn/openframe-kernel
https://github.com/andydvsn/openframe-ubuntu
https://github.com/andydvsn/rtl8821cu_bt
https://github.com/andydvsn/rtl8821cu_wlan


Appeal

You may notice we're still using kernel 3.16. Everything works for this process right up to the latest kernel 5.2, except for ALSA audio switching. If you know anything about C programming or ALSA, please help in the 'Annual ALSA Appeal' thread. We have almost everything working, including line out detection; the only thing remaining is properly muting the internal speaker when a line out is connected. At the moment the speaker remains powered and an audio system interference crackle is always present. Get this fixed and I'll be able to bump us up to the latest long-term kernel.


This should be a great little project platform, so have fun with it! You'll find many Debian or Ubuntu guides are directly applicable, including a lot of Raspberry Pi guides - just don't go trying to install their ARM binaries, that won't work! ;)

Re: Ubuntu Bionic for OpenFrame

Posted: Tue Aug 13, 2019 2:46 pm
by Andrew1971
@roobarb
Thank you for your continuing hard work for the Joggler. Very much appreciated.
Many Thank's
Andrew

Re: Ubuntu Bionic for OpenFrame

Posted: Tue Aug 13, 2019 4:27 pm
by roobarb!
Thanks, @Andrew1971!

Hilariously enough, minutes after publishing this, kernel 3.16.72 was released with a breaking change to the USB struct adapter used by the RTL8821CU Bluetooth driver. :roll:

Code: Select all

error: ‘struct usb_interface’ has no member named ‘pm_usage_cnt’
In case anybody ends up Googling their way here, the solution is to switch any use of counter ‘pm_usage_cnt’ with ‘dev.power.usage_count’. The latest image works fine now.

Re: Ubuntu Bionic for OpenFrame

Posted: Wed Aug 14, 2019 7:15 am
by hawsey
Thank you for this Roobarb , it is appreciated .

Sent from my Moto G (4) using Tapatalk


Re: Ubuntu Bionic for OpenFrame

Posted: Wed Aug 14, 2019 3:11 pm
by hawsey
@Roobarb , with this build does that wireless adapter you linked to work out of the box please ?
Also just building a simple desktop environment is hard for my limited skills unfortunately :-( , can I ask if you have such a build for say a usb stick that you could share pretty please .
Thanks again :-)

Sent from my Moto G (4) using Tapatalk


Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 1:08 am
by pete
Great news roobarb!

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 2:47 am
by roobarb!
hawsey wrote:
Wed Aug 14, 2019 3:11 pm
@Roobarb , with this build does that wireless adapter you linked to work out of the box please ?
Yup. Won't work with the original OpenPeak OS because the drivers won't build for that kernel, but using this image you just unplug the old Ralink 2770F, disconnect the 2.4 GHz antennae and plug this one in. Old antennae aren't used with the new adapter.
hawsey wrote:
Wed Aug 14, 2019 3:11 pm
Also just building a simple desktop environment is hard for my limited skills unfortunately :-( , can I ask if you have such a build for say a usb stick that you could share pretty please .
Thanks again :-)
I don't, but what do you need it to do? I've not tested much in any GUI environment beyond "oh good, the windows move", but if I get some time I'll take a look.

In the meantime, this might work.

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 6:16 am
by hawsey
Cheers , looks like I could follow that to get a desktop.
I just need wireless to work so I'll buy one of those adapters you used :-)
I would like to use it for some amateur radio stuff .

Sent from my Moto G (4) using Tapatalk


Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 9:40 am
by roobarb!
hawsey wrote:
Thu Aug 15, 2019 6:16 am
I just need wireless to work so I'll buy one of those adapters you used :-)
I would like to use it for some amateur radio stuff .
Sounds interesting!

The old wireless adapters all still work on the OF1/Joggler, so don't feel like you have to change it - but having 5 GHz wifi is great (so much 2.4 GHz interference around here) and when I get time I'd like to play with Bluetooth. The adapter has Bluetooth LE support as well, so you can run a scan with:

Code: Select all

hcitool lescan
It's remarkable how many MAC addresses show up. :)

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 8:26 pm
by Juggler
Thanks very much roobarb!, this is some amazing work !

I've downloaded the image. Just need to find a spare Joggler to try it on.

Would it be possible to share the image with the v5 kernel ? I wouldn't be using sound, so the ALSA issues shouldn't affect my use. Additionally / alternatively, do you have any instructions on how to include the v5 kernel in the automated build rather than 3.16 ?

I had a quick look through the latest build's log and it all seems fine. Surprised I understood most of it !

The WiFi Bluetooth dongle you've referenced above looks appealing and at a good price.

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 15, 2019 10:30 pm
by roobarb!
Thank you! Yeah, of course - I just need to bundle together the patches in the right places and I could start running a v5 build branch as well. Might actually be a useful thing to have if anybody can dig in to the ALSA issues. I had an update from one of the ALSA developers a couple of weeks ago - he seems happy to help, but I honestly seem to get a bit lost in that world!

I’ll look into it tomorrow if I get some time.

Re: Ubuntu Bionic for OpenFrame

Posted: Sun Aug 18, 2019 9:39 pm
by roobarb!
Juggler wrote:
Thu Aug 15, 2019 8:26 pm
Would it be possible to share the image with the v5 kernel ? I wouldn't be using sound, so the ALSA issues shouldn't affect my use.
I've managed to get this working - there were a few things that needed tweaking for kernel v5.2, including a squiffy issue with misidentification of the machine architecture (because I'm building 32-bit images on a 64-bit system). You can grab a copy of Bionic with the 5.2 kernel here.

So you know, I've not tested it on a real Joggler yet and I've excluded the RTL8821CU drivers for that little network adapter because I think some of it is baked in to the kernel now. The drivers I was using for 3.16 won't compile under 5.2 right now anyway. Also, the kernel config is bloated because I fed in one I did for kernel 4 and told it to pick defaults for anything new. If you spot anything that can be removed or you need compiled into the kernel, just let me know.

When I get around to it I'll also change the filenames of the builds to include the date, so people can more easily match the image against the build log in case there are any weird issues.

Re: Ubuntu Bionic for OpenFrame

Posted: Tue Aug 20, 2019 7:42 pm
by pete
Wrote the image to the Joggler emmc. Working fine here Andy. Very nice!!!

Note this Joggler has an adjusted Realtek NIC with ROM.

Deleted my stuff here cuz I tried with two Jogglers. Then after a bit would get RW errors on the eMMC after a couple of reboots.

I am assuming maybe I have too many RW's on these Jogglers.

Will try again today.

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 22, 2019 12:38 am
by pete
Update 21st of August 2019.

I was able to get a desktop going on the Joggler eMMC. Used barebones lxde-core. Works well at around 600Mb.

Followed Andy's steps above and added the barebones lxde-core.

1 - wrote image to USB stick
2 - booted with USB stick and wrote image to eMMC
3 - logged in as root and created joggler user
4 - ran /usr/local/sbin/of-install-xorg
5 - ran sudo apt install lxde-core
6 - rebooted and logged in as joggler and went to desktop with no issues.

Here is a picture of the Joggler running the desktop and Gparted.
Joggler.jpg
root@openframe:/usr/local/sbin# uname -a
Linux openframe 5.2.9op #1 Sun Aug 18 01:44:25 BST 2019 i686 i686 i686 GNU/Linux

Checked the network interfaces:

root@openframe:/usr/local/sbin# sudo lshw -class network

*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: eth0
version: 02
serial: 02:0e:8e:24:bf:96
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full ip=192.168.244.250 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
resources: irq:16 ioport:e000(size=256) memory:fef10000-fef10fff memory:fef00000-fef0ffff memory:d0000000-d000ffff

*-network:0
description: Ethernet interface
physical id: 1
bus info: usb@1:5
logical name: wlan0
serial: 00:0e:8e:24:bf:96
capabilities: ethernet physical
configuration: broadcast=yes driver=rt2800usb driverversion=5.2.9op firmware=0.36 link=no multicast=yes

*-network:1 DISABLED
description: Ethernet interface
physical id: 2
logical name: bond0
serial: 9a:93:f4:ee:eb:e0
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=bonding driverversion=3.7.1 firmware=2 link=no master=yes multicast=yes

Update 21st of August 2019 Update #2

Updated to install some more applications and got the RW error on the update and then it failed to boot. Gonna try to repair the Emmc with another Ubuntu boot disk.

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 22, 2019 1:05 pm
by roobarb!
It's great to see this working in other people's hands, particularly a GUI at 600 MB! And especially when I haven't booted or tested that 5.2.9 image at all. :D

Shame that your internal MMC seems to be giving up the ghost though. I suppose we could check the part number and see what the MTBF is rated at.

Re: Ubuntu Bionic for OpenFrame

Posted: Thu Aug 22, 2019 3:09 pm
by hawsey
Fantastic Pete , are you able to put this on a bootable stick for me please and share the image ?
Great work :-)

Sent from my Moto G (4) using Tapatalk


Re: Ubuntu Bionic for OpenFrame

Posted: Fri Aug 23, 2019 12:44 am
by pete
Yes I am impressed that I could fit a lite desktop on 600Mb. Yes most likely the two Jogglers have failing eMMCs.

Most likely it will run better on a USB stick.

Re: Ubuntu Bionic for OpenFrame

Posted: Fri Aug 23, 2019 9:23 am
by roobarb!
hawsey wrote:
Thu Aug 22, 2019 3:09 pm
Fantastic Pete , are you able to put this on a bootable stick for me please and share the image ?

To be honest, I'd recommend against that - there are unique IDs and keys set up on first boot; you can delete and regenerate them, but it's more effort that it's worth.

Download the image and type these commands:
  1. of-expand <- if you've written the image to a USB device or OpenFrame 2 internal memory
  2. adduser hawsey
  3. usermod -aG sudo hawsey
  4. of-install-xorg
  5. apt install lxde-core
  6. reboot
You'll then have the exact same desktop as Pete.

Re: Ubuntu Bionic for OpenFrame

Posted: Fri Aug 23, 2019 10:42 am
by hawsey
Roobarb , thank you for the advice , I'm away until early September but will try this out on my return .
Cheers
There will be questions no doubt :-)

Sent from my Moto G (4) using Tapatalk