New Arch Linux Live-USB for B3 Released

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

New Arch Linux Live-USB for B3 Released

Post by sakaki » 11 Nov 2015, 10:21

Hello,

I've just released version 1.2.0 of the live-USB image of Arch Linux for the B3 on GitHub (here). All included packages are up-to-date against the Arch tree, as of 10 November 2015 (and so, of course, shellshock, heartbleed and Ghost fixes have been applied). As before, the kernel used is (via some kexec trickery) that supplied by Arch Linux ARM, so can be kept up-to-date (along with the rest of your packages) with a simple pacman -Syu.

You can burn the supplied image to a USB key (>=4GB, Lexar and SanDisk keys seem the most reliable), then boot your B3 from it, without affecting any installed (Excito) system on your B3's hard drive. (The compressed image is 155MiB; writing takes between 5 and 15 minutes, depending on your system.) You can even boot a diskless B3! No soldering, compilation or U-Boot flashing is required.

The live-USB may then be used as a rescue disk, to play with Arch Linux, or as the starting point to install Arch Linux on your B3'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 Arch 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.

Arch Linux, like Debian, is a binary distribution, so you can install new packages 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:
  • Networking / initial login now simplified: on first boot, the eth1 (lan) interface has a DHCP (dnsmasq) server running, the eth0 (wan) interface is set up as a DHCP client, and shorewall is configured to provide forwarding etc. (the basic setup follows that outlined in my wiki page here). The WiFi interface (where available) is also enabled by default (SSID b3, password changeme), using hostapd, and is bridged with eth1 on br0. As a result, new users can simply hook their PC up to the B3 by Ethernet cable (to the LAN port), or connect via WiFi, without having to specify initial detailed network settings. For external internet access, the B3 may be connected to an ADSL/cable router etc. via the WAN port. (Of course, once logged in, users can configure whatever network setting is desired). As a result, the copynetsetup service is no longer enabled. Also, because forwarding is enabled by default, connected clients should be able to browse the web etc (assuming the WAN port is hooked up). The (new) initial networking setup of the B3 when started from the live-USB is shown below:ImageLogin via eth1/WiFi is still possible, even if the eth0 (wan) interface is disconnected, or the wan network does not support DHCP.
  • The WiFi interface is now renamed wlan0, via a udev rule.
  • Migrated from netctl to native systemd network interface management (as recent changes in systemd appear to have been causing some issues).
  • Fixed install_on_sda.sh and install_on_sda_gpt.sh scripts (they were not copying the /opt directory).
  • Explicitly specified PermitRootLogin yes in /etc/ssh/sshd_config (as not allowed by default in openssh v7), which has caused some people to get locked out when they upgraded.
Full instructions are provided on the project's GitHub page (including how to install Arch 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)
Have fun ^-^

best,
sakaki

victor
Posts: 9
Joined: 01 Feb 2011, 07:04

Re: New Arch Linux Live-USB for B3 Released

Post by victor » 13 Nov 2016, 08:00

Hi,

I tried today to boot on the image for arch but after a few seconds of no light (it is green first, then off), the light simply turns red.

Is there any way to find what goes wrong? Is there some logs somewhere maybe on the key?

I used the same usb key I used for installing the debian jessie image previously (because I had problems in the past with some other usb keys) and tried it with all the usb ports (because, also, I had problems with one of the ports in the past :).

Thanks!

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

Re: New Arch Linux Live-USB for B3 Released

Post by sakaki » 14 Nov 2016, 08:05

Hi victor,

Sorry to hear you are having problems with this ><

The arch live USB is reasonably stable now, with quite a number of users, so there are only a few likely problems that may be causing the issues you are experiencing. You can view the initramfs init script used here, and the sourced kexec.sh here. As you can see, the red LED is lit if a failure occurs during the early boot process.

The two most likely problems are either a corrupted image on the USB stick, or an inability to mount the root partition on /dev/sdb3 per this /etc/fstab (this can be caused if you have no HDD in your B3, or if the HDD is not recognized successfully, or if you have a second USB device connected etc.)

A few suggestions:
  • Did you do the "gpg --verify archb3img.xz.asc archb3img.xz" step to verify the downloaded image? And did the image cat to the usb stick without error?
  • Do you have an HDD fitted in your B3?
  • You might downloading and writing either my Redsleeve live USB image for B3 (needs a >=4GB stick) or Gentoo live USB image (needs a >= 8GB stick), just as a test, since both of these will work regardless of whether or not an HDD is present/detected on your machine.
pls let me know how you get on,

best, sakaki

victor
Posts: 9
Joined: 01 Feb 2011, 07:04

