summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-20 13:20:38 -0400
committerScott Moser <smoser@brickies.net>2017-04-21 12:28:24 -0400
commit068dec2f6694da263147a5a7fbc5e6d30f7d1e0d (patch)
tree00a717c29cd21cf16b7b32736297d362c502721e /cloudinit/config
parenta7d8fb4ce3727f86e20b1674d1cddab09514f61d (diff)
downloadvyos-cloud-init-068dec2f6694da263147a5a7fbc5e6d30f7d1e0d.tar.gz
vyos-cloud-init-068dec2f6694da263147a5a7fbc5e6d30f7d1e0d.zip
Fix growpart for some cases when booted with root=PARTUUID.
Growing the root partition would fail in either of two cases: a.) if the device /dev/root existed b.) the kernel command line had upper case letters in PARTUUID=<value> the kernel will accept upper case partuuid, but udev creates links with lower case. In that scenario, we need to adjust to a /dev/disk/by-<partuuid|uuid> with lower case. The fix here addresses that, and also fixes uuid similarly for the lowercase issue. LP: #1684869
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_growpart.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
index 089693e8..d2bc6e6c 100644
--- a/cloudinit/config/cc_growpart.py
+++ b/cloudinit/config/cc_growpart.py
@@ -252,9 +252,13 @@ def devent2dev(devent):
container = util.is_container()
# Ensure the path is a block device.
- if (dev == "/dev/root" and not os.path.exists(dev) and not container):
+ if (dev == "/dev/root" and not container):
dev = util.rootdev_from_cmdline(util.get_cmdline())
if dev is None:
+ if os.path.exists(dev):
+ # if /dev/root exists, but we failed to convert
+ # that to a "real" /dev/ path device, then return it.
+ return dev
raise ValueError("Unable to find device '/dev/root'")
return dev