Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate udev rules files to rename devices #31

Merged
merged 2 commits into from
May 22, 2018

Commits on May 17, 2018

  1. tests/generate: rename assert_udev to assert_nm_udev

    The function specifically tests a NM specific udev rule. We're
    about to add more udev support, so it would be helpful to have
    clearer names.
    
    Signed-off-by: Daniel Axtens <dja@axtens.net>
    daxtens committed May 17, 2018
    Configuration menu
    Copy the full SHA
    d158eb9 View commit details
    Browse the repository at this point in the history
  2. Generate udev rules files to rename devices

    Due to a systemd issue[1], using link files to rename interfaces
    doesn't work as expected. Link files will not rename an interface
    if it was already renamed, and interfaces are renamed in initrd, so
    set-name will often not work as expected when rebooting.
    
    However, rules files will cause a renaming, even if the interface
    has been renamed in initrd.
    
    So, while we sort out whether the systemd-udev behaviour is broken
    or not, we can simply generate udev rules files with appropriate
    renaming info in /run/udev/rules.d/70-netplan-<interface>.rules
    
    A file will be created for non-virtual interfaces with both a
    set-name and a driver or a mac address in the match stanza.
    (Renaming from name to name doesn't work.)
    
    This is at least a temporary fix to LP: #1770082
    
    As far as testing goes, test successful set-name: generations, and
    a few cases where we expect no files to be generated.
    
    [1] systemd/systemd#9006
    
    Signed-off-by: Daniel Axtens <dja@axtens.net>
    daxtens committed May 17, 2018
    2 Configuration menu
    Copy the full SHA
    b0c51bf View commit details
    Browse the repository at this point in the history