-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from macmpi/dev
Release 0.7
- Loading branch information
Showing
10 changed files
with
165 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SPDXVersion: SPDX-2.1 | ||
DataLicense: CC0-1.0 | ||
PackageName: alpine-linux-headless-bootstrap | ||
PackageOriginator: macmpi | ||
PackageHomePage: /~https://github.com/macmpi/alpine-linux-headless-bootstrap | ||
PackageLicenseDeclared: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2022 - 2023, macmpi | ||
# SPDX-License-Identifier: MIT | ||
|
||
chmod 600 overlay/etc/ssh/ssh_host_*_key | ||
chmod +x overlay/etc/local.d/headless.start | ||
tar czvf headless.apkovl.tar.gz -C overlay etc --owner=0 --group=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2022 - 2023, macmpi | ||
# SPDX-License-Identifier: MIT | ||
|
||
# added to support USB-Ethernet gadget mode at boot for Pi devices | ||
|
||
options g_ether dev_addr=ea:64:2f:e8:19:94 host_addr=f6:67:ce:b3:c0:ea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2022 - 2023, macmpi | ||
# SPDX-License-Identifier: MIT | ||
|
||
# Sample network interfaces file | ||
|
||
auto lo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,88 @@ | ||
#/bin/sh | ||
|
||
# Copyright 2022 - 2023, macmpi | ||
# SPDX-License-Identifier: MIT | ||
|
||
## collection of few code snippets as sample unnatteded actions some may find usefull | ||
|
||
|
||
## Obvious one; reminder: is run in the background | ||
echo hello world !! | ||
sleep 60 | ||
|
||
######################################################## | ||
|
||
|
||
## This snippet removes apkovl file on volume after initial boot | ||
ovlpath=$( find /media -maxdepth 2 -type d -path '*/.*' -prune -o -type f -name *.apkovl.tar.gz -exec dirname {} \; | head -1 ) | ||
|
||
# also works in case volume is mounted read-only | ||
grep -q "${ovlpath}.*[[:space:]]ro[[:space:],]" /proc/mounts; RO=$? | ||
[ "$RO" -eq "0" ] && mount -o remount,rw "${ovlpath}" | ||
rm "${ovlpath}"/*.apkovl.tar.gz | ||
[ "$RO" -eq "0" ] && mount -o remount,ro "${ovlpath}" | ||
|
||
######################################################## | ||
|
||
|
||
## This snippet configures Minimal diskless environment | ||
# note: with INTERFACESOPTS=none, no networking will be setup so it won't work after reboot! | ||
# Change it or run setup-interfaces in interractive mode afterwards (and lbu commit -d thenafter) | ||
|
||
logger -st ${0##*/} "Setting-up minimal environment" | ||
|
||
cat <<-EOF > /tmp/ANSWERFILE | ||
# base answer file for setup-alpine script | ||
# Do not set keyboard layout | ||
KEYMAPOPTS=none | ||
# Keep hostname | ||
HOSTNAMEOPTS="$(hostname)" | ||
# Set device manager to mdev | ||
DEVDOPTS=mdev | ||
# Contents of /etc/network/interfaces | ||
INTERFACESOPTS=none | ||
# Set Public nameserver | ||
DNSOPTS="-n 208.67.222.222" | ||
# Set timezone to UTC | ||
TIMEZONEOPTS="UTC" | ||
# set http/ftp proxy | ||
PROXYOPTS=none | ||
# Add first mirror (CDN) | ||
APKREPOSOPTS="-1" | ||
# Do not create any user | ||
USEROPTS=none | ||
# No Openssh | ||
SSHDOPTS=none | ||
# Use openntpd | ||
NTPOPTS="chrony" | ||
# No disk install (diskless) | ||
DISKOPTS=none | ||
# Setup storage for diskless (find boot directory in /media/xxxx/apk/.boot_repository) | ||
LBUOPTS="$( find /media -maxdepth 3 -type d -path '*/.*' -prune -o -type f -name '.boot_repository' -exec dirname {} \; | head -1 | xargs dirname )" | ||
APKCACHEOPTS="\$LBUOPTS/cache" | ||
EOF | ||
|
||
# trick setup-alpine to pretend existing SSH connection | ||
# and therefore keep (do not reset) network interfaces while running in background | ||
SSH_CONNECTION="FAKE" setup-alpine -ef /tmp/ANSWERFILE | ||
lbu commit -d | ||
|
||
######################################################## | ||
|
||
|
||
logger -st ${0##*/} "Finished unattended script" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright 2022 - 2023, macmpi | ||
# SPDX-License-Identifier: MIT | ||
|
||
# Sample wpa_supplicant.conf | ||
country=FR | ||
|
||
|