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:
parent
6cd22a42bb
commit
a23030e49f
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user