|
4 | 4 | However, in many cases one might want to deploy a headless system that is only available through a network connection (ethernet, wifi or as USB ethernet gadget). |
5 | 5 |
|
6 | 6 | This repo provides an **overlay file** to initially bootstrap[^1] a headless system (leveraging Alpine distro's `initramfs` feature): it starts a ssh server to log-into from another Computer, so that actual install on fresh system (or rescue on existing disk-based system) can then be performed remotely.\ |
7 | | -An optional script may be launched at startup, to perform automated actions/setup. |
| 7 | +An optional script may also be launched during that same initial bootstrap, to perform fully automated setup. |
8 | 8 |
|
9 | 9 |
|
10 | 10 | ## Setup procedure: |
11 | 11 | Please follow [Alpine Linux Wiki](https://wiki.alpinelinux.org/wiki/Installation#Installation_Overview) to download & create installation media for the target platform.\ |
12 | 12 | Tools provided here can be used on any plaform for any install modes (diskless, data disk, system disk). |
13 | 13 |
|
14 | | -Just add [**headless.apkovl.tar.gz**](https://is.gd/apkovl_master)[^2] overlay file at the root of Alpine Linux boot media (or onto any custom side-media) and boot-up the system.\ |
15 | | -With default network interface definitions (and [SSID/pass file](#extra-configuration) if using wifi), system can then be remotely accessed with: `ssh root@<IP>`\ |
| 14 | +Just add [**headless.apkovl.tar.gz**](https://is.gd/apkovl_master)[^2] overlay file *as-is* at the root of Alpine Linux boot media (or onto any custom side-media) and boot-up the system.\ |
| 15 | +With default DCHP-based network interface definitions (and [SSID/pass file](#extra-configuration) if using wifi), system can then be remotely accessed with: `ssh root@<IP>`\ |
16 | 16 | (system IP address may be determined with any IP scanning tools such as `nmap`). |
17 | 17 |
|
18 | | -As with Alpine Linux initial bring-up, `root` account has no password initially (change that during setup!).\ |
| 18 | +As with Alpine Linux initial bring-up, `root` account has no password initially (change that during target setup!).\ |
19 | 19 | From there, actual system install can be performed as usual with `setup-alpine` for instance (check [wiki](https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts#setup-alpine) for details). |
20 | 20 |
|
21 | 21 | ## Extra configuration: |
22 | 22 | Extra files may be added next to `headless.apkovl.tar.gz` to customise boostrapping configuration (check sample files): |
23 | 23 | - `wpa_supplicant.conf`[^3] (*mandatory for wifi usecase*): define wifi SSID & password. |
| 24 | +- `unattended.sh`[^3] (*optional*): provide a deployment script to automate setup & customizations during initial bootstrap. |
24 | 25 | - `interfaces`[^3] (*optional*): define network interfaces at will, if defaults DCHP-based are not suitable. |
25 | 26 | - `authorized_keys` (*optional*): provide client's public SSH key to secure `root` ssh login. |
26 | 27 | - `ssh_host_*_key*` (*optional*): provide server's custom ssh keys to be injected (may be stored), instead of using bundled ones[^2] (not stored). Providing an empty key file will trigger new keys generation (ssh server may take longer to start). |
27 | | -- `unattended.sh`[^3] (*optional*): create custom automated deployment script to further tune & extend actual setup (backgrounded). |
28 | 28 |
|
29 | 29 |
|
30 | | -**Goody:** seamless USB-ethernet gadget boostrapping (PiZero for instance):\ |
31 | | -On supporting Pi devices, just add `dtoverlay=dwc2` in `usercfg.txt` (or `config.txt`), and plug USB cable into Computer port.\ |
32 | | -With Computer set-up to share networking with USB interface as 10.42.0.1 gateway, one can log into device from Computer with: `ssh [email protected]` |
| 30 | +**Goody:** seamless USB-serial & USB-ethernet gadget mode (PiZero for instance):\ |
| 31 | +On supporting Pi devices, just add `dtoverlay=dwc2,dr_mode=peripheral` in `usercfg.txt` (or `config.txt`), and plug USB cable into host Computer port.\ |
| 32 | +Serial terminal can then be connected-to from host Computer (xon/xoff flow control: e.g. on Linux with `cu -l ttyACM0`).\ |
| 33 | +Alternatively, with host Computer set-up to share networking with USB interface as 10.42.0.1 gateway, one can log into device from host with: `ssh [email protected]`. |
33 | 34 |
|
34 | | -Main execution steps are logged in `/var/log/messages`. |
| 35 | +Main execution steps are logged: `cat /var/log/messages | grep headless`. |
35 | 36 |
|
36 | 37 | [^1]: Initial boot fully preserves system's original state (config files & installed packages): a fresh system will therefore come-up as unconfigured. |
37 | 38 |
|
38 | | -[^2]: About bundled ssh keys: this overlay is meant to **quickly bootstrap** system in order to then proceed with proper install; therefore it purposely embeds [some ssh keys](https://github.com/macmpi/alpine-linux-headless-bootstrap/tree/main/overlay/etc/ssh) so that bootstrapping is as fast as possible. Those temporary keys are moved in RAM /tmp: they will **not be stored/reused** once actual system install is performed (whether or not ssh server is installed in final setup). |
| 39 | +[^2]: About bundled ssh keys: this overlay is meant to **quickly bootstrap** system in order to then proceed with proper install; therefore it purposely embeds [some ssh keys](https://github.com/macmpi/alpine-linux-headless-bootstrap/tree/main/overlay/tmp/.trash) so that bootstrapping is as fast as possible. Those temporary keys are moved in RAM /tmp: they will **not be stored/reused** once actual system install is performed (whether or not ssh server is installed in final setup). |
39 | 40 |
|
40 | 41 | [^3]: These files are linux text files: Windows/macOS users need to use text editors supporting linux text line-ending (such as [notepad++](https://notepad-plus-plus.org/), BBEdit or any similar). |
41 | 42 |
|
42 | 43 |
|
43 | 44 | ## Want to tweak more ? |
44 | 45 | This repository may be forked/cloned/downloaded.\ |
45 | | -Main script file is [`headless.start`](https://github.com/macmpi/alpine-linux-headless-bootstrap/blob/main/overlay/etc/local.d/headless.start).\ |
| 46 | +Main script file is [`headless.start`](https://github.com/macmpi/alpine-linux-headless-bootstrap/tree/main/overlay/usr/local/bin/headless_bootstrap).\ |
46 | 47 | Execute `./make.sh` to rebuild `headless.apkovl.tar.gz` after changes. |
47 | 48 |
|
48 | 49 |
|
|
0 commit comments