Skip to content

Instantly share code, notes, and snippets.

@arianvp
Created September 17, 2019 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arianvp/6e5468f8487e54b68d4f82175902b959 to your computer and use it in GitHub Desktop.
Save arianvp/6e5468f8487e54b68d4f82175902b959 to your computer and use it in GitHub Desktop.
[arian@t490s:~/Projects/nixos/nixpkgs]$ git diff nixos/modules/system/boot/initrd-network.nix
diff --git a/nixos/modules/system/boot/initrd-network.nix b/nixos/modules/system/boot/initrd-network.nix
index cb8fc957a99..d7de85b00df 100644
--- a/nixos/modules/system/boot/initrd-network.nix
+++ b/nixos/modules/system/boot/initrd-network.nix
@@ -130,6 +130,15 @@ in
if [ -n "$hasNetwork" ]; then
echo "networking is up!"
${cfg.postCommands}
+ # And bring all interfaces down Reason is that we don't do interface
+ # renaming in stage-1 (yet), But having the un-renamed interfaces "in
+ # use" when switching to stage-2 causes the rename to fail
+ for iface in $(ls /sys/class/net/); do
+ echo "bringing up network interface $iface..."
+ ip link set "$iface" down
+ done
+
+
fi
'');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment