mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
Clean up swap partition mounting logic
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
097879fa92
commit
df2c4818ed
@ -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