move automount to packages

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
Justin Cormack
2015-12-23 13:02:25 +00:00
parent 635a44ab99
commit a7cc326f1c
3 changed files with 1 additions and 1 deletions

View File

@@ -1,24 +0,0 @@
#!/sbin/openrc-run
depend()
{
after dev
before docker
}
start()
{
ebegin "Configuring host block device"
DEV="$(ls /dev/[sxv]da | head -1 | sed s@/dev/@@)"
DRIVE="/dev/${DEV}"
if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table"
then
ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
else
SWAP=$(fdisk -l ${DRIVE} | grep 'Linux swap' | head -1 | awk '{print $1}')
DATA=$(fdisk -l ${DRIVE} | grep 'Linux$' | head -1 | awk '{print $1}')
mount ${DATA} /var && swapon ${SWAP} || ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
fi
}