From 9f9b9b48b1cdc972e2aa3c2e3df4b629201a9ebe Mon Sep 17 00:00:00 2001 From: dann frazier Date: Wed, 30 Apr 2014 15:05:31 -0600 Subject: Mount root by label Instead of keeping a map of qemu disk types to /dev files, we can just mount by label and let the initramfs detect which device file to use. This avoids having to deal with differences between partitioned disks and unpartitioned disks, as well as not having to predict the order in which the seed and root disks get enumerated. --- bin/virtualization | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/virtualization b/bin/virtualization index 50dc685..ea54e7e 100755 --- a/bin/virtualization +++ b/bin/virtualization @@ -112,11 +112,13 @@ class QemuRunner(object): self.append = [] if self.config['cloudimg_type'] == CLOUD_IMAGE_TYPE.TAR: - self.append = self.append + ['console=ttyAMA0', 'earlyprintk=serial', 'ro', 'rootfstype=ext4'] - if self.config['qemu_disk_type'] == QEMU_DISK_TYPE.SD: - self.append = self.append + ['root=/dev/mmcblk0'] - elif self.config['qemu_disk_type'] == QEMU_DISK_TYPE.VIRTIO: - self.append = self.append + ['root=/dev/vda'] + self.append = self.append + [ + 'console=ttyAMA0', + 'earlyprintk=serial', + 'ro', + 'rootfstype=ext4', + 'root=LABEL=cloudimg-rootfs', + ] def add_boot_files(self, kernel=None, initrd=None, dtb=None): if kernel: -- cgit v1.2.3