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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user