Rather than hard-code the GPT partition label into the `init-storage` and `factory-reset` scripts, these now determine the block device by reading `/etc/fstab` and using the device specified for `/var`.
14 lines
259 B
Bash
Executable File
14 lines
259 B
Bash
Executable File
#!/bin/sh
|
|
# vim: set sw=4 ts=4 sts=4 et :
|
|
|
|
DATAPART=$(awk '$2=="/var"{print $1}' /etc/fstab)
|
|
|
|
seq 1 30
|
|
|
|
dev=$(findfs "${DATAPART}")
|
|
if [ -z "${dev}" ]; then
|
|
printf 'Could not find data partition (%s)\n' "${DATAPART}" >&2
|
|
exit 1
|
|
fi
|
|
wipefs -fa "${dev}"
|