Skip to content

Commit b843c8b

Browse files
committed
dietpi: test quicker firstboot
1 parent c3fb032 commit b843c8b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/build_dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,24 @@ EOF
144144
# reduce the timeout for acquiring a dhcp lease, this makes dietpi networking less painful (default 60s)
145145
echo "timeout 30;" >> "$MNT_DIR"/etc/dhcp/dhclient.conf
146146

147+
# make firstboot quicker
148+
patch "$MNT_DIR"/var/lib/dietpi/services/dietpi-firstboot.bash <<FEO
149+
@@ -352,8 +352,9 @@ _EOF_
150+
# - Configure enabled interfaces now, /etc/network/interfaces will be effective from next boot on
151+
# Failsafe: Bring up Ethernet, whenever WiFi is disabled or fails to be configured, e.g. due to wrong credentials
152+
# shellcheck disable=SC2015
153+
- (( $wifi_enabled )) && ifup "$iface_wlan"
154+
- (( $ethernet_enabled )) && ifup "$iface_eth"
155+
+ (( $wifi_enabled )) && ifup "$iface_wlan" &
156+
+ (( $ethernet_enabled )) && ifup "$iface_eth" &
157+
+ wait
158+
159+
# - Boot wait for network
160+
/boot/dietpi/func/dietpi-set_software boot_wait_for_network "$(( ! $(grep -cm1 '^[[:blank:]]*AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=0' /boot/dietpi.txt) ))"
161+
FEO
162+
163+
164+
147165
sed -i "s/ADSB_RANDOM_PASSWORD/$ROOT_PWD/" "${DIR}/variants/dietpi/dietpi.txt"
148166
echo "AUTO_SETUP_SSH_PUBKEY=$SSH_PUB_KEY" >> "${DIR}/variants/dietpi/dietpi.txt"
149167
cp "${DIR}/variants/dietpi/dietpi.txt" "$MNT_DIR"/"$CONFIG_DIR"

0 commit comments

Comments
 (0)