~nacc/curtin/iscsi-stacked

« back to all changes in this revision

Viewing changes to curtin/udev.py

  • Committer: Scott Moser
  • Date: 2017-04-06 20:41:48 UTC
  • mfrom: (481.2.2 trunk.lp1680591)
  • Revision ID: smoser@ubuntu.com-20170406204148-8rdcwyp5fcmvkgew
Make systems with root on bcache use root=UUID=.

Systems with root on bcache would end up booting with root=/dev/bcache0
(or bcache1). Bcache device names are not guaranteed, so this could
cause issues.

The fix is to invoke 'udevadm trigger' after creating a filesystem on
a bcache device. That will populate /dev/disk/by-uuid, which will
cause grub to properly decide to boot by root=UUID=.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        settle_cmd.extend(['--timeout=%s' % timeout])
67
67
 
68
68
    util.subp(settle_cmd)
 
69
 
 
70
 
 
71
def udevadm_trigger(devices):
 
72
    if devices is None:
 
73
        devices = []
 
74
    util.subp(['udevadm', 'trigger'] + list(devices))
 
75
    udevadm_settle()
 
76
 
 
77
 
69
78
# vi: ts=4 expandtab syntax=python