summaryrefslogtreecommitdiffstats
path: root/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
diff options
context:
space:
mode:
authorSimon Rettberg2023-02-03 12:22:16 +0100
committerSimon Rettberg2023-02-03 12:22:16 +0100
commitea3f4ec5ac55cfa789510c7efe480edeba204c18 (patch)
tree4f1b0b1405b6eeeda9ff962064311bd035f1452a /core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
parent[hardware-stats] Get uptime when submitting report, not 5 hours earlier (diff)
downloadmltk-ea3f4ec5ac55cfa789510c7efe480edeba204c18.tar.gz
mltk-ea3f4ec5ac55cfa789510c7efe480edeba204c18.tar.xz
mltk-ea3f4ec5ac55cfa789510c7efe480edeba204c18.zip
[dhcpc-busybox] Don't wait for dhcp on br0 anymore
We did this to avoid issues if the hostname changes after Xorg started up. But sometimes, DHCP is really slow, and we delay the startup of the login screen by a good 10 seconds. Avoid this by instead just touching the flag file that prevents the udhcpc trigger script from changing the hostname. Running with a potentially wrong hostname should be an acceptable tradeoff.
Diffstat (limited to 'core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index 0d74e832..327bdaa4 100755
--- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -29,6 +29,22 @@ declare -rg RESOLV_CONF="/opt/openslx/resolv.conf"
declare -rg THIS_RESOLV="/run/network/${interface}.resolv"
declare -rg flag="/run/network/primary-dhcp.flag"
+if [ "$1" = "--lock-hostname-updates" ]; then
+ # If we change the hostname while Xorg is running, this might
+ # cause issues, depending on how it's set up. So we run this
+ # script with the lock argument to touch the flag file right
+ # before we try to launch lightdm/Xorg. In case the DHCP request
+ # is too slow, this means we'll run with the wrong hostname
+ # (potentially), but that's better than delaying the bootup
+ # unnecessarily.
+ # So also note that if you ever change this script's name/location
+ # (JUST DON'T), you'd need to update all call sites, i.e. the
+ # udhcpc startup script, and the lightdm service drop-in.
+ mkdir -p /run/network
+ touch "$flag"
+ exit 0
+fi
+
shopt -s extglob
rebuild_resolv_conf () {
@@ -186,7 +202,8 @@ case "$1" in
echo "SLX_NET_WINS='$wins'" >> /opt/openslx/config
fi
- # Only if network is not ready yet
+ # Only update hostname if network is not ready yet
+ # later on this might cause issues
if ! [ -e "$flag" ]; then
# Update hostname
if [ -z "$dns_fqdn" ] && [ -n "$domain" ] && [ -n "$hostname" ]; then