Headless Alpine Linux deployment scripts
Go to file
macmpi 134360420b prune hidden directories (like .trash) in ovl search 2022-07-24 19:47:28 +02:00
overlay/etc prune hidden directories (like .trash) in ovl search 2022-07-24 19:47:28 +02:00
LICENSE Initial commit 2022-07-08 22:41:32 +02:00
README.md Initial commit 2022-07-09 14:35:14 +02:00
headless.apkovl.tar.gz prune hidden directories (like .trash) in ovl search 2022-07-24 19:47:28 +02:00
make.sh Initial commit 2022-07-09 14:35:14 +02:00
sample_interfaces Initial commit 2022-07-09 14:35:14 +02:00
sample_unattended.sh Initial commit 2022-07-09 14:35:14 +02:00
sample_wpa_supplicant.conf Initial commit 2022-07-09 14:35:14 +02:00

README.md

Deploy Alpine Linux on a headless box

The Alpine Linux documentation assumes one can interract with system directly with a keyboard & display.
However, there are many cases where one might want to deploy a headless system, only available via a network connection (ethernet, wifi or as USB ethernet gadget).

This repo provides an overaly file headless system can boot with (leveraging Alpine distro's initramfs feature): it enables basic ssh server to log-into from another Computer in order to finalize system set-up.

Install procedure:

Please follow Alpine Linux Wiki to download & create installation media for chosen platform.
Tools provided here can be used on any plaform for any install modes (diskless, data disk, system disk).

Just add headless.apkovl.tar.gz overlay file at the root of Alpine Linux boot media (or onto any writeable side-media) and boot the box !

With default network interface definitions (and optional wifi SSID/pass file), one may then access the system under ssh with:
ssh root@<IP> (system IP address may be determined with any IP scanning tools such as nmap).

As with Alpine Linux initial bring-up, root account has no password initially (change that after setup!).
From there, system install can be fine-tuned as usual with setup-alpine for instance (check wiki for details).

Optional files can be added next to headless.apkovl.tar.gz to customise setup (sample files are provided):

  • wpa_supplicant.conf: define wifi SSID & password (mandatory for wifi usecase).
  • interfaces: define network interfaces at will, if defaults (DCHP-based) are not suitable.
  • unattended.sh: make custom automated deployment script to further tune setup automatically (backgrounded).

Note: these files are linux text files: Windows/macOS users need to use text editors supporting linux text line-ending (such as notepad++, BBEdit or any other).

Main steps are logged in /var/log/messages.

How to customize further ?

This repository may be forked/cloned/downloaded.
Main script file is headless.start.
Execute ./make.sh to rebuild headless.apkovl.tar.gz.

Side note: one nicety for bootstrapping PiZero devices or similar which can support USB ethernet gadget networking.
Just add dtoverlay=dwc2 in config.txt, and plug-in USB to Computer port.
With Computer set-up to share networking with USB interface, device will appear at 10.42.0.2 onto Computer's subnet to log into !...

Credits

Thanks for the original instructions & scripts from @sodface and @davidmytton.