Significant milestone: working firmware from pure mainline Linux

130 views
Skip to first unread message

Neil Brown

unread,
Feb 13, 2023, 3:02:54 AM2/13/23
to GnuBee

We have a pleasing success recently.  I can now build a working firmware image with unmodified upstream kernel source.  I've confirmed with with 6.1.11 and a late 6.2-rc.

The last steps in the journey were a change that I cannot pinpoint that seems to have fixed a stability problem with the ethernet - it means I didn't need a hack to disable flow control any more.  Also a change to gbmake which incorporates the device-tree-blob (dtb) into the firmware using a method that is supported upstream.  With these in place I can simply run "gbmake" in clean kernel source tree, and get working firmware.

I haven't published any firmware built this way yet - I'll wait for 6.2.1 or shortly there-after.  But my gnubee-utils on github is ready to go you could can build one for yourself if you are keen.

Alex Davies

unread,
Feb 13, 2023, 7:49:22 AM2/13/23
to Neil Brown, GnuBee
You want my Gnubee? Never got it to work well enough to be useful, performance was just awful. It's the 3.5' model.

--
You received this message because you are subscribed to the Google Groups "GnuBee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gnubee+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gnubee/f6fa9ce7-0927-4ca7-90cb-9fb7db323191n%40googlegroups.com.


--
With dread but cautious optimism, Alex Davies.
trave...@gmail.com
+1 902 580 1543

Aaron D Borden

unread,
Feb 13, 2023, 9:56:19 AM2/13/23
to Neil Brown, GnuBee
That's fantastic! Thank you for submitting the initial patches and getting this upstreamed. Looks like 6.1.11 is available in gentoo-sources. I'll give it a try.

I've seen too many of these crowd funded open source projects languish because they couldn't get supported in upstream projects.

Who else do we have to thank for this?




--

Neil Brown

unread,
Feb 13, 2023, 5:29:13 PM2/13/23
to GnuBee
On Tuesday, February 14, 2023 at 1:56:19 AM UTC+11 adbo...@a14n.net wrote:

Who else do we have to thank for this?


Check the commit logs :-)
Recent names of significance are:
Arınç ÜNAL <arinc...@arinc9.com>
Vincent Legoll <vincent...@gmail.com>
Sergio Paracuellos <sergio.pa...@gmail.com>
but anyone who contributes to Linux has helped, if only indirectly.

Miles Raymond

unread,
May 16, 2023, 12:36:06 AM5/16/23
to GnuBee
If there are no other takers, please email me!

Miles Raymond

unread,
Jun 10, 2023, 1:37:25 AM6/10/23
to GnuBee
Is there an Etcher-flashable image to try out? I was able to get a Gnubee v2 and would like to get modern software on it.

Miles Raymond

unread,
Jun 10, 2023, 2:55:22 AM6/10/23
to GnuBee
I found http://neil.brown.name/gnubee/ which has all your images. I'm reading through the install process - will any of these work from an SD card to boot?

NeilBrown

unread,
Jun 11, 2023, 11:29:14 PM6/11/23
to Miles Raymond, GnuBee
On Sat, 10 Jun 2023, Miles Raymond wrote:
> I found http://neil.brown.name/gnubee/ which has all your images. I'm
> reading through the install process - will any of these work from an SD
> card to boot?

I'm not sure I understand the question, but the answer is probably
"yes".

The images at that link needs to be loaded into the on-board flash. You
typically do this by puts in the image on a USB device in a FAT
filesystem calling the file "GNUBEE.BIN" Then power-on with the USB
plugged in, and waiting a while.

Then when you next power on it will boot from the on-board flash.

The code in the image can mount a root filesystem from any available
device. So if you put a suitable Debian root filesystem on an SD card,
then it can use that to continue booting.

NeilBrown

>
> On Friday, June 9, 2023 at 10:37:25 PM UTC-7 Miles Raymond wrote:
>
> Is there an Etcher-flashable image to try out? I was able to get a
> Gnubee v2 and would like to get modern software on it.
>
> On Monday, February 13, 2023 at 2:29:13 PM UTC-8 Neil Brown wrote:
>
> On Tuesday, February 14, 2023 at 1:56:19 AM UTC+11
> adbo...@a14n.net wrote:
>
> Who else do we have to thank for this?
>
>
> Check the commit logs :-)
> Recent names of significance are:
> Arınç ÜNAL <arinc...@arinc9.com>
> Vincent Legoll <vincent...@gmail.com>
> Sergio Paracuellos <sergio.pa...@gmail.com>
> but anyone who contributes to Linux has helped, if only
> indirectly.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GnuBee" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic
> /gnubee/HhDnU3LJMAY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> gnubee+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/gnubee/e9e38598-3579-46b8-87f4-0856bb14342cn%40googlegroups.com.
>
>
>

Miles Raymond

unread,
Jun 12, 2023, 12:01:54 AM6/12/23
to GnuBee
Yeah, after a lot more reading I realize this is nothing like rpi booting. I was able to download http://neil.brown.name/gnubee/gnubee-6.1.1-gbpc2.bin, rename it to gnubee.bin on a fat32 usb stick, watch it flash through uart, then use the config script to install debian to the SD card. There was a small snafu in that the config script really didn't want to reformat the fat32 SD card to ext4 and I had to do it manually, but after that it installed (slowly).

Thank you very much for providing the updated kernel and the corresponding config script to make installation a lot easier than the official docs! I read that there was previously work on uboot to get it loading directly from SD card - what progress has been made on that?

Miles Raymond

unread,
Jun 12, 2023, 2:13:13 AM6/12/23
to GnuBee
2023-06-12 03:28:19 root@gnubee:~/zram-swap# zramctl -f    
zramctl: no free zram device found
2023-06-12 03:28:34 root@gnubee:~/zram-swap#

Does this build not support zram? Could I request it added into the firmware?

Miles Raymond

unread,
Jun 16, 2023, 6:41:15 PM6/16/23
to GnuBee
I tried to install linux-image (which selected linux-image-6.1.0-9-mips32r2el) and copy the zram.ko from there, but it doesn't seem to like it?
2023-06-13 23:37:41 root@gnubee:~# insmod /usr/lib/modules/6.1.1+/kernel/drivers/block/zram/zram.ko
insmod: ERROR: could not insert module /usr/lib/modules/6.1.1+/kernel/drivers/block/zram/zram.ko: Invalid module format
2023-06-13 23:38:15 root@gnubee:~#

Does this need to be recompiled? I tried following the directions from https://github.com/neilbrown/gnubee-tools but I'm not even sure that compiled all the kernel modules.
2023-06-13 23:34:53 root@gnubee:/home/gnubee/linux-gnubee-v6.1# ../gnubee-tools/scripts/gbmake firmware gbpc2-6.1

After hours it still doesn't seem to build the zram.ko anywhere:
2023-06-13 23:49:58 root@gnubee:/home/gnubee/gnubee-tools# find /home -type f -name zram*
/home/gnubee/linux-gnubee-v6.1/tools/testing/selftests/zram/zram.sh
/home/gnubee/linux-gnubee-v6.1/tools/testing/selftests/zram/zram02.sh
/home/gnubee/linux-gnubee-v6.1/tools/testing/selftests/zram/zram_lib.sh
/home/gnubee/linux-gnubee-v6.1/tools/testing/selftests/zram/zram01.sh
/home/gnubee/linux-gnubee-v6.1/Documentation/admin-guide/blockdev/zram.rst
/home/gnubee/linux-gnubee-v6.1/drivers/block/zram/zram_drv.h
/home/gnubee/linux-gnubee-v6.1/drivers/block/zram/zram_drv.c
2023-06-13 23:50:15 root@gnubee:/home/gnubee/gnubee-tools#

Miles Raymond

