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 B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

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

Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Hello,

I've just released version 2.0.0 of the live-USB image of Gentoo Linux for the B3 on GitHub (here). All included packages are up-to-date against the Gentoo tree, as of 19 June 2017; a full package list may be viewed here.

Major changes in this release:
  • An "interstitial" kernel is now used during early boot, a strategy that has been succesfully used for a number of years now on my archlinux-on-b3 image. Under this approach, the B3's U-Boot loader actually starts a fixed-version kernel (the "interstitial kernel") which, together with its initramfs, then acts as a second-stage* bootloader for the kernel proper (chainloaded via kexec). This allows the "real" kernel to be distributed as a vanilla zImage, and also enables you to change the kernel command line easily (by editing the file /boot/kexec.sh), without having to flash any U-Boot variables.
  • The current gentoo-b3-kernel is utilized as the "real" kernel, via the binary package gentoo-b3-kernel-bin. Accordingly, your kernel (and module set) will automatically be updated (along with all other packages on the system) whenever you issue genup; the initial kernel version shipped on the image is 4.11.6-gentoo-b3. (gentoo-b3-kernel contains an automatic weekly build of the latest ~arm gentoo-sources kernel, based on this baseline config; a companion gentoo-b3-kernel-bin package is simultaneously created for each new release).
  • A Gentoo binhost (also automatically updated weekly) has been provided (at https://isshoni.org/b3), to allow your B3 to perform fast updates via binary packages where possible, only falling back to local source-based compilation where necessary (using this facility is optional). The binhost also provides an rsync mirror for the main gentoo repo (with signed porthash authentication), used to keep the B3's ebuild tree in lockstep.
  • A custom Gentoo profile, gentoo-b3:default/linux/arm/13.0/armv5te/b3, is provided, which supplies many of the default build settings, USE flags etc., required for Gentoo on the B3, keeping them also in lockstep with the binhost. You can view this profile (provided via the gentoo-b3 overlay) here.
tl;dr: the Gentoo live-USB now has weekly-autobuild binary kernel and userspace package updates available, much like Arch Linux does, so keeping your system up to date should be much less painful (anything not on the pre-installed list, you still have to build from source, however).

Although I make no guarantees about the future availability of these autobuilds, we currently use this infrastructure on our own production B3s, so it should be around for a while. Use the supplied binary packages (and kernels) at your own risk. Also, please be aware that, even with binhost backing, a full genup run will take around an hour to complete on your B3 (due to time taken by rsync, Portage's dependency tree processing etc.). Nevertheless, upgrade of major packages like gcc will take only a few minutes using the binhost, rather than many hours when building from source; plus, you can keep your kernel fully up-to-date easily (something that was rather awkward on Gentoo previously).

Neither the userspace package binhost nor binary kernel package use is mandatory of course; you can easily turn both off for the fully-authentic source-based Gentoo experience ^-^

Installation and Use

As before, you can burn the supplied image to a USB key (>=8GB, 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 376MiB; writing takes between 10 and 20 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 Gentoo Linux, or as the starting point to install Gentoo 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 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.

Full instructions are provided on the project's GitHub page (including how to install Gentoo on your B3's internal hard drive too, in case you want to do that).

Manually Upgrading from a Previous Live-USB Release

If you are currently using a <2.0.0 release of the live-USB and would like to take advantage of the userspace binhost and binary kernel autobuilds now provided, but without switching directly to the 2.0.0 image, please see my short form instructions here.

have fun ^-^
(and as always, any issues, please let me know)

best,
sakaki

PS if you have any "must-have" kernel config changes or packages you'd like included on the weekly autobuild, please note them in this thread.
(*) technically, it is actually a third-stage bootloader; H/W bootloader -> U-Boot -> interstitial kernel -> "real" kernel ^-^
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Hello sakaki! I really appreciate your work. Ijust did a gentoo fresh install on my excito b3 successfully! Never believe that my old b3 would get my favorite distro.

The only problem I have is that I can't connect my wifi devices on the hostapd. I didnt modify your configurations. SSID is "b3" and password is "changeme". However my devices iphone,ipad and lgtv can't connect to the wireless nor on the live, neither on the installation. Seems that the password control is working but I can't get local ip from the dhcp.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Hi andyb3,

sorry to hear you are having problems with this ><

We use a couple of Gentoo B3's at home for WiFi gateways, using the identical image you are running, and it seems to work OK with iPads, phones etc.

I assume you're able to ssh in OK on the LAN port, so you are receiving an address over DHCP there? Is there anything showing up in /var/log/messages or via dmesg when you try to connect a WiFi device? Are any services showing up as failing to start? Is dnsmasq running ("pgrep dnsmasq")? if you set one of your WiFi devices to have a fixed IP address e.g. 192.168.50.99 mask 255.255.255.0 gateway 192.168.50.1, can it connect then (over WiFi)?

The other thing to quickly try would be to boot your B3 with another live USB; that'll quickly help determine whether a userland, config or kernel problem is at the root of this. You could try booting with either my Arch Linux live USB (small, just 193MiB to download) or Gordon's bubbagen (also Gentoo-based) and see if either of those work for you. No need to do a full install, just boot the relevant live USB image and see if you can connect.

Best, sakaki
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Hello again,

1) Here is my /var/log/messages : https://pastebin.com/bPfFP7AD

2) dnsmasq/dhcpcd/hostapd are up and running..

3) I try to connect on the wifi via my laptop. It doesnt connect over DHCP. However, when I tried to connect over static ip the connection was established but I could ping only 192.168.50.* (ping google.gr failed).

