Repository navigation
Mount binfmt_misc when sysinit starts #14485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| echo "Mount binfmt_misc when sysinit starts, before the mount rate limit delays it" | ||
|
|
||
| # New installs get this from install/config/enable-services.sh. Existing ones | ||
| # keep waiting on the binfmt_misc automount, whose first trigger lands inside | ||
| # the opening mount burst, where the mount rate limit holds it back about a | ||
| # second past sysinit. | ||
|
|
||
| as_root() { | ||
| if (( EUID == 0 )); then | ||
| "$@" | ||
| else | ||
| sudo "$@" | ||
| fi | ||
| } | ||
|
|
||
| # Machine-wide, so a second user on the same box finds it already done. | ||
| if ! systemctl is-enabled --quiet proc-sys-fs-binfmt_misc.mount 2>/dev/null; then | ||
| as_root systemctl enable proc-sys-fs-binfmt_misc.mount >/dev/null 2>&1 || | ||
| echo "Could not enable proc-sys-fs-binfmt_misc.mount; boot keeps waiting on its automount." | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,3 +104,23 @@ pass "systemd-oomd acts on sustained memory stall" | |
| grep -Fx 'systemctl enable systemd-oomd.service' "$ROOT/install/config/enable-services.sh" >/dev/null || | ||
| fail "new installs ship the oomd drop-ins with the daemon that reads them disabled" | ||
| pass "new installs enable systemd-oomd" | ||
|
|
||
| # Mount binfmt_misc when sysinit starts. Left to its automount, the first | ||
| # binfmt registration fires it inside the opening mount burst, where systemd's | ||
| # mount rate limit holds the start back about a second, and sysinit.target | ||
| # waits with it. The enable only works while systemd's unit keeps its | ||
| # [Install] section; that proves the link resolves, not the ordering or the | ||
| # timing of a live boot. | ||
| grep -Fx 'systemctl enable proc-sys-fs-binfmt_misc.mount' "$ROOT/install/config/enable-services.sh" >/dev/null || | ||
| fail "new installs do not enable the binfmt_misc mount, so sysinit waits on its rate-limited automount" | ||
| pass "new installs enable the binfmt_misc mount for sysinit" | ||
|
|
||
| grep -rq 'systemctl enable proc-sys-fs-binfmt_misc.mount' "$ROOT/migrations" || | ||
| fail "existing installs have no migration enabling the binfmt_misc mount" | ||
| pass "a migration enables the binfmt_misc mount on existing installs" | ||
|
|
||
| [[ -f /usr/lib/systemd/system/proc-sys-fs-binfmt_misc.mount ]] || | ||
| fail "systemd ships proc-sys-fs-binfmt_misc.mount, the unit both enables name" | ||
| grep -qx 'WantedBy=sysinit.target' /usr/lib/systemd/system/proc-sys-fs-binfmt_misc.mount || | ||
| fail "proc-sys-fs-binfmt_misc.mount must keep WantedBy=sysinit.target, or the enable creates no sysinit link" | ||
|
Comment on lines
+122
to
+125
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If the test host lacks |
||
| pass "the enabled unit is systemd's own, pulled into sysinit.target" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check only searches for an enable command anywhere under
migrations. It never runs1791412720.sh, so a broken enabled-state check or an enable failure that unexpectedly stops migrations can still pass. Add a test with stubbedsystemctlandsudothat checks the enable call, reruns with the unit enabled, and covers an enable failure.