mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-05 08:49:39 +00:00
Clean up swap partition mounting logic
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
8324e0df31
commit
e36e15b371
@ -142,8 +142,13 @@ start()
|
||||
fi
|
||||
|
||||
# Use existing swap partition of present; we do not create one now
|
||||
SWAP=$(fdisk -l "$DRIVE" | grep 'Linux swap' | head -1 | awk '{print $1}')
|
||||
[ -z "$SWAP" ] && do_swapfile "$DRIVE" || swapon "$SWAP"
|
||||
SWAP_PART=$(fdisk -l "$DRIVE" | grep 'Linux swap' | head -1 | awk '{print $1}')
|
||||
if [ -z "$SWAP_PART" ]
|
||||
then
|
||||
do_swapfile "$DRIVE"
|
||||
else
|
||||
swapon "$SWAP_PART"
|
||||
fi
|
||||
|
||||
# boot2docker compat, has /var and /tmp on partition
|
||||
[ -d /var/var/lib/boot2docker/ ] && (mv /var/var/* /var && rm -rf /var/var)
|
||||
|
Loading…
Reference in New Issue
Block a user