[UBUNTU 20.04] udev rule change did not get applied
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
| Ubuntu on IBM z Systems |
Medium
|
Skipper Bug Screeners | |||
| subiquity |
Undecided
|
Skipper Bug Screeners | |||
s390-tools (Ubuntu) | Status tracked in Hirsute | |||||
| Focal |
Undecided
|
Unassigned | |||
| Groovy |
Undecided
|
Unassigned | |||
| Hirsute |
Undecided
|
Canonical Foundations Team |
Bug Description
During the ubuntu installation in tessia, we do chzdev for both dasd and qeth devices, as below.
2020-08-20 09:54:45 | INFO | START subiquity/
2020-08-20 09:54:45 | INFO | SUCCESS subiquity/
2020-08-20 09:54:45 | INFO | START subiquity/
2020-08-20 09:54:47 | INFO | SUCCESS subiquity/
and we can see the below files in the /etc/udev/rules.d/
oot@m8360024:~# ls -l /etc/udev/rules.d/
total 76
-rw-r--r-- 1 root root 154 Aug 20 09:08 41-cio-ignore.rules
-rw-r--r-- 1 root root 430 Aug 20 09:08 41-dasd-
-rw-r--r-- 1 root root 357 Aug 20 09:08 41-generic-
-rw-r--r-- 1 root root 1049 Aug 20 09:08 41-qeth-
-rw-r--r-- 1 root root 58549 Aug 20 09:10 70-snap.snapd.rules
Now, lsinitramfs shows files as below,
root@m8360024:~# lsinitramfs /boot/initrd.
etc/udev/
etc/udev/
usr/lib/
usr/lib/
usr/lib/
usr/lib/
Even though lsinitramfs shows the below files, they are overruled by the filesystem files.
Next thing we did was to modify the 41-qeth-
bugproxy (bugproxy) wrote : qeth-udev.rule file | #1 |
tags: | added: architecture-s39064 bugnameltc-187578 severity-medium targetmilestone-inin2004 |
Changed in ubuntu: | |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
affects: | ubuntu → linux (Ubuntu) |
Andrew Cloke (andrew-cloke) wrote : | #2 |
Triaged to the subiquity project, as this issue appears to be related to a subiquity 20.04 installation. Please feel free to reclassify if that's inappropriate.
no longer affects: | subiquity |
affects: | linux (Ubuntu) → subiquity |
Changed in ubuntu-z-systems: | |
importance: | Undecided → Medium |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
Dimitri John Ledkov (xnox) wrote : | #3 |
> But, in our case, if we are not doing a zipl or update-initramfs -u, the value is not getting modified.
Ubuntu initramfs copies all udev rules that are present in /etc/udev/rules.d into the initramfs. It cannot possibly know which ones are hand-edited, which ones are generated by zdev, and which ones must be in the initramfs or not. For example, we do support bringing up networking interactively inside the initrd, thus even the qeth ones are useful in the initrd.
Separately, we do ship zdev & initramfs integration hook (/lib/s390-
We have discussed this before that `chzdev` persistent enable|disable commands should always invoke zdev-root-update, but that has not been implemented upstream. I too find it confusing that chzdev enable|disable doesn't call zdev-root-update hook (which in turn calls update-initramfs -u to update udev rules in the initrd).
Please open issue against upstream chzdev https:/
Changed in subiquity: | |
status: | New → Invalid |
Changed in ubuntu-z-systems: | |
status: | New → Invalid |
Test comment: Mirror was not initiated till today.
------- Comment From <email address hidden> 2020-09-01 10:18 EDT-------
> Ubuntu initramfs copies all udev rules that are present in /etc/udev/rules.d
> into the initramfs. It cannot possibly know which ones are hand-edited,
> which ones are generated by zdev, and which ones must be in the initramfs or
> not. For example, we do support bringing up networking interactively inside
> the initrd, thus even the qeth ones are useful in the initrd.
>
Basically, this means the custom 'hand-edited' value in the /etc/udev/
But, what we see is, this is not happening. The buffer_count attribute value was always the one which is part of initramfs.
tags: | added: id-5f3edb43483dbd71389ae8c1 |
Changed in ubuntu-z-systems: | |
status: | Invalid → New |
Frank Heimes (fheimes) wrote : | #6 |
Currently discussed IBM internally - hence setting project entry to Incomplete ...
Changed in ubuntu-z-systems: | |
status: | New → Incomplete |
tags: | added: fr-588 |
bugproxy (bugproxy) wrote : | #7 |
------- Comment From <email address hidden> 2020-10-26 07:55 EDT-------
Addl Information for a possible solution.
zdev provides an option to specify that a specific device should be configured as part of the initial ram disk configuration steps:
zdev: Implement support for early device configuration
Enable user to specify that a device should be configured early, that is
during the initial RAM-disk boot phase. This may be necessary, e.g. to
override auto-configuration for a device which is also applied during
that boot phase. It may also be used to manually specify devices that
are required to access the root file system, such as networking devices.
Users can mark devices as requiring early configuration by specifying
a value of 1 for the newly added internal attribute zdev:early:
# chzdev dasd-eckd 0.0.1234 -p zdev:early=1
This can be changed back by removing the attribute setting, or by
setting the attribute value to 0:
# chzdev dasd-eckd 0.0.1234 -p -r zdev:early
or
# chzdev dasd-eckd 0.0.1234 -p zdev:early=0
This support was added with s390-tools v2.4.0. It can be used to work around the issue described in this bugzilla.
At the core of this problem lies the fact that unlike other linux vendors, Canonical decided to always want to copy all udev rules to the initial RAM-disk. As this is different between distributions, we cannot just change zdev to always update the RAM-disk as this would potentially introduce problems with other linux vendor distributions.
A potential solution could be done easily by providing a build-time switch that allows Canonical to specify that whenever a persistent device configuration changed, the RAM-disk is updated (this could be implemented via a modified root_check() function in s390-tools/
Could that be a potenital solution? Please provide your feedback. Many thanks in advance
Frank Heimes (fheimes) wrote : | #8 |
Using the 'zdev:early' device attribute (and setting it to '1') could be indeed an alternative (at least for the most cases), since with this set one is automatically asked if the initramfs should be rebuild - and in combination with '--yes' this question is automatically confirmed.
I've added here a 2nd disk 0400 and lsinitramfs shows that it's not only listed under
'usr/lib/
$ sudo chzdev dasd-eckd 0.0.0400 -p zdev:early=1 --yes
Configuring devices in the persistent configuration only
ECKD DASD 0.0.0400 configured
Note: The initial RAM-disk must be updated for these changes to take effect:
- ECKD DASD 0.0.0400
update-initramfs: Generating /boot/initrd.
Using config file '/etc/zipl.conf'
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Preparing boot device: dasda (0200).
Done.
$ lsinitramfs /boot/initrd.
etc/udev/
etc/udev/
etc/udev/
usr/lib/
usr/lib/
usr/lib/
usr/lib/
usr/lib/
However, like Dimitri already pointed out in comment #3, if someone manually modifies udev rules, a manual mkinitramfs is needed, too.
However (moving from the above DASD example to a qeth example) if you specify any further attributes, that you want to get activated, immediately with the chzdev command (like in your case 'buffer_count=128' and probably layer2=1), this will then land in the initramfs as well - and in case 'zdev:early=1' was specified, it will even land in a rule under 'etc/udev/rules.d', too. See:
$ sudo chzdev qeth 0603 -p zdev:early=1 layer2=1 buffer_count=128 --yes
Configuring devices in the persistent configuration only
QETH device 0.0.0603:
Note: The initial RAM-disk must be updated for these changes to take effect:
- QETH device 0.0.0603:
update-initramfs: Generating /boot/initrd.
Using config file '/etc/zipl.conf'
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Preparing boot device: dasda (0200).
Done.
$ cat /etc/udev/
ATTR{[ccwgroup/
ATTR{[ccwgroup/
$ lsinitramfs -l /boot/initrd.
-rw-r--r-- 1 root root 1023 Oct 27 09:07 etc/udev/
-rw-r--r-- 1 root root 1023 Oct 27 09:07 usr/lib/
bugproxy (bugproxy) wrote : | #9 |
------- Comment From <email address hidden> 2020-11-10 10:24 EDT-------
The zdev:early parameter in the chzdev command is a work-around for this issue.
The Actual issue is,the fact that unlike SUSE or Red Hat, Canonical always want to copy all udev rules to the initial RAM-disk. As this is different between distributions, we cannot just change zdev to always update the RAM-disk as this would potentially introduce problems with SUSE and Red Hat distributions.
As discussed internally with the team, what could be done is, to provide a build-time switch, a MACRO that allows Canonical to specify that whenever a persistent device configuration changed, the RAM-disk is updated (this could be implemented via a modified root_check() function in s390-tools/
The functionality mentioned above is same as having "zdev:early=1" on this usecase. But, we would like to avoid this extra parameter and make it work like other distros.
We would like to get a go from Canonical on this.
Changed in ubuntu-z-systems: | |
status: | Incomplete → New |
Dimitri John Ledkov (xnox) wrote : | #10 |
Hi Vineeth,
that is correct that Debian/Ubuntu always copy all the udev rules from host, to the initramfs by default. And for us, stopping to do that will cause change of behavior which may trigger bug. Same as it would on RHEL/SUSE side if those would start doing this.
If I understand you correctly, an Ubuntu-only change to internal_attr_early to have .defval="1" is the sort of thing you are proposing right? Which should lead to any persistent commands that affect udev rules to trigger initramfs rebuild?
That should fix the originally reported UX issue.
bugproxy (bugproxy) wrote : | #11 |
------- Comment From <email address hidden> 2020-12-10 08:39 EDT-------
Unfortunately .defval="1" functionality doesnt work for this case.
Instead, what we do is, we modify the root_check() function in root.c,such a way that, the required functionality of zdev:early=1 is enabled by default, based on a MACRO.
The new MACRO will be build-time configurable, which will then be used by Canonical while building the chzdev.
The patch is being developed and will push to s390-tools upstream once it is ready. Which can then be used by Canonical. So, we dont need a Canonical-only change in the code; But the change is only the MACRO-definition passed during the build-time.
Dimitri John Ledkov (xnox) wrote : | #12 |
Sounds good! Looking forward to that patch. And then we will most likely try to pick it up for stable release updates too. Cause yes, this behaviour needs to be fixed properly.
Changed in ubuntu-z-systems: | |
status: | New → Incomplete |
bugproxy (bugproxy) wrote : | #13 |
------- Comment From <email address hidden> 2021-01-20 09:02 EDT-------
Upstream patch will be pushed soon to the next upcoming s390-tools...
-> in progresss
bugproxy (bugproxy) wrote : | #14 |
------- Comment From <email address hidden> 2021-01-25 07:44 EDT-------
The patch mentioned in comment#39 is available in the s390-tools upstream now.
https:/
Changed in ubuntu-z-systems: | |
status: | Incomplete → Triaged |
assignee: | Canonical Foundations Team (canonical-foundations) → Skipper Bug Screeners (skipper-screen-team) |
Changed in s390-tools (Ubuntu): | |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
bugproxy (bugproxy) wrote : | #15 |
------- Comment From <email address hidden> 2021-02-01 09:15 EDT-------
@Can, when can we expect the integration of the fix ?
Changed in s390-tools (Ubuntu Focal): | |
milestone: | none → ubuntu-20.04.3 |
Changed in ubuntu-z-systems: | |
status: | Triaged → Confirmed |
Frank Heimes (fheimes) wrote : | #16 |
The idea is to pick this up once 2.16 is out (LP#1892367), since with 2.16 the udev topic is solved for hirsute, hence just the SRU to G and F is remaining.
Changed in s390-tools (Ubuntu Hirsute): | |
status: | New → Fix Committed |
Changed in ubuntu-z-systems: | |
status: | Confirmed → In Progress |
Launchpad Janitor (janitor) wrote : | #17 |
This bug was fixed in the package s390-tools - 2.16.0-0ubuntu1
---------------
s390-tools (2.16.0-0ubuntu1) hirsute; urgency=medium
* New upstream release. LP: #1914574
* Drop patches applied upstream.
* Compile with ZDEV_ALWAYS_
chzdev to trigger update-initramfs -u. LP: #1892367
* Set install path via make variables, instead of patching source
Makefiles.
* Update homepage to github.com.
s390-tools (2.15.1-1ubuntu3) hirsute; urgency=medium
* No-change rebuild to drop the udeb package.
s390-tools (2.15.1-1ubuntu2) hirsute; urgency=medium
* No change rebuild with fixed ownership.
s390-tools (2.15.1-1ubuntu1) hirsute; urgency=low
* Update debian/watch for new ibm-s390-linux repo
* Update debian/control for [XC-]Package-Type
* Merge from Debian unstable. Remaining changes:
- keep providing zkey
- split some tools into individuall packages
- Drop udevadm-path.patch
- Drop ziomon package
- Linux on z Systems naming
- 0001-ziomon-
- 0001-zkey-
- 0001-zkey-
- 0001-dumpconf-
- update-
- 0010-no-
- s390-tools-
s390-tools (2.15.1-2) unstable; urgency=medium
* Remove myself as a maintainer.
s390-tools (2.15.1-1) unstable; urgency=medium
* New upstream release
- Install new tool lsstp.
- Continue to skip out on zkey for now.
-- Dimitri John Ledkov <email address hidden> Wed, 24 Feb 2021 05:49:54 +0000
Changed in s390-tools (Ubuntu Hirsute): | |
status: | Fix Committed → Fix Released |
Default Comment by Bridge