Q: How to include custom udev rule into initramfs ?
Q: How to include custom udev rule into initramfs ?
Hi !
How to include custom udev rule into initramfs ?
I hacked "module-setup.sh", added "inst_rules 62-my.rules", yet it doesn't work, seems like this file should somewhere not in /usr/lib/dracut/modules.d/95udev-rules/.
Anyone can suggest right way to do this ?
Thanks in advance.
How to include custom udev rule into initramfs ?
I hacked "module-setup.sh", added "inst_rules 62-my.rules", yet it doesn't work, seems like this file should somewhere not in /usr/lib/dracut/modules.d/95udev-rules/.
Anyone can suggest right way to do this ?
Thanks in advance.
Re: Q: How to include custom udev rule into initramfs ?
What are you really trying to do? This sounds like an XY question...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Q: How to include custom udev rule into initramfs ?
That doesn't really answer "what are you really trying to do" but... put your udev rules in /etc/udev/rules.d and rebuild the initramfs. They are included.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Q: How to include custom udev rule into initramfs ?
Dracut copies *some* udev rules from
/etc/udev/rules.d/
/usr/lib/udev/rules.d/
but not *all*, only selected by some config I'm not aware about.
PS. I'm need to adjust values in /sys/class/power_supply/BAT0/...
They are read-only after boot, not writeable by root even after chmod +w.
/etc/udev/rules.d/
/usr/lib/udev/rules.d/
but not *all*, only selected by some config I'm not aware about.
PS. I'm need to adjust values in /sys/class/power_supply/BAT0/...
They are read-only after boot, not writeable by root even after chmod +w.
Re: Q: How to include custom udev rule into initramfs ?
I would expect those "files" to always be readonly since they are a view onto the kernel itself.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Q: How to include custom udev rule into initramfs ?
So its not possible to alter their values even if custom udev rules included in initramfs ?
Code: Select all
ACTION=="add|change", KERNEL=="BAT*", SUBSYSTEM=="power_supply", ATTR{energy_full_design}="*", MODE="0664"
ACTION=="add|change", KERNEL=="BAT*", SUBSYSTEM=="power_supply", ATTR{energy_full_design}="68000000"
Re: Q: How to include custom udev rule into initramfs ?
Everything under /sys is created by code in the kernel itself and just provides a view onto or a means of altering various "knobs" inside the system. I would expect that the code that creates those particular "files" there will have the mode hard coded.
I did some quick digging and found that there is some documentation (mostly aimed at kernel devs by the looks of it) in /usr/share/doc/kernel-doc-3.10.0/Documentation/power/power_supply_class.txt which is part of the kernel-doc package if it doesn't exist on your system now. I also found the code that is responsible for creating those /sys entries and that's in drivers/power/power_supply_sysfs.c in the kernel source. Most of that seems to assume that you already have a working knowledge of kernel development and my skills in that area are barely readonly but it would appear to me that the "file" you're looking at is meant to be for information only as the kernel sets the value in there based on what it thinks of your battery and its condition.
I did some quick digging and found that there is some documentation (mostly aimed at kernel devs by the looks of it) in /usr/share/doc/kernel-doc-3.10.0/Documentation/power/power_supply_class.txt which is part of the kernel-doc package if it doesn't exist on your system now. I also found the code that is responsible for creating those /sys entries and that's in drivers/power/power_supply_sysfs.c in the kernel source. Most of that seems to assume that you already have a working knowledge of kernel development and my skills in that area are barely readonly but it would appear to me that the "file" you're looking at is meant to be for information only as the kernel sets the value in there based on what it thinks of your battery and its condition.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke