Hi,
The images work with the ClusterHAT and the ClusterCTRL devices I've been working on.
They support booting Pi Zeros/A+/3A+/CM1/CM3/CM3+ from either SD (and eMMC for compute modules) or without an SD card using rpiboot, as before the controller can be setup with either a bridged (CBRIDGE) or NAT (CNAT) network.
*For this test release only*
- SSH is enabled on both controller and Pi Zero images.
- Auto login is enabled via serial console (controller) and ttyGS0 (Pi Zeros) accessible using /dev/ttypiX (you can use "minicom p1" or "screen /dev/ttypi2" etc. as before).
Login: pi/clusterctrl
Controller images can be used on SD or USB Flash (3B+ or 3B with OTP set).
Pi Zero "pX" images can be used on Pi Zeros/A+/3A+/CM1/CM3/CM3+.
Not all 3A+ are able to boot via USB, sadly there's no further information on which can boot other than the first few thousand can't :(.
Image Changes
To reconfigure the SD image type you need to append " init=/sbin/reconfig-clusterctrl X" to /boot/cmdline.txt where X is "cnat" (NAT) or "cbridge" (BRIDGE) for the controller and "pX" where X is 1-252 for the Pi Zeros.
As above the hostname of the bridged controller image is now "cbridge" and not "controller".
Merges in the functionality of the usbboot test image.
Image filenames are now prefixed with ClusterCTRL.
Added restrictions to limit NFS access (/etc/hosts.allow & /etc/hosts.deny) to the internal network IP range
172.19.180.0/24.
rpiboot runs as a service "clustercrtl-rpiboot", progress can be seen in "/var/log/daemon.log".
"clusterhat init" no longer runs from rc.local, there is now a "clusterctrl-init" service.
Gadgets are setup as Ethernet and two serial ports (the first port /dev/ttypiX is used for a serial console. I plan to use the second port /dev/ttypiXa to allow comms with the Pi Zero from the controller).
Switched from g_cdc to RNDIS for USB Gadget Ethernet.
The above change allows the SD images to be used on a Pi Zero/A+/3A+/CM1/CM3/CM3+ connected to a Windows 10 or Linux machine allowing access via Ethernet/Serial.
USB Gadget interface is setup using libcomposite. With the SD image this is setup in the "clusterctrl-composite" service, for usbboot it's setup within initramfs allong with internal networks VLAN 10 interface.
initramfs are automatically rebuilt when the kernel is upgraded (usbboot only)
Filesystem automatically expanded to size of SD/USB.
Probably lots of other things I can't remember right now.
Network Setup
The network is configured the same way as the previous ClusterHAT images. The usbboot root filesystem uses initramfs allowing usb0 on the Pi Zero to be used for the external network (the same as the SD images) and usb0.10 for the internal network for the NFS filesystem.
Controller types
cnat.local (CNAT)
- Network address translation is setup to work with a controller connected via either WiFi or Ethernet. Due to the fallback IPs the controller will have IP 172.19.181.254 on br0 and 172.19.181.X (X=pX number) for the Pi Zeros.
cbridge.local (CBRIDGE)
- Pi Zeros network is bridged with controllers Ethernet port, controller+Pi Zeros get an IP from DHCP server on local network. Will fallback to 172.19.181.254 on the controller and 172.19.181.X (X=pX number) for the Pi Zeros if no DHCP server is available on the network.
Network Bridges
br0 - External network
- CNAT - Controller has the fallback IP 172.19.181.254 on br0, the Pi Zeros will also fallback to 172.19.181.X where X is the pX number.
- CBRIDGE - The controller and Pi Zeros will obtain an IP address from the DHCP server on the local Ethernet connection.
[ When using WiFi on the controller you must use the CNAT image to enable the Pi Zeros to access the internet ]
brint - Internal network only used for usbboot on Pi Zeros/etc.
- 172.19.180.254 on the controller and Pi Zeros (usbboot only) have 172.19.180.X where X is pX.
How to boot Pi Zeros without SD cards.
Overview
The root filesystems are stored in /var/lib/clusterctrl/nfs/
In previous releases of the test image the USB cable to the ClusterHAT needed to be in a specific USB port on the controller. The USB path is now detected on boot for Cluster HAT v2.x . For those using Cluster HAT v1.x you will need to configure the USB port by uncommenting the appropriate line in "/etc/default/clusterctrl" to allow the USB path links in "/var/lib/clusterctrl/boot/" to be update on boot (you can also run "sudo clusterctrl init" to update the links without rebooting).
Filesystem Setup
To start with the root filesystems in /var/lib/clusterctrl/nfs/pX/ are empty.
Then reconfigure the root filesystem
P=1 # The pX number
DIR=/var/lib/clusterctrl/nfs/p$P
tar -C $DIR -axf <path to>/ClusterCTRL-2019-04-08-lite-1-usbboot.tar.xz
# Replace "lite" with "std" or "full" depending on which image you use.
/var/lib/clusterctrl/nfs/p$P/usr/share/clusterctrl/reconfig-usbboot $P
Booting
Ensure the Pi Zeros either have no SD card in them or the SD card doesn't contain a bootcode.bin file in the first FAT partition and then power on as normal "clusterctrl on pX".
You can watch the boot process with "tail -f /var/log/kern.log /var/log/daemon.log". daemon.log shows rpiboot transferring the files to the Pi Zero and kern.log shows the network interfaces being configured. It will then take a few more seconds for the Pi Zero to boot over the USB network before you can access them using the normal "pX.local" from the controller.
If you use this with a 3rd generation Pi (3A+, CM3 or CM3+) be aware
a halted Pi is still running at some level so you'll see it trying to boot over and over in the logs for rpiboot, so I'd advise powering off after halting if using these models as nodes.
Thanks,
Chris.