[make-initrd] Добавить udev правило в initrd через initrd.mk

Alexey Gladkov gladkov.alexey at gmail.com
Fri Sep 24 12:58:30 MSK 2021


On Fri, Sep 24, 2021 at 11:22:55AM +0700, Антон Мидюков wrote:
> 24.09.2021 02:13, Alexey Gladkov пишет:
> > On Thu, Sep 23, 2021 at 11:12:35PM +0700, Антон Мидюков wrote:
> >> Этот вариант приводит к проблеме. В initrd не попадают:
> >> /etc/udev/rules.d/50-udev-default.rules
> >> /etc/udev/rules.d/60-persistent-input.rules
> >> /etc/udev/rules.d/60-persistent-storage.rules
> >> /etc/udev/rules.d/80-drivers.rules
> > 
> > # initrd-ls /boot/initrd.img |grep -e udev-default.rules -e persistent-input.rules -e persistent-storage.rules -e drivers.rules
> > 2 -rw-r--r-- 1 0 0    3885 Jan 01 01:00:00 1970 ./etc/udev/rules.d/50-udev-default.rules
> > 2 -rw-r--r-- 1 0 0    2651 Jan 01 01:00:00 1970 ./etc/udev/rules.d/60-persistent-input.rules
> > 2 -rw-r--r-- 1 0 0    7967 Jan 01 01:00:00 1970 ./etc/udev/rules.d/60-persistent-storage.rules
> > 2 -rw-r--r-- 1 0 0     556 Jan 01 01:00:00 1970 ./etc/udev/rules.d/80-drivers.rules
> > 
> > За их попадание отвечает add-udev-rules.
> > 
> > Расскажите, как собираете образ и какая версия make-initrd ?
> > 
> 
> Собираю в mkimage-profiles regular-net-install.iso:
> 
> make-initrd 2.24.0-alt1
> 
> make-initrd --no-checks AUTODETECT= -v -k 5.13.18-un-def-alt1
> 
> В нормальном режиме воспроизвести не получается.
> Если добавляю в /etc/initrd.mk:
> PUT_UDEV_RULES += *-net-setup-link.rules
> 
> В выводе make-initrd:
> 
> [00:00:03] Putting udev rules ...
> put-rules: Copying udev rules ...
> '/lib/udev/rules.d/80-net-setup-link.rules' -> '/tmp/make-initrd.qK7agTPYz/modules/etc/udev/rules.d/80-net-setup-link.rules'
> '/lib/udev/rules.d/80-net-setup-link.rules' -> '/tmp/make-initrd.qK7agTPYz/modules/etc/udev/rules.d/80-net-setup-link.rules'
> find-udev-rule-externals: import{builtin} = path_id
> find-udev-rule-externals: import{builtin} = net_setup_link
> put-tree: Copying '/tmp/make-initrd.qK7agTPYz/modules' recursively ...
> 
> Если не добавляю, то:
> 
> [00:00:01] Putting udev rules ...
> put-rules: Copying udev rules ...
> '/usr/share/make-initrd/features/add-udev-rules/rules.d/50-udev-default.rules' -> '/tmp/make-initrd.HHFhQe74V/modules/etc/udev/rules.d/50-udev-default.rules'
> '/usr/share/make-initrd/features/add-udev-rules/rules.d/60-persistent-input.rules' -> '/tmp/make-initrd.HHFhQe74V/modules/etc/udev/rules.d/60-persistent-input.rules'
> '/usr/share/make-initrd/features/add-udev-rules/rules.d/60-persistent-storage.rules' -> '/tmp/make-initrd.HHFhQe74V/modules/etc/udev/rules.d/60-persistent-storage.rules'
> '/usr/share/make-initrd/features/add-udev-rules/rules.d/80-drivers.rules' -> '/tmp/make-initrd.HHFhQe74V/modules/etc/udev/rules.d/80-drivers.rules'
> put-rules: WARNING: Found two udev rules with the same name but different content: /lib/udev/initramfs-rules.d/50-udev-default.rules
> put-rules: WARNING: Found two udev rules with the same name but different content: /lib/udev/initramfs-rules.d/60-persistent-storage.rules
> put-rules: WARNING: Found two udev rules with the same name but different content: /lib/udev/initramfs-rules.d/80-drivers.rules
> find-udev-rule-externals: run{builtin} = kmod load $env{MODALIAS}
> find-udev-rule-externals: run{builtin} = kmod load tifm_sd
> find-udev-rule-externals: run{builtin} = kmod load tifm_ms
> find-udev-rule-externals: run{builtin} = kmod load ms_block mspro_block
> find-udev-rule-externals: run{builtin} = kmod load i2o_block
> find-udev-rule-externals: run{builtin} = kmod load ppdev
> find-udev-rule-externals: run{builtin} = kmod load sm_ftl
> find-udev-rule-externals: import{program} = ata_id --export $devnode
> find-udev-rule-externals: import{program} = ata_id --export $devnode
> find-udev-rule-externals: import{program} = ata_id --export $devnode
> find-udev-rule-externals: import{builtin} = usb_id
> find-udev-rule-externals: import{program} = scsi_id --export --whitelisted -d $devnode
> find-udev-rule-externals: import{program} = scsi_id --export --whitelisted -d $devnode
> find-udev-rule-externals: import{builtin} = path_id
> find-udev-rule-externals: import{builtin} = blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}
> find-udev-rule-externals: import{builtin} = blkid --noraid
> find-udev-rule-externals: import{builtin} = blkid
> find-udev-rule-externals: import{builtin} = usb_id
> find-udev-rule-externals: import{builtin} = path_id
> find-udev-rule-externals: run{program} = $env{REMOVE_CMD}
> find-udev-rule-externals: import{builtin} = usb_id
> find-udev-rule-externals: import{builtin} = hwdb --subsystem=usb
> find-udev-rule-externals: import{builtin} = hwdb --subsystem=$env{SUBSYSTEM}
> put-tree: Copying '/tmp/make-initrd.HHFhQe74V/modules' recursively ...

# initrd-diff /tmp/initrd-5.10.62-std-def-alt1.img{.old,}
--- initrd-5.10.62-std-def-alt1.img.old
+++ initrd-5.10.62-std-def-alt1.img
@@ -366,4 +366 @@
-2  xz -rw-r--r-- 1 0 0    3885 ./etc/udev/rules.d/50-udev-default.rules
-2  xz -rw-r--r-- 1 0 0    2651 ./etc/udev/rules.d/60-persistent-input.rules
-2  xz -rw-r--r-- 1 0 0    7967 ./etc/udev/rules.d/60-persistent-storage.rules
-2  xz -rw-r--r-- 1 0 0     556 ./etc/udev/rules.d/80-drivers.rules
+2  xz -rw-r--r-- 1 0 0     295 ./etc/udev/rules.d/80-net-setup-link.rules

Да, это бага. Спасибо!

Пока что кладите это правило PUT_FILES. Там нет вызова внешних утилит и
ничего страшного не будет.

-- 
Rgrds, legion



More information about the Make-initrd mailing list