Files
aimee-os/overlay/usr/libexec/factory-reset
Dustin C. Hatch a4baa58563 Read /etc/fstab to determine data partition
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`.
2023-03-15 21:48:44 -05:00

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}"