4) Also, I tried to boot via live archb3img.xz and dhcp/dnsmasq/hostapd works perfect.
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Hi again...

I add the follow files on the bottom of dnsmasq.conf

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

Now my devices can connect to the wi-fi network... Then I can resolve a domain to IP but I can't get content to the browser..

Code: Select all

andreas@gentoo ~ $ wget kernel.org/index.html
--2017-09-16 19:47:24--  http://kernel.org/index.html
Resolving kernel.org... 198.145.29.83
Connecting to kernel.org|198.145.29.83|:80... 

^C
andreas@gentoo ~ $
(ps: I use google DNS servers 8.8.8.8,8.8.4.4)
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Hi,

There is a problem I think.. dnsmasq should be picking up the file /etc/dnsmasq.d/b3.conf, but the version on the image seems to require

Code: Select all

conf-dir=/etc/dnsmasq.d,*.conf
at the end of /etc/dnsmasq.conf to do that. I'll fix this and re-release. Not sure how that slipped through (the build I use locally picks up files from this directory by default). Apologies ><

As to the rest, wget fetching should work fine with your modified dnsmasq config, since you can ping out. Can you try e.g. "wget google.com" and see what that returns?

Also what do you see if you run "iptables-save"?

Best, sakaki
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Hello again, thanks for the response.
Here is the "iptables-save"

Code: Select all

b3 andreas # iptables-save 
# Generated by iptables-save v1.4.21 on Sun Sep 17 18:32:02 2017
*filter
:INPUT ACCEPT [47:3680]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [29:3860]
COMMIT
# Completed on Sun Sep 17 18:32:02 2017
b3 andreas #

wget cmd:

Code: Select all

andreas@gentoo ~ $ wget google.com
--2017-09-17 18:33:09--  http://google.com/
Resolving google.com... 216.58.206.174, 2a00:1450:4017:807::200e
Connecting to google.com|216.58.206.174|:80... 


(wget stuck on this step :/)


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

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Can I just check, have you disabled the shorewall firewall front-end service on your system?
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Yeap I had disable the firewall. Do I need this service for routing?
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Yes, on the image shorewall sets up the iptables rules for forwarding / masquerading between br0 and eth0, and also takes care of e.g. setting /proc/sys/net/ipv4/ip_forward to 1 on boot etc.

Try booting with shorewall active first, to see if you can wget then. This should work - I've just uploaded a 2.0.1 release (with the /etc/dnsmasq.conf fix) and booted it on a spare B3; was able to connect a client over WiFi and then browse the web etc.

Once you know it works in principle it is an easy matter to remove shorewall and setup forwarding manually, following something like this guide (substitute br0 for eth1).
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Starting up the shorewall solve the problem! Thanks a lot! :D

--

Is there any way to run hostapd over 5Ghz "n" ? I need to stream large files over wifi so increasing speed to 300mbps would be very helpfull.

I tried to edit /etc/hostapd.conf

Code: Select all

channel=7 -> 36
hw_mode=g -> a
but I got some errors.

Code: Select all

b3 hostapd # /etc/init.d/hostapd restart
 * /etc/init.d/hostapd uses runscript, please convert to openrc-run.
 * Stopping hostapd ...                                                                [ ok ]
 * Starting hostapd ...
Configuration file: /etc/hostapd/hostapd.conf
rfkill: Cannot open RFKILL control device
channel [0] (36) is disabled for use in AP mode, flags: 0x57 NO-IBSS PASSIVE-SCAN
wlan0: IEEE 802.11 Configured channel (36) not found from the channel list of current mode (2) IEEE 802.11a
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-4)
wlan0: Unable to setup interface.
 * start-stop-daemon: failed to start `/usr/sbin/hostapd'
 * Failed to start hostapd                                                             [ !! ]
 * ERROR: hostapd failed to start
b3 hostapd # 
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

Hi, glad to hear it works now ^-^

The 5GHz issue is a regulatory one, due to the shipped firmware config of the B3's wifi hardware - can be worked around by patching (but not everywhere legal to distribute in binary form when patched in this way). Travelling atm but if you search for "5GHz" on this forum, you should a few posts relevant to what you need. Or hopefully someone else can dive in to help you on this - it's not really a Gentoo specific issue.

Best, sakaki
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Ok I'll search about "5Ghz" on the other topics.

Thank you again for all the special things you do to promote the gentoo community :wink:
andyb3
Posts: 10
Joined: 13 Sep 2017, 18:34

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by andyb3 »

Hello again sakaki,

It would be great if you could add some (lightweight :lol:) additional packages to your local repositories so I could get them as precompiled packages on my b3 O:)

So here we are:

Code: Select all

app-text/wgetpaste
net-dns/ddclient
net-dns/bind-tools
net-fs/sshfs
net-misc/whois
sys-apps/pmount
sys-apps/uam
sys-process/htop
www-client/links
www-servers/nginx
app-admin/hddtemp
net-fs/davfs2
net-fs/sshfs
net-irc/irssi
This is some of my favorite apps, you can add everything you think it would be usefull. Also, I could provide you web-hosting if is needed in order to support your project :D

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

Re: Gentoo Live-USB for B3 Updated (with Weekly-Autobuild Binhost Backing, including Kernel)

Post by sakaki »

andyb3 wrote: 25 Sep 2017, 13:11 Hello again sakaki,

It would be great if you could add some (lightweight :lol:) additional packages to your local repositories so I could get them as precompiled packages on my b3 O:)
OK, I'll test compile these over the next couple of days. If there are no blockers I'll add to the autobuild list and post again here.

Best, sakaki
Post Reply