Skip to content

Commit

Permalink
dietpi: don't fail after testing wifi
Browse files Browse the repository at this point in the history
less wait: change dhclient timeout 60s -> 30s
  • Loading branch information
wiedehopf committed Dec 21, 2024
1 parent b9296da commit 86321c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/build_dist
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ EOF

# reduce default networking timeout from 300 to 120 seconds for dietpi
echo WAIT_ONLINE_TIMEOUT=120 >> "$MNT_DIR"/etc/default/networking
# reduce the timeout for acquiring a dhcp lease, this makes dietpi networking less painful (default 60s)
echo "timeout 30;" >> "$MNT_DIR"/etc/default/networking

sed -i "s/ADSB_RANDOM_PASSWORD/$ROOT_PWD/" "${DIR}/variants/dietpi/dietpi.txt"
echo "AUTO_SETUP_SSH_PUBKEY=$SSH_PUB_KEY" >> "${DIR}/variants/dietpi/dietpi.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ def test_wifi(self):
capture_output=True,
)

if success:
# this needs a long sleep so the networking actually works when we check it after exiting the hotspot app
# somehow on first boot, eth0 and wlan0 are checked sequentially instead of parallel
# thus we need to wait the dhclient.conf timeout which is 30 (modified, default is 60)
print_err(f"successfully connected to '{self.ssid}' but it's dietpi so we need to wait for networking to come up")
time.sleep(30)

elif self._baseos == "raspbian":
# try for a while because it takes a bit for NetworkManager to come back up
startTime = time.time()
Expand Down

0 comments on commit 86321c8

Please sign in to comment.