initramfs: initialize volatile.img partition table also in TemplateVM

While there is no additional snapshot device, swap partition is still
used.

Fixes QubesOS/qubes-issues#1308
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-25 03:41:04 +01:00
parent 6cd22a42bb
commit a23030e49f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 18 additions and 0 deletions

View File

@ -83,6 +83,15 @@ EOF
log_end
else
log_begin "Qubes: Doing R/W setup for TemplateVM..."
while ! [ -e /dev/xvdc ]; do sleep 0.1; done
sfdisk -q --unit S /dev/xvdc >/dev/null <<EOF
1,$SWAP_SIZE,S
EOF
if [ $? -ne 0 ]; then
die "Qubes: failed to setup partitions on volatile device"
fi
while ! [ -e /dev/xvdc1 ]; do sleep 0.1; done
mkswap /dev/xvdc1
echo "0 `cat /sys/block/xvda/size` linear /dev/xvda 0" | \
dmsetup --noudevsync create dmroot || die "Qubes: FATAL: cannot create dmroot!"
log_end

View File

@ -44,6 +44,15 @@ EOF
echo Qubes: done.
else
echo "Qubes: Doing R/W setup for TemplateVM..."
while ! [ -e /dev/xvdc ]; do sleep 0.1; done
sfdisk -q --unit S /dev/xvdc >/dev/null <<EOF
1,$SWAP_SIZE,S
EOF
if [ $? -ne 0 ]; then
die "Qubes: failed to setup partitions on volatile device"
fi
while ! [ -e /dev/xvdc1 ]; do sleep 0.1; done
mkswap /dev/xvdc1
echo "0 `cat /sys/block/xvda/size` linear /dev/xvda 0" | \
dmsetup create dmroot || { echo "Qubes: FATAL: cannot create dmroot!"; exit 1; }
echo Qubes: done.