Skip to content

Commit

Permalink
systemd: add module to disable network device renaming
Browse files Browse the repository at this point in the history
This should make it a little easier to control this behavior by waiting
until the real system boots to enable this policy.
  • Loading branch information
marineam committed Jul 7, 2014
1 parent 79d407f commit 6ec04c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dracut/80disable-net-names/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

depends() {
echo systemd
}

install() {
# Override the default link to disable the NamePolciy, that way
# device names remain untouched until the real system boots.
mkdir -p "$initdir/etc/systemd/network"
{
echo "[Link]"
echo "NamePolicy="
echo "MACAddressPolicy=persistent"
} >> "$initdir/etc/systemd/network/98-disable-net-names.link"
}

0 comments on commit 6ec04c8

Please sign in to comment.