summaryrefslogtreecommitdiff
path: root/scripts/setup-config-alpine
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setup-config-alpine')
-rwxr-xr-xscripts/setup-config-alpine46
1 files changed, 20 insertions, 26 deletions
diff --git a/scripts/setup-config-alpine b/scripts/setup-config-alpine
index 5b414aa..23cb6a8 100755
--- a/scripts/setup-config-alpine
+++ b/scripts/setup-config-alpine
@@ -25,8 +25,8 @@ print_log "Installing software from alpine repositories"
25tmp_repo_file=$(mktemp) 25tmp_repo_file=$(mktemp)
26main_repo="$(grep main /etc/apk/repositories)" 26main_repo="$(grep main /etc/apk/repositories)"
27community_repo="$(echo "$main_repo" | sed 's/main/community/')" 27community_repo="$(echo "$main_repo" | sed 's/main/community/')"
28printf '%s\n%s\n' "$main_repo" "$community_repo" > $tmp_repo_file 28printf '%s\n%s\n' "$main_repo" "$community_repo" > "$tmp_repo_file"
29doas mv $tmp_repo_file /etc/apk/repositories 29doas mv "$tmp_repo_file" /etc/apk/repositories
30 30
31./scripts/apkworld 31./scripts/apkworld
32 32
@@ -47,7 +47,7 @@ done
47cd 47cd
48 48
49tmp_xorg_file=$(mktemp) 49tmp_xorg_file=$(mktemp)
50cat <<EOF > $tmp_xorg_file 50cat <<EOF > "$tmp_xorg_file"
51Section "InputClass" 51Section "InputClass"
52 Identifier "libinput touchpad catchall" 52 Identifier "libinput touchpad catchall"
53 MatchIsTouchpad "on" 53 MatchIsTouchpad "on"
@@ -58,48 +58,42 @@ EndSection
58EOF 58EOF
59 59
60doas mkdir -p /etc/X11/xorg.conf.d 60doas mkdir -p /etc/X11/xorg.conf.d
61doas mv $tmp_xorg_file /etc/X11/xorg.conf.d/40-libinput.conf 61doas mv "$tmp_xorg_file" /etc/X11/xorg.conf.d/40-libinput.conf
62 62
63tmp_doas_file=$(mktemp) 63tmp_doas_file=$(mktemp)
64cp /etc/doas.d/20-wheel.conf $tmp_doas_file 64cp /etc/doas.d/20-wheel.conf "$tmp_doas_file"
65for c in poweroff reboot; do 65for c in poweroff reboot; do
66 printf 'permit nopass :wheel as root cmd %s\n' "$c" >> $tmp_doas_file 66 printf 'permit nopass :wheel as root cmd %s\n' "$c" >> "$tmp_doas_file"
67done 67done
68doas cp $tmp_doas_file /etc/doas.d/20-wheel.conf 68doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf
69 69
70 70
71print_log "Configuring the console" 71print_log "Configuring the console"
72 72
73tmp_kmap_file=$(mktemp) 73tmp_kmap_file=$(mktemp)
74tmp_loadkmap_file=$(mktemp) 74tmp_loadkmap_file=$(mktemp)
75printf 'keycode 1 = Caps_Lock\nkeycode 58 = Escape\n' > $tmp_kmap_file 75printf 'keycode 1 = Caps_Lock\nkeycode 58 = Escape\n' > "$tmp_kmap_file"
76doas loadkeys $tmp_kmap_file 76doas loadkeys "$tmp_kmap_file"
77dumpkmap > us-swapesc.bmap 77dumpkmap > us-swapesc.bmap
78gzip us-swapesc.bmap 78gzip us-swapesc.bmap
79doas mv us-swapesc.bmap.gz /etc/keymap/ 79doas mv us-swapesc.bmap.gz /etc/keymap/
80printf 'KEYMAP=/etc/keymap/us-swapesc.bmap.gz\n' > $tmp_loadkmap_file 80printf 'KEYMAP=/etc/keymap/us-swapesc.bmap.gz\n' > "$tmp_loadkmap_file"
81doas mv $tmp_loadkmap_file /etc/conf.d/loadkmap 81doas mv "$tmp_loadkmap_file" /etc/conf.d/loadkmap
82 82
83tmp_blacklist_file=$(mktemp) 83tmp_blacklist_file=$(mktemp)
84cp /etc/modprobe.d/blacklist.conf $tmp_blacklist_file 84cp /etc/modprobe.d/blacklist.conf "$tmp_blacklist_file"
85printf '\n# Disable PC speaker for real\nblacklist pcspkr\n' >> $tmp_blacklist_file 85printf '\n# Disable PC speaker for real\nblacklist pcspkr\n' >> "$tmp_blacklist_file"
86doas cp $tmp_blacklist_file /etc/modprobe.d/blacklist.conf 86doas cp "$tmp_blacklist_file" /etc/modprobe.d/blacklist.conf
87 87
88 88
89print_log "Setting up ACPI (see https://wiki.alpinelinux.org/wiki/Power_management)" 89print_log "Setting up ACPI (see https://wiki.alpinelinux.org/wiki/Power_management)"
90 90
91tmp_acpi_file=$(mktemp) 91tmp_acpi_file=$(mktemp)
92cat <<EOF > $tmp_acpi_file 92printf '#!/bin/sh\necho mem > /sys/power/state\n' > "$tmp_acpi_file"
93#!/bin/sh
94
95xhci="$(grep XHCI /proc/acpi/wakeup | awk '{print $3}')"
96[ "$xhci" == '*enabled' ] && echo XHCI > /proc/acpi/wakeup
97echo mem > /sys/power/state
98EOF
99 93
100for dir in LID PWRF; do 94for dir in LID PWRF; do
101 doas mkdir -p /etc/acpi/$dir 95 doas mkdir -p /etc/acpi/$dir
102 doas cp $tmp_acpi_file /etc/acpi/$dir/00000080 96 doas cp "$tmp_acpi_file" /etc/acpi/$dir/00000080
103 doas chmod +x /etc/acpi/$dir/00000080 97 doas chmod +x /etc/acpi/$dir/00000080
104done 98done
105 99
@@ -109,7 +103,7 @@ doas rc-update add acpid
109print_log "Setting up WiFi (iwd) (see https://wiki.alpinelinux.org/wiki/Iwd)" 103print_log "Setting up WiFi (iwd) (see https://wiki.alpinelinux.org/wiki/Iwd)"
110 104
111tmp_iwd_file=$(mktemp) 105tmp_iwd_file=$(mktemp)
112cat <<EOF > $tmp_iwd_file 106cat <<EOF > "$tmp_iwd_file"
113[General] 107[General]
114EnableNetworkConfiguration=True 108EnableNetworkConfiguration=True
115 109
@@ -117,7 +111,7 @@ EnableNetworkConfiguration=True
117NameResolvingService=resolvconf 111NameResolvingService=resolvconf
118EOF 112EOF
119 113
120doas mv $tmp_iwd_file /etc/iwd/main.conf 114doas mv "$tmp_iwd_file" /etc/iwd/main.conf
121 115
122doas rc-update add iwd boot 116doas rc-update add iwd boot
123doas rc-update del networking boot 117doas rc-update del networking boot
@@ -136,8 +130,8 @@ doas rc-service bluetooth start
136print_log "Setting up SyncThing" 130print_log "Setting up SyncThing"
137 131
138tmp_syncthing_file=$(mktemp) 132tmp_syncthing_file=$(mktemp)
139doas print 'SYNCTHING_USER="sebastiano"\n' > $tmp_syncthing_file 133doas print 'SYNCTHING_USER="sebastiano"\n' > "$tmp_syncthing_file"
140mv $tmp_syncthing_file /etc/conf.d/syncthing 134mv "$tmp_syncthing_file" /etc/conf.d/syncthing
141doas rc-update add syncthing 135doas rc-update add syncthing
142doas rc-service start syncthing 136doas rc-service start syncthing
143 137

Generated with cgit - Back to sebastiano.tronto.net