summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
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/util.py
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/util.py')
-rw-r--r--cloudinit/util.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index bfddca67..22af99dd 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -2404,9 +2404,10 @@ def rootdev_from_cmdline(cmdline):
if found.startswith("LABEL="):
return "/dev/disk/by-label/" + found[len("LABEL="):]
if found.startswith("UUID="):
- return "/dev/disk/by-uuid/" + found[len("UUID="):]
+ return "/dev/disk/by-uuid/" + found[len("UUID="):].lower()
if found.startswith("PARTUUID="):
- disks_path = "/dev/disk/by-partuuid/" + found[len("PARTUUID="):]
+ disks_path = ("/dev/disk/by-partuuid/" +
+ found[len("PARTUUID="):].lower())
if os.path.exists(disks_path):
return disks_path
results = find_devs_with(found)