Skip to content

[WIP] Issue #205 Remove creation of swap partition code #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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