From 80301e1a4aa1a7396b2cb2d6c5d0e46b75a46a98 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 6 Apr 2011 06:35:45 -0400 Subject: fix bug seeding grub dpkg config when devices are named xvdX (LP: #752361) With newer ubuntu kernels the xen block devices are named xvd[a-z][0-9] Ie, instead of /dev/sda1 the root device is /dev/xvda1. LP: #752361 --- ChangeLog | 2 ++ cloudinit/CloudConfig/cc_grub_dpkg.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 635fb933..a79b9fff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ failure of 'blkid /dev/root' (LP: #726938) - convert dos formated files to unix for user-scripts, boothooks, and upstart jobs (LP: #744965) + - fix bug in seeding of grub dpkg configuration (LP: #752361) due + to renamed devices in newer (natty) kernels (/dev/sda1 -> /dev/xvda1) 0.6.1: - fix bug in fixing permission on /var/log/cloud-init.log (LP: #704509) - improve comment strings in rsyslog file tools/21-cloudinit.conf diff --git a/cloudinit/CloudConfig/cc_grub_dpkg.py b/cloudinit/CloudConfig/cc_grub_dpkg.py index dafb43cf..b26e90e8 100644 --- a/cloudinit/CloudConfig/cc_grub_dpkg.py +++ b/cloudinit/CloudConfig/cc_grub_dpkg.py @@ -31,7 +31,8 @@ def handle(name,cfg,cloud,log,args): idevs_empty=util.get_cfg_option_str(cfg["grub-dpkg"], "grub-pc/install_devices_empty",None) - if os.path.exists("/dev/sda1") and not os.path.exists("/dev/sda"): + if (( os.path.exists("/dev/sda1") and not os.path.exists("/dev/sda") ) or + ( os.path.exists("/dev/xvda1") and not os.path.exists("/dev/xvda") )): if idevs == None: idevs="" if idevs_empty == None: idevs_empty="true" else: -- cgit v1.2.3