-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathezsdm
More file actions
executable file
Β·85 lines (65 loc) Β· 2.7 KB
/
ezsdm
File metadata and controls
executable file
Β·85 lines (65 loc) Β· 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
# Simple script to use sdm with plugins
# Edit the text inside the EOF/EOF as appropriate for your configuration
# You must modify these: user, network
# Review and change others as desired, especially these: apps, L10n
# >> Suggestion: Copy this file to somewhere in your path and edit your copy
# (~/bin is a good location)
function errexit() {
echo -e "$1"
exit 1
}
img="$1"
[ "$img" == "" ] && errexit "? No IMG specified"
[ "$(type -p sdm)" == "" ] && errexit "? sdm is not installed"
assets="."
rm -f $assets/my.plugins.1
[ -f $assets/my.plugins ] && mv $assets/my.plugins $assets/my.plugins.1
(cat <<EOF
# Plugin List generated $(date +"%Y-%m-%d %H:%M:%S")
EOF
) | bash -c "cat >|$assets/my.plugins"
(cat <<'EOF'
# **** Complete Plugin Documentation: https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md
# Delete user pi if it exists
user:deluser=pi
# ** Add a new user
# **** change 'myuser' and 'mypassword' ****
user:adduser=myuser|password=mypassword
# **** Install apps ****
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#apps
apps:name=mybrowsers|apps=firefox,chromium
apps:name=mytools|apps=keychain,lsof,iperf3,dnsutils
# **** Configure network ** change 'myssid' and 'mywifipassword' ****
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#network
network:ifname=wlan0|wifissid=myssid|wifipassword=mywifipassword|wificountry=US
network:ifname=eth0
# **** Configure localization settings to the same as this system ****
# **** Use L10n:host if host is Debian/RasPiOS/Ubuntu
# **** Use specific settings when running on other hosts
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#l10n
#L10n:keymap=us|locale=en_US.UTF-8|timezone=America/Los_Angeles|wificountry=us
L10n:host
# **** Uncomment to enable persistent journaling ***
# *** The Trixie default is to keep no previous boot logs ***
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#system
#system:journal=persistent
# **** Configure the text mode console to blank after 5 minutes ****
# **** Comment this out if desired ****
quietness:consoleblank=300
#
# This configuration eliminates the need for piwiz so disable it
# Cloudinit is not necessary so disable it as well
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#disables
disables:piwiz|cloudinit
# **** Uncomment to enable trim on all disks ****
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#trim-enable
#trim-enable
EOF
) | bash -c "cat >>$assets/my.plugins"
sdm --customize --plugin @$assets/my.plugins --extend --xmb 2048 --restart --logwidth 256 $img
echo $"
Use sdm to burn the disk and create SSH Host Keys:
sdm --burn /dev/sdX --hostname myhost $img --expand-root --plugin sshhostkey:generate-keys
"