-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_net_quirks.patch
47 lines (43 loc) · 2 KB
/
mod_net_quirks.patch
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
diff --git a/src/modules/network/config b/src/modules/network/config
index 9b8923f..2487176 100755
--- a/src/modules/network/config
+++ b/src/modules/network/config
@@ -16,4 +16,7 @@
[ -n "$NETWORK_WPA_SUPPLICANT" ] || NETWORK_WPA_SUPPLICANT=no
# Enable Network Manager boot folder support (bookworm)
-[ -n "$NETWORK_NETWORK_MANAGER" ] || NETWORK_NETWORK_MANAGER=yes
\ No newline at end of file
+[ -n "$NETWORK_NETWORK_MANAGER" ] || NETWORK_NETWORK_MANAGER=yes
+
+# Enable/Disable rc.local/NTP quirks code
+[ -n "$NETWORK_ENABLE_NTP_QUIRKS" ] || NETWORK_ENABLE_NTP_QUIRKS=no
diff --git a/src/modules/network/start_chroot_script b/src/modules/network/start_chroot_script
index 2b086a0..bcb0897 100755
--- a/src/modules/network/start_chroot_script
+++ b/src/modules/network/start_chroot_script
@@ -49,17 +49,19 @@ fi
[ -f /etc/ifplugd/action.d/ifupdown ] && mv /etc/ifplugd/action.d/ifupdown /etc/ifplugd/action.d/ifupdown.original
[ -f /etc/wpa_supplicant/ifupdown.sh ] && ln -s /etc/wpa_supplicant/ifupdown.sh /etc/ifplugd/action.d/ifupdown
-if [ ! -f "/etc/rc.local" ];then
- echo 'exit 0' >> /etc/rc.local
+if [ "$NETWORK_ENABLE_NTP_QUIRKS" == "yes" ]; then
+ if [ ! -f "/etc/rc.local" ];then
+ echo '#!/bin/sh -e' > /etc/rc.local
+ fi
+
+ # prevent ntp updates from failing due to some Rpi3 weirdness, see also "Fix SSH" further below
+ apt-get update --allow-releaseinfo-change
+ apt-get install -y iptables
+ sed -i 's@exit 0@@' /etc/rc.local
+ echo '/sbin/iptables -t mangle -I POSTROUTING 1 -o wlan0 -p udp --dport 123 -j TOS --set-tos 0x00' >> /etc/rc.local
+ echo 'exit 0' >> /etc/rc.local
fi
-# prevent ntp updates from failing due to some Rpi3 weirdness, see also "Fix SSH" further below
-apt-get update --allow-releaseinfo-change
-apt-get install -y iptables
-sed -i 's@exit 0@@' /etc/rc.local
-echo '/sbin/iptables -t mangle -I POSTROUTING 1 -o wlan0 -p udp --dport 123 -j TOS --set-tos 0x00' >> /etc/rc.local
-echo 'exit 0' >> /etc/rc.local
-
# Install powersave option
if [ "$NETWORK_DISABLE_PWRSAVE" == "yes" ]; then