Skip to content

Commit

Permalink
chore: remove config and documentation related to Raspberry Pi (#3345)
Browse files Browse the repository at this point in the history
Refs: #3102
  • Loading branch information
targos committed May 7, 2023
1 parent 01d576e commit fe593b5
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 616 deletions.
60 changes: 0 additions & 60 deletions ansible/MANUAL_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* [jenkins-workspace](#jenkins-workspace)
* [Docker hosts](#docker-hosts)
* [SmartOS](#smartos)
* [Raspberry Pi](#raspberry-pi)
* [NFS boot](#nfs-boot)
* [IBM i](#ibm-i)
* [z/OS](#zos)

Expand Down Expand Up @@ -734,64 +732,6 @@ Note that while this is being done across all Docker hosts, you should disable [

Joyent SmartOS machines use `libsmartsshd.so` for PAM SSH authentication in order to look up SSH keys allowed to access machines. Part of our Ansible setup removes this so we can only rely on traditional SSH authentication. Therefore, it is critcal to put `nodejs_test_*` public keys into `$USER/.ssh/authorized_keys` as appropriate or access will be lost and not recoverable after reboot or sshd restart (part of Ansible setup).

## Raspberry Pi

Raspberry Pi configuration is integrated into the standard Ansible playbooks and will run properly when the right hosts are executed.

The current configuration relies upon an NFS boot and NFS root architecture, although it should still be possible to connect a non-NFS Raspberry Pi to the Node.js CI and the Ansible playbooks are intended to be friendly to non-NFS hosts. It's possible that current Ansible scripts don't properly account for non-NFS hosts since these are not regularly included so some adjustments may be necessary.

This document covers much of the process we use: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md

### NFS boot

* The SD card in the Raspberry Pi should have an up to date bootcode.bin (found in the FAT partition of the Raspbian images and comes via regular updates) and ideally an updated firmware. It is possible to boot newer Pi's without SD card but the SD card is necessary for older models and our Ansible setup uses it for local swap space.
* Upon boot, the bootcode will cause the Pi to reach out for an initial DHCP discovery. A DHCP server should be configured to respond appropriately for that device's address along with some NFS boot signals, such as this configuration for dnsmasq:

```
enable-tftp
tftp-root=/var/tftpd
pxe-service=0,"Raspberry Pi Boot"
```

* The tftp server on the same DHCP server should be able to respond to boot requests.
* After looking in the root of the tftp server, the Pi will attempt to load files from a subdirectory named by its serial number. Obtain the serial number from /proc/cpuinfo from a running Pi, take the last 8 characters from the `Serial` field and use that to store individual boot files.
* Copy the entirety of the boot partition of the Raspbian disk image into a subdirectory for each Pi. Symlinks are acceptable to map serial numbers to the names of the Pi's to keep them organised properly.
* Edit cmdline.txt inside the tftp subdirectory for each file and replace the contents with:

```
modprobe.blacklist=bcm2835_v4l2 root=/dev/nfs nfsroot=NFS_ROOT_SERVER_IP:/NFS_ROOT_FOR_THIS_PI,vers=3 rw ip=dhcp rootwait elevator=deadline
```

* Replacing `NFS_ROOT_SERVER_IP` and `NFS_ROOT_FOR_THIS_PI` as appropraite. It is assumed that NFSv3 is used for the root server. The `modprobe.blacklist` is for a sound driver that has been causing problems in most 2019 versions of the Raspbian kernels (Stretch and Buster), this may be fixed at a later day and be unnecessary. Booting would freeze late in the process without this driver removed.
* The DHCP / tftp server should export each of the boot directories via NFS so they can be mounted by the Pi's as /boot/ which will allow the files to be updated during system updates.

### NFS root

An NFS root server can be separate from NFS boot server, and could be different for each Pi.

* The NFS root server should export a shared .ccache directory to be mounted by all Pi's, so it should be exported in such a way as to be permissive with IP addresses. The export should have roughly these options: `(async,rw,all_squash,anonuid=1001,anongid=1002,no_subtree_check)`.
* The NFS root server should export a root directory for each Pi. The IP of the server along with the path to the directory should be put in cmdline.txt on the NFS boot server. The exports should have roughly these options: `(rw,sync,no_subtree_check,no_root_squash)`/
* The ext4 partition of the Raspbian image file (second partition, not the boot FAT partition) should be extracted into this root directory.
* `etc/fstab` in the root directory should be edited to make it NFS compatible. Remove the existing `/boot` and `/` entries and replace them with:

```
/dev/mmcblk0p1 /mnt/mmcblk0p1 vfat defaults 0 0
NFS_ROOT_SERVER_IP:PATH_TO_SHARED_CCACHE_DIRECTORY /home/iojs/.ccache nfs4 rw,exec,async,noauto 0 0
NFS_BOOT_SERVER_IP:PATH_TO_TFTP_BOOT_EXPORT /boot nfs4 nfsvers=3,rw,noexec,async,noauto 0 0
```

* Ansible should also perform checks on `/etc/fstab` so these modifications may not be strictly necessary but it is helpful to have first-boot be into an appropriate state.
* Mounting `/` is done during the NFS boot process so is omitted from `/etc/fstab`.
* The SD card is mounted at `/mnt/mmcblk0p1` and is assumed to be in this location by the Ansible scripts for swap file creation.
* `/boot` is this Pi's tftp boot directory from the NFS boot server.
* When powered on, the Pi should perform all mount steps and present with the standard initial Raspbian boot & login. Note that SSH is not enabled by default and this needs to be done manually before you can remotely access it. To streamline setup, these additional steps can be performed on an initial Pi and then its root directory copied to all other root directories with only minor modifications to `/etc/fstab` required:
* Enable SSH with `raspi-config`
* Add the `nodejs_build_test` public SSH key to `~pi/.ssh/authorized_keys` (with appropriate permissions).
* Change the default password for user `pi` to remove insecurity. This could even be disabled entirely since the SSH key is in place.

After these steps are performed and the Pi's are running, Ansible can be run to finish setup. A reboot is recommended after initial setup to ensure the environment is configured correctly (locale and other settings that are changed).


## IBM i

There isn't a system start service on IBMi -- the machine should not be
Expand Down
2 changes: 0 additions & 2 deletions ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ Unsorted stuff of things we need to do/think about
- [ ] assign 192/256mb ram to the jenkins instances that requires it:
- aix
- TBD
- [ ] automate more items in initial Raspberry Pi setup (see bottom of
setup/raspberry-pi/README.md, some of these can be automated)
- [ ] epel-release for centos - required for centos7 on packet.net arm64
before ccache can be installed
- [x] make .ssh/config and .ssh/id_rsa for release machines, adding config
Expand Down
4 changes: 0 additions & 4 deletions ansible/roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
- "{{ role_path }}/tasks/partials/{{ os }}.yml"
- "{{ role_path }}/tasks/partials/{{ os|stripversion }}.yml"
skip: true

- name: run raspberry pi bootstrap
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"
159 changes: 0 additions & 159 deletions ansible/roles/bootstrap/tasks/partials/raspberry-pi.yml

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/roles/bootstrap/templates/rpi_apt_proxy.j2

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/bootstrap/templates/rpi_boot-config.pi1p.txt.j2

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/bootstrap/templates/rpi_boot-config.pi2.txt.j2

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/roles/bootstrap/templates/rpi_dphys-swapfile.j2

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/bootstrap/templates/rpi_keyboard_defaults.j2

This file was deleted.

1 change: 0 additions & 1 deletion ansible/roles/bootstrap/templates/rpi_sources_list.j2

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/roles/bootstrap/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
raspberry_pi: {
apt_proxy: 'http://192.168.2.100:3142',
nfs_boot_server: '192.168.2.100',
nfs_boot_share_root: '/var/tftpd',
}

autologon_regpath: 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
4 changes: 0 additions & 4 deletions ansible/roles/jenkins-worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
state: present
line: ::1 localhost.localdomain localhost

- name: run raspberry pi jenkins-worker setup
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"

- name: run scaleway armv7 jenkins-worker setup
when: "'scaleway-ubuntu1804-armv7l' in inventory_hostname"
include: "{{ role_path }}/tasks/partials/scaleway-armv7.yml"
Expand Down
60 changes: 0 additions & 60 deletions ansible/roles/jenkins-worker/tasks/partials/raspberry-pi.yml

This file was deleted.

Loading

0 comments on commit fe593b5

Please sign in to comment.