dracut: initialize volatile.img partitions
Do not rely on dom0 initializing that device. Actually volatile.img content should be none of dom0 business. QubesOS/qubes-issues#1308
This commit is contained in:
parent
0f954034a1
commit
a30d583249
@ -11,5 +11,7 @@ check() {
|
||||
install() {
|
||||
inst_hook pre-udev 90 $moddir/qubes_cow_setup.sh
|
||||
inst_hook pre-pivot 50 $moddir/mount_modules.sh
|
||||
|
||||
inst_multiple \
|
||||
sfdisk \
|
||||
mkswap
|
||||
}
|
||||
|
@ -18,6 +18,22 @@ if [ `cat /sys/block/xvda/ro` = 1 ] ; then
|
||||
echo "Qubes: Doing COW setup for AppVM..."
|
||||
|
||||
while ! [ -e /dev/xvdc ]; do sleep 0.1; done
|
||||
VOLATILE_SIZE=$(sfdisk -s /dev/xvdc)
|
||||
ROOT_SIZE=$(sfdisk -s /dev/xvda) # kbytes
|
||||
SWAP_SIZE=1024 # kbytes
|
||||
if [ $VOLATILE_SIZE -lt $(($ROOT_SIZE + $SWAP_SIZE)) ]; then
|
||||
ROOT_SIZE=$(($VOLATILE_SIZE - $SWAP_SIZE))
|
||||
fi
|
||||
sfdisk -q --unit B /dev/xvdc >/dev/null <<EOF
|
||||
0,$SWAP_SIZE,S
|
||||
,$ROOT_SIZE,L
|
||||
EOF
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Qubes: failed to setup partitions on volatile device"
|
||||
exit 1
|
||||
fi
|
||||
while ! [ -e /dev/xvdc1 ]; do sleep 0.1; done
|
||||
mkswap /dev/xvdc1
|
||||
while ! [ -e /dev/xvdc2 ]; do sleep 0.1; done
|
||||
|
||||
echo "0 `cat /sys/block/xvda/size` snapshot /dev/xvda /dev/xvdc2 N 16" | \
|
||||
|
@ -19,6 +19,22 @@ if [ `cat /sys/block/xvda/ro` = 1 ] ; then
|
||||
echo "Qubes: Doing COW setup for AppVM..."
|
||||
|
||||
while ! [ -e /dev/xvdc ]; do sleep 0.1; done
|
||||
VOLATILE_SIZE=$(sfdisk -s /dev/xvdc)
|
||||
ROOT_SIZE=$(sfdisk -s /dev/xvda) # kbytes
|
||||
SWAP_SIZE=1024 # kbytes
|
||||
if [ $VOLATILE_SIZE -lt $(($ROOT_SIZE + $SWAP_SIZE)) ]; then
|
||||
ROOT_SIZE=$(($VOLATILE_SIZE - $SWAP_SIZE))
|
||||
fi
|
||||
sfdisk -q --unit B /dev/xvdc >/dev/null <<EOF
|
||||
0,$SWAP_SIZE,S
|
||||
,$ROOT_SIZE,L
|
||||
EOF
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Qubes: failed to setup partitions on volatile device"
|
||||
exit 1
|
||||
fi
|
||||
while ! [ -e /dev/xvdc1 ]; do sleep 0.1; done
|
||||
mkswap /dev/xvdc1
|
||||
while ! [ -e /dev/xvdc2 ]; do sleep 0.1; done
|
||||
|
||||
echo "0 `cat /sys/block/xvda/size` snapshot /dev/xvda /dev/xvdc2 N 16" | \
|
||||
|
@ -11,4 +11,7 @@ depends() {
|
||||
|
||||
install() {
|
||||
inst $moddir/init.sh /init
|
||||
inst_multiple \
|
||||
sfdisk \
|
||||
mkswap
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ static long u2mfn_ioctl(struct file *f, unsigned int cmd,
|
||||
(current, current->mm, data, 1, 1, 0, &user_page, 0);
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
if (ret != 1) {
|
||||
printk("U2MFN_GET_MFN_FOR_PAGE: get_user_pages failed, ret=0x%x\n", ret);
|
||||
printk("U2MFN_GET_MFN_FOR_PAGE: get_user_pages failed, ret=0x%lx\n", ret);
|
||||
return -1;
|
||||
}
|
||||
kaddr = kmap(user_page);
|
||||
|
Loading…
Reference in New Issue
Block a user