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`.
This commit is contained in:
2023-03-15 20:53:02 -05:00
parent 749d5b818a
commit a4baa58563
3 changed files with 4 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
DATAPART=PARTLABEL=dch-data
DATAPART=$(awk '$2=="/var"{print $1}' /etc/fstab)
seq 1 30

View File

@@ -71,7 +71,7 @@ setup_etc() {
umount "${tmpdir}"
}
datapart=$(findfs PARTLABEL=dch-data)
datapart=$(findfs $(awk '$2=="/var"{print $1}' /etc/fstab))
if [ -b "${datapart}" ]; then
printf 'Found data partition: %s\n' "${datapart}"
else