Skip to content

Fix zfs sysext by triggering udev when sysext includes udev rules - #4377

Open
chewi wants to merge 3 commits into
mainfrom
chewi/sysext-udev
Open

chewi wants to merge 3 commits into
mainfrom
chewi/sysext-udev

Conversation

@chewi

@chewi chewi commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The zfs sysext tried to delay udevd until after the sysext is merged, but that recently broke. We probably can't order things that way round any more. This change triggers udev when the sysext is merged instead, which is better anyway. I had to backport the EXTENSION_RESTART_UNITS from systemd 262 to do this.

I also made it so that EXTENSION_RELOAD_MANAGER is only added when the sysext includes systemd units.

How to use

With a second disk attached, manually add the zfs sysext, reboot, verify that it doesn't hang like before, create the zpool, reboot again, and check that it loaded the zfs kernel module. You can also (un)merge the sysext while checking for activity in systemctl status systemd-udev-trigger.service.

Testing done

I've manually done the above. I'll kick off Jenkins from here.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update) -- (it wasn't broken in a release)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

We need this to fix the zfs sysext.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
No need to prod it if the sysext doesn't include any systemd units.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This fixes the zfs sysext, which tried to delay udevd until after the
sysext is merged, but that recently broke. We probably can't order
things that way round any more.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi chewi self-assigned this Nov 11, 2026
@chewi
chewi requested a review from a team as a code owner November 11, 2026 16:34
@chewi chewi added the jenkins-ci Perform a CI build using Jenkins rather than GitHub Actions label Nov 11, 2026
Copilot AI balanced review requested due to automatic review settings November 11, 2026 16:34
@chewi
chewi deployed to development November 11, 2026 16:34 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Extension updates can replay stale udev rules, retain the problematic legacy ordering drop-in, and lose removed extensions’ daemon-reload and restart/stop requests.

3 open issues
What changed in this PR

This PR changes ZFS system-extension activation to retrigger udev after merging, replacing the previous approach of delaying udevd.

Changes:

  • Backports systemd support for extension-requested unit restarts and reloads.
  • Generates restart metadata for extensions containing udev rules and manager-reload metadata for those containing systemd files.
  • Removes the ZFS-specific udevd ordering drop-in.
File Description
sdk_container/​src/​third_party/​coreos-overlay/​coreos/​user-patches/​sys-apps/​systemd/​0009-sysext-Allow-to-re-start-units-from-extension-releas.patch Backports extension metadata support for restarting, reloading, and stopping units.
build_sysext Generates conditional manager-reload and udev-trigger metadata.
build_library/​sysext_mangle_flatcar-zfs Removes the drop-in ordering udevd after sysext activation.

Review effort: Balanced

L /etc/zfs/zfs-functions - - - - /usr/share/zfs/etc/zfs/zfs-functions
L /etc/zfs/zpool.d - - - - /usr/share/zfs/etc/zfs/zpool.d
C /etc/systemd/system/systemd-udevd.service.d/10-zfs.conf - - - - /usr/lib/systemd/system/systemd-udevd.service.d/10-zfs.conf
EOF
Comment thread build_sysext
fi

if [[ -d ${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/udev/rules.d || -d ${BUILD_DIR}/${FLAGS_install_root_basename}/etc/udev/rules.d ]]; then
echo "EXTENSION_RESTART_UNITS='systemd-udev-trigger.service'" >> "${metadata}"
Comment on lines +318 to +320
+ _cleanup_set_free_ Set *units_to_restart = NULL, *units_to_reload_or_restart = NULL;
+ bool need_to_reload;
+ r = get_extension_release_metadata(image_class, hierarchies, no_reload, &need_to_reload, &units_to_restart, &units_to_reload_or_restart);

This branch was successfully deployed

1 active deployment
development — 43cfeab7 Deployed Nov 11, 2026 by chewi via Wait for approval #6130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jenkins-ci Perform a CI build using Jenkins rather than GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants