Make-initrd development discussion
 help / color / mirror / Atom feed
From: Arseny Maslennikov <arseny@altlinux.org>
To: make-initrd@lists.altlinux.org
Subject: Re: [make-initrd] Добавить udev правило в initrd через initrd.mk
Date: Thu, 23 Sep 2021 17:43:07 +0300
Message-ID: <YUySe75vsVDzGmNM@cello> (raw)
In-Reply-To: <20210923140546.kho57ezxxsh74nwt@example.org>

[-- Attachment #1: Type: text/plain, Size: 3108 bytes --]

On Thu, Sep 23, 2021 at 04:05:46PM +0200, Alexey Gladkov wrote:
> On Thu, Sep 23, 2021 at 08:37:08PM +0700, Антон Мидюков wrote:
> > Здравствуйте
> > 
> > Подскажите, что нужно прописать в initrd.mk, чтобы добавить udev правило в initrd?
> > Хочу ради эксперимента добавить /lib/udev/rules.d/80-net-setup-link.rules.
> 
> Это можно сделать двумя способами. Либо с помощью фичи add-udev-rules,
> которая активна по умолчанию:
> 
> PUT_UDEV_RULES += *-net-setup-link.rules
> 
> либо просто:
> 
> PUT_FILES += /lib/udev/rules.d/80-net-setup-link.rules
> 
> > Кажется, именно оно отвечает за то, что сетевые интерфейсы переименовываются в
> > в enp0s8 подобные названия.
> 
> Это не оно.
> 
> > Обнаружил, что сетевой интерфейс включенный в initrd остаётся с именем eth0 при сетевой
> > установке. Что приводит к тому, что в инсталяторе настраиваем eth0, а в установленной системе
> > имеем его с именем enp0s8 подобным без конфигурации. Так что к установленной системе по сети после установки уже
> > можно и не подключиться (сетевой интерфейс подключен один).
> 
> Переименовывает systemd или что-то около его.

Переименовывает сам udevd, т. е. его встроеннный компонент:
https://github.com/systemd/systemd/blob/main/src/udev/udev-builtin-net_setup_link.c
https://github.com/systemd/systemd/blob/main/src/udev/udev-builtin-net_id.c

>>  % cat /lib/udev/rules.d/80-net-setup-link.rules
>>  # do not edit this file, it will be overwritten on update
>>
>>  SUBSYSTEM!="net", GOTO="net_setup_link_end"
>>
>>  IMPORT{builtin}="path_id"
>>
>>  ACTION=="remove", GOTO="net_setup_link_end"
>>
>>  IMPORT{builtin}="net_setup_link"
                     ^^^^^^^^^^^^^^
Вот здесь этот компонент и вступает в игру.
>>
>>  NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}"
>>
>>  LABEL="net_setup_link_end"

> Насколько я помню на это
> влияет присутствие dmidecode.
> 
> Это не моё дело, но инсталлер неправ, когда использует имена без
> последующей привязки имени к mac или businfo.
> 
> > Соответственно, появилась мысль, что нужно отработать в initrd udev-правило переименования интерфейса.
> 
> initrd как раз ничего не переименовывает. Имя eth* каноническое.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-09-23 14:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 13:37 Антон Мидюков
2021-09-23 14:05 ` Alexey Gladkov
2021-09-23 14:20   ` Антон Мидюков
2021-09-23 14:36     ` Alexey Gladkov
2021-09-27 15:38       ` Антон Мидюков
2021-09-27 15:59         ` Alexey Gladkov
2021-09-27 18:54           ` Leonid Krivoshein
2021-09-29  4:18             ` Антон Мидюков
2021-09-27 18:25         ` Leonid Krivoshein
2021-09-23 16:12     ` Антон Мидюков
2021-09-23 19:13       ` Alexey Gladkov
2021-09-24  4:22         ` Антон Мидюков
2021-09-24  5:37           ` Антон Мидюков
2021-09-24  9:53           ` Alexey Gladkov
2021-09-24  9:57             ` Антон Мидюков
2021-09-24  9:58           ` Alexey Gladkov
2021-09-24 13:17             ` Leonid Krivoshein
2021-09-24 13:52               ` [make-initrd] has_feature() и initrd_release() Leonid Krivoshein
2021-09-24 14:31                 ` Alexey Gladkov
2021-09-24 14:56                   ` Leonid Krivoshein
2021-09-24 14:29               ` [make-initrd] Добавить udev правило в initrd через initrd.mk Alexey Gladkov
2021-09-24 14:54                 ` Leonid Krivoshein
2021-09-23 14:43   ` Arseny Maslennikov [this message]
2021-09-23 15:22     ` Alexey Gladkov
2021-09-23 15:39       ` [make-initrd] udev network interface renaming policy Arseny Maslennikov
2021-09-23 19:05         ` Alexey Gladkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUySe75vsVDzGmNM@cello \
    --to=arseny@altlinux.org \
    --cc=make-initrd@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Make-initrd development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/make-initrd/0 make-initrd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 make-initrd make-initrd/ http://lore.altlinux.org/make-initrd \
		make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com
	public-inbox-index make-initrd

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.make-initrd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git