dracut: split 'full' dracut module into 'full-dmroot' and 'full-modules'

When PV Grub will be used, VM initramfs should not contain /lib/modules
mounting code, as the VM root.img will already contains kernel modules.
Make it possible by splitting the module.

QubesOS/qubes-issues#1354
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-08 00:29:55 +01:00
parent d1238ce060
commit 882052eca0
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
8 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,4 @@
install: install:
$(MAKE) -C simple $(MAKE) -C simple
$(MAKE) -C full $(MAKE) -C full-dmroot
$(MAKE) -C full-modules

View File

@ -1,4 +1,4 @@
install: install:
install -d $(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm install -d $(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm
install module-setup.sh mount_modules.sh qubes_cow_setup.sh \ install module-setup.sh qubes_cow_setup.sh \
$(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm/ $(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm/

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
check() { check() {
if xenstore-read qubes-vm-type &>/dev/null; then if xenstore-read qubes-vm-type &>/dev/null || qubesdb-read qubes-vm-type &>/dev/null; then
return 0 return 0
else else
return 255 return 255
@ -10,7 +10,6 @@ check() {
install() { install() {
inst_hook pre-udev 90 $moddir/qubes_cow_setup.sh inst_hook pre-udev 90 $moddir/qubes_cow_setup.sh
inst_hook pre-pivot 50 $moddir/mount_modules.sh
inst_multiple \ inst_multiple \
sfdisk \ sfdisk \
mkswap mkswap

View File

@ -1,8 +1,8 @@
#!/bin/sh
# #
# This file should be places in pre-mount directory in dracut's initramfs # This file should be places in pre-mount directory in dracut's initramfs
# #
#!/bin/sh
echo "Qubes initramfs script here:" echo "Qubes initramfs script here:"
if [ -e /dev/mapper/dmroot ] ; then if [ -e /dev/mapper/dmroot ] ; then

View File

@ -0,0 +1,4 @@
install:
install -d $(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm-modules
install module-setup.sh mount_modules.sh \
$(DESTDIR)/usr/lib/dracut/modules.d/90qubes-vm-modules/

View File

@ -0,0 +1,9 @@
#!/bin/bash
check() {
return 255
}
install() {
inst_hook pre-pivot 50 $moddir/mount_modules.sh
}

View File

@ -1,8 +1,8 @@
#!/bin/sh
# #
# This file should be places in pre-pivot directory in dracut's initramfs # This file should be places in pre-pivot directory in dracut's initramfs
# #
#!/bin/sh
if ! [ -d $NEWROOT/lib/modules/`uname -r` ]; then if ! [ -d $NEWROOT/lib/modules/`uname -r` ]; then
echo "Waiting for /dev/xvdd device..." echo "Waiting for /dev/xvdd device..."

View File

@ -61,6 +61,7 @@ make install-kernel-support DESTDIR=%{buildroot}
%files %files
/usr/lib/dracut/modules.d/90qubes-vm /usr/lib/dracut/modules.d/90qubes-vm
/usr/lib/dracut/modules.d/90qubes-vm-modules
/usr/lib/dracut/modules.d/90qubes-vm-simple /usr/lib/dracut/modules.d/90qubes-vm-simple
/usr/src/u2mfn-%{version}/ /usr/src/u2mfn-%{version}/
/usr/sbin/qubes-prepare-vm-kernel /usr/sbin/qubes-prepare-vm-kernel