Commit Graph

17 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
44edc8a9b2
dracut: add missing 'die' function to 'simple' module 2017-04-08 13:58:32 +02:00
Marek Marczykowski-Górecki
a23030e49f
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
2015-11-25 03:41:04 +01:00
Marek Marczykowski-Górecki
6cd22a42bb
initramfs: use units of sectors in sfdisk call
New version of sfdisk have different syntax for other units (suffixes
beside the numbers, instead of global --unit). The only common unit is
sector, so use that.

Fixes QubesOS/qubes-issues#1427
2015-11-25 03:38:51 +01:00
Marek Marczykowski-Górecki
8311e1263d
initramfs: fix swap size
It should be 1GB, not 1MB...

QubesOS/qubes-issues#1354
2015-11-13 14:42:51 +01:00
Marek Marczykowski-Górecki
64331d7e09
dracut: add a safety check preventing qubes_cow_setup.sh running in dom0
Theoretically it shouldn't be a problem, because module isn't installed
in initramfs by default (in dom0), but since such error would be fatal
to dom0 (will prevent it from booting), add a safety check for it.

Probably it will be required when (if) we migrate dom0 to Debian
2015-11-11 05:10:59 +01:00
Marek Marczykowski-Górecki
3cd77e4f70
debian: introduce qubes-kernel-vm-support package
This package is responsible for kernel modules and initramfs additions
needed in Qubes VM. When installed, it is possible to switch the VM to
use PV Grub and load the kernel from inside of VM. This greatly ease
installing custom kernel modules.

Changes:
 - make qubes_cow_setup.sh working with both dracut and initramfs-tools
 - add initramfs-tools configuration/scripts (including
         qubes_cow_setup.sh)
 - modify DESTDIR to handle multiple binary packages out of single
   source

QubesOS/qubes-issues#1354
2015-11-11 05:10:59 +01:00
Marek Marczykowski-Górecki
25c05a3bd3
dracut: add dmsetup --noudevsync since we're running in pre-udev hook
When udev is installed (and scheduled to be started), but not running
yet, plain dmsetup will deadlock on waiting for udev. Since we call
`dmsetup mknodes dmroot` anyway

QubesOS/qubes-issues#1354
2015-11-09 00:44:24 +01:00
Marek Marczykowski-Górecki
789e9c2549
dracut: mount only subdirectory of /lib/modules
This makes is possible to modify /lib/modules content - especially
install other kernel packages, without unmounting the whole
/lib/modules. Since dom0-provided modules will no longer conflict with
VM kernel packages (assuming kernel versions are different), there is no
need for qubes-kernel-vm-placeholder anymore.

Having only one subdirectory of /lib/modules mounted is somehow tricky,
because:
1. Directory name isn't always the same - it depends on kernel version.
This means that mountpoint must be created dynamically (so $NEWROOT must
be mounted in R/W for a moment).
2. There is one-command way to mount only a subdirectory of some
filesystem. So use a trick: mount it in some temporary directory, get
interesting subdir with `mount --bind`, then unmount temporary
directory.

QubesOS/qubes-issues#1354
2015-11-08 03:46:25 +01:00
Marek Marczykowski-Górecki
42469fdbe4
dracut: fix qubes-vm module dependencies
It needs 'dm' for 'dmsetup' utility. Additionally fix check - qubesdb
path starts with '/'.

QubesOS/qubes-issues#1354
2015-11-08 03:44:46 +01:00
Marek Marczykowski-Górecki
882052eca0
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
2015-11-08 03:44:27 +01:00
Marek Marczykowski-Górecki
a30d583249
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
2015-10-26 20:00:08 +01:00
Marek Marczykowski-Górecki
0f954034a1
dracut: abort on dmroot assemble error
Add missing "exit 1". In the other case (TemplateVM) it is already
there.
2015-10-15 02:37:20 +02:00
Marek Marczykowski-Górecki
d3d84d5d49
dracut: expand tabs to spaces
Fix to match our code style guide.
2015-10-15 02:36:23 +02:00
Marek Marczykowski-Górecki
bc7a2091db dracut: load ext4 module manually in minimalistic dracut module 2015-03-25 23:25:33 +01:00
Marek Marczykowski-Górecki
15cc3b2d51 dracut: Provide minimalistic initramfs files - no udev, no systemd
Provide simple script to run under busybox, this is all we need in the
VM.
2015-03-25 23:25:33 +01:00
Marek Marczykowski-Górecki
2b6fd27839 dracut: do not assume full udevd running inside initramfs
Limited udev (or just limited rule set) will not create device-mapper
entries in /dev, so create them manually.
2015-03-25 23:25:33 +01:00
Marek Marczykowski-Górecki
0c4c2323c0 Add VM kernel related files as qubes-core-vm-kernel-support package
This is preparation for pvgrub support, where all VM kernel files will
be installed inside of VM instead of dom0.
But also the same could be used to prepare VM kernel image from any dom0
kernel.
2015-03-25 23:25:33 +01:00