Re: New Arch Linux Live-USB for B3 Released

Post by victor » 14 Nov 2016, 13:14

Sorry, in the end it was the usb key that had a problem, I'm not clear which, but it worked with another one (after I retried everything from zero with the first one with no success).

Thanks for your detailed and helpful reply in any case!

marcz
Posts: 5
Joined: 01 Oct 2011, 06:25

Re: New Arch Linux Live-USB for B3 Released

Post by marcz » 16 Nov 2016, 07:43

Hi Sakaki
I just tried your arch image, and the boot up went flawlessly. I have had some difficulties to connect, but after some time of trying, with the usual RTFM! where I found that changeme was not the root password!
And thank to your clear network schema I better understood how to connect.

Your description of the step to gain access to the B3 is well suited for people that previously used their b3 as router between the wan and the lan. But if, like I do, you use it as a nas in your lan, things are a lot easier.

You connect at boot the wan of the B3 to your switch or router the B3 lan is not used here, then you ssh from any machine on your lan as root@archb3 or if you have a name resolution problem, you look on your router to the attributed lease to get the IP, or even to use nmap but this last is a sledgehammer to crack a nut.

Thank you for this nice work.

Marc

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

Re: New Arch Linux Live-USB for B3 Released

Post by sakaki » 24 Dec 2016, 09:32

I have just posted a new (1.3.0) release of the Arch Linux Live-USB here.

This release addresses an recent issue that was causing login problems for users of the prior 1.2.0 image, when they updated their system using pacman -Syu (the semantics of systemd-networkd-wait-online appear to have changed, causing dnsmasq to fail to start correctly). (NB - if this issue has affected you, please see my other post here, for recovery instructions).

All packages and kernel on the 1.3.0 live-USB are up-to-date against in the archlinuxarm.org tree, as of 22 December 2016. The image has also been made 'universal', so should work without modification whether or not you have an HDD in your B3.

best, sakaki

redw0001
Posts: 96
Joined: 07 Sep 2009, 14:03

Re: New Arch Linux Live-USB for B3 Released

Post by redw0001 » 09 Feb 2017, 03:47

Hi Sakaki,

Decided to go to Arch (rather than Gentoo) for my LMS server after all so downloaded your image, booted and installed to SDA. All went as smooth as can be. I've come unstuck moving from dhcp to static. Could you give me a couple of pointers please as to where I need to make changes.

The B3 will only run LMS and only needs one interface active (eth0 or eth1). I discovered if you make the wrong changes it needs a re-install as you cant see an ip address to find out what the error is. Live and learn.

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

Re: New Arch Linux Live-USB for B3 Released

Post by sakaki » 09 Feb 2017, 14:55

Hi redw0001,

it depends what sort of setup you want. It is sensible, even if the B3 is only going to run LMS, to keep an outbound network connection available via eth0, to allow updating etc. Also worth noting that the bridge interface br0 (=eth1 + optional WiFi, if present) already has a fixed IP address on the image, 192.168.50.1:

Image
As such, you could simply setup LMS to use br0 (rather then eth0 or eth1), if the address 192.168.50.1 works for you.

Of course, it's easy to change the address too, by editing the files in /etc/systemd/network. For example, on the image, /etc/systemd/network/eth1.network is set to:

Code: Select all

[Match]
Name=eth1

[Network]
Bridge=br0
making it part of the br0 bridge, and /etc/systemd/network/br0.network reads:

Code: Select all

[Match]
Name=br0
 
[Network]
Address=192.168.50.1/24
which sets the fixed IP address; whereas /etc/systemd/network/eth0.network, which runs a DHCP client by default on the image, reads:

Code: Select all

[Match]
Name=eth0

[Network]
DHCP=ipv4
You can therefore modify these files to suit your desired configuration.

Note that if you choose to use br0 (i.e. eth1) and to change the address from 192.168.50.1, then you will either need to change the IP address range provided by the dnsmasq DHCP server to match, or disable this server (if you will manually set client addresses, or you are connecting your B3 into a LAN with another DHCP server on it).

The dnsmasq settings on the image reside in the file /etc/dnsmasq.conf, and the non-comment lines read:

Code: Select all

domain-needed
bogus-priv
filterwin2k
listen-address=192.168.50.1
bind-interfaces
no-resolv
server=8.8.8.8
interface=br0
dhcp-range=192.168.50.151,192.168.50.200,12h
The last and "listen-address" lines are the ones you need to edit, if retaining a DHCP server on a modified br0 address.

Alternatively, if you want to disable dnsmasq completely instead, issue:

Code: Select all

