archlinux: use dracut native file instead of our own

This commit is contained in:
Olivier MEDOC 2017-01-29 15:10:33 +01:00
parent d3cda230b4
commit e83c8036e6
3 changed files with 7 additions and 47 deletions

View File

@ -6,7 +6,7 @@
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
pkgname=(qubes-vm-utils qubes-vm-kernel-support)
pkgver=`cat version`
pkgrel=9
pkgrel=10
epoch=
pkgdesc="Common Linux files for Qubes VM."
arch=("x86_64")
@ -26,12 +26,12 @@ changelog=
source=(PKGBUILD-initcpio-hook.sh PKGBUILD-initcpio-install.sh)
noextract=()
md5sums=(e88b50aed7d28087968da728ec1dc2b6 3d204b0d8acda9cf3ea5ebd5334a04d6)
md5sums=(SKIP)
build() {
for source in qrexec-lib udev qmemman core kernel-modules Makefile; do
for source in qrexec-lib udev qmemman core kernel-modules Makefile dracut; do
(ln -s $srcdir/../$source $srcdir/$source)
done
@ -53,11 +53,12 @@ install=PKGBUILD-qubes-vm-kernel-support.install
mkdir -p ${pkgdir}/usr/lib/initcpio/install/
mkdir -p ${pkgdir}/usr/lib/initcpio/hooks/
mkdir -p ${pkgdir}/usr/lib/qubes/
mkdir -p ${pkgdir}/usr/bin/
install -m 611 ${srcdir}/PKGBUILD-initcpio-install.sh ${pkgdir}/usr/lib/initcpio/install/qubes
install -m 611 ${srcdir}/PKGBUILD-initcpio-hook.sh ${pkgdir}/usr/lib/initcpio/hooks/qubes
install -m 755 ${srcdir}/dracut/full-dmroot/qubes_cow_setup.sh ${pkgdir}/usr/lib/qubes/qubes_cow_setup.sh
make install-u2mfn DESTDIR=$pkgdir -C kernel-modules
}

View File

@ -4,48 +4,6 @@ run_earlyhook() {
msg "Starting Qubes copy on write setup script"
if ! grep -q 'root=[^ ]*dmroot' /proc/cmdline; then
warning "Qubes: dmroot not requested, probably not a Qubes VM"
exit 0
fi
/usr/lib/qubes/qubes_cow_setup.sh
if [ -e /dev/mapper/dmroot ] ; then
die "Qubes: FATAL error: /dev/mapper/dmroot already exists?!"
fi
modprobe xen-blkfront || warning "Qubes: Cannot load Xen Block Frontend..."
msg "Qubes: Waiting for /dev/xvda* devices..."
while ! [ -e /dev/xvda ]; do sleep 0.1; done
msg "Qubes: /dev/xvda* found"
SWAP_SIZE=$(( 1024 * 1024 * 2 )) # sectors, 1GB
if [ `cat /sys/block/xvda/ro` = 1 ] ; then
msg "Qubes: Doing COW setup for AppVM..."
while ! [ -e /dev/xvdc ]; do sleep 0.1; done
VOLATILE_SIZE=$(cat /sys/block/xvdc/size) # sectors
ROOT_SIZE=$(cat /sys/block/xvda/size) # sectors
if [ $VOLATILE_SIZE -lt $SWAP_SIZE ]; then
die "Qubes: volatile.img smaller than 1GB, cannot continue"
fi
sfdisk -q --unit S /dev/xvdc >/dev/null <<EOF
1,$SWAP_SIZE,S
,,L
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
while ! [ -e /dev/xvdc2 ]; do sleep 0.1; done
echo "0 `cat /sys/block/xvda/size` snapshot /dev/xvda /dev/xvdc2 N 16" | \
dmsetup --noudevsync create dmroot || die "Qubes: FATAL: cannot create dmroot!"
fi
dmsetup mknodes dmroot
}

View File

@ -7,6 +7,7 @@ build() {
add_binary "/usr/bin/sfdisk"
add_binary "/usr/bin/mkswap"
add_binary "/usr/bin/dmsetup"
add_binary "/usr/lib/qubes/qubes_cow_setup.sh"
add_runscript