From 86795cc6058fffbd1bf03547d2e4eecc8ea51ffd Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Tue, 15 Dec 2015 16:54:06 +0000 Subject: [PATCH] identify the partition types for mounting; fixes issues with some beta users where this changed Signed-off-by: Justin Cormack --- alpine/etc/init.d/automount | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/etc/init.d/automount b/alpine/etc/init.d/automount index b939ac270..22361c55d 100755 --- a/alpine/etc/init.d/automount +++ b/alpine/etc/init.d/automount @@ -12,13 +12,13 @@ start() DEV="$(ls /dev/[xv]da | head -1 | sed s@/dev/@@)" DRIVE="/dev/${DEV}" - SWAP="${DRIVE}1" - DATA="${DRIVE}2" 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' | awk '{print $1}') + DATA=$(fdisk -l ${DRIVE} | grep 'Linux$' | awk '{print $1}') mount ${DATA} /var && swapon ${SWAP} || ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE} fi }