Skip to content

Commit d8fbe8d

Browse files
authored
Merge pull request #48 from macmpi/dev
Version 1.3
2 parents 3666fd7 + d0d8d64 commit d8fbe8d

16 files changed

+57
-74
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "xg_multi"]
2+
path = xg_multi
3+
url = ../xg_multi
4+
branch = main

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-2023 macmpi
3+
Copyright (c) 2022-2025, macmpi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ An optional script may also be launched during that same initial bootstrap, to p
99

1010
## Setup procedure:
1111
Please follow [Alpine Linux Wiki](https://wiki.alpinelinux.org/wiki/Installation#Installation_Overview) to download & create installation media for the target platform.\
12-
Tools provided here can be used on any plaform for any install modes (diskless, data disk, system disk).
12+
Tools provided here can be used on any hardware platform to prepare for any install modes (diskless, data disk, system disk).
1313

1414
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.\
1515
With default DCHP-based network interface definitions (and [SSID/pass](#extra-configuration) file if using wifi), system can then be remotely accessed with: `ssh root@<IP>`\
1616
(system IP address may be determined with any IP scanning tools such as `nmap`).
1717

18-
As with Alpine Linux initial bring-up, `root` account has no password initially (change that during target setup!).\
18+
As with Alpine Linux initial bring-up, `root` account has no password initially.\
1919
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).
2020

2121
## Extra configuration:
@@ -26,17 +26,18 @@ Extra files may be added next to `headless.apkovl.tar.gz` to customise boostrapp
2626
- `authorized_keys` (*optional*): provide client's public SSH key to secure `root` ssh login.
2727
- `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).
2828
- `opt-out` (*optional*): dummy file to opt-out internet features (connection status, version check, auto-update) and related links usage anonymous [telemetry](https://is.gd/privacy.php).
29-
- `auto-updt` (*optional*): allow apkovl file automatic update with latest from master branch. If it contains *reboot* keyword all in one line, system will reboot after succesful update (unless ssh session is active or `unattended.sh` script is available).
29+
- `auto-updt` (*optional*): enable automatic `headless.apkovl.tar.gz` file update with latest from master branch. If it contains `reboot` keyword all in one line, system will reboot after succesful update (unless ssh session is active or `unattended.sh` script is available).
3030

3131
Main execution steps are logged: `cat /var/log/messages | grep headless`.
3232

3333
## Goody:
34-
Seamless USB-serial & USB-ethernet gadget mode (*e.g. PiZero*):
35-
- Make sure dwc2/dwc3 driver is loaded accordingly, and device configuration is set to `peripheral` mode: this may be hardware (including cable) and/or software driven.\
36-
(on supporting Pi devices, just add `dtoverlay=dwc2,dr_mode=peripheral` in `usercfg.txt` (or `config.txt`) to force by software)
34+
Seamless USB-gadget mode: serial console, ethernet and mass-storage (*e.g. on PiZero*), leveraging [xg_multi](https://github.com/macmpi/xg_multi/).
35+
- Make sure `dwc2` (or `dwc3`) driver is previously loaded on device, and configuration is set to **OTG peripheral** mode: this may be driven by hardware (including cable) and/or software.\
36+
(on supporting Pi devices, just add `dtoverlay=dwc2,dr_mode=peripheral` in `usercfg.txt` (or `config.txt`) to force both by software)
3737
- Plug USB cable into host Computer port before boot.\
38-
Serial terminal can then be connected-to from host Computer (e.g. `cu -l ttyACM0` on Linux. xon/xoff flow control).\
39-
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]`.
38+
-- serial terminal can then be connected-to from host Computer (e.g. `cu -l ttyACM0` on Linux. xon/xoff flow control).\
39+
-- alternatively, with host Computer ECM/RNDIS interface set-up as 10.42.0.1 (sharing internet or not), one can log into device from host with: `ssh [email protected]`.\
40+
-- volume containing `headless.apkovl.tar.gz` file may be accessed/mounted from host, and config files easily edited. Make sure to unmount properly before removing USB plug.
4041

4142
[^1]: Initial boot fully preserves system's original state (config files & installed packages): a fresh system will therefore come-up as unconfigured.
4243

@@ -54,4 +55,3 @@ Execute `./make.sh` to rebuild `headless.apkovl.tar.gz` after changes.\
5455

5556
## Credits
5657
Thanks for the initial guides & scripts from @sodface and @davidmytton.
57-

headless.apkovl.tar.gz

2.77 KB
Binary file not shown.

headless.apkovl.tar.gz.sha512

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fecc6b66f1b08a959c6509334b5c1942b8df76ba6b7d51c54630f0c502706650b9d345bab71cd3d787681113eb5c1a40b2f6bc238ca6e4137fd00de8a6bc8a17 headless.apkovl.tar.gz
1+
7d72e7a46066aebb0572f1431d6e9f354b3d0df4fce0a05090c1667f68738e876c195460d294a0c279c86d02b65d101625ed9c86a1f465c2f2f29ee59bdde5fa headless.apkovl.tar.gz

make.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/busybox sh
22

3-
# SPDX-FileCopyrightText: Copyright 2022-2023, macmpi
3+
# SPDX-FileCopyrightText: Copyright 2022-2025, macmpi
44
# SPDX-License-Identifier: MIT
55

66
# Script meant to be run on Alpine (busybox) or on Ubuntu.
@@ -18,6 +18,7 @@ if [ -n "$build_path" ]; then
1818
# prefer timestamp option for touch as it works on directories too
1919
t_stamp="$( TZ=UTC date +%Y%m%d0000.00 )"
2020
cp -a overlay "$build_path"/.
21+
cp xg_multi/xg_multi "$build_path"/overlay/usr/local/bin/.
2122
find "$build_path"/overlay/ -exec sh -c 'TZ=UTC touch -chm -t "$0" "$1"' "$t_stamp" {} \;
2223
# setting modes and owner/groups for runtime (won't affect mtime)
2324
find "$build_path"/overlay/etc -type d -exec chmod 755 {} \;

overlay/etc/init.d/headless_bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/sbin/openrc-run
22

3-
# SPDX-FileCopyrightText: Copyright 2022-2023, macmpi
3+
# SPDX-FileCopyrightText: Copyright 2022-2025, macmpi
44
# SPDX-License-Identifier: MIT
55

66
description="Headless main boostrappring script"

overlay/etc/init.d/headless_cleanup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/sbin/openrc-run
22

3-
# SPDX-FileCopyrightText: Copyright 2022-2023, macmpi
3+
# SPDX-FileCopyrightText: Copyright 2022-2025, macmpi
44
# SPDX-License-Identifier: MIT
55

66
description="Headless cleanup script"

overlay/etc/init.d/headless_unattended

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/sbin/openrc-run
22

3-
# SPDX-FileCopyrightText: Copyright 2022-2023, macmpi
3+
# SPDX-FileCopyrightText: Copyright 2022-2025, macmpi
44
# SPDX-License-Identifier: MIT
55

66
description="Headless unattended setup script (optional)"

overlay/etc/modprobe.d/headless_gadget.conf

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)