Skip to content

Commit

Permalink
Remove where a swap partition is created and activated
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Mar 21, 2019
1 parent bf4f6ee commit 089e1c9
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions deploy/iso/minikube-iso/package/automount/minikube-automount
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,8 @@ if [ ! -n "$BOOT2DOCKER_DATA" ]; then
dd if=$UNPARTITIONED_HD of=/userdata.tar bs=1 count=4096 2>/dev/null
# 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
timer=0
while [ "$timer" -lt 10 ]; do
if [ -b "${UNPARTITIONED_HD}2" ]; then
mkswap "${UNPARTITIONED_HD}2" && break
fi
echo "Waiting for ${UNPARTITIONED_HD}2 to exist."
timer=$((timer + 1))
sleep 0.5
done

# Add the data partition
(echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $UNPARTITIONED_HD
# Let kernel re-read partition table
Expand Down Expand Up @@ -74,12 +57,6 @@ if [ ! -n "$BOOT2DOCKER_DATA" ]; then
if [ $NON_NUL == 0 ]; then
# Create the partition, format it and then mount it
echo "NEW VMware 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
(echo t; echo 82) | fdisk $UNPARTITIONED_HD
mkswap "${UNPARTITIONED_HD}2"
# Add the data partition
(echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $UNPARTITIONED_HD
BOOT2DOCKER_DATA=`echo "${UNPARTITIONED_HD}1"`
mkfs.ext4 -i 2048 -L $LABEL $BOOT2DOCKER_DATA
Expand Down Expand Up @@ -194,7 +171,6 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
mkdir -p /var/run/minikube
echo "PERSISTENT_DIR=\"/mnt/$PARTNAME\"" > /var/run/minikube/env
fi
swapon "${UNPARTITIONED_HD}2"

# /etc dirs are initialised from /usr/local, to allow the user/admin to customise
mkdir -p /var/lib/boot2docker/etc/
Expand Down

0 comments on commit 089e1c9

Please sign in to comment.