Skip to content

Commit 9e07f19

Browse files
Tom Deweytdewey-rpi
authored andcommitted
naked: Remove sparsing, set up TCP ahead of main write
1 parent 79783cd commit 9e07f19

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

service/rpi-naked-provisioner.sh

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,6 @@ else
185185
announce_stop "Finding the cache directory: Using specified name"
186186
fi
187187

188-
# If the file is already a sparse image, don't re-sparse it
189-
# Find the name of the sparse-image by extractin the filename sans path from GOLD_MASTER_OS_FILE
190-
prepare_sparse_image() {
191-
SPARSE_IMAGE_NAME=$(basename "${GOLD_MASTER_OS_FILE}")
192-
if [ ! -f "${RPI_SB_WORKDIR}/${SPARSE_IMAGE_NAME}" ]; then
193-
# If the file doesn't exist, we need to convert it to a sparse image
194-
img2simg "${GOLD_MASTER_OS_FILE}" "${RPI_SB_WORKDIR}/${SPARSE_IMAGE_NAME}"
195-
announce_stop "Converting OS image to sparse image"
196-
else
197-
announce_stop "Using existing sparse image"
198-
fi
199-
}
200-
with_lock "${LOCK_BASE}/rootfs-image.lock" 600 prepare_sparse_image
201188

202189
systemd-notify --ready --status="Provisioning started"
203190

@@ -208,12 +195,12 @@ fastboot -s "${FASTBOOT_DEVICE_SPECIFIER}" erase "${RPI_DEVICE_STORAGE_TYPE}"
208195
sleep 3
209196
announce_stop "Erase Device Storage"
210197

211-
fastboot -s "${FASTBOOT_DEVICE_SPECIFIER}" flash "${RPI_DEVICE_STORAGE_TYPE}" "${RPI_SB_WORKDIR}/${SPARSE_IMAGE_NAME}"
212-
announce_stop "Writing OS images"
213-
214198
# Re-check the fastboot devices specifier, as it may take a while for a device to gain IP connectivity
215199
setup_fastboot_and_id_vars "${FASTBOOT_DEVICE_SPECIFIER}"
216200

201+
fastboot -s "${FASTBOOT_DEVICE_SPECIFIER}" flash "${RPI_DEVICE_STORAGE_TYPE}" "${GOLD_MASTER_OS_FILE}"
202+
announce_stop "Writing OS images"
203+
217204
announce_start "Set LED status"
218205
fastboot -s "${FASTBOOT_DEVICE_SPECIFIER}" oem led PWR 0
219206
announce_stop "Set LED status"

0 commit comments

Comments
 (0)