mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 03:15:36 +00:00
Merge pull request #1079 from justincormack/swapdiskname
Clean up swap partition mounting logic
This commit is contained in:
commit
4278e0d78e
@ -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