forked from dracutdevs/dracut
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Backport upstream fixes to 059 #322
Merged
aafeijoo-suse
merged 17 commits into
openSUSE:SUSE/059
from
aafeijoo-suse:059-upstream-fixes-12
Apr 26, 2024
Merged
Backport upstream fixes to 059 #322
aafeijoo-suse
merged 17 commits into
openSUSE:SUSE/059
from
aafeijoo-suse:059-upstream-fixes-12
Apr 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since we are using `actions/labeler@main`, its format changed, displaying the following error with every new PR: ``` Run actions/labeler@main The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api Error: Error: found unexpected type for label 'repository' (should be array of config options) Error: found unexpected type for label 'repository' (should be array of config options) ``` (cherry picked from commit de8ac63)
``` > valgrind --leak-check=full --show-leak-kinds=all ./dracut-install --kerneldir /lib/modules/$(uname -r)/ --modalias ... ==22005== ==22005== HEAP SUMMARY: ==22005== in use at exit: 54,984 bytes in 1,286 blocks ==22005== total heap usage: 585,546 allocs, 584,260 frees, 165,213,417 bytes allocated ==22005== ... ==22005== ==22005== LEAK SUMMARY: ==22005== definitely lost: 4,390 bytes in 390 blocks ==22005== indirectly lost: 0 bytes in 0 blocks ==22005== possibly lost: 0 bytes in 0 blocks ==22005== still reachable: 50,594 bytes in 896 blocks ==22005== suppressed: 0 bytes in 0 blocks ==22005== ==22005== For lists of detected and suppressed errors, rerun with: -s ==22005== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) ```
Use `regfree` to free memory allocated by `regcomp`. Quoting [1]: "If the preg argument to regexec() or regfree() is not a compiled regular expression returned by regcomp(), the result is undefined." Therefore, `regfree` must only be called if `regcomp` succeeded. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html
The content of the kernel command line is assigned via `strdup`, but not freed on exit. This happens after each call to `getarg(s)`, what makes an interesting amount of bytes not released at every boot. ``` master> grep -r -o -e getarg -e getargs modules.d | wc -l 457 master> export CMDLINE=$(< /proc/cmdline) master> echo ${#CMDLINE} 130 afeijoo@localhost:~/src/dracut/opensuse-fork/master> valgrind --leak-check=full --show-leak-kinds=all ./dracut-getarg security ==24270== Memcheck, a memory error detector ==24270== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==24270== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info ==24270== Command: ./dracut-getarg security ==24270== apparmor ==24270== ==24270== HEAP SUMMARY: ==24270== in use at exit: 131 bytes in 1 blocks ==24270== total heap usage: 2 allocs, 1 frees, 1,155 bytes allocated ==24270== ==24270== 131 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==24270== at 0x4838744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==24270== by 0x490D839: strdup (in /lib64/libc-2.31.so) ==24270== by 0x108AF6: getarg (util.c:188) ==24270== by 0x108AF6: main (util.c:300) ==24270== ==24270== LEAK SUMMARY: ==24270== definitely lost: 131 bytes in 1 blocks ==24270== indirectly lost: 0 bytes in 0 blocks ==24270== possibly lost: 0 bytes in 0 blocks ==24270== still reachable: 0 bytes in 0 blocks ==24270== suppressed: 0 bytes in 0 blocks ==24270== ==24270== For lists of detected and suppressed errors, rerun with: -s ==24270== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ```
… dir The `remove_hostonly_files` function should only remove (as its name suggests) hostonly configuration and files. The initqueue/finished scripts considered as hostonly that must be removed are added via `wait_for_dev`. But, the `hookdirs` are always created at build time, and should not be removed. This patch also allows to remove the `mkdir` workaround in the `network-manager` module (copied-pasted into the `connman` module after), and avoids having to add it tree-wide in many missing places. Fixes 87e90d7
…y included Some required libraries that used to be statically included are in the process to be opened via `dlopen()`. References: - systemd/systemd#31131 - systemd/systemd#31550 - systemd/systemd#32019
I also want to merge dracutdevs#2591 in this batch once there is some agreement on the final location of the hooks, so we will be ready for systemd-v256. |
tblume
approved these changes
Apr 8, 2024
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.
LGTM
systemd/systemd@4e1f0037 added a new `tpm2.target`, which is now used by `systemd-pcrphase-initrd.service`, and `systemd-tpm2-generator`, which adds a `Wants=` dependency from `sysinit.target` to `tpm2.target` when it detects that the firmware discovered a TPM2 device but the kernel didn't.
aafeijoo-suse
force-pushed
the
059-upstream-fixes-12
branch
from
April 19, 2024 12:23
79a958a
to
9de32c2
Compare
Since systemd/systemd@ffc1ec73, /usr is mounted as read-only in the initramfs by default. Fixes dracutdevs#2588 Co-authored-by: Antonio Alvarez Feijoo <[email protected]> (cherry picked from commit dracut-ng/dracut-ng@a45048b)
aafeijoo-suse
force-pushed
the
059-upstream-fixes-12
branch
from
April 19, 2024 12:41
9de32c2
to
0037413
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upstream commits:
Upstream PRs:
--modalias
option dracutdevs/dracut#2571Commits from the "new upstream":
OBS: