|
|
Subscribe / Log in / New account

Opening up the GnuBee open NAS system

January 12, 2018

This article was contributed by Neil Brown

GnuBee is the brand name for a line of open hardware boards designed to provide Linux-based network-attached storage. Given the success of the crowdfunding campaigns for the first two products, the GB-PC1 and GB-PC2 (which support 2.5 and 3.5 inch drives respectively), there appears to be a market for these devices. Given that Linux is quite good at attaching storage to a network, it seems likely they will perform their core function more than adequately. My initial focus when exploring my GB-PC1 is not the performance but the openness: just how open is it really? The best analogy I can come up with is that of a door with rusty hinges: it can be opened, but doing so requires determination.

A mainline kernel on the GnuBee?

Different people look for different things when assessing how open or free some device is, so I should be clear about what my own metrics are. I am interested primarily in the pragmatics of openness: whether I can examine, understand, and modify the behavior of my device with no informational, technological, or legal impediments — cognitive and temporal impediments I'll take responsibility for myself. A good first measurement is: can I run the latest upstream kernel on the device? I can, but there is plenty of room for improvement.

The heart of the GB-PC is the MT7621 SoC (System On a Chip) from Mediatek. It provides a dual-core, 32-bit MIPS processor together with controllers for memory, flash ROM, serial ports, USB, SD cards, audio, Ethernet, and most of the connections you might expect. It doesn't control SATA drives directly, but it provides a PCI Express interface to which the GnuBee board [GnuBee photo] connects an ASM1061 SATA controller. This SoC is mostly used in WiFi routers and similar network hardware and it is supported by Linux distributions focused on those devices, such as OpenWrt, LEDE, and libreCMC, but this support is only partially upstream.

There are some specifications and documentation available for the MT7621 on the web, but most of the PDFs have a watermark saying "Confidential", so their legality seems unclear and, while useful, they are incomplete. The main source of driver code for this SoC appears to be a software development kit (SDK) from Mediatek. The OpenWrt-based distribution that GnuBee provides as one source for a bootable kernel builds Linux from a GitHub repository provided by mqmaker Inc. This is not a clone of the upstream Git tree with patches added, but is rather a code-dump for Linux 3.10.14 with lots of changes. It seems a reasonable guess that this code was part of the Mediatek SDK. This code appears to be completely functional; all the MT7621 hardware works as expected when using this kernel. It is a little old though.

GnuBee also provides a 4.4.87-based kernel as part of a libreCMC distribution. This contains the MT7621 support broken out as individual patches — 83 in total, though several of those are not specific to the hardware. This is a much easier starting point when aiming to use the latest kernel and John Crispin, author of many of the patches, deserves thanks. He has not been idle and several of these patches have already landed upstream; they are not enough to boot a working kernel, but it is a useful start. One remaining weakness with this set of patches is that the driver for the MMC interface, which is used to access the microSD card, isn't reliable. It can read data from the card, but it can also fail to read. Given that the 3.10.14 code is reliable, this should be fixable given time and patience.

It should be possible to start with the latest mainline kernel, apply those patches from libreCMC that seem relevant and haven't already been applied upstream, fix merge conflicts and compiler errors, and get a working kernel. Unfortunately this didn't quite work. The resulting kernel did nothing — nothing on the console at all, so no indication of what might be wrong, just that something was wrong.

The standard approach to analyzing this sort of problem is to use git-bisect. I had a 4.4 kernel that worked and a 4.15-rc kernel that didn't. I just need to try the kernel in the middle, then continue searching earlier or later depending on how things turned out. While git-bisect is an invaluable tool, it can be a bit of a painful process even when working with the upstream kernel. When you have a pile of patches to apply to each kernel before testing, and when that set is different for each different kernel (as some have already been included upstream at different point), it requires real determination.

I was lucky and tested 4.5 early and found that it didn't work, thus narrowing my search space more quickly than I had any reason to expect. I eventually discovered commit 3af5a67c86a3 ("MIPS: Fix early CM probing"). This commit makes a tiny change that probably makes sense to people who understand what the code is supposed to do, but which breaks booting of the GnuBee board. Reverting this patch gave me a kernel that booted enough to print useful error messages about the next problem it hit, which was then easy to fix (something to do with maximum transfer sizes for the SPI bus driver).

With a 4.15-rc kernel that boots and a minimal initramfs that can find the device with the root system, I only have two kernel issues to fix. One is the MMC controller that is still unreliable. The other is the Ethernet interface.

The Ethernet interface in the MT7621 comes with an integrated 6-port switch. One port connects to the processor and the other five can be wired externally (the GB-PC1 only provides connectors for two, the GB-PC2 has three). The switch can understand VLANs so different ports on the switch can be on different logical networks, and the MT7621 port can send packets to any VLAN.

When the SDK was created, Linux didn't have an API for integrated switches, so Mediatek used an out-of-tree implementation called "swconfig". Now Linux has "switchdev", which was introduced in late 2014. When Crispin posted his patches in early 2016 to support the Mediatek Ethernet controller, though with minimal support for the switch and no switchdev integration, he hit a roadblock. Dave Miller made it quite clear that they could not be accepted without proper switchdev integration, and reminded readers that help was available from various people who were quite familiar with the inner working of switchdev. No further progress on these patches can be found.

I could simply include Crispin's latest patches and I suspect I could get the network working with minimal pain, but I don't think that is the right way forward. If I do ever dig into those patches, it will be as part of learning switchdev and creating a proper upstreamable solution. For now, I dug through my drawer and found a USB-attached Ethernet adapter that only needed a little bit of convincing to work. This sits nicely beside my USB-attached card reader that holds the micro-SD card and my root filesystem. This isn't the most elegant solution, but hopefully it will be temporary.

How about mainline U-Boot?

So I have the door open now, but it still squeaks a bit. I can run a mainline kernel (important if I want to benefit from the latest filesystem developments, or avoid the more well-known exploits) and I have code and some documentation, which should be enough to develop and test new kernels. The only remaining barrier is that testing new kernels isn't quite as easy as I would like. My bar for "easy" is rather high here. When I'm doing a git-bisect to find the cause of a regression (and experience assures me I'll need to do that again one day), I need every step to be as smooth and automatic as possible: if I have to do anything manually I will get it wrong occasionally and end up late for dinner.

The easiest method for installing a new kernel is to copy the kernel file onto a USB storage device as "gnubee.bin", plug that in and turn on the board. The U-Boot firmware will notice this, write the kernel to flash memory, then ask you to unplug and power-cycle. When you do that the new kernel will boot. This is conceptually easy enough, but I don't really want to write the kernel to flash (which takes several seconds), I just want to boot it. It is possible to do this by interrupting the boot (type "4" on the console) and issuing a couple of commands to the U-Boot CLI (which I can copy/paste with the mouse instead of typing), but this is still manual interaction which I would like to avoid. "U-Boot" can load a new kernel over the network (it even supports a simple HTTP server for uploading firmware) but all this still requires manual interaction.

The obvious answer would be to replace U-Boot — it is open source after all. There is a difference with updating U-Boot though: the fear of turning my NAS into a brick.

U-Boot, for those not familiar with the term, is a suite of code designed to fill a similar role to the BIOS on a traditional PC. It is stored in flash memory that the processor can read directly (or at least can copy directly to RAM) and it performs all early configuration (such as enabling and mapping the DRAM, and setting up various clock signals etc.), and then finds a storage device to load your kernel from. Modern U-Boot can be quite sophisticated; it is able to read from USB, IDE, SATA, or the network, and can understand a variety of filesystems (FAT, ZFS, ext4, etc.) and network protocols (such as TFTP or NFS).

The U-Boot that is provided with the GnuBee looks like it was probably part of the Mediatek SDK. It is fairly old, contains a lot of hackish code, and looks like a separate development path; the HTTP server it contains is not present in the mainline code, for example. The ideal way forward would be to extract all the hardware drivers from the old U-Boot installation and add them upstream. There will undoubtedly be bugs at first, which, just as with the kernel, will be hard to analyze. A bad kernel can easily be replaced because U-Boot is still working. If you break U-Boot, instead, your hardware becomes what we like to call a "brick". There is no easy mechanism to replace that broken U-Boot code.

By "easy" here I mean easy for the home hacker. A professional with a fully kitted-out lab will have a device that can use a JTAG port to take control of the processor and load anything into memory directly. Even a fairly sophisticated home hacker might be able to attach a secondary flash ROM to the board as shown in these two pictures and boot from that. But as I prefer working with software, I like a software solution. I need the main U-Boot to normally jump straight into a secondary U-Boot. If that is missing, or if the reset button is held (for example), it can continue to the default behavior, which doesn't need to be sophisticated, it just needs to work.

The U-Boot in the GnuBee does have something that looks just enough like this functionality that it might be usable. The "uImage" file (a container format used by U-Boot) that it expects to load the kernel from can, instead, hold a standalone program. This will be copied from flash into RAM and run. It even has access to some of the functionality of the original U-Boot so that I don't have to get new code working for everything at once.

There are a few challenges with this approach. One of the more frustrating so far is that it doesn't work for small test programs, only larger programs. Like many processors, MIPS has separate instruction and data caches. If you write some bytes to memory, they will be stored in the d-cache. If you try to execute code, it will be read from memory through the i-cache. If you don't flush the d-cache out to main memory between writing out the code and running the code, the wrong code will be run. The old U-Boot on the GnuBee doesn't do that flush, so I spent quite a few hours wondering what could possibly be wrong. Fortunately I don't have enough hair for it to be worth pulling out. This was eventually fixed by the simple expedient of adding 32K of zeros to the end of the test program, this being the size of the d-cache.

Another challenge is that the USB code in the main U-Boot is a bit unreliable and I cannot seem to get it to work from a separate standalone program, so booting straight from USB is not an option until I can include my own USB driver. Similarly, booting directly from an SD card won't work as U-Boot doesn't have an MMC driver. That leaves the network. I suspect it will be possible to write a standalone program, loaded by U-Boot, which uses the TFTP functionality from U-Boot to load a kernel and then boot it. This will allow me to build a kernel on my workstation, then boot it by simply turning the GnuBee on. I'm not yet desperate enough to have arranged for a remotely controllable power switch, but I have thought about it.

Is this open enough?

While I would like proper SoC documentation that didn't have "Confidential" watermarks and which was reasonably complete, code that works reliably and isn't deliberately obfuscated is at least a good start. Working code and sketchy documentation is probably enough to keep me happy. Having an easy path to experiment with U-Boot code without the risk of creating a brick would be ideal, I suspect I can get close enough with what I have. And who knows, maybe one day I'll be brave enough to try flashing a whole new U-Boot.

Certainly I can run a current mainline kernel (with just a few patches) and I can run the Linux distribution of my choice, so that is open enough for now.


Index entries for this article
GuestArticlesBrown, Neil


to post comments

Automation of Linux boot on remote systems

Posted Jan 12, 2018 17:41 UTC (Fri) by wentasah (subscriber, #54572) [Link] (1 responses)

I have written a tool that automates booting of Linux on hardware like GnuBee. Maybe, it can help you as well. It's called novaboot and besides normal development, I use it for things like bisecting Linux kernel, continuous integration etc. It can interact with U-Boot via serial line and when combined with remotely controlled relay (I often use this one), booting the system on target board is just like running a local console program.

Automation of Linux boot on remote systems

Posted Jan 13, 2018 22:22 UTC (Sat) by neilbrown (subscriber, #359) [Link]

Thanks for the links. I'll definitely have a look to see if it might be useful.

Opening up the GnuBee open NAS system

Posted Jan 12, 2018 20:53 UTC (Fri) by oldnpastit (subscriber, #95303) [Link]

The joys of out-of-tree SoC vendor kernel trees!

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 11:22 UTC (Sat) by darwish (guest, #102479) [Link] (10 responses)

I guess at this point in time, we should really as ourselves, is the current linux kernel development model suitable at all for Embedded products?

I mean, we already break the Linux ecosystem into a "kernel" and "user-space", with a very stable API in between.

Maybe it's the right time to break the kernel itself into more components, with stable APIs in between? It's been like what, 25 years now, and we cannot have a proper internal stable API?

I've seen too many horrible SoC kernels in my day-job embedded Linux work that it just became the norm -- all in very reputable companies and teams. Everyone just gave up on this and is dealing with the ugly reality..

Yeah, I've read gregkh treatise on the topic, "stable-api-nonsense.txt", etc. But really, why divide the stable boundaries of the Linux ecosystem into just two components: kernel and user-space? Was this an explicit decision, or honestly just a historical accident?

Linus himself said multiple times, especially at Debconf, that the userspace distribution folks not providing stable APIs are "crazy". So, by his own admission, the stable boundaries in the Linux ecosystem must be __more than one__. So maybe it's the right time now to ask ourselves if treating the whole kernel, internally, as a bundle of unstable APIs, is the right decision.

Google itself has realized how unworkable this development model is for the embedded industry and is working on a whole new kernel to solve this. Maybe we should wake-up and re-investigate our decisions before it's too late.

I won't be arrogant and claim that I know the answer for such an intractable problem, but starting from "set-in-stone" propositions does not seem to be wise when the whole industry is kind of against you at this point.

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 15:45 UTC (Sat) by gregkh (subscriber, #8) [Link] (3 responses)

Ok, how would you go about defining this "stable API" between drivers and the rest of the kernel?

Seriously, it's a non-trivial thing to do, lots of people and companies have tried to do so over the decades in operating system development, and no one has been able to do so for a general-purpose operating system that supported more than just a handful of hardware devices/types.

Remember if your in-kernel api is not changing over time, your operating system is dead :)

People forget that change happens because it has to, given the environment or requirements change over time, it's not done just because it is fun to do so. Well, not usually...

Anyway, take a look at how the enterprise distro kernels do this type of thing, they define a subset of all in-kernel apis and work hard to keep that stable over time. That works good for their target market, and is also something that embedded people should copy.

But, to get back to the main topic of this article, I fail to see how a stable api would solve any of the issues Neil had here, what ones do you think it would have helped resolve?

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 23:42 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

> Seriously, it's a non-trivial thing to do, lots of people and companies have tried to do so over the decades in operating system development, and no one has been able to do so for a general-purpose operating system that supported more than just a handful of hardware devices/types.
Windows NT, Solaris.

Both are exceptionally stable. My filesystem driver from 2005 still works on Windows 8 with only build system adjustments.

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 20, 2018 0:00 UTC (Sat) by giraffedata (guest, #1954) [Link] (1 responses)

My filesystem driver from 2005 still works on Windows 8 with only build system adjustments.

You mean it's source code compatible? You have to recompile your filesystem driver?

Long ago, I worked on AIX filesystem and device drivers, and AIX was binary backward compatible with kernel extensions. I could plug a binary driver developed for AIX 4 into an AIX 5 kernel.

Making this possible made AIX considerably more complex and the kernel extension APIs harder to use, so I understand why Linux kernel developers enjoy not having the backward compatibility obligation.

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 20, 2018 5:26 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

The driver signing requirements have changed so I had to recompile it. It is probably possible to re-sign the binary directly, but I haven’t tried it.

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 21:08 UTC (Sat) by nix (subscriber, #2304) [Link]

Yeah, I've read gregkh treatise on the topic, "stable-api-nonsense.txt", etc. But really, why divide the stable boundaries of the Linux ecosystem into just two components: kernel and user-space? Was this an explicit decision, or honestly just a historical accident?
The division follows the boundaries of the address space -- the idea is that within the domain in which simple function calls to/from the kernel are possible, the ABI is uncontrolled. (Note that for the vDSO, which is part of the domain in which simple function calls from userspace are possible, the ABI is very strictly controlled.)

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 22:22 UTC (Sat) by neilbrown (subscriber, #359) [Link]

I don't think that "API stability" is a good way to frame this issue. I think "legacy API support" is much more helpful.

No API is really stable - we add things to the user->kernel API all the time. You might have noticed that a new event notification API was proposed recently. If we add things, then the API isn't really "Stable", it is "Changing".
Internally, we tend to manage this by providing shims to support the legacy API. For example, file change notification has a single internal implementation with three shims: dnotify, inotify, fanotify. You see this sort of pattern of various shims over an internal implementation a lot in the kernel.
This works well for the user->kernel interface because there are lots of applications making calls into one kernel, so the one kernel can easily support multiple APIs. For the kernel->driver interface the situation is a bit different. One kernel is calling lots of drivers.
To manage that, the kernel would need to detect what API the driver expects, and adjust its calling style accordingly. We do do that to some extent. The stand-out example is my mind is "unlocked_ioctl" in 'struct file_operations'. There used to be a 'ioctl' interface. The BKL would be held while that was called. Part of removing the BKL was to handle ioctls without it. So unlocked_ioctl was added and for a time we supported drivers with the new interface and drivers with the legacy interface, by detecting which of the two functions was not NULL. This is a thing that happens quite a bit, but it certainly isn't universal. And we do get rid of the legacy support because we find it adds no value, and does entail a cost.
It would have made my job easier if every time an internal API changed, the name changed (like ioctl -> unlocked_ioctl) so that old drivers wouldn't compile. When an old driver doesn't compile it is easy to find out why, find the commit that introduced the change, read the explanation, and fix the code. I might have done while while forward-porting the mt7621 drivers, but it would have been so "normal" that I wouldn't bother to remember.
The problem is when the API changes and the code still compiles. I think we could do better here, but I'm not sure that we are all that bad. In some cases it might be that the driver was misusing the API in some way. After all, we don't test against a generic API, we test against a particular kernel. If the kernel starts using an API in a new way, a driver might break even though the API didn't change. The only real solution to making drivers work with new kernels is regular testing.

If legacy driver-API support was really important to someone I suspect they could create a shim which exports exactly that API. Then they can keep the shim up-to-date as the kernel changes. Probably the most difficult part is creating a good API definition (lwn readers know that we suck at designing new APIs) and ensuring drivers adhere to the intent of the API. I think that is a lot of work, but maybe it would be worth it for someone.
We in the kernel community think it isn't worth it. We would rather keep all drivers in the common tree, and update all API users when we update an API. And we try to make this easy. If you have out-of-tree code, then *please* put it in drivers/staging. The barrier to entry is low and we will do our best to keep the API up-to-date, and may well clean up the code and make it maintainable as well. Free service!
I actually wonder if the swconfig Ethernet driver I mentioned should go into drivers/staging. Davem doesn't want it, but maybe gregkh would take it. Then we can fix it up in the open and convert to switchdev. Then it might be ready for davem.
I think my next sub-project with the gnubee will be to try to get all of the drivers into staging before looking to clean them up. See if it actually works :-)

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 13, 2018 22:27 UTC (Sat) by jhoblitt (subscriber, #77733) [Link] (3 responses)

I'm not sure what advantage that would provide in this case? The driver still wouldn't work with switchdev and would need out of tree patches.

A much better solution would be to simply not buy hardware that does not have in-tree support. I realize that is easier said than done with this type of hardware but is, AFAIK, possible.

I even hope to someday follow my own advice WRT to GPUs. Sigh.

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 14, 2018 12:10 UTC (Sun) by hubcapsc (subscriber, #98078) [Link] (1 responses)

I need to get a new laptop.

I'd like to get one of those studly thinkpad p71's with
the 17 inch screen, but they have NVIDIA graphics.

So I'll get an X1 Carbon with Intel graphics and a 14 in
screen...

-Mike "and squint more..."

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 25, 2018 11:28 UTC (Thu) by Wol (subscriber, #4433) [Link]

17" screen?

I'll just say that I've got a 17" laptop (an old Tosh), and while I do like large screens, imho a 17" screen on a laptop makes the whole caboodle that little bit too big. 15" seems the sweet spot.

Cheers,
Wol

"Unstable kernel APIs" vs. the embedded reality :-(

Posted Jan 20, 2018 0:39 UTC (Sat) by neilbrown (subscriber, #359) [Link]

> A much better solution would be to simply not buy hardware that does not have in-tree support.

That depends on what your goal is. Some people like buying jigsaw puzzles. Others like buying open hardware that doesn't have complete in-tree support.

Opening up the GnuBee open NAS system

Posted Jan 14, 2018 10:11 UTC (Sun) by ngiger@mus.ch (subscriber, #4013) [Link]

Thanks a lot for your work Neil!

When I my GnuBee arrived a few months ago, I invested some hours to set up the http://gnubee.org home page.

As I was very busy, I put the work to get a mainline linux kernel/u-boot support GnuBee on my TODO list, probably after retirement.

Therefore I am very happy, that I made so much progress and I hope that the remaining holes can be closed, too. I will post a link to your article on gnubee.org as soon as it will become generally available.

Opening up the GnuBee open NAS system

Posted Jan 15, 2018 21:36 UTC (Mon) by paravoid (subscriber, #32869) [Link] (1 responses)

> The Ethernet interface in the MT7621 comes with an integrated 6-port switch. One port connects to the processor and the other five can be wired externally (the GB-PC1 only provides connectors for two, the GB-PC2 has three).

That's interesting. The CrowdSupply link mentions "2 ports can support Ethernet bonding", but I guess from the above that bonding two of these ports is pretty useless from a speed PoV (I guess it can still be useful for availability purposes, albeit not as much).

Opening up the GnuBee open NAS system

Posted Jan 19, 2018 23:27 UTC (Fri) by neilbrown (subscriber, #359) [Link]

> The CrowdSupply link mentions "2 ports can support Ethernet bonding", but I guess from the above that bonding two of these ports is pretty useless from a speed PoV

I don't think that is a safe guess. While I believe that the description I gave is accurate as far as it goes, I am certain that it is not complete. You seem to assume that the processor-side port is limited to the same speed as individual external ports, and I see no reason to assume that. Also, I think there is a second processor-side port which can hook directly to one of the external ports, bypassing the switch. Maybe that is involved in the "Ethernet bonding".

Cross-compilers

Posted Jan 15, 2018 21:41 UTC (Mon) by paravoid (subscriber, #32869) [Link]

(Thanks for the super-informative article!)

I don't know what operating system run on your computer, but since you mentioned running Debian on the Gnubee: note that Debian ships with cross-compilers already, and you don't need to build your own (as I saw you did on your README). It's been a while since I used it, but it has worked pretty well for me in the past! See https://wiki.debian.org/CrossToolchains for more.

Opening up the GnuBee open NAS system

Posted Jan 17, 2018 17:34 UTC (Wed) by Rubusch (subscriber, #80225) [Link] (1 responses)

Thank you for the interesting article!

Talking about JTAG/debricking: How about some of those cheap JTAGers out on the market using openOCD? Might be an idea to debrick (or, generally install u-boot on) the MIPS with a flyswatter setup. Is the "GnuBee" u-boot or patches available somewhere? It should be, if it was open source...

http://www.tincantools.com/JTAG/Flyswatter2.html

http://openocd.org/

Opening up the GnuBee open NAS system

Posted Jan 20, 2018 0:32 UTC (Sat) by neilbrown (subscriber, #359) [Link]

It hadn't occurred to me to consider getting a JTAG interface... I can see things on ebay that claim to be USB->JTAG for just a few dollars. I wonder if they would be enough to just load data into flash... The flyswatter isn't too expensive if I could be certain it would work for me.
However, while I had assumed the GnuBee would have a JTAG port, I hadn't checked. I have now and the result is not good. The JTAG pins from the SoC appear to be tied to 3V3 or GND by resistors, with no pin-outs.

Gnubee u-boot can be found at https://github.com/gnubee-git/GnuBee_PCx_uboot

Opening up the GnuBee open NAS system

Posted Jan 18, 2018 14:58 UTC (Thu) by dezgeg (subscriber, #92243) [Link] (4 responses)

Nice article, thanks.

I'm interested on what's the endianness of the MIPS core on the GnuBee. I have been looking for some reasonably powerful (and priced) big-endian machines with mainline support, but haven't been very successful.

Opening up the GnuBee open NAS system

Posted Jan 20, 2018 0:33 UTC (Sat) by neilbrown (subscriber, #359) [Link]

> I'm interested on what's the endianness of the MIPS core on the GnuBee.

Gnubee is little endian unfortunately.

Opening up the GnuBee open NAS system

Posted Jan 20, 2018 8:51 UTC (Sat) by johill (subscriber, #25196) [Link] (2 responses)

What do you count as "reasonably powerful"? Presumably something like the i.MX6 ARM (can run in BE mode) doesn't count?

Opening up the GnuBee open NAS system

Posted Jan 23, 2018 10:57 UTC (Tue) by dezgeg (subscriber, #92243) [Link] (1 responses)

Okay, one additional constraint: it should be an architecture where the big-endian port has reasonable interest and support from the open source community so that I'm not completely alone with it :)

For example, there's no Debian for big-endian ARM.

Opening up the GnuBee open NAS system

Posted Jan 23, 2018 13:54 UTC (Tue) by pabs (subscriber, #43278) [Link]

Debian used to have one:

https://wiki.debian.org/ArmPorts

> armeb - Big-endian OABI port targeting the linksys NSLU2 and similar. Interest fell after a method was determined for running little ending Linux systems on the NSLU2. Active during the sarge timeframe and now abandoned.

I would wager the Debian ports folks would help you restart armeb if you wanted to. They are already working on bringing back Itanium, SPARC and PPC variants and other old stuff.

Opening up the GnuBee open NAS system

Posted Jan 18, 2018 15:43 UTC (Thu) by kpfleming (subscriber, #23250) [Link]

Fabulous article, makes those of us who no longer have time for this kind of hacking wistful and weepy :-)

Opening up the GnuBee open NAS system

Posted Jan 25, 2018 21:02 UTC (Thu) by neilbrown (subscriber, #359) [Link]

> One remaining weakness with this set of patches is that the driver for the MMC interface, which is used to access the microSD card, isn't reliable. It can read data from the card, but it can also fail to read.

I can now be a bit more precise about this. The circumstance where it fails to read is when it is asked to read data into a page which is not directly mapped into the kernel's address space. Such pages only exist when CONFIG_HIGHMEM is selected, so the microSD can be made to work in 4.4.87 by disabling CONFIG_HIGHMEM. In mainline there is also a problem that host->id is set to -1 which causes problems with some array accesses, but that is easily fixed.
As the MT7621 can only access 512Meg, and CONFIG_HIGHMEM is only of use if you might have more than 2G, there is no cost in disabling CONFIG_HIGHMEM on this board.

Opening up the GnuBee open NAS system

Posted Feb 20, 2018 10:11 UTC (Tue) by cmm (guest, #81305) [Link] (1 responses)

Something possessed me to buy a GB-PC2 recently, and after some efforts
it does indeed serve files on my home network.

The project promised open and affordable NAS hardware. The
"affordable" part is absolutely true. The "open" part is also technically
true, but is practically useless.

The GB-PC1 has been shipping since Sep 2017 (GB-PC2 is the exact same
HW, but for 3.5" disks) -- and in that time, despite the quite
respectable number of sold units (judging by the CrowdSupply funding
figures), the community development thingy haven't materialized. I
doubt it will until the HW is thoroughly obsolete. I think there are
reasons for that (ones I should have seen beforehand, but oh well), so
I'll list them in random order:

1. This is a NAS. Once you get it set up, you (and family) start
using it to store files, serve media, etc. You don't fuck around with
your NAS, once it's working well enough to store & serve data.

2. It costs non-trivial amount of money. I mean, if this were an RPi
you'd just buy a spare one to tinker with. But 300$ is not a sum I
would spend on a "play" piece of hardware.

3. MIPSel is a niche platform, at least as far as NAS's are concerned.
So, an official binary repository of OMV, say? Nope.

4. The authors/developers are disengaged. This is not a criticism --
they probably have their hands full with the HW side of things
(manufacturing, sourcing, logistics, what have you). But the end
result is that the public-facing side of the project (the GitHub bug
tracker & the Google group) is basically a couple of people mumbling
to themselves in public on weekends and *crickets*. Needless to say
the GitHub repos have not seen updates for quite some time.

5. The out-of-the-box state of software is not exactly shiny. The
stable firmware (one with the ancient vendor kernel) is said to
work well for Debian Jessie. Apparently (I'm not sure about this but
cannot check) you need the newer one for Debian Scratch or later -- or
at least that was the possibly-mistaken impression I got when setting
things up. The newer firmware has problems (which I've mostly worked
around in user-space). I cannot go back to the stable firmware because
I was stupid enough to partition my disks (with my, you know, data) in
Debian Scratch and the old kernel cannot read them.

(Problems with the newer firmware? Let's see: clock skew that is too
large for NTP to keep up with, no way for iotop to work, weird FP problems
that prevent libopenmp to work out of the box -- these are the ones I've
encountered, anyway).

Basically, 1. and 2. are the main points that really doom GnuBee as a live
"open" HW project, I think. It's still a nice zombie one, and at the end of
the day it does perform its intended function of serving files, so I probably
shouldn't complain.

Bottom line: uhh, I guess some things just don't work out, you know?

Opening up the GnuBee open NAS system

Posted Apr 14, 2018 18:52 UTC (Sat) by gperreal (guest, #123678) [Link]

As a proud (?) owner of a GB-PC1, the point 4 is what I have found to be the most frustrating. Not only are the authors/developers disengaged, but they are almost unwilling to answer or discard the question. At the some point they called my needs into question, e.g. "why would someone use extended ACL on a NAS ?" I thought I could run whatever software I wanted on a "open" HW.

I would like to thanks Neil Brown for his work on integrating GB drivers in a recent kernel, and trying to help us with some nasty bugs.

Opening up the GnuBee open NAS system

Posted Feb 19, 2023 4:14 UTC (Sun) by neilbrown (subscriber, #359) [Link]

Just in case anyone is interested, from 6.2-rc1 and 6.1.1 it is possible to build a working kernel for the gnubee with zero extra patches.
The process of attaching the devicetree-blob to the vmlinux is slightly non-trivial in that just running "make" with the right config isn't enough. The extra command or two that are needed are encoded in the "gbmake" tool in https://github.com/neilbrown/gnubee-tools, so it isn't a problem.

Being able to use an unpatched kernel makes git-bisect SO much easier.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds