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 !

Keep your B3 up-to-date with Arch Linux! (new live USB)

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

Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by sakaki »

Hello,

if you are interested in keeping your B3's software up-to-date (both kernel and user packages) using a convenient binary distribution (no compilation involved!), you might like to try the 1.1.0 release of my Arch Linux live USB for the B3 (image available on GitHub, here).

As before, this should work on any 'stock' B3; no soldering, compilation or U-Boot flashing is required. You can run the live USB without affecting any existing (Excito Debian) system on your B3's hard drive. Changes you make are persisted on the USB, however, so if you install a new package, for example, it'll still be there next time you boot from the USB. Permanent installation to your B3's HDD is also supported, for those who want to do that.

Arch Linux, like Debian, is a binary distribution, so you can install and update your B3 very quickly (using the command "pacman -Syu", see below). This new release of the live USB has some significant new features:
  • An 'interstitial' kernel is used, which then patches, loads and kexecs the 'real' (linux-kirkwood-dt) kernel, provided by archlinuxarm.org. This trick enables you to use archlinuxarm.org's binary kernels (without requiring a U-Boot reflash). You can also change the kernel command line if you like (just modify the file /boot/kexec.sh)
  • Tor's bubba-buttond is now included, so you can power off your B3 by holding down the rear button, when running Arch, just as you would in Debian.
  • The official archlinuxarm.org workaround for the Marvell TSO issue is included.
  • All packages have been brought up to date against the archlinuxarm.org tree, as of 27 March 2015.
  • The ssh host keys are now regenerated on first boot, for security.
  • For those who wish to install Arch Linux onto their B3's HDD (this is strictly optional), a script has been provided to simplify the process (/root/install_on_sda.sh).
Full instructions are provided on the GitHub page (including how to specify initial network settings, so you can ssh in once booted, and how to install Arch Linux on your B3's internal hard drive too, in case you want to do that).

Once logged in, you can then play around with Arch. For example, install the apache web server:

Code: Select all

[root@archb3 ~]# pacman -Sy
   (confirm if prompted, this is equivalent to apt-get-update on Debian)
[root@archb3 ~]# pacman -S apache
   (confirm if prompted, this is equivalent to apt-get-upgrade ... on Debian)
You can search a list of prebuilt archlinuxarm packages here (filter by armv5 architecture).

Bring all packages (userspace and kernel) bang up to date:

Code: Select all

[root@archb3 ~]# pacman -Syu
   (confirm if prompted; like apt-get update && apt-get upgrade on Debian)
Let me know how you get on ^-^

best

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

Re: Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by sakaki »

Slight issue with switching to using the default archlinuxarm.org kernel (as opposed to the custom kernel used in the 1.0.0 release): turns out it doesn't have CONFIG_PCI_MVEBU enabled. This means the B3's built-in WiFi (for those who have it) is not currently supported. Apologies, I should have checked that before releasing the image ><

Anyway, I've posted about this on the archlinuxarm.org forum - hopefully one of the devs there will agree to add this setting to the stock linux-kirkwood-dt kernel configuration. I'll relay any status update here. In the meantime, feel free to play with the release, and please let me know of any other issues that come up!

best

sakaki
past_51
Posts: 22
Joined: 25 Aug 2014, 06:27

Re: Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by past_51 »

Hi sakaki,

I will test as I just need to reinstall my B3 (wifi edition) and was thinking to go to Arch Linux.

2 questions:
- What about partition alignment ? Will your install script take care of that ? (HDD of 4TB)
- As my UBoot is already flashed, can I remove the file kexec.sh from the /boot ?

Thanks,
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by sakaki »

OK, so the devs at archlinuxarm.org have been super-helpful in response to my request: they have added CONFIG_PCI_MVEBU to their default linux-kirkwood-dt kernel configuration, and have re-released a new compiled version also (currently 3.19.3-2-ARCH).

I've pulled their current kernel into the Arch Linux live-USB and re-released it (as version 1.1.2), available on GitHub here. WiFi is now working (and, since this change is in their default configuration, should continue to do so on future kernel releases).

@past_51, the default install script is quite basic, and uses a DOS partition table, not GPT, so is limited to 2TiB (2^32*512 bytes). You can see the script here. If your U-Boot can handle booting from a GPT partition, then you can easily adapt this script to fit your requirements.

Similarly, if you have the updated U-Boot then you will not have to worry about patching the linux-kirkwood-dt kernel with the 'L2-caches-off-during-early-boot' machine code. However, you will need to either append the device tree blob to the kernel, or ensure that U-Boot loads it (so that r2 points to it), and also set up an appropriate kernel command line via U-Boot (the kexec.sh script handles all these points for you).

You can see the (default image's interstitial kernel) init here, and the /boot/kexec.sh script that it sources here, for reference.

In short, the easiest thing might be to try booting from the vanilla live USB first, check that works. Then, perhaps try the default script install to your HDD (DOS partition table), boot from it, check that all works to your satisfaction. If good, then reboot from the USB, modify the script to create a GPT partition table, install again to the HDD (only takes 5 minutes or so), and reboot to check everything is still working. If that is good, you can then try (if you like) removing the interstitial kernel / kexec, with appropriate commands set in your U-Boot environment. This last step will be a lot easier if you have a serial cable attached! Alternatively, just stick with the interstitial kernel, it only adds about 10 seconds to the boot time.

Hope that makes sense, but any further problems / questions, please just ask.

Best,

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

Re: Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by sakaki »

So, quick update, I just tried installing to, and then booting from, a GPT-partitioned /dev/sda, and it all worked fine. My U-Boot version string (on the B3 in question) is "U-Boot 2010.06 (Jun 10 2011 - 09:06:51)".

I've created a GPT version of the HDD install script, which is available here. You can try this version if you like. It creates:
  • A boot partition of size 64MiB (which is then formatted ext3)
  • A swap partition of 1GiB
  • A root partition, taking up the rest of the drive (which is then formatted ext4)
Just boot from the live USB, then download this new script, make it executable, and run it, to perform a GPT-install of Arch Linux onto your HDD.

Edit: I have re-released the image (version 1.1.2) with this additional script now included, so if you boot from the current version of the live USB, you don't have to download anything.

Best

sakaki
past_51
Posts: 22
Joined: 25 Aug 2014, 06:27

Re: Keep your B3 up-to-date with Arch Linux! (new live USB)

Post by past_51 »

Hi sakaki,

I tested the version 1.1.2, and tried to install on the hard drive (gpt script), it worked fine.
I would only recommend to separate the storage from the root partition, in case of reinstall without loosing all data.

I was interested by having a system without interstitial kernel, but if the only difference is that the boot time and that the L2 cache is off during boot, I can live with that.

Thanks sakaki!
Post Reply