[root@archb3 ~]# systemctl disable dnsmasq
[root@archb3 ~]# systemctl stop dnsmasq
If you make network changes, use:

Code: Select all

[root@archb3 ~]# systemctl restart systemd-networkd
(or simply reboot) to have them taken up. Make sure you make a note of the new IP address before restarting, to allow ssh-ing back in!

Now, to actually allow LMS server to accept inbound connections on your chosen interface, you will have to tell the shorewall firewall to open the necessary ports (I believe for LMS these are 3483/tcp, 3483/udp and 9000/tcp - no doubt Gordon will be able to help you here if I am wrong). The file you need to edit is /etc/shorewall/rules. If you are running the service on br0 (eth1 + optional wifi), use source loc. If on eth0, use source net. For example, if you wanted to serve on br0, add the following to /etc/shorewall/rules (leaving existing content as-is):

Code: Select all

ACCEPT loc $FW tcp 3483
ACCEPT loc $FW udp 3483
ACCEPT loc $FW tcp 9000
Substitute net for loc in the above if serving on eth0 instead. To pick up the changes:

Code: Select all

[root@archb3 ~]# systemctl restart shorewall
hth, sakaki

redw0001
Posts: 96
Joined: 07 Sep 2009, 14:03

Re: New Arch Linux Live-USB for B3 Released

Post by redw0001 » 09 Feb 2017, 16:36

Hi Sakaki,

That helped immensely thank you. I disabled dnsmasq as my router handles that. I was not taking into account Shorewall. Now working OK, although I need to plug in the second port to allow internet access from the B3, but that is not a problem as it will only be used for pacman and other downloads.

The LMS 9000 port is for the web interface and I think the other port is for the players to access the music.

Gordon
Posts: 1346
Joined: 10 Aug 2011, 03:18

Re: New Arch Linux Live-USB for B3 Released

Post by Gordon » 09 Feb 2017, 17:15

Are you laying this back on me now? Bad girl.

If you are shielding local net it gets a bit more complicated than you think. And as a matter of fact I happen to do this because I have my squeezebox running on an uncoded vnet wifi bridge (people within my wifi range are very welcome to snoop that I'm streaming Metallica inside my house but I don't like them to actually log on to the network and do naughty things).

These are my lines:

Code: Select all

-A SQUEEZEBOX_fwd -p tcp -m multiport --dports 80,3483,9000,9090 -j ACCEPT
-A SQUEEZEBOX_fwd -p udp -m multiport --dports 3483,17784 -j ACCEPT
-A SQUEEZEBOX_fwd -j REJECT --reject-with icmp-port-unreachable
-A SQUEEZEBOX_in -p tcp -m multiport --dports 3483,9000,9090 -j ACCEPT
-A SQUEEZEBOX_in -p udp -m multiport --dports 67,68,53,3483,17784 -j ACCEPT
-A SQUEEZEBOX_in -d 224.0.0.0/24 -j ACCEPT
-A SQUEEZEBOX_in -j REJECT --reject-with icmp-port-unreachable
In case you're wondering about port 80 (http) forward, you need this for fetching the images assigned to the radio stream you're listening to.

PS had a quick look at the LMS install suggestion for Arch and it doesn't look like it is about installing LMS but SqueezeLite. In my experience running build.sh as is from the CPAN sources is not going to work. However, I did create binaries for Perl 5.20 and 5.22 for use in the Gentoo logitechmediaserver-bin package. They are on my GitHub page and if you follow the instructions on the readme it should work with Arch (and other distros) as well. Obviously I can't vouch for this.

redw0001
Posts: 96
Joined: 07 Sep 2009, 14:03

Re: New Arch Linux Live-USB for B3 Released

Post by redw0001 » 11 Feb 2017, 12:47

Sakaki and Gordon, thank you for your help. Think I'm finally getting the grip of Shorewall enough to do what I want.

In the end I found LMS was available on Arch AUR. So, I downloaded that version (7.9.0) and have it running now. Pretty straightforward in the end.
Address: https://aur.archlinux.org/packages/logitechmediaserver/

Steps:
1: Read the info on the AUR for dependencies. Used pacman to install of them first.
2: Downloaded the snapshot and unpacked it.
3: makepkg -si (went for a coffee - takes quite a while.) This failed at the end as my Id was not a sudoer.
4a: su
4b:pacman -U logitechmediaserver-7.9.0.arch6-1-arm.pkg.tar.xz (this was command that failed in 3:)
5: systemctl enable logitechmediaserver
6: systemctl start logitechmediaserver

All working hunky dory, thanks for your help.

Post Reply