unread,
Jul 1, 2023, 2:13:28 PM7/1/23
to GnuBee
Continuing on this zram path, I've opened https://github.com/neilbrown/gnubee-tools/issues/38 more so for documentation on how to get any kernel module compiled for this GnuBee. Specifically, I've tried forcing forcing `CONFIG_MODULES=y` in so many places that I finally get the build command to output a zram.ko, but it still refuses to load.

2023-07-01 17:35:14 root@gnubee:~# find / -type f -name zram.ko
/usr/lib/modules/6.1.1+/kernel/drivers/block/zram/zram.ko
2023-07-01 18:11:33 root@gnubee:~# insmod /usr/lib/modules/6.1.1+/kernel/drivers/block/zram/zram.ko

insmod: ERROR: could not insert module /usr/lib/modules/6.1.1+/kernel/drivers/block/zram/zram.ko: Invalid module format
2023-07-01 18:11:43 root@gnubee:~# cat /proc/version
Linux version 6.1.1+ (neilb@noble) (mipsel-unknown-linux-gnu-gcc (GCC) 7.2.0, GNU ld (GNU Binutils) 2.29.1.20170915) #2 SMP Mon Jan  2 13:00:11 AEDT 2023
2023-07-01 18:12:48 root@gnubee:~#

Brett Neumeier

unread,
Oct 1, 2023, 3:58:58 PM10/1/23
to GnuBee
On Mon, Feb 13, 2023 at 2:02 AM Neil Brown <ne...@brown.name> wrote:

We have a pleasing success recently.  I can now build a working firmware image with unmodified upstream kernel source.  I've confirmed with with 6.1.11 and a late 6.2-rc.

The last steps in the journey were a change that I cannot pinpoint that seems to have fixed a stability problem with the ethernet - it means I didn't need a hack to disable flow control any more.  Also a change to gbmake which incorporates the device-tree-blob (dtb) into the firmware using a method that is supported upstream.  With these in place I can simply run "gbmake" in clean kernel source tree, and get working firmware.

Continuing in this vein -- I have used Neil Brown's gnubee-utils to produce a 6.5.5 firmware image that I am using on my Gnubee PC2 with no issues. I did this on the Gnubee itself, using Debian 12.1 and the normal build tools included with it.

Step-by-step instructions on how I did the build (in case you would like to repeat this process yourself):
  1. git clone https://github.com/neilbrown/gnubee-tools
  2. obtain and unpack linux-6.5.5.tar.xz
  3. alias gbm=/full/path/to/gnubee-tools/scripts/gbmake
  4. gbm defconfig_gb-6.2 # take defaults for all prompted questions
  5. gbm nconfig
  6. gbm firmware
I did `nconfig` so that I could enable some additional kernel settings:

Kernel Type -> Kexec system call [*]
Device Drivers -> Block devices -> Compressed RAM block device support [M]
Device Drivers -> Block devices -> Network block device support [M]
Device Drivers -> USB support -> USB Serial Converter support [M]
    --> USB Generic Serial Driver [*]
    --> USB Prolific 2303 Single Port Serial Driver [M]
    --> USB Winchiphead CH341 Single Port Serial Driver [M]

If you would like to use this kernel and do not want to build it yourself, you can at present obtain it from my Dropbox account -- but note these links will not work forever, just until I need more room on dropbox for something else.

Thank you again, Neil, for making the firmware build system available to everyone! It is really quite straightforward to use.


--
Brett Neumeier (bneu...@gmail.com)

Miles Raymond

unread,
Oct 9, 2023, 6:38:39 PM10/9/23
to GnuBee
And thanks again Brett for making this firmware easy for us dumb gnubees!

Miles Raymond

unread,
Jun 4, 2024, 5:20:24 AMJun 4
to GnuBee
I'm reposting these as I feel they are super helpful to get gnubees started. I feel zram-swap is essential for all servers, big or small, and is substantially better than using sdcard swap.

Reply all
Reply to author
Forward
0 new messages