Skip to content

Commit

Permalink
Issue minishift#205 Remove creation of swap partition code
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkumar committed Jan 31, 2018
1 parent 816d406 commit ebdaade
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions scripts/handle-user-data
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ mount_partitions() {
mount $BOOT2DOCKER_DATA /mnt/$PARTNAME
fi

# Activate swap partition
echo "activate swap ..."
swapon "${UNPARTITIONED_HD}2"

# Just in case, the links will fail if not
umount -f /var/lib/docker || true
rm -rf /var/lib/docker /var/lib/boot2docker /etc/docker /var/lib/minishift /opt
Expand Down Expand Up @@ -70,30 +66,12 @@ prepare_partions() {
# Create the partition, format it and then mount it
echo "NEW boot2docker managed disk image ($UNPARTITIONED_HD): formatting it for use"

# Add a swap partition (so Docker doesn't complain about it missing)
(echo n; echo p; echo 2; echo ; echo +1000M ; echo w) | fdisk $UNPARTITIONED_HD
# Let kernel re-read partition table
partprobe

(echo t; echo 82; echo w) | fdisk $UNPARTITIONED_HD
# Let kernel re-read partition table
partprobe
# wait for the partition to actually exist, timeout after about 5 seconds
local timer=0
while [ "$timer" -lt 10 -a ! -b "${UNPARTITIONED_HD}2" ]; do
timer=$((timer + 1))
sleep 0.5
done

# Prepare the swap partition
mkswap "${UNPARTITIONED_HD}2"

# Add the data partition
(echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $UNPARTITIONED_HD
# Let kernel re-read partition table
partprobe
# wait for the partition to actually exist, timeout after about 5 seconds
timer=0
local timer=0
while [ "$timer" -lt 10 -a ! -b "${UNPARTITIONED_HD}1" ]; do
timer=$((timer + 1))
sleep 0.5
Expand Down

0 comments on commit ebdaade

Please sign in to comment.