fix automount script, as the settings do not persist, as fstab changes dropped

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
Justin Cormack 2015-12-14 18:16:08 +00:00
parent 96df479682
commit c6f6a6ffa2

View File

@ -13,9 +13,13 @@ start()
# XXX this may change on other ports # XXX this may change on other ports
DEV="sda" DEV="sda"
DRIVE="/dev/${DEV}" DRIVE="/dev/${DEV}"
SWAP="${DRIVE}1"
DATA="${DRIVE}2"
if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table" if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table"
then then
ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE} ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
else
mount ${DATA} /var && swapon ${SWAP} || ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
fi fi
} }