New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Discuss development on Bubba
Post Reply
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by sakaki »

Hello

I've just released a live-USB image of Gentoo Linux for the Bubba|2 (B2) on GitHub (here). It uses a customized version of kernel 3.18.2 (with these patches applied), and includes (following Gordon's very helpful input) an enhanced set of userspace packages (full list here), precompiled for convenience. All included packages are up-to-date against the Gentoo tree, as of 25 Jan 2015 (and so, of course, shellshock and heartbleed fixes have been applied).

You can burn the supplied image to a USB key (>=8GB), then boot your B2 from it, without affecting any installed (Excito) system on your B2's hard drive. (The compressed image is 324MiB; writing takes between 10 and 20 minutes, depending on your system.) You can even boot a diskless B2! No soldering, compilation or U-Boot flashing is required. (However, please read this note about quickly testing your USB key for compatibility with U-Boot - the B2 is quite picky! Lexar and SanDisk USB keys seem to work reliably.)

The live-USB may then be used as a rescue disk, to play with Gentoo Linux, or as the starting point to install Gentoo Linux on your B2's main hard drive. Any packages you install, or other changes you make, while running the live-USB are saved on the USB key, but do not affect your existing Excito system, so you can run Gentoo for a while, then reboot back into your Excito system and continue to use it as normal, then boot back into the USB at a later date - any changes you made will still be there when you do.

As this is a full (persistent) PowerPC (ppc) Gentoo system, not simply a 'minimal install' or 'stage3', you can run emerge operations (Gentoo's equivalent of apt-get) etc. immediately. All binaries (libraries and applications) on the image have been recompiled from scratch to target the B2's e300c3 processor specifically, so hopefully performance should be reasonable.

Full instructions are provided on the project's GitHub page (including how to specify initial network settings, so you can ssh in once booted, and how to install Gentoo on your B2's internal hard drive too, in case you want to do that).

Utilities for (re)building the kernel, and keeping your system up to date, are also provided on the image (and described in the instructions just mentioned).

The GitHub project has an associated wiki. I have put a few notes there on how to set up your PC as a cross-compilation / distcc server for the B2, to accelerate builds (you don't need to do this just to play with the image, of course). Feel free to add your own material!

Well, if you get a chance to try it, please let me know how you get on ^-^

best,
sakaki

PS - unfortunately, I'll not be able to put out an Arch Linux variant for the B2, for lack of an upstream - the ArchPPC project apparently is no more...

Edited to add a little more info about image size and persistence, for those coming to this for the first time.
Last edited by sakaki on 27 Jan 2015, 07:35, edited 1 time in total.
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by johannes »

Wow, this is awesome. Having worked next to the B2/B3 software guys I know what you have done is not trivial. Fantastic work!
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by Gordon »

Thought of another missing last night: ntp

Actually didn't even miss it the past week running on the new system, but I got some new camera's in and started typing my B3 address to get their clocks right...
MouettE
Site admin
Posts: 341
Joined: 06 Oct 2011, 19:45

Re: Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by MouettE »

Good god you've written assembly code to boot large kernels on b2. Man you are crazy :twisted: I confess I would have modified U-Boot configuration. It's not that risky and the maintenance is easier in the long run. That being said I love the shimmed challenge :D

Edit : just read the buildkernel-b2.pdf man page. Very interesting and well written, I recommend anyone who is curious about the boot procedures on embedded devices to read it !

Congrats !
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by sakaki »

Gordon wrote:Thought of another missing last night: ntp
Yep, agreed, I'll add that to the B3 live-USB's @world for the next release.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB for Bubba|2 (with Linux 3.18.2) released

Post by sakaki »

MouettE wrote:I confess I would have modified U-Boot configuration. It's not that risky and the maintenance is easier in the long run.
Yes, I nearly went that route. My first attempt was to try a relocatable kernel; but the e300c3 is not a book E processor, so no dice. Then kexec()... which is my old standby for rooting phones etc., but I couldn't get that working reliably on the B2 either. So then I thought about editing U-Boot's environment minimally via fw_setenv, adding in (as some plug computers do, for example) a command to attempt, as the first step when booting, to load a U-Boot script into high-ish memory from the boot partition, then run it via autoscr (and if the required file is not found, fail over to the prior boot stanza). This works, the fw_printenv / fw_setenv stuff is easily automatable, and the indirection to a script provides future flexibility; but I decided not to in this case because:
  • if the user has already modified the boot command environment in flash, I couldn't be completely sure of not bricking the device when I permuted it (ok, in this case, they should know what they're doing / have a serial cable connected to recover, but still...)
  • the fw_setenv stuff needs to be run first; if the user still has their existing Excito system running, that's not a problem (download a tiny shell script); but that doesn't work if they need to use the live-USB as a rescue disk... (so we'd need another (small) kernel + initramfs to do the one-time environment setup; definitely possible, but a bit of a pain)
  • unlike the B3, the B2 kernel needs tweaking anyway (for the USB drivers, at least) so the extra overhead of another patch doesn't add much to the maintenance (the buildkernel-b2 stuff should really go in the kernel boot wrapper though...)
  • my husband bet me i couldn't get it to work on a 'stock' B2 ^-^
best, sakaki
Post Reply