From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 28EA51FF38F for ; Tue, 21 May 2024 14:55:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5F53718ADE; Tue, 21 May 2024 14:55:32 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Tue, 21 May 2024 14:55:18 +0200 Message-Id: <20240521125518.239369-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -2.546 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH docs] network: override device names: suggest running update-initramfs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The initramfs-tools hook /usr/share/initramfs-tools/hooks/udev copies link files from /etc/systemd/network to the initramfs, where they take effect in early userspace. If the link files in the initramfs diverge from the link files in the rootfs, this can lead to confusing behavior, as reported in enterprise support. For instance: - If an interface matches link files both in the initramfs and the rootfs, it will be renamed twice during boot. - A leftover link file in the initramfs renaming an interface A to a new name X may prevent a link file in the rootfs from renaming a different interface B to the same name X (it will fail with "File exists"). To avoid this confusion, mention the link files are copied to the initramfs, and suggest updating the initramfs after making changes to the link files. Suggested-by: Hannes Laimer Signed-off-by: Friedrich Weber --- pve-network.adoc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pve-network.adoc b/pve-network.adoc index be8d63c..acdcf39 100644 --- a/pve-network.adoc +++ b/pve-network.adoc @@ -184,6 +184,13 @@ manpage] for more details. Then, you can assign a name using the `Name` option in the `[Link]` section. +Link files are copied to the `initramfs`, so it is recommended to refresh the +`initramfs` after adding, modifying, or removing a link file: + +---- +# update-initramfs -u -k all +---- + For example, to assign the name `enwan0` to the Ethernet device with MAC address `aa:bb:cc:dd:ee:ff`, create a file `/etc/systemd/network/10-enwan0.link` with the following contents: @@ -197,8 +204,9 @@ Type=ether Name=enwan0 ---- -Do not forget to adjust `/etc/network/interfaces` to use the new name. -You need to reboot the node for the change to take effect. +Do not forget to adjust `/etc/network/interfaces` to use the new name, and +refresh your `initramfs` as described above. You need to reboot the node for +the change to take effect. NOTE: It is recommended to assign a name starting with `en` or `eth` so that {pve} recognizes the interface as a physical network device which can then be -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel