Compare commits
217 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e473057ae1 | ||
![]() |
b3e55bde30 | ||
![]() |
8cceee8059 | ||
![]() |
5f0d35b665 | ||
![]() |
3a12309c0d | ||
![]() |
cb495a073e | ||
![]() |
7c2521091f | ||
![]() |
6fee16eab0 | ||
![]() |
209f157d2a | ||
![]() |
f57b1b9368 | ||
![]() |
09eb4de3d4 | ||
![]() |
1517f4c504 | ||
![]() |
983aee0ef1 | ||
![]() |
7825c32bd6 | ||
![]() |
5fc7c05321 | ||
![]() |
ed7ce0d64f | ||
![]() |
e1845955ff | ||
![]() |
f8f3b0f358 | ||
![]() |
8c8af8a2cd | ||
![]() |
4339d47cf8 | ||
![]() |
1a5845b45f | ||
![]() |
952c2e4e9b | ||
![]() |
6685d99448 | ||
![]() |
3aec4fca0b | ||
![]() |
6b8ee4fc37 | ||
![]() |
5840c466dc | ||
![]() |
e0524af2bf | ||
![]() |
1ec85e5232 | ||
![]() |
a23a4680e7 | ||
![]() |
0f89c0dff6 | ||
![]() |
09804a4629 | ||
![]() |
831e310adf | ||
![]() |
5698258d30 | ||
![]() |
3b45c7e1a0 | ||
![]() |
5817934936 | ||
![]() |
6375d5d504 | ||
![]() |
5a49fd3656 | ||
![]() |
cbafcd0fc7 | ||
![]() |
ab17cb8515 | ||
![]() |
c69961b403 | ||
![]() |
1e92f7285d | ||
![]() |
e4483e5917 | ||
![]() |
83c65fd3db | ||
![]() |
c050190f86 | ||
![]() |
8f56daa8c3 | ||
![]() |
9fb2431a88 | ||
![]() |
12ab0dce66 | ||
![]() |
f51d013384 | ||
![]() |
512c51d267 | ||
![]() |
7990ab91f9 | ||
![]() |
a298f5f285 | ||
![]() |
811c814677 | ||
![]() |
7ea391b527 | ||
![]() |
7c923f1de8 | ||
![]() |
251b424727 | ||
![]() |
0e2ef80993 | ||
![]() |
f0ac6cb462 | ||
![]() |
e9a614b50c | ||
![]() |
4087fd4d1a | ||
![]() |
ee9b9b1241 | ||
![]() |
4916dfc2b9 | ||
![]() |
ee6ce31003 | ||
![]() |
9eb1d1ed5e | ||
![]() |
dee4f26adc | ||
![]() |
5afd3cfc96 | ||
![]() |
89cd7a4629 | ||
![]() |
38ea7e821b | ||
![]() |
f3e328a7fd | ||
![]() |
37502d4c89 | ||
![]() |
39d90012a6 | ||
![]() |
d76e9ad5d7 | ||
![]() |
f87605e3ab | ||
![]() |
a5372b8ba8 | ||
![]() |
ff2d8bdfb3 | ||
![]() |
d418e292e3 | ||
![]() |
ff78577d3f | ||
![]() |
d2b3289aa5 | ||
![]() |
de27127752 | ||
![]() |
0132527b8f | ||
![]() |
455c5dbd35 | ||
![]() |
cd1a002512 | ||
![]() |
b7a7735c1d | ||
![]() |
fece5bfcac | ||
![]() |
d795211778 | ||
![]() |
497916e13b | ||
![]() |
3b92d8bf84 | ||
![]() |
1855efb15a | ||
![]() |
e096d861ed | ||
![]() |
da4c9a950f | ||
![]() |
31d0b55b86 | ||
![]() |
dae2759e61 | ||
![]() |
fe761330e5 | ||
![]() |
f7e924c577 | ||
![]() |
74f83fb9f3 | ||
![]() |
5da70385bc | ||
![]() |
c4f2b11b89 | ||
![]() |
0e30f33a32 | ||
![]() |
3f4771ebf4 | ||
![]() |
fc1d50b270 | ||
![]() |
cafd314b70 | ||
![]() |
ac733934fa | ||
![]() |
2be5e3ac4c | ||
![]() |
9521b435d0 | ||
![]() |
64748b3383 | ||
![]() |
76d8b30f4e | ||
![]() |
4cd8f2c90e | ||
![]() |
3b20f5c72e | ||
![]() |
27047bb5c6 | ||
![]() |
80f1ce6c13 | ||
![]() |
376ce85105 | ||
![]() |
01b7163a59 | ||
![]() |
fea53784ad | ||
![]() |
f84ad9e062 | ||
![]() |
3f5bf54fbf | ||
![]() |
09a691af3b | ||
![]() |
d9e27b0917 | ||
![]() |
ae83919a7a | ||
![]() |
4159819fbb | ||
![]() |
cfd872392c | ||
![]() |
3a2beb037c | ||
![]() |
dc9596155d | ||
![]() |
acc782bad5 | ||
![]() |
5c025a7d2a | ||
![]() |
07417b7fc5 | ||
![]() |
30ea52f88c | ||
![]() |
e902207014 | ||
![]() |
480aa9695f | ||
![]() |
fe02bc78ac | ||
![]() |
880d155967 | ||
![]() |
6dbae7e772 | ||
![]() |
ceca74ccc3 | ||
![]() |
019610af26 | ||
![]() |
63b05a8e67 | ||
![]() |
fa1b98e4ea | ||
![]() |
05ce5c41b6 | ||
![]() |
f7ad1479f2 | ||
![]() |
0cf01f125a | ||
![]() |
8cb5ac1b30 | ||
![]() |
d9149c6ca7 | ||
![]() |
c437933cb0 | ||
![]() |
e1130a8340 | ||
![]() |
0c1bd016ec | ||
![]() |
317d841c78 | ||
![]() |
5cb2a4004d | ||
![]() |
38ba90bf88 | ||
![]() |
265f696b53 | ||
![]() |
d8d5cb839c | ||
![]() |
3b869230a0 | ||
![]() |
46f3156426 | ||
![]() |
5a4c346933 | ||
![]() |
de3cb0e321 | ||
![]() |
6dafdda4a6 | ||
![]() |
5c3d0a9647 | ||
![]() |
6e1e87cd25 | ||
![]() |
55b0d2edaf | ||
![]() |
2f03d69f9d | ||
![]() |
5f8063c6f2 | ||
![]() |
871d63c3be | ||
![]() |
eb770a4a20 | ||
![]() |
7169e5f0e4 | ||
![]() |
c800d1a7b9 | ||
![]() |
b448655ba7 | ||
![]() |
50cc23ba32 | ||
![]() |
f769154bcc | ||
![]() |
2a61132865 | ||
![]() |
424f01e2a0 | ||
![]() |
1ec7b694b5 | ||
![]() |
ff366790a6 | ||
![]() |
32dfd41688 | ||
![]() |
cb9e6881dd | ||
![]() |
c6a2ebffe5 | ||
![]() |
5bfebf0f04 | ||
![]() |
586a56c287 | ||
![]() |
faea4e4ddb | ||
![]() |
7dd8a2f4d3 | ||
![]() |
49c4172f4e | ||
![]() |
87bffc36e7 | ||
![]() |
3a4a212649 | ||
![]() |
de34ba76e5 | ||
![]() |
8e1a4dc5f8 | ||
![]() |
25c7a13985 | ||
![]() |
872eb69936 | ||
![]() |
11474b808b | ||
![]() |
3b626094bd | ||
![]() |
b8a92b7156 | ||
![]() |
3a043feea1 | ||
![]() |
b68930ed3d | ||
![]() |
defb1611c7 | ||
![]() |
db44331dc4 | ||
![]() |
c490ea8b2b | ||
![]() |
dfe2247a43 | ||
![]() |
17d62d1206 | ||
![]() |
97a931c7d9 | ||
![]() |
91418b13dc | ||
![]() |
ca8ca19091 | ||
![]() |
7069132ec7 | ||
![]() |
3b396a7d50 | ||
![]() |
d5bfaf58ab | ||
![]() |
a22ab24d53 | ||
![]() |
3dcaa97ca4 | ||
![]() |
fc6f458c3b | ||
![]() |
0402b3777b | ||
![]() |
058739bf69 | ||
![]() |
8446c8f9de | ||
![]() |
7fb8f939a5 | ||
![]() |
a76aa8e390 | ||
![]() |
2293609dcb | ||
![]() |
bc1e69b691 | ||
![]() |
0386e46277 | ||
![]() |
7a04712ad0 | ||
![]() |
db9b5851f3 | ||
![]() |
5a720ebf67 | ||
![]() |
18420d9ce5 | ||
![]() |
7ef5ead6f4 | ||
![]() |
eb8a7a9635 | ||
![]() |
9e68789d66 | ||
![]() |
3ba12b2249 |
56
.github/CODE_OF_CONDUCT.md
vendored
Normal file
56
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Dracut Code of Conduct
|
||||
|
||||
This code of conduct outlines our expectations for participants within the Dracut community, as well as steps for reporting unacceptable behavior.
|
||||
We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored.
|
||||
Anyone who violates this code of conduct may be banned from the community.
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others’ private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@redhat.com>.
|
||||
All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances.
|
||||
Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
|
||||
Translations are available at https://www.contributor-covenant.org/translations.
|
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: "\U0001F41B Bug report"
|
||||
about: A report of an error in a recent Dracut version
|
||||
labels: 'bug'
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the error is.
|
||||
|
||||
**Distribution used**
|
||||
Which distribution was this behaviour seen in?
|
||||
|
||||
**Dracut version**
|
||||
Which dracut version was this behaviour seen in?
|
||||
|
||||
**Init system**
|
||||
Which init system is being used?
|
||||
|
||||
**To Reproduce**
|
||||
Steps or code to reproduce the behavior.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Additional context**
|
||||
Add any other context you like about the problem here.
|
8
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: "\U0001F4D6 Documentation"
|
||||
about: Suggest an improvement for documentation in Dracut
|
||||
labels: 'documents'
|
||||
---
|
||||
|
||||
**Describe the documentation**
|
||||
A clear and concise description of what should be better documented.
|
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: "\U00002728 Feature Request"
|
||||
about: A request for enhancement in Dracut
|
||||
labels: 'enhancement'
|
||||
---
|
||||
|
||||
**Describe the enhancement**
|
||||
A clear and concise description of what the enhancement is that you would like to see.
|
3
.github/SECURITY.md
vendored
Normal file
3
.github/SECURITY.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of
|
||||
the information, so please disclose the information responsibly by sending an email to Harald Hoyer harald@redhat.com and not by creating a GitHub issue.
|
||||
We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams.
|
296
.github/labeler.yml
vendored
Normal file
296
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,296 @@
|
||||
needs review:
|
||||
- "*"
|
||||
|
||||
repository:
|
||||
- ./*
|
||||
|
||||
github:
|
||||
- .github/*
|
||||
- .github/**/*
|
||||
|
||||
dracut-install:
|
||||
- install/*
|
||||
- install/**/*
|
||||
|
||||
example:
|
||||
- examples/*
|
||||
- examples/**/*
|
||||
- examples/**/**/*
|
||||
|
||||
modules:
|
||||
- modules.d/*
|
||||
- modules.d/**/*
|
||||
|
||||
bash:
|
||||
- modules.d/00bash/*
|
||||
|
||||
bootchart:
|
||||
- modules.d/00bootchart/*
|
||||
|
||||
dash:
|
||||
- modules.d/00dash/*
|
||||
|
||||
mksh:
|
||||
- modules.d/00mksh/*
|
||||
|
||||
systemd:
|
||||
- modules.d/00systemd/*
|
||||
|
||||
warpclock:
|
||||
- modules.d/00warpclock/*
|
||||
|
||||
fips:
|
||||
- modules.d/01fips/*
|
||||
|
||||
systemd-initrd:
|
||||
- modules.d/01systemd-initrd/*
|
||||
|
||||
caps:
|
||||
- modules.d/02caps/*
|
||||
|
||||
systemd-networkd:
|
||||
- modules.d/02systemd-networkd/*
|
||||
|
||||
modsign:
|
||||
- modules.d/03modsign/*
|
||||
|
||||
rescue:
|
||||
- modules.d/03rescue/*
|
||||
|
||||
watchdog:
|
||||
- modules.d/04watchdog/*
|
||||
|
||||
busybox:
|
||||
- modules.d/05busybox/*
|
||||
|
||||
rngd:
|
||||
- modules.d/06rngd/*
|
||||
|
||||
i18n:
|
||||
- modules.d/10i18n/*
|
||||
|
||||
convertfs:
|
||||
- modules.d/30convertfs/*
|
||||
|
||||
network-legacy:
|
||||
- modules.d/35network-legacy/*
|
||||
|
||||
network-manager:
|
||||
- modules.d/35network-manager/*
|
||||
|
||||
network:
|
||||
- modules.d/40network/*
|
||||
|
||||
ifcfg:
|
||||
- modules.d/45ifcfg/*
|
||||
|
||||
url-lib:
|
||||
- modules.d/45url-lib/*
|
||||
|
||||
drm:
|
||||
- modules.d/50drm/*
|
||||
|
||||
gensplash:
|
||||
- modules.d/50gensplash/*
|
||||
|
||||
plymouth:
|
||||
- modules.d/50plymouth/*
|
||||
|
||||
cms:
|
||||
- modules.d/80cms/*
|
||||
|
||||
lvmmerge:
|
||||
- modules.d/80lvmmerge/*
|
||||
|
||||
cio_ignore:
|
||||
- modules.d/81cio_ignore/*
|
||||
|
||||
btrfs:
|
||||
- modules.d/90btrfs/*
|
||||
|
||||
crypt:
|
||||
- modules.d/90crypt/*
|
||||
|
||||
dm:
|
||||
- modules.d/90dm/*
|
||||
|
||||
dmraid:
|
||||
- modules.d/90dmraid/*
|
||||
|
||||
dmsquash-live:
|
||||
- modules.d/90dmsquash-live/*
|
||||
|
||||
dmsquash-live-ntfs:
|
||||
- modules.d/90dmsquash-live-ntfs/*
|
||||
|
||||
kernel-modules:
|
||||
- modules.d/90kernel-modules/*
|
||||
|
||||
kernel-modules-extra:
|
||||
- modules.d/90kernel-modules-extra/*
|
||||
|
||||
kernel-network-modules:
|
||||
- modules.d/90kernel-network-modules/*
|
||||
|
||||
livenet:
|
||||
- modules.d/90livenet/*
|
||||
|
||||
lvm:
|
||||
- modules.d/90lvm/*
|
||||
|
||||
mdraid:
|
||||
- modules.d/90mdraid/*
|
||||
|
||||
multipath:
|
||||
- modules.d/90multipath/*
|
||||
|
||||
nvdimm:
|
||||
- modules.d/90nvdimm/*
|
||||
|
||||
ppcmac:
|
||||
- modules.d/90ppcmac/*
|
||||
|
||||
qemu:
|
||||
- modules.d/90qemu/*
|
||||
|
||||
qemu-net:
|
||||
- modules.d/90qemu-net/*
|
||||
|
||||
stratis:
|
||||
- modules.d/90stratis/*
|
||||
|
||||
crypt-gpg:
|
||||
- modules.d/91crypt-gpg/*
|
||||
|
||||
crypt-loop:
|
||||
- modules.d/91crypt-loop/*
|
||||
|
||||
zipl:
|
||||
- modules.d/91zipl/*
|
||||
|
||||
cifs:
|
||||
- modules.d/95cifs/*
|
||||
|
||||
dasd:
|
||||
- modules.d/95dasd/*
|
||||
|
||||
dasd_mod:
|
||||
- modules.d/95dasd_mod/*
|
||||
|
||||
dasd_rules:
|
||||
- modules.d/95dasd_rules/*
|
||||
|
||||
dcssblk:
|
||||
- modules.d/95dcssblk/*
|
||||
|
||||
debug:
|
||||
- modules.d/95debug/*
|
||||
|
||||
fcoe:
|
||||
- modules.d/95fcoe/*
|
||||
|
||||
fcoe-uefi:
|
||||
- modules.d/95fcoe-uefi/*
|
||||
|
||||
fstab-sys:
|
||||
- modules.d/95fstab-sys/*
|
||||
|
||||
iscsi:
|
||||
- modules.d/95iscsi/*
|
||||
|
||||
lunmask:
|
||||
- modules.d/95lunmask/*
|
||||
|
||||
nbd:
|
||||
- modules.d/95nbd/*
|
||||
|
||||
nfs:
|
||||
- modules.d/95nfs/*
|
||||
|
||||
nvmf:
|
||||
- modules.d/95nvmf/*
|
||||
|
||||
qeth_rules:
|
||||
- modules.d/95qeth_rules/*
|
||||
|
||||
resume:
|
||||
- modules.d/95resume/*
|
||||
|
||||
rootfs-block:
|
||||
- modules.d/95rootfs-block/*
|
||||
|
||||
ssh-client:
|
||||
- modules.d/95ssh-client/*
|
||||
|
||||
terminfo:
|
||||
- modules.d/95terminfo/*
|
||||
|
||||
udev-rules:
|
||||
- modules.d/95udev-rules/*
|
||||
|
||||
virtfs:
|
||||
- modules.d/95virtfs/*
|
||||
|
||||
zfcp:
|
||||
- modules.d/95zfcp/*
|
||||
|
||||
zfcp_rules:
|
||||
- modules.d/95zfcp_rules/*
|
||||
|
||||
znet:
|
||||
- modules.d/95znet/*
|
||||
|
||||
securityfs:
|
||||
- modules.d/96securityfs/*
|
||||
|
||||
biosdevname:
|
||||
- modules.d/97biosdevname/*
|
||||
|
||||
masterkey:
|
||||
- modules.d/97masterkey/*
|
||||
|
||||
dracut-systemd:
|
||||
- modules.d/98dracut-systemd/*
|
||||
|
||||
ecryptfs:
|
||||
- modules.d/98ecryptfs/*
|
||||
|
||||
integrity:
|
||||
- modules.d/98integrity/*
|
||||
|
||||
pollcdrom:
|
||||
- modules.d/98pollcdrom/*
|
||||
|
||||
selinux:
|
||||
- modules.d/98selinux/*
|
||||
|
||||
syslog:
|
||||
- modules.d/98syslog/*
|
||||
|
||||
usrmount:
|
||||
- modules.d/98usrmount/*
|
||||
|
||||
base:
|
||||
- modules.d/99base/*
|
||||
|
||||
fs-lib:
|
||||
- modules.d/99fs-lib/*
|
||||
|
||||
img-lib:
|
||||
- modules.d/99img-lib/*
|
||||
|
||||
memstrack:
|
||||
- modules.d/99memstrack/*
|
||||
|
||||
shutdown:
|
||||
- modules.d/99shutdown/*
|
||||
|
||||
squash:
|
||||
- modules.d/99squash/*
|
||||
|
||||
uefi-lib:
|
||||
- modules.d/99uefi-lib/*
|
||||
|
||||
test:
|
||||
- test/*
|
||||
- test/**/*
|
10
.github/pull_request_template.md
vendored
Normal file
10
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
This pull request changes...
|
||||
|
||||
## Changes
|
||||
|
||||
## Checklist
|
||||
- [ ] I have tested it locally
|
||||
- [ ] I have reviewed and updated any documentation if relevant
|
||||
- [ ] I am providing new code and test(s) for it
|
||||
|
||||
Fixes #
|
20
.github/stale.yml
vendored
Normal file
20
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- documents
|
||||
- enhancement
|
||||
- regression
|
||||
- wiki
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue is being marked as stale because it has not had any recent activity.
|
||||
It will be closed if no further activity occurs.
|
||||
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
|
||||
Thank you for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
6
.github/workflows/fedora-31.yml
vendored
6
.github/workflows/fedora-31.yml
vendored
@@ -13,7 +13,9 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
#container: quay.io/haraldh/dracut-fedora:30
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:31
|
||||
options: "--privileged"
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -51,4 +53,4 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:31 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
||||
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-30
|
||||
name: Fedora-32
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -13,7 +13,9 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
#container: quay.io/haraldh/dracut-fedora:30
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:32
|
||||
options: "--privileged"
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -30,11 +32,17 @@ jobs:
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"21",
|
||||
"30",
|
||||
"31",
|
||||
"35",
|
||||
"36",
|
||||
"40",
|
||||
"41",
|
||||
"50",
|
||||
"51",
|
||||
"60",
|
||||
"61",
|
||||
"99",
|
||||
]
|
||||
fail-fast: false
|
||||
@@ -45,4 +53,4 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:30 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
||||
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
15
.github/workflows/labels.yml
vendored
Normal file
15
.github/workflows/labels.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Label the Pull Requests automatically via Cron
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '*/15 * * * *'
|
||||
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: paulfantom/periodic-labeler@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
LABEL_MAPPINGS_FILE: .github/labeler.yml
|
3
.mailmap
3
.mailmap
@@ -31,3 +31,6 @@ Lidong Zhong <lidong.zhong@suse.com> <lzhong@suse.com>
|
||||
Nikoli <nikoli@gmx.us> <nikoli@lavabit.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org> <pbrobinson@gmail.com>
|
||||
Xunlei Pang <xlpang@redhat.com> <xpang@redhat.com>
|
||||
Daniel Molkentin <daniel.molkentin@suse.com> <dmolkentin@suse.com>
|
||||
Thomas Blume <thomas.blume@suse.com> <Thomas.Blume@suse.com>
|
||||
Brian C. Lane <bcl@redhat.com> <bcl@brianlane.com>
|
||||
|
@@ -2,7 +2,7 @@ language: generic
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
- docker
|
||||
env:
|
||||
matrix:
|
||||
- IMAGE=latest
|
||||
@@ -44,7 +44,7 @@ before_script:
|
||||
|
||||
script:
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
|
@@ -1,68 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LANG=C
|
||||
|
||||
KERNEL_VERSION="$1"
|
||||
KERNEL_IMAGE="$2"
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
|
||||
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
[[ $MACHINE_ID ]] || exit 1
|
||||
[[ -f $KERNEL_IMAGE ]] || exit 1
|
||||
|
||||
INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
|
||||
NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"
|
||||
|
||||
[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0
|
||||
|
||||
dropindirs_sort()
|
||||
{
|
||||
suffix=$1; shift
|
||||
args=("$@")
|
||||
files=$(
|
||||
while (( $# > 0 )); do
|
||||
for i in ${1}/*${suffix}; do
|
||||
[[ -f $i ]] && echo ${i##*/}
|
||||
done
|
||||
shift
|
||||
done | sort -Vu
|
||||
)
|
||||
|
||||
for f in $files; do
|
||||
for d in "${args[@]}"; do
|
||||
if [[ -f "$d/$f" ]]; then
|
||||
echo "$d/$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
[[ $dracut_rescue_image != "yes" ]] && exit 0
|
||||
|
||||
if [[ ! -f $INITRDFILE ]]; then
|
||||
dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||
cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
|
||||
|
||||
((ret+=$?))
|
||||
|
||||
exit $ret
|
@@ -105,8 +105,12 @@ case "$COMMAND" in
|
||||
echo "linux $BOOT_DIR/linux"
|
||||
echo "initrd $BOOT_DIR/initrd"
|
||||
} > $LOADER_ENTRY
|
||||
else
|
||||
if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
|
||||
cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" $LOADER_ENTRY
|
||||
else
|
||||
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
|
||||
fi
|
||||
sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
|
||||
fi
|
||||
|
||||
|
67
AUTHORS
67
AUTHORS
@@ -2,74 +2,82 @@ Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Hannes Reinecke <hare@suse.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Jóhann B. Guðmundsson <johannbg@gmail.com>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Jonathan Lebon <jonathan@jlebon.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Frantisek Sumsal <frantisek@sumsal.cz>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Frantisek Sumsal <frantisek@sumsal.cz>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Xunlei Pang <xlpang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Angelo "pallotron" Failla <pallotron@fb.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Beniamino Galvani <bgalvani@redhat.com>
|
||||
Böszörményi Zoltán <zboszor@pr.hu>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Jonathan Lebon <jonathan@jlebon.com>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Jonas Witschel <diabonas@gmx.de>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nathan Rini <nate@ucar.edu>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
q66 <daniel@octaforge.org>
|
||||
Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
David Tardon <dtardon@redhat.com>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Norbert Lange <norbert.lange@andritz.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Takashi Iwai <tiwai@suse.de>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
tpgxyz <tpgxyz@gmail.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
@@ -79,7 +87,9 @@ Chris Leech <cleech@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Doan Tran Cong Danh <congdanhqx@gmail.com>
|
||||
Gaël PORTAY <gael.portay@collabora.com>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Jiri Konecny <jkonecny@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
@@ -88,12 +98,12 @@ Marian Ganisin <mganisin@redhat.com>
|
||||
Matthias Gerstner <matthias.gerstner@suse.de>
|
||||
Max Resch <resch.max@gmail.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Norbert Lange <norbert.lange@andritz.com>
|
||||
Pratyush Anand <panand@redhat.com>
|
||||
Silvio Fricke <silvio.fricke@gmail.com>
|
||||
Steven Brudenell <steven.brudenell@gmail.com>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Topi Miettinen <toiwoton@gmail.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
@@ -107,6 +117,7 @@ Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Denis Silakov <dsilakov@virtuozzo.com>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Dusty Mabe <dusty@dustymabe.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Guido Trentalancia <guido@trentalancia.net>
|
||||
@@ -115,7 +126,6 @@ Ian Dall <ian@beware.dropbear.id.au>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
Jan Macku <jamacku@redhat.com>
|
||||
Jiri Konecny <jkonecny@redhat.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
@@ -125,9 +135,9 @@ Lukas Wunner <lukas@wunner.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Patrick Talbert <ptalbert@redhat.com>
|
||||
Pedro Monreal <pmgdeb@gmail.com>
|
||||
Pingfan Liu <piliu@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
@@ -136,26 +146,29 @@ Robert Scheck <robert@fedoraproject.org>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Tony Asleson <tasleson@redhat.com>
|
||||
Topi Miettinen <toiwoton@gmail.com>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Érico Rolim <erico.erc@gmail.com>
|
||||
наб <nabijaczleweli@nabijaczleweli.xyz>
|
||||
A. Wilcox <AWilcox@Wilcox-Tech.com>
|
||||
Alexander Kurtz <alexander@kurtz.be>
|
||||
Alexander Miroshnichenko <alex@millerson.name>
|
||||
Alexander Sosedkin <asosedkin@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Alexey Kodanev <alexey.kodanev@oracle.com>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
Andreas Stieger <astieger@suse.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antz <antzz@protonmail.ch>
|
||||
Arnaud Rebillout <arnaud.rebillout@collabora.com>
|
||||
Artem Savkov <asavkov@redhat.com>
|
||||
Attila Bruncsak <bruncsak@users.noreply.github.com>
|
||||
B. Wilson <x@wilsonb.com>
|
||||
Ben Howard <ben.howard@redhat.com>
|
||||
Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Brian C. Lane <bcl@brianlane.com>
|
||||
Bruno E. O. Meneguele <bmeneg@redhat.com>
|
||||
Bryn M. Reeves <bmr@redhat.com>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
@@ -164,24 +177,29 @@ Chad Dupuis <chad.dupuis@cavium.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Dan Fuhry <dfuhry@datto.com>
|
||||
Daniel Molkentin <daniel.molkentin@suse.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Disseldorp <ddiss@suse.de>
|
||||
David Michael <david.michael@coreos.com>
|
||||
Denis Volkov <denis@simpletexting.net>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Derek Hageman <hageman@inthat.cloud>
|
||||
Derek Higgins <derekh@redhat.com>
|
||||
Donovan Tremura <neurognostic@protonmail.ch>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Dusty Mabe <dusty@dustymabe.com>
|
||||
Elan Ruusamäe <glen@delfi.ee>
|
||||
Enno Boland <g@s01.de>
|
||||
Enzo Matsumiya <ematsumiya@suse.de>
|
||||
Eugene S. Sobolev <sobolev@protei.ru>
|
||||
Eugene Syromiatnikov <esyr@redhat.com>
|
||||
Fabian Vogt <fvogt@suse.de>
|
||||
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
|
||||
Florian Gamböck <mail@floga.de>
|
||||
Frank Deng <frank.deng@oracle.com>
|
||||
François Cami <fcami@fedoraproject.org>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
GuoChuang <guo.chuang@zte.com.cn>
|
||||
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hendrik Brueckner <brueckner@linux.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
@@ -199,6 +217,7 @@ Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Johannes Thumshirn <jthumshirn@suse.com>
|
||||
Jonas Jonsson <jonas@websystem.se>
|
||||
Jonas Witschel <diabonas@archlinux.org>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lee Duncan <lduncan@suse.com>
|
||||
@@ -226,11 +245,12 @@ Olivier Blin <dev@blino.org>
|
||||
Ondrej Dubaj <odubaj@redhat.com>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Patrick Talbert <ptalbert@redhat.com>
|
||||
Paul Robins <exp@users.noreply.github.com>
|
||||
Pavel Zhukov <pzhukov@redhat.com>
|
||||
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
|
||||
Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Peter Georg <peter.georg@physik.uni-regensburg.de>
|
||||
Petr Pavlu <petr.pavlu@suse.com>
|
||||
Petr Tesarik <ptesarik@suse.com>
|
||||
Petr Vorel <pvorel@suse.cz>
|
||||
Prarit Bhargava <prarit@redhat.com>
|
||||
@@ -239,7 +259,9 @@ Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sebastian Mitterle <smitterl@redhat.com>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
@@ -265,13 +287,14 @@ jbash aka John Bashinski <jbash@velvet.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
johannes <johannes.brechtmann@gmail.com>
|
||||
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
|
||||
leo-lb <lle-bout@zaclys.net>
|
||||
logan <logancaldwell23@gmail.com>
|
||||
masem <matej.semian@gmail.com>
|
||||
maximilian attems <max@stro.at>
|
||||
mulhern <amulhern@redhat.com>
|
||||
mwberry <mwberry@users.noreply.github.com>
|
||||
nabijaczleweli <nabijaczleweli@gmail.com>
|
||||
privb0x23 <privb0x23@users.noreply.github.com>
|
||||
q66 <daniel@octaforge.org>
|
||||
tpg <tpgxyz@gmail.com>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
Дамјан Георгиевски <gdamjan@gmail.com>
|
||||
|
25
Makefile
25
Makefile
@@ -1,8 +1,13 @@
|
||||
-include dracut-version.sh
|
||||
|
||||
DRACUT_MAIN_VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || :)
|
||||
DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
|
||||
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
|
||||
ifeq ($(DRACUT_MAIN_VERSION),)
|
||||
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
|
||||
endif
|
||||
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
|
||||
ifeq ($(DRACUT_FULL_VERSION),)
|
||||
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
|
||||
endif
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
@@ -13,8 +18,7 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
|
||||
CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
||||
@@ -45,6 +49,9 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||
|
||||
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
|
||||
|
||||
%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
|
||||
|
||||
DRACUT_INSTALL_OBJECTS = \
|
||||
install/dracut-install.o \
|
||||
install/hashmap.o\
|
||||
@@ -92,14 +99,14 @@ endif
|
||||
|
||||
%.xml: %.asc
|
||||
@rm -f -- "$@"
|
||||
asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $<
|
||||
asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
|
||||
|
||||
dracut.8: dracut.usage.asc dracut.8.asc
|
||||
|
||||
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
@rm -f -- dracut.xml
|
||||
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
|
||||
-a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \
|
||||
-a "version=$(DRACUT_FULL_VERSION)" \
|
||||
-a numbered \
|
||||
-d book -b docbook -o dracut.xml dracut.asc
|
||||
@rm -f -- dracut.html
|
||||
@@ -112,7 +119,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
dracut.pc: Makefile.inc Makefile
|
||||
@echo "Name: dracut" > dracut.pc
|
||||
@echo "Description: dracut" >> dracut.pc
|
||||
@echo "Version: $(DRACUT_MAIN_VERSION)$(GITVERSION)" >> dracut.pc
|
||||
@echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
|
||||
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
|
||||
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
|
||||
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
|
||||
@@ -182,7 +189,7 @@ endif
|
||||
|
||||
dracut-version.sh:
|
||||
@rm -f dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
$(RM) *~
|
||||
|
268
NEWS
268
NEWS
@@ -1,3 +1,264 @@
|
||||
dracut-051
|
||||
==========
|
||||
|
||||
dracut:
|
||||
- allow running on a cross-compiled rootfs
|
||||
|
||||
dracutsysrootdir is the root directory, file existence checks use it.
|
||||
|
||||
DRACUT_LDCONFIG can override ldconfig with a different one that works
|
||||
on the sysroot with foreign binaries.
|
||||
|
||||
DRACUT_LDD can override ldd with a different one that works
|
||||
with foreign binaries.
|
||||
|
||||
DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot
|
||||
may use symlinks that are valid only when running on the target
|
||||
so a real file must be provided that exist in the sysroot.
|
||||
|
||||
DRACUT_INSTALL now supports debugging dracut-install in itself
|
||||
when run by dracut but without debugging the dracut scripts.
|
||||
E.g. DRACUT_INSTALL="valgrind dracut-install or
|
||||
DRACUT_INSTALL="dracut-install --debug".
|
||||
|
||||
DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA,
|
||||
DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ,
|
||||
DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4,
|
||||
DRACUT_COMPRESS_CAT: All of the compression utilities may be
|
||||
overridden, to support the native binaries in non-standard places.
|
||||
|
||||
DRACUT_ARCH overrides "uname -m".
|
||||
|
||||
SYSTEMD_VERSION overrides "systemd --version".
|
||||
|
||||
The dracut-install utility was overhauled to support sysroot via
|
||||
a new option -r and fixes for clang-analyze. It supports
|
||||
cross-compiler-ldd from
|
||||
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f
|
||||
|
||||
DRACUT_INSTALL_PATH was introduced so dracut-install can work with
|
||||
a different PATH. In a cross-compiled environment (e.g. Yocto), PATH
|
||||
points to natively built binaries that are not in the host's /bin,
|
||||
/usr/bin, etc. dracut-install still needs plain /bin and /usr/bin
|
||||
that are relative to the cross-compiled sysroot.
|
||||
|
||||
DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were
|
||||
introduced so dracut-install can use different settings from
|
||||
DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL.
|
||||
|
||||
- don't call fsfreeze on subvol of root file system
|
||||
- Use TMPDIR (typically /run/user/$UID) if available
|
||||
- dracut.sh: add check for invalid configuration files
|
||||
Emit a warning about possible misconfigured configuration files, where
|
||||
the spaces around values are missing for +=""
|
||||
- dracut-functions: fix find_binary() to return full path
|
||||
- dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
|
||||
- dracut.sh: fix early microcode detection logic
|
||||
- dracut.sh: fix ia32 detection for uefi executables
|
||||
- dracut.sh: Add --version
|
||||
- dracut.sh: Add --hostonly-nics option
|
||||
- EFI Mode: only write kernel cmdline to UEFI binary
|
||||
- Allow $DRACUT_INSTALL to be not an absolute path
|
||||
- Don't print when a module is explicitly omitted (by default)
|
||||
- Remove uses of bash (and bash specific syntax) in runtime scripts
|
||||
- dracut-init.sh: Add a helper for detect device kernel modules
|
||||
- dracut-functions.sh: Fix check_block_and_slaves_all
|
||||
- dracut-functions.sh: add a helper to check if kernel module is available
|
||||
|
||||
Documentation
|
||||
- dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv`
|
||||
- dracut.conf.5.asc: document how to config --no-compress in the config
|
||||
- fix CI badges in README.md and fix dracut description
|
||||
- dracut.modules.7.asc: fix typos
|
||||
- dracut.modules.7.asc: fix reference to insmodpost module
|
||||
- Add --version to man page
|
||||
- Adding code of conduct
|
||||
- Document initqueue/online hook
|
||||
|
||||
|
||||
dracut-install:
|
||||
- install: also install post weak dependencies of kernel modules
|
||||
- install: Globbing support for resolving "firmware:"
|
||||
|
||||
mkinitrd:
|
||||
- use vmlinux regex for ppc*, vmlinuz for i686
|
||||
|
||||
mkinitrd-suse:
|
||||
- fix i586 platform detection
|
||||
|
||||
modules:
|
||||
|
||||
00systemd:
|
||||
- skip dependency add for non-existent units
|
||||
- add missing cryptsetup-related targets
|
||||
|
||||
05busybox:
|
||||
- simplify listing of supported utilities
|
||||
|
||||
06rngd:
|
||||
- install dependant libs too
|
||||
- Do not start inside container
|
||||
|
||||
10i18n:
|
||||
- i18n: Always install /etc/vconsole.conf
|
||||
|
||||
35network-legacy:
|
||||
- dhclient-script: Fix typo in output of BOUND & BOUND6 cases
|
||||
- simplify fallback dhcp setup
|
||||
|
||||
35network-manager:
|
||||
- ensure that nm-run.sh is executed when needed
|
||||
- install libnss DNS and mDNS plugins
|
||||
- always pull in machinery to read ifcfg files
|
||||
- set kernel hostname from the command line
|
||||
- move connection generation to a lib file
|
||||
|
||||
40network:
|
||||
- fix glob matching ipv6 addresses
|
||||
- net-lib.sh: support infiniband network mac addresses
|
||||
|
||||
45url-lib:
|
||||
- drop NSS if it's not in curl --version
|
||||
|
||||
80cms:
|
||||
- regenerate NetworkManager connections
|
||||
|
||||
90btrfs:
|
||||
- force preload btrfs module
|
||||
- Install crypto modules in 90kernel-modules
|
||||
|
||||
90crypt:
|
||||
- cryptroot-ask: no warn if /run/cryptsetup exist
|
||||
- install crypto modules in 90kernel-modules
|
||||
- try to catch kernel config changes
|
||||
- fix force on multiple lines
|
||||
- pull in remote-cryptsetup.target enablement
|
||||
- cryptroot-ask: unify /etc/crypttab and rd.luks.key
|
||||
|
||||
90dmsquash-live:
|
||||
- iso-scan.sh: Provide an easy reference to iso-scan device
|
||||
|
||||
90kernel-modules:
|
||||
- remove nfit from static module list (see nvdimm module)
|
||||
- install crypto modules in 90kernel-modules
|
||||
- add sg kernel module
|
||||
- add pci_hyperv
|
||||
- install block drivers more strictly
|
||||
- install less modules for hostonly mode
|
||||
- arm: add drivers/hwmon for arm/arm64
|
||||
|
||||
90kernel-network-modules
|
||||
- on't install iscsi related module (use 95iscsi)
|
||||
|
||||
90lvm:
|
||||
- remove unnecessary ${initdir} from lvm_scan.sh
|
||||
- fix removal of pvscan from udev rules
|
||||
- do not add newline to cmdline
|
||||
|
||||
90multipath:
|
||||
- add automatic configuration for multipath
|
||||
(adds 'rd.multipath=default' to use the default config)
|
||||
- install kpartx's 11-dm-parts.rules
|
||||
|
||||
90nvdimm:
|
||||
- new module for NVDIMM support
|
||||
|
||||
90ppcmac:
|
||||
- respect DRACUT_ARCH, don't exclude ppcle
|
||||
|
||||
90qemu-net:
|
||||
- in hostonly mode, only install if network is needed
|
||||
- install less module for strict hostonly mode
|
||||
|
||||
91zipl:
|
||||
- parse-zipl.sh: honor SYSTEMD_READY
|
||||
|
||||
95cifs:
|
||||
- pass rootflags to mount
|
||||
- install new softdeps (sha512, gcm, ccm, aead2)
|
||||
|
||||
95dasd:
|
||||
- only install /etc/dasd.conf if present
|
||||
|
||||
95dcssblk:
|
||||
- fix script permissions
|
||||
|
||||
95fcoe:
|
||||
- fix pre-trigger stage by replacing exit with return in lldpad.sh
|
||||
- default rd.nofcoe to false
|
||||
- don't install if there is no FCoE hostonly devices
|
||||
|
||||
95iscsi:
|
||||
- fix missing space when compiling cmdline args
|
||||
- fix ipv6 target discovery
|
||||
|
||||
95nfs:
|
||||
- only install rpc services for NFS < 4 when hostonly is strict
|
||||
- Change the order of NFS servers during the boot
|
||||
(next-server option has higher priority than DHCP-server itself)
|
||||
- install less module if hostonly mode is strict
|
||||
|
||||
95nvmf:
|
||||
- add module for NVMe-oF
|
||||
- add NVMe over TCP support
|
||||
|
||||
95resume:
|
||||
- do not resume on iSCSI, FCoE or NBD
|
||||
|
||||
95rootfs-block:
|
||||
- mount-root.sh: fix writing fstab file with missing fsck flag
|
||||
- only write root argument for block device
|
||||
|
||||
95zfcp:
|
||||
- match simplified rd.zfcp format too
|
||||
|
||||
95zfcp_rules:
|
||||
- parse-zfcp.sh: remove rule existence check
|
||||
|
||||
95znet:
|
||||
- add a rd.znet_ifname= option
|
||||
|
||||
98dracut-systemd:
|
||||
- remove memtrace-ko and rd.memdebug=4 support in dracut
|
||||
- remove cleanup_trace_mem calls
|
||||
- dracut-initqueue: Print more useful info in case of timeout
|
||||
- as of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
|
||||
- don't wait for root device if remote cryptsetup active
|
||||
|
||||
99base:
|
||||
- dracut-lib.sh: quote variables in parameter expansion patterns
|
||||
- remove memtrace-ko and rd.memdebug=4 support in dracut
|
||||
- remove cleanup_trace_mem calls
|
||||
- see new module 99memstrack
|
||||
- prevent creating unexpected files on the host when running dracut
|
||||
|
||||
99memstrack:
|
||||
- memstrack is a new tool to track the overall memory usage and
|
||||
allocation, which can help off load the improve the builtin module
|
||||
memory tracing function in dracut.
|
||||
|
||||
99squash:
|
||||
- don't hardcode the squash sub directories
|
||||
- improve pre-requirements check
|
||||
- check require module earlier, and properly
|
||||
|
||||
new modules:
|
||||
- nvmf
|
||||
- watchdog-modules
|
||||
- dbus
|
||||
- network-wicked
|
||||
|
||||
removed modules:
|
||||
- stratis
|
||||
|
||||
test suite:
|
||||
- use dd from /dev/zero, instead of creating files with a hole
|
||||
- TEST-03-USR-MOUNT/test.sh: increase loglevel
|
||||
- TEST-12-RAID-DEG/create-root.sh: more udevadm settle
|
||||
- TEST-35-ISCSI-MULTI: bump disk space
|
||||
- TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS
|
||||
- TEST-99: exclude /etc/dnf/* from check
|
||||
|
||||
dracut-050
|
||||
==========
|
||||
|
||||
@@ -54,6 +315,9 @@ dracut-install:
|
||||
- add support for compressed firmware files
|
||||
- dracut_mkdir(): create parent directories as needed.
|
||||
|
||||
configure:
|
||||
- Find FTS library with --as-needed
|
||||
|
||||
test suite:
|
||||
- lots of cleanups
|
||||
- add github actions
|
||||
@@ -85,6 +349,7 @@ livenet:
|
||||
|
||||
dmsquash-live:
|
||||
- Support a flattened squashfs.img
|
||||
- Remove obsolete osmin.img processing
|
||||
|
||||
dracut-systemd:
|
||||
- Start systemd-vconsole-setup before dracut-cmdline-ask
|
||||
@@ -274,6 +539,9 @@ nfs:
|
||||
|
||||
fips:
|
||||
- fixed creating path to .hmac of kernel based on BOOT_IMAGE
|
||||
- turn info calls into fips_info calls
|
||||
- modprobe failures during manual module loading is not fatal
|
||||
|
||||
|
||||
lunmask:
|
||||
- add module to handle LUN masking
|
||||
|
14
README.md
14
README.md
@@ -3,16 +3,17 @@ dracut
|
||||
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
[](.github/CODE_OF_CONDUCT.md)
|
||||
[](https://travis-ci.org/dracutdevs/dracut)
|
||||

|
||||

|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-31)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
|
||||
|
||||
dracut (the tool) is used to create an initramfs image by copying tools
|
||||
and files from an installed system and combining it with the
|
||||
dracut framework, usually found in /usr/lib/dracut/modules.d.
|
||||
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
Unlike other implementations, dracut hard-codes as little
|
||||
as possible into the initramfs. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
@@ -20,10 +21,7 @@ various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
This helps to keep the time required in the initramfs as little as
|
||||
possible so that things like a 5 second boot aren't made impossible as
|
||||
a result of the very existence of an initramfs. It's likely that
|
||||
we'll grow some hooks for running arbitrary commands in the flow of
|
||||
the script, but it's worth trying to resist the urge as much as we can
|
||||
as hooks are guaranteed to be the path to slow-down.
|
||||
a result of the very existence of an initramfs.
|
||||
|
||||
Most of the initramfs generation functionality in dracut is provided by a bunch
|
||||
of generator modules that are sourced by the main dracut script to install
|
||||
|
2
configure
vendored
2
configure
vendored
@@ -85,7 +85,7 @@ EOF
|
||||
|
||||
found=no
|
||||
for lib in "-lc" "-lfts"; do
|
||||
${CC} $CFLAGS -Wl,$lib $LDFLAGS conftest.c >/dev/null 2>&1
|
||||
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib >/dev/null 2>&1
|
||||
ret=$?
|
||||
if test $ret -eq 0; then
|
||||
FTS_LIBS="$lib"
|
||||
|
@@ -73,6 +73,17 @@ _dracut() {
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local args
|
||||
_count_args
|
||||
if [[ $args -eq 1 ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
elif [[ $args -eq 2 ]]; then
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _dracut dracut
|
||||
|
@@ -41,31 +41,36 @@ str_ends() { [ "${1%*"$2"}" != "$1" ]; }
|
||||
# search in the usual places to find the binary.
|
||||
find_binary() {
|
||||
local _delim
|
||||
local _path
|
||||
local l
|
||||
local p
|
||||
[[ -z ${1##/*} ]] || _delim="/"
|
||||
|
||||
if [[ "$1" == *.so* ]]; then
|
||||
for l in libdirs ; do
|
||||
if { $DRACUT_LDD "$dracutsysrootdir$l$_delim$1" &>/dev/null; }; then
|
||||
printf "%s\n" "$1"
|
||||
_path="${l}${_delim}${1}"
|
||||
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
if { $DRACUT_LDD "$dracutsysrootdir$_delim$1" &>/dev/null; }; then
|
||||
printf "%s\n" "$1"
|
||||
_path="${_delim}${1}"
|
||||
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
if [[ "$1" == */* ]]; then
|
||||
if [[ -L $dracutsysrootdir$_delim$1 ]] || [[ -x $dracutsysrootdir$_delim$1 ]]; then
|
||||
printf "%s\n" "$1"
|
||||
_path="${_delim}${1}"
|
||||
if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
for p in $DRACUT_PATH ; do
|
||||
if [[ -L $dracutsysrootdir$p$_delim$1 ]] || [[ -x $dracutsysrootdir$p$_delim$1 ]]; then
|
||||
printf "%s\n" "$1"
|
||||
_path="${p}${_delim}${1}"
|
||||
if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
@@ -521,7 +526,6 @@ check_block_and_slaves() {
|
||||
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
|
||||
check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
@@ -540,7 +544,6 @@ check_block_and_slaves_all() {
|
||||
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
|
||||
check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
@@ -669,6 +672,11 @@ check_kernel_config()
|
||||
return 1
|
||||
}
|
||||
|
||||
# 0 if the kernel module is either built-in or available
|
||||
# 1 if the kernel module is not enabled
|
||||
check_kernel_module() {
|
||||
modprobe -S $kernel --dry-run $1 &>/dev/null || return 1
|
||||
}
|
||||
|
||||
# get_cpu_vendor
|
||||
# Only two values are returned: AMD or Intel
|
||||
@@ -723,3 +731,166 @@ btrfs_devs() {
|
||||
printf -- "%s\n" "$_dev"
|
||||
done
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
set -- $(ip -o route get to "$1")
|
||||
echo $3
|
||||
}
|
||||
|
||||
local_addr_for_remote_addr() {
|
||||
set -- $(ip -o route get to "$1")
|
||||
echo $5
|
||||
}
|
||||
|
||||
peer_for_addr() {
|
||||
local addr=$1
|
||||
local qtd
|
||||
|
||||
# quote periods in IPv4 address
|
||||
qtd=${addr//./\\.}
|
||||
ip -o addr show | \
|
||||
sed -n 's%^.* '"$qtd"' peer \([0-9a-f.:]\{1,\}\(/[0-9]*\)\?\).*$%\1%p'
|
||||
}
|
||||
|
||||
netmask_for_addr() {
|
||||
local addr=$1
|
||||
local qtd
|
||||
|
||||
# quote periods in IPv4 address
|
||||
qtd=${addr//./\\.}
|
||||
ip -o addr show | sed -n 's,^.* '"$qtd"'/\([0-9]*\) .*$,\1,p'
|
||||
}
|
||||
|
||||
gateway_for_iface() {
|
||||
local ifname=$1 addr=$2
|
||||
|
||||
case $addr in
|
||||
*.*) proto=4;;
|
||||
*:*) proto=6;;
|
||||
*) return;;
|
||||
esac
|
||||
ip -o -$proto route show | \
|
||||
sed -n "s/^default via \([0-9a-z.:]\{1,\}\) dev $ifname .*\$/\1/p"
|
||||
}
|
||||
|
||||
# This works only for ifcfg-style network configuration!
|
||||
bootproto_for_iface() {
|
||||
local ifname=$1
|
||||
local dir
|
||||
|
||||
# follow ifcfg settings for boot protocol
|
||||
for dir in network-scripts network; do
|
||||
[ -f "/etc/sysconfig/$dir/ifcfg-$ifname" ] && {
|
||||
sed -n "s/BOOTPROTO=[\"']\?\([[:alnum:]]\{1,\}\)[\"']\?.*\$/\1/p" \
|
||||
"/etc/sysconfig/$dir/ifcfg-$ifname"
|
||||
return
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
is_unbracketed_ipv6_address() {
|
||||
strglob "$1" '*:*' && ! strglob "$1" '\[*:*\]'
|
||||
}
|
||||
|
||||
# Create an ip= string to set up networking such that the given
|
||||
# remote address can be reached
|
||||
ip_params_for_remote_addr() {
|
||||
local remote_addr=$1
|
||||
local ifname local_addr peer netmask= gateway ifmac
|
||||
|
||||
[[ $remote_addr ]] || return 1
|
||||
ifname=$(iface_for_remote_addr "$remote_addr")
|
||||
[[ $ifname ]] || {
|
||||
berror "failed to determine interface to connect to $remote_addr"
|
||||
return 1
|
||||
}
|
||||
|
||||
# ifname clause to bind the interface name to a MAC address
|
||||
if [ -d "/sys/class/net/$ifname/bonding" ]; then
|
||||
dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
|
||||
elif [ -e "/sys/class/net/$ifname/address" ] ; then
|
||||
ifmac=$(cat "/sys/class/net/$ifname/address")
|
||||
[[ $ifmac ]] && printf 'ifname=%s:%s ' "${ifname}" "${ifmac}"
|
||||
fi
|
||||
|
||||
bootproto=$(bootproto_for_iface "$ifname")
|
||||
case $bootproto in
|
||||
dhcp|dhcp6|auto6) ;;
|
||||
dhcp4)
|
||||
bootproto=dhcp;;
|
||||
static*|"")
|
||||
bootproto=;;
|
||||
*)
|
||||
derror "bootproto \"$bootproto\" is unsupported by dracut, trying static configuration"
|
||||
bootproto=;;
|
||||
esac
|
||||
if [[ $bootproto ]]; then
|
||||
printf 'ip=%s:%s ' "${ifname}" "${bootproto}"
|
||||
else
|
||||
local_addr=$(local_addr_for_remote_addr "$remote_addr")
|
||||
[[ $local_addr ]] || {
|
||||
berror "failed to determine local address to connect to $remote_addr"
|
||||
return 1
|
||||
}
|
||||
peer=$(peer_for_addr "$local_addr")
|
||||
# Set peer or netmask, but not both
|
||||
[[ $peer ]] || netmask=$(netmask_for_addr "$local_addr")
|
||||
gateway=$(gateway_for_iface "$ifname" "$local_addr")
|
||||
# Quote IPv6 addresses with brackets
|
||||
is_unbracketed_ipv6_address "$local_addr" && local_addr="[$local_addr]"
|
||||
is_unbracketed_ipv6_address "$peer" && peer="[$peer]"
|
||||
is_unbracketed_ipv6_address "$gateway" && gateway="[$gateway]"
|
||||
printf 'ip=%s:%s:%s:%s::%s:none ' \
|
||||
"${local_addr}" "${peer}" "${gateway}" "${netmask}" "${ifname}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# block_is_nbd <maj:min>
|
||||
# Check whether $1 is an nbd device
|
||||
block_is_nbd() {
|
||||
[[ -b /dev/block/$1 && $1 == 43:* ]]
|
||||
}
|
||||
|
||||
# block_is_iscsi <maj:min>
|
||||
# Check whether $1 is an nbd device
|
||||
block_is_iscsi() {
|
||||
local _dir
|
||||
local _dev=$1
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
_dir="$(readlink -f "/sys/dev/block/$_dev")" || return
|
||||
until [[ -d "$_dir/sys" || -d "$_dir/iscsi_session" ]]; do
|
||||
_dir="$_dir/.."
|
||||
done
|
||||
[[ -d "$_dir/iscsi_session" ]]
|
||||
}
|
||||
|
||||
# block_is_fcoe <maj:min>
|
||||
# Check whether $1 is an FCoE device
|
||||
# Will not work for HBAs that hide the ethernet aspect
|
||||
# completely and present a pure FC device
|
||||
block_is_fcoe() {
|
||||
local _dir
|
||||
local _dev=$1
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
_dir="$(readlink -f "/sys/dev/block/$_dev")"
|
||||
until [[ -d "$_dir/sys" ]]; do
|
||||
_dir="$_dir/.."
|
||||
if [[ -d "$_dir/subsystem" ]]; then
|
||||
subsystem=$(basename $(readlink $_dir/subsystem))
|
||||
[[ $subsystem == "fcoe" ]] && return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# block_is_netdevice <maj:min>
|
||||
# Check whether $1 is a net device
|
||||
block_is_netdevice() {
|
||||
block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1"
|
||||
}
|
||||
|
||||
# get the corresponding kernel modules of a /sys/class/*/* or/dev/* device
|
||||
get_dev_module() {
|
||||
udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p'
|
||||
}
|
||||
|
@@ -183,7 +183,7 @@ for i in $DRACUT_INSTALL ; do
|
||||
DRINSTALLPARTS=$(($DRINSTALLPARTS+1))
|
||||
done
|
||||
|
||||
if [[ $DRINSTALLPARTS = 1 ]] && ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
if [[ $DRINSTALLPARTS = 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1 ; then
|
||||
dfatal "dracut-install not found!"
|
||||
exit 10
|
||||
fi
|
||||
@@ -839,7 +839,7 @@ check_module() {
|
||||
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
|
||||
|
||||
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
dinfo "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
|
||||
ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
19
dracut.8.asc
19
dracut.8.asc
@@ -265,6 +265,9 @@ example:
|
||||
**-v, --verbose**::
|
||||
increase verbosity level (default is info(4))
|
||||
|
||||
**--version**::
|
||||
display version and exit
|
||||
|
||||
**-q, --quiet**:: decrease verbosity level (default is info(4))
|
||||
|
||||
**-c, --conf** _<dracut configuration file>_::
|
||||
@@ -659,18 +662,18 @@ Harald Hoyer
|
||||
|
||||
Victor Lowther
|
||||
|
||||
Amadeusz Żołnowski
|
||||
|
||||
Hannes Reinecke
|
||||
|
||||
Daniel Molkentin
|
||||
|
||||
Will Woods
|
||||
|
||||
Philippe Seewer
|
||||
|
||||
Warren Togami
|
||||
|
||||
Amadeusz Żołnowski
|
||||
|
||||
Jeremy Katz
|
||||
|
||||
David Dillow
|
||||
|
||||
Will Woods
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)
|
||||
|
@@ -113,6 +113,9 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
iso-scan/filename
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Mount all mountable devices and search for ISO pointed by the argument. When
|
||||
the ISO is found set it up as a loop device. Device containing this ISO
|
||||
image will stay mounted at /run/initramfs/isoscandev.
|
||||
Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work
|
||||
by copying the original kernel cmdline parameters.
|
||||
|
||||
@@ -188,8 +191,8 @@ It should be attached to any report about dracut problems.
|
||||
_/run/initramfs/init.log_.
|
||||
If "quiet" is set, it also logs to the console.
|
||||
|
||||
**rd.memdebug=[0-4]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 4.
|
||||
**rd.memdebug=[0-5]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 5.
|
||||
+
|
||||
Higher level means more debugging output:
|
||||
+
|
||||
@@ -198,10 +201,14 @@ It should be attached to any report about dracut problems.
|
||||
1 - partial /proc/meminfo
|
||||
2 - /proc/meminfo
|
||||
3 - /proc/meminfo + /proc/slabinfo
|
||||
4 - /proc/meminfo + /proc/slabinfo + tracekomem
|
||||
NOTE: tracekomem is a shell script utilizing kernel trace to track
|
||||
the rough total memory consumption of kernel modules during
|
||||
loading. It may override other trace configurations.
|
||||
4 - /proc/meminfo + /proc/slabinfo + memstrack summary
|
||||
NOTE: memstrack is a memory tracing tool that tracks the total memory
|
||||
consumption, and peak memory consumption of each kernel modules
|
||||
and userspace progress during the whole initramfs runtime, report
|
||||
is genereted and the end of initramsfs run.
|
||||
5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace)
|
||||
NOTE: memstrack (with top memory stacktrace) will print top memory
|
||||
allocation stack traces during the whole initramfs runtime.
|
||||
----
|
||||
|
||||
**rd.break**::
|
||||
@@ -277,12 +284,12 @@ LVM
|
||||
disable LVM detection
|
||||
|
||||
**rd.lvm.vg=**__<volume group name>__::
|
||||
only activate the volume groups with the given name. rd.lvm.vg can be
|
||||
specified multiple times on the kernel command line.
|
||||
only activate all logical volumes in the the volume groups with the given name.
|
||||
rd.lvm.vg can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.lv=**__<logical volume name>__::
|
||||
only activate the logical volumes with the given name. rd.lvm.lv can be
|
||||
specified multiple times on the kernel command line.
|
||||
**rd.lvm.lv=**__<volume group name>/<logical volume name>__::
|
||||
only activate the logical volumes with the given name.
|
||||
rd.lvm.lv can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.conf=0**::
|
||||
remove any _/etc/lvm/lvm.conf_, which may exist in the initramfs
|
||||
@@ -298,6 +305,8 @@ crypto LUKS
|
||||
The comparisons also matches, if _<luks uuid>_ is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
_<luks uuid>_ may be prefixed by the keyword `keysource:`, see
|
||||
_rd.luks.key_ below.
|
||||
|
||||
**rd.luks.allow-discards=**__<luks uuid>__::
|
||||
Allow using of discards (TRIM) requests for LUKS partitions with the given
|
||||
@@ -393,6 +402,49 @@ head -32c /dev/urandom > rootkey.key
|
||||
cryptsetup --batch-mode --key-file rootkey.key \
|
||||
luksFormat /dev/sda47
|
||||
--
|
||||
|
||||
You can also use regular key files on an encrypted _keydev_.
|
||||
|
||||
Compared to using GPG encrypted keyfiles on an unencrypted
|
||||
device this provides the following advantages:
|
||||
|
||||
- you can unlock your disk(s) using multiple passphrases
|
||||
- better security by not loosing the key stretching mechanism
|
||||
|
||||
To use an encrypted _keydev_ you *must* ensure that it becomes
|
||||
available by using the keyword `keysource`, e.g.
|
||||
`rd.luks.uuid=keysource:aaaa`
|
||||
_aaaa_ being the uuid of the encrypted _keydev_.
|
||||
|
||||
Example:
|
||||
|
||||
Lets assume you have three disks _A_, _B_ and _C_ with the uuids
|
||||
_aaaa_, _bbbb_ and _cccc_. +
|
||||
You want to unlock _A_ and _B_ using keyfile _keyfile_. +
|
||||
The unlocked volumes be _A'_, _B'_ and _C'_ with the uuids
|
||||
_AAAA_, _BBBB_ and _CCCC_. +
|
||||
_keyfile_ is saved on _C'_ as _/keyfile_.
|
||||
|
||||
One luks keyslot of each _A_, _B_ and _C_ is setup with a
|
||||
passphrase. +
|
||||
Another luks keyslot of each _A_ and _B_ is setup with _keyfile_.
|
||||
|
||||
To boot this configuration you could use:
|
||||
[listing]
|
||||
--
|
||||
rd.luks.uuid=aaaa
|
||||
rd.luks.uuid=bbbb
|
||||
rd.luks.uuid=keysource:cccc
|
||||
rd.luks.key=/keyfile:UUID=CCCC
|
||||
--
|
||||
Dracut asks for the passphrase for _C_ and uses the
|
||||
keyfile to unlock _A_ and _B_. +
|
||||
If getting the passphrase for _C_ fails it falls back to
|
||||
asking for the passphrases for _A_ and _B_.
|
||||
|
||||
If you want _C'_ to stay unlocked, specify a luks name for
|
||||
it, e.g. `rd.luks.name=cccc=mykeys`, otherwise it gets closed
|
||||
when not needed anymore.
|
||||
===============================
|
||||
|
||||
MD RAID
|
||||
@@ -431,6 +483,9 @@ MULTIPATH
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
**rd.multipath=default**::
|
||||
use default multipath settings
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -600,7 +655,7 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
boolean, bring up network even without netroot set
|
||||
|
||||
**vlan=**__<vlanname>__:__<phydevice>__::
|
||||
Setup vlan device named <vlanname> on <phydeivce>.
|
||||
Setup vlan device named <vlanname> on <phydevice>.
|
||||
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005),
|
||||
VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005),
|
||||
DEV_PLUS_VID_NO_PAD (eth0.5)
|
||||
@@ -615,9 +670,13 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
Bond without parameters assumes
|
||||
bond=bond0:eth0,eth1:mode=balance-rr
|
||||
|
||||
**team=**__<teammaster>__:__<teamslaves>__::
|
||||
**team=**__<teammaster>__:__<teamslaves>__[:__<teamrunner>__]::
|
||||
Setup team device <teammaster> on top of <teamslaves>.
|
||||
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
|
||||
<teamrunner> is the runner type to be used (see *teamd.conf*(5)); defaults to
|
||||
activebackup.
|
||||
Team without parameters assumes
|
||||
team=team0:eth0,eth1:activebackup
|
||||
|
||||
**bridge=**__<bridgename>__:__<ethnames>__::
|
||||
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
|
||||
@@ -809,6 +868,23 @@ FCoE
|
||||
+
|
||||
NOTE: letters in the MAC-address must be lowercase!
|
||||
|
||||
NVMf
|
||||
~~~~
|
||||
**rd.nvmf.hostnqn=**__<hostNQN>__::
|
||||
NVMe host NQN to use
|
||||
|
||||
**rd.nvmf.hostid=**__<hostID>__::
|
||||
NVMe host id to use
|
||||
|
||||
**rd.nvmf.discover=**__{rdma|fc|tcp}__,__<traddr>__,[__<host_traddr>__],[__<trsvcid>__]::
|
||||
Discover and connect to a NVMe-over-Fabric controller specified by
|
||||
_<traddr>_ and the optionally _<host_traddr>_ or _<trsvcid>_.
|
||||
The first argument specifies the transport to use; currently only
|
||||
'rdma', 'fc', or 'tcp' are supported.
|
||||
The _<traddr>_ parameter can be set to 'auto' to select
|
||||
autodiscovery; in that case all other parameters are ignored.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
NBD
|
||||
~~~
|
||||
**root=**??? **netroot=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
@@ -860,6 +936,11 @@ ZNET
|
||||
RHEL/Fedora with ccw_init, which is called from udev for certain
|
||||
devices on z-series.
|
||||
rd.znet can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.znet_ifname=**__<ifname>__:__<subchannels>__::
|
||||
Assign network device name <interface> (i.e. "bootnet") to the NIC
|
||||
corresponds to the subchannels. This is useful when dracut's default
|
||||
"ifname=" doesn't work due to device having a changing MAC address.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
|
@@ -80,12 +80,13 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Specify additional files to include in the initramfs, separated by spaces,
|
||||
if they exist.
|
||||
|
||||
*compress=*"__{bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
|
||||
*compress=*"__{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
|
||||
Compress the generated initramfs using the passed compression program. If
|
||||
you pass it just the name of a compression program, it will call that
|
||||
program with known-working arguments. If you pass arguments, it will be called
|
||||
with exactly those arguments. Depending on what you pass, this may result in
|
||||
an initramfs that the kernel cannot decompress.
|
||||
To disable compression, use "cat".
|
||||
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
|
@@ -93,13 +93,18 @@ udev state.
|
||||
|
||||
==== Initqueue settled
|
||||
|
||||
This hooks (initqueue/settled) gets executed every time udev has settled.
|
||||
This hook (initqueue/settled) gets executed every time udev has settled.
|
||||
|
||||
==== Initqueue timeout
|
||||
|
||||
This hooks (initqueue/timeout) gets executed, when the main loop counter becomes
|
||||
This hook (initqueue/timeout) gets executed, when the main loop counter becomes
|
||||
half of the rd.retry counter.
|
||||
|
||||
==== Initqueue online
|
||||
|
||||
This hook (initqueue/online) gets executed whenever a network interface comes online
|
||||
(that is, once it is up and configured by the configured network module).
|
||||
|
||||
==== Initqueue finished
|
||||
|
||||
This hook (initqueue/finished) is called after udev has settled and
|
||||
@@ -146,8 +151,8 @@ FIXME
|
||||
|
||||
== Writing a Module
|
||||
|
||||
A simple example module is _96insmodpost_, which modprobes a kernel module after
|
||||
udev has settled and the basic device drivers have been loaded.
|
||||
A simple example module is _90kernel-modules_, which modprobes a kernel module
|
||||
after udev has settled and the basic device drivers have been loaded.
|
||||
|
||||
All module installation information is in the file module-setup.sh.
|
||||
|
||||
@@ -159,7 +164,7 @@ check():
|
||||
return 0
|
||||
----
|
||||
|
||||
The we create the install() function, which installs a cmdline hook with
|
||||
Then we create the install() function, which installs a cmdline hook with
|
||||
priority number 20 called _parse-insmodpost.sh_. It also installs the
|
||||
_insmodpost.sh_ script in _/sbin_.
|
||||
|
||||
|
224
dracut.sh
224
dracut.sh
@@ -140,7 +140,7 @@ Creates initial ramdisk images for preloading modules
|
||||
--confdir [DIR] Specify configuration directory to use *.conf files
|
||||
from. Default: /etc/dracut.conf.d
|
||||
--tmpdir [DIR] Temporary directory to be used instead of default
|
||||
/var/tmp.
|
||||
${TMPDIR:-/var/tmp}.
|
||||
-r, --sysroot [DIR] Specify sysroot directory to collect files from.
|
||||
-l, --local Local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
@@ -175,6 +175,8 @@ Creates initial ramdisk images for preloading modules
|
||||
--hostonly-i18n Install only needed keyboard and font files according
|
||||
to the host configuration (default).
|
||||
--no-hostonly-i18n Install all keyboard and font files available.
|
||||
--hostonly-nics [LIST]
|
||||
Only enable listed NICs in the initramfs.
|
||||
--persistent-policy [POLICY]
|
||||
Use [POLICY] to address disks and partitions.
|
||||
POLICY can be any directory name found in /dev/disk.
|
||||
@@ -242,6 +244,7 @@ Creates initial ramdisk images for preloading modules
|
||||
--kernel-image [FILE] location of the kernel image
|
||||
--regenerate-all Regenerate all initramfs images at the default location
|
||||
for the kernel versions found on the system
|
||||
--version Display version
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
@@ -252,6 +255,14 @@ For example:
|
||||
EOF
|
||||
}
|
||||
|
||||
long_version() {
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
echo "dracut $DRACUT_VERSION"
|
||||
}
|
||||
|
||||
# Fills up host_devs stack variable and makes sure there are no duplicates
|
||||
push_host_devs() {
|
||||
local _dev
|
||||
@@ -279,6 +290,14 @@ read_arg() {
|
||||
fi
|
||||
}
|
||||
|
||||
check_conf_file()
|
||||
{
|
||||
if grep -H -e '^[^#]*[+]=\("[^ ]\|.*[^ ]"\)' "$@"; then
|
||||
printf '\ndracut: WARNING: <key>+=" <values> ": <values> should have surrounding white spaces!\n' >&2
|
||||
printf 'dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.\n\n' >&2
|
||||
fi
|
||||
}
|
||||
|
||||
dropindirs_sort()
|
||||
{
|
||||
local suffix=$1; shift
|
||||
@@ -407,7 +426,9 @@ rearrange_params()
|
||||
--long kernel-image: \
|
||||
--long no-hostonly-i18n \
|
||||
--long hostonly-i18n \
|
||||
--long hostonly-nics: \
|
||||
--long no-machineid \
|
||||
--long version \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -569,6 +590,8 @@ while :; do
|
||||
hostonly_cmdline_l="yes" ;;
|
||||
--hostonly-i18n)
|
||||
i18n_install_all_l="no" ;;
|
||||
--hostonly-nics)
|
||||
hostonly_nics_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--no-hostonly-i18n)
|
||||
i18n_install_all_l="yes" ;;
|
||||
--no-hostonly-cmdline)
|
||||
@@ -608,6 +631,7 @@ while :; do
|
||||
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--no-machineid)
|
||||
machine_id_l="no";;
|
||||
--version) long_version; exit 1 ;;
|
||||
--) shift; break;;
|
||||
|
||||
*) # should not even reach this point
|
||||
@@ -703,10 +727,14 @@ if [[ ! -d $confdir ]]; then
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
if [[ -f $conffile ]]; then
|
||||
check_conf_file "$conffile"
|
||||
. "$conffile"
|
||||
fi
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); do
|
||||
check_conf_file "$f"
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
@@ -732,6 +760,7 @@ unset NPATH
|
||||
(( ${#fstab_lines_l[@]} )) && fstab_lines+=( "${fstab_lines_l[@]}" )
|
||||
(( ${#install_items_l[@]} )) && install_items+=" ${install_items_l[@]} "
|
||||
(( ${#install_optional_items_l[@]} )) && install_optional_items+=" ${install_optional_items_l[@]} "
|
||||
(( ${#hostonly_nics_l[@]} )) && hostonly_nics+=" ${hostonly_nics_l[@]} "
|
||||
|
||||
# these options override the stuff in the config file
|
||||
(( ${#dracutmodules_l[@]} )) && dracutmodules="${dracutmodules_l[@]}"
|
||||
@@ -765,6 +794,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel"
|
||||
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
|
||||
[[ $tmpdir ]] || tmpdir="$TMPDIR"
|
||||
[[ $tmpdir ]] || tmpdir=$dracutsysrootdir/var/tmp
|
||||
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
||||
[[ $compress_l ]] && compress=$compress_l
|
||||
@@ -1140,7 +1170,7 @@ if [[ ! $print_cmdline ]]; then
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
EFI_MACHINE_TYPE_NAME=x64;;
|
||||
ia32)
|
||||
i?86)
|
||||
EFI_MACHINE_TYPE_NAME=ia32;;
|
||||
*)
|
||||
dfatal "Architecture '$(uname -m)' not supported to create a UEFI executable"
|
||||
@@ -1181,19 +1211,26 @@ fi
|
||||
|
||||
if [[ $early_microcode = yes ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
[[ $(get_cpu_vendor) == "AMD" ]] \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_AMD \
|
||||
&& unset early_microcode
|
||||
[[ $(get_cpu_vendor) == "Intel" ]] \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_INTEL \
|
||||
&& unset early_microcode
|
||||
if [[ $(get_cpu_vendor) == "AMD" ]]; then
|
||||
check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode
|
||||
elif [[ $(get_cpu_vendor) == "Intel" ]]; then
|
||||
check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode
|
||||
else
|
||||
unset early_microcode
|
||||
fi
|
||||
else
|
||||
! check_kernel_config CONFIG_MICROCODE_AMD \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_INTEL \
|
||||
&& unset early_microcode
|
||||
fi
|
||||
# Do not complain on non-x86 architectures as it makes no sense
|
||||
case $(uname -m) in
|
||||
x86_64|i?86)
|
||||
[[ $early_microcode != yes ]] \
|
||||
&& dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
@@ -1600,7 +1637,9 @@ if [[ $kernel_only != yes ]]; then
|
||||
(( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
|
||||
(( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
|
||||
|
||||
[[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
|
||||
if [[ $kernel_cmdline ]] && [[ $uefi != yes ]]; then
|
||||
printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
|
||||
fi
|
||||
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
line=($line)
|
||||
@@ -1648,15 +1687,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
# Now we are done with lazy resolving, always install dependencies
|
||||
unset DRACUT_RESOLVE_LAZY
|
||||
export DRACUT_RESOLVE_DEPS=1
|
||||
|
||||
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
|
||||
[[ -e "$_f" ]] || continue
|
||||
inst_libdir_file "libgcc_s.so*"
|
||||
break 2
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
for ((i=0; i < ${#include_src[@]}; i++)); do
|
||||
@@ -1718,7 +1748,7 @@ fi
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
# Prefer strip from elfutils for package size
|
||||
declare strip_cmd=$(command -v eu-strip)
|
||||
test -z "$strip_cmd" && strip_cmd="strip"
|
||||
[ -z "$strip_cmd" ] && strip_cmd="strip"
|
||||
|
||||
for p in $strip_cmd xargs find; do
|
||||
if ! type -P $p >/dev/null; then
|
||||
@@ -1811,7 +1841,7 @@ if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
dinfo "Stored kernel commandline:"
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
dinfo "$(< $conf)"
|
||||
dinfo "$(< "$conf")"
|
||||
_stored_cmdline=1
|
||||
done
|
||||
fi
|
||||
@@ -1822,23 +1852,8 @@ fi
|
||||
|
||||
if dracut_module_included "squash"; then
|
||||
dinfo "*** Install squash loader ***"
|
||||
if ! check_kernel_config CONFIG_SQUASHFS; then
|
||||
dfatal "CONFIG_SQUASHFS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
if ! check_kernel_config CONFIG_OVERLAY_FS; then
|
||||
dfatal "CONFIG_OVERLAY_FS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
if ! check_kernel_config CONFIG_DEVTMPFS; then
|
||||
dfatal "CONFIG_DEVTMPFS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readonly squash_dir="$initdir/squash/root"
|
||||
readonly squash_img=$initdir/squash/root.img
|
||||
|
||||
# Currently only move "usr" "etc" to squashdir
|
||||
readonly squash_img="$initdir/squash/root.img"
|
||||
readonly squash_candidate=( "usr" "etc" )
|
||||
|
||||
mkdir -m 0755 -p $squash_dir
|
||||
@@ -1849,57 +1864,15 @@ if dracut_module_included "squash"; then
|
||||
# Move some files out side of the squash image, including:
|
||||
# - Files required to boot and mount the squashfs image
|
||||
# - Files need to be accessible without mounting the squash image
|
||||
required_in_root() {
|
||||
local file=$1
|
||||
local _sqsh_file=$squash_dir/$file
|
||||
local _init_file=$initdir/$file
|
||||
|
||||
if [[ -e $_init_file ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -e $_sqsh_file ]] && [[ ! -L $_sqsh_file ]]; then
|
||||
derror "$file is required to boot a squashed initramfs but it's not installed!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -d $(dirname $_init_file) ]]; then
|
||||
required_in_root $(dirname $file)
|
||||
fi
|
||||
|
||||
if [[ -L $_sqsh_file ]]; then
|
||||
cp --preserve=all -P $_sqsh_file $_init_file
|
||||
_sqsh_file=$(realpath $_sqsh_file 2>/dev/null)
|
||||
if [[ -e $_sqsh_file ]] && [[ "$_sqsh_file" == "$squash_dir"* ]]; then
|
||||
# Relative symlink
|
||||
required_in_root ${_sqsh_file#$squash_dir/}
|
||||
return
|
||||
fi
|
||||
if [[ -e $squash_dir$_sqsh_file ]]; then
|
||||
# Absolute symlink
|
||||
required_in_root ${_sqsh_file#/}
|
||||
return
|
||||
fi
|
||||
required_in_root ${module_spec#$squash_dir/}
|
||||
else
|
||||
if [[ -d $_sqsh_file ]]; then
|
||||
mkdir $_init_file
|
||||
else
|
||||
mv $_sqsh_file $_init_file
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
required_in_root etc/initrd-release
|
||||
|
||||
for module_spec in $squash_dir/usr/lib/modules/*/modules.*;
|
||||
# - Initramfs marker
|
||||
for file in \
|
||||
$squash_dir/usr/lib/modules/*/modules.* \
|
||||
$squash_dir/usr/lib/dracut/* \
|
||||
$squash_dir/etc/initrd-release
|
||||
do
|
||||
required_in_root ${module_spec#$squash_dir/}
|
||||
done
|
||||
|
||||
for dracut_spec in $squash_dir/usr/lib/dracut/*;
|
||||
do
|
||||
required_in_root ${dracut_spec#$squash_dir/}
|
||||
[[ -d $file ]] && continue
|
||||
DRACUT_RESOLVE_DEPS=1 dracutsysrootdir=$squash_dir inst ${file#$squash_dir}
|
||||
rm $file
|
||||
done
|
||||
|
||||
mv $initdir/init $initdir/init.stock
|
||||
@@ -1910,17 +1883,14 @@ if dracut_module_included "squash"; then
|
||||
# accessible before mounting the image.
|
||||
inst_multiple "echo" "sh" "mount" "modprobe" "mkdir"
|
||||
hostonly="" instmods "loop" "squashfs" "overlay"
|
||||
|
||||
# Only keep systemctl outsite if we need switch root
|
||||
if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then
|
||||
inst "systemctl"
|
||||
fi
|
||||
|
||||
# Remove duplicated files
|
||||
for folder in "${squash_candidate[@]}"; do
|
||||
# Remove duplicated files in squashfs image, save some more space
|
||||
[[ ! -d $initdir/$folder/ ]] && continue
|
||||
for file in $(find $initdir/$folder/ -not -type d);
|
||||
do
|
||||
for file in $(find $initdir/$folder/ -not -type d); do
|
||||
if [[ -e $squash_dir${file#$initdir} ]]; then
|
||||
mv $squash_dir${file#$initdir} $file
|
||||
fi
|
||||
@@ -1928,6 +1898,28 @@ if dracut_module_included "squash"; then
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
|
||||
[[ -e "$_f" ]] || continue
|
||||
inst_libdir_file "libgcc_s.so*"
|
||||
break 2
|
||||
done
|
||||
done
|
||||
|
||||
# FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled
|
||||
if [[ $DRACUT_FIPS_MODE ]]; then
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$dracutsysrootdir$_dir/libcrypto.so"*; do
|
||||
[[ -e "$_f" ]] || continue
|
||||
inst_libdir_file -o "libssl.so*"
|
||||
break 2
|
||||
done
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
|
||||
dinfo "*** Stripping files ***"
|
||||
find "$initdir" -type f \
|
||||
@@ -2018,10 +2010,10 @@ umask 077
|
||||
if [[ $uefi = yes ]]; then
|
||||
if [[ $kernel_cmdline ]]; then
|
||||
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
|
||||
elif [[ $hostonly_cmdline = yes ]] && [ -d $initdir/etc/cmdline.d ];then
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
elif [[ $hostonly_cmdline = yes ]] && [ -d "$initdir/etc/cmdline.d" ];then
|
||||
for conf in "$initdir"/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
printf "%s " "$(< $conf)" >> "$uefi_outdir/cmdline.txt"
|
||||
printf "%s " "$(< "$conf")" >> "$uefi_outdir/cmdline.txt"
|
||||
done
|
||||
else
|
||||
do_print_cmdline > "$uefi_outdir/cmdline.txt"
|
||||
@@ -2034,7 +2026,7 @@ if [[ $uefi = yes ]]; then
|
||||
[[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
|
||||
[[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
|
||||
[[ -s "${dracutsysrootdir}${uefi_splash_image}" ]] && \
|
||||
uefi_splash_image="${dracutsysroot}${uefi_splash_image}" || unset uefi_splash_image
|
||||
uefi_splash_image="${dracutsysrootdir}${uefi_splash_image}" || unset uefi_splash_image
|
||||
|
||||
if objcopy \
|
||||
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
|
||||
@@ -2075,20 +2067,54 @@ fi
|
||||
|
||||
command -v restorecon &>/dev/null && restorecon -- "$outfile"
|
||||
|
||||
btrfs_uuid() {
|
||||
btrfs filesystem show "$1" | sed -n '1s/^.*uuid: //p'
|
||||
}
|
||||
|
||||
freeze_ok_for_btrfs() {
|
||||
local mnt uuid1 uuid2
|
||||
# If the output file is on btrfs, we need to make sure that it's
|
||||
# not on a subvolume of the same file system as the root FS.
|
||||
# Otherwise, fsfreeze() might freeze the entire system.
|
||||
# This is most conveniently checked by comparing the FS uuid.
|
||||
|
||||
[[ "$(stat -f -c %T -- "/")" == "btrfs" ]] || return 0
|
||||
mnt=$(stat -c %m -- "$1")
|
||||
uuid1=$(btrfs_uuid "$mnt")
|
||||
uuid2=$(btrfs_uuid "/")
|
||||
[[ "$uuid1" && "$uuid2" && "$uuid1" != "$uuid2" ]]
|
||||
}
|
||||
|
||||
freeze_ok_for_fstype() {
|
||||
local outfile=$1
|
||||
local fstype
|
||||
|
||||
[[ "$(stat -c %m -- "$outfile")" == "/" ]] && return 1
|
||||
fstype=$(stat -f -c %T -- "$outfile")
|
||||
case $fstype in
|
||||
msdos)
|
||||
return 1;;
|
||||
btrfs)
|
||||
freeze_ok_for_btrfs "$outfile";;
|
||||
*)
|
||||
return 0;;
|
||||
esac
|
||||
}
|
||||
|
||||
# We sync/fsfreeze only if we're operating on a live booted system.
|
||||
# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
|
||||
# and there's no reason to sync, and *definitely* no reason to fsfreeze.
|
||||
# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze
|
||||
# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0
|
||||
if test -d $dracutsysrootdir/run/systemd/system; then
|
||||
if [ -d "$dracutsysrootdir/run/systemd/system" ]; then
|
||||
if ! sync "$outfile" 2> /dev/null; then
|
||||
dinfo "dracut: sync operation on newly created initramfs $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# use fsfreeze only if we're not writing to /
|
||||
if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then
|
||||
if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
|
||||
if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then
|
||||
if ! (fsfreeze -f "$(dirname "$outfile")" 2>/dev/null && fsfreeze -u "$(dirname "$outfile")" 2>/dev/null); then
|
||||
dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
|
||||
fi
|
||||
fi
|
||||
|
25
dracut.spec
25
dracut.spec
@@ -77,6 +77,7 @@ Requires: xz
|
||||
Requires: gzip
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
Recommends: memstrack
|
||||
Recommends: hardlink
|
||||
Recommends: pigz
|
||||
Recommends: kpartx
|
||||
@@ -98,7 +99,7 @@ Requires: libkcapi-hmaccalc
|
||||
|
||||
%description
|
||||
dracut contains tools to create bootable initramfses for the Linux
|
||||
kernel. Unlike previous implementations, dracut hard-codes as little
|
||||
kernel. Unlike other implementations, dracut hard-codes as little
|
||||
as possible into the initramfs. dracut contains various modules which
|
||||
are driven by the event-based udev. Having root on MD, DM, LVM2, LUKS
|
||||
is supported as well as NFS, iSCSI, NBD, FCoE with the dracut-network
|
||||
@@ -202,11 +203,10 @@ cp %{SOURCE1} .
|
||||
%endif
|
||||
${NULL}
|
||||
|
||||
make %{?_smp_mflags}
|
||||
%make_build
|
||||
|
||||
%install
|
||||
make %{?_smp_mflags} install \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
%make_install %{?_smp_mflags} \
|
||||
libdir=%{_prefix}/lib
|
||||
|
||||
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
|
||||
@@ -278,12 +278,6 @@ rm -f -- $RPM_BUILD_ROOT%{_mandir}/man1/lsinitrd.1*
|
||||
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
|
||||
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
# FIXME: remove after F30
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
|
||||
install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
|
||||
%endif
|
||||
|
||||
%files
|
||||
%if %{with doc}
|
||||
%doc README.md HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
@@ -348,7 +342,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
%{dracutlibdir}/modules.d/04watchdog-modules
|
||||
%{dracutlibdir}/modules.d/05busybox
|
||||
%{dracutlibdir}/modules.d/06dbus
|
||||
%{dracutlibdir}/modules.d/06rngd
|
||||
%{dracutlibdir}/modules.d/10i18n
|
||||
%{dracutlibdir}/modules.d/30convertfs
|
||||
@@ -365,7 +361,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/90stratis
|
||||
%{dracutlibdir}/modules.d/90nvdimm
|
||||
%{dracutlibdir}/modules.d/90ppcmac
|
||||
%{dracutlibdir}/modules.d/90qemu
|
||||
%{dracutlibdir}/modules.d/91crypt-gpg
|
||||
@@ -373,6 +369,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/95debug
|
||||
%{dracutlibdir}/modules.d/95fstab-sys
|
||||
%{dracutlibdir}/modules.d/95lunmask
|
||||
%{dracutlibdir}/modules.d/95nvmf
|
||||
%{dracutlibdir}/modules.d/95resume
|
||||
%{dracutlibdir}/modules.d/95rootfs-block
|
||||
%{dracutlibdir}/modules.d/95terminfo
|
||||
@@ -403,6 +400,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99memstrack
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
@@ -431,6 +429,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||
%{dracutlibdir}/modules.d/35network-manager
|
||||
%{dracutlibdir}/modules.d/35network-legacy
|
||||
%{dracutlibdir}/modules.d/35network-wicked
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/45ifcfg
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
@@ -475,9 +474,5 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%files config-rescue
|
||||
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
# FIXME: remove after F30
|
||||
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <glob.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
@@ -123,6 +124,7 @@ static inline void fts_closep(FTS **p) {
|
||||
}
|
||||
#define _cleanup_fts_close_ _cleanup_(fts_closep)
|
||||
|
||||
#define _cleanup_globfree_ _cleanup_(globfree)
|
||||
|
||||
|
||||
static size_t dir_len(char const *file)
|
||||
@@ -569,6 +571,9 @@ static int resolve_deps(const char *src)
|
||||
if (strstr(buf, "cannot read header"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, "cannot be preloaded"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, destrootdir))
|
||||
break;
|
||||
|
||||
@@ -807,8 +812,7 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
|
||||
log_debug("'%s' already exists", fulldstpath);
|
||||
|
||||
/* dst does already exist */
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
|
||||
/* check destination directory */
|
||||
fulldstdir = strdup(fulldstpath);
|
||||
@@ -925,6 +929,7 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
|
||||
log_info("cp '%s' '%s'", fullsrcpath, fulldstpath);
|
||||
ret += cp(fullsrcpath, fulldstpath);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
i = strdup(dst);
|
||||
@@ -1325,8 +1330,33 @@ static int install_all(int argc, char **argv)
|
||||
return r;
|
||||
}
|
||||
|
||||
static int install_firmware(struct kmod_module *mod)
|
||||
static int install_firmware_fullpath(const char *fwpath)
|
||||
{
|
||||
const char *fw;
|
||||
_cleanup_free_ char *fwpath_xz = NULL;
|
||||
fw = fwpath;
|
||||
struct stat sb;
|
||||
int ret, r;
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
r = asprintf(&fwpath_xz, "%s.xz", fwpath);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (stat(fwpath_xz, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
return 1;
|
||||
}
|
||||
fw = fwpath_xz;
|
||||
}
|
||||
ret = dracut_install(fw, fw, false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' OK", fwpath);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_firmware(struct kmod_module *mod) {
|
||||
struct kmod_list *l;
|
||||
_cleanup_kmod_module_info_free_list_ struct kmod_list *list = NULL;
|
||||
int ret;
|
||||
@@ -1351,8 +1381,6 @@ static int install_firmware(struct kmod_module *mod)
|
||||
ret = -1;
|
||||
STRV_FOREACH(q, firmwaredirs) {
|
||||
_cleanup_free_ char *fwpath = NULL;
|
||||
_cleanup_free_ char *fwpath_xz = NULL;
|
||||
const char *fw;
|
||||
struct stat sb;
|
||||
int r;
|
||||
|
||||
@@ -1362,29 +1390,24 @@ static int install_firmware(struct kmod_module *mod)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fw = fwpath;
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
r = asprintf(&fwpath_xz, "%s.xz", fwpath);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (stat(fwpath_xz, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
continue;
|
||||
}
|
||||
fw = fwpath_xz;
|
||||
}
|
||||
|
||||
ret = dracut_install(fw, fw, false, false, true);
|
||||
if (ret == 0)
|
||||
log_debug("dracut_install '%s' OK", fwpath);
|
||||
}
|
||||
|
||||
if ((strstr(value, "*") != 0 || strstr(value, "?") != 0 || strstr(value, "[") != 0) && stat(fwpath, &sb) != 0) {
|
||||
int i;
|
||||
_cleanup_globfree_ glob_t globbuf;
|
||||
glob(fwpath, 0, NULL, &globbuf);
|
||||
for (i = 0; i < globbuf.gl_pathc; i++) {
|
||||
install_firmware_fullpath(globbuf.gl_pathv[i]);
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
install_firmware_fullpath(fwpath);
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1482,8 +1505,12 @@ static int install_dependent_modules(struct kmod_list *modlist)
|
||||
ret = install_dependent_modules(modlist);
|
||||
if (ret == 0) {
|
||||
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
int r;
|
||||
ret = install_dependent_modules(modpre);
|
||||
r = install_dependent_modules(modpost);
|
||||
ret = ret ? : r;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
|
||||
@@ -1545,8 +1572,12 @@ static int install_module(struct kmod_module *mod)
|
||||
|
||||
if (ret == 0) {
|
||||
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
int r;
|
||||
ret = install_dependent_modules(modpre);
|
||||
r = install_dependent_modules(modpost);
|
||||
ret = ret ? : r;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -206,7 +206,7 @@ if [ "$bin" = "MZ" ]; then
|
||||
fi
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
|
||||
if [ -n $uefi ]; then
|
||||
if [ -n "$uefi" ]; then
|
||||
echo -n "initrd in UEFI: $uefi: "
|
||||
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
|
||||
if [ -f "$TMPDIR/osrel.txt" ]; then
|
||||
|
@@ -57,10 +57,10 @@ default_kernel_images() {
|
||||
s390|s390x)
|
||||
regex='image'
|
||||
;;
|
||||
ppc|ppc64)
|
||||
ppc*)
|
||||
regex='vmlinux'
|
||||
;;
|
||||
i386|x86_64)
|
||||
i?86|x86_64)
|
||||
regex='vmlinuz'
|
||||
;;
|
||||
arm*)
|
||||
|
@@ -171,7 +171,7 @@ default_kernel_images() {
|
||||
ppc|ppc64)
|
||||
regex='vmlinux'
|
||||
;;
|
||||
i386|x86_64)
|
||||
i?86|x86_64)
|
||||
regex='vmlinuz'
|
||||
;;
|
||||
arm*)
|
||||
|
@@ -65,6 +65,8 @@ install() {
|
||||
$systemdutildir/system-generators/systemd-gpt-auto-generator \
|
||||
\
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/cryptsetup-pre.target \
|
||||
$systemdsystemunitdir/remote-cryptsetup.target \
|
||||
$systemdsystemunitdir/emergency.target \
|
||||
$systemdsystemunitdir/sysinit.target \
|
||||
$systemdsystemunitdir/basic.target \
|
||||
@@ -241,6 +243,7 @@ install() {
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
[[ -f $systemdsystemunitdir/$i ]] || continue
|
||||
systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
|
||||
done
|
||||
|
||||
|
@@ -1,5 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# systemd lets stdout go to journal only, but the system
|
||||
# has to halt when the integrity check fails to satisfy FIPS.
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
fips_info() {
|
||||
info "$*"
|
||||
}
|
||||
else
|
||||
fips_info() {
|
||||
echo "$*" >&2
|
||||
}
|
||||
fi
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
boot=$(getarg boot=)
|
||||
@@ -45,7 +57,7 @@ mount_boot()
|
||||
[ -e "$boot" ] || return 1
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
fips_info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
elif [ -d "$NEWROOT/boot" ]; then
|
||||
rm -fr -- /boot
|
||||
@@ -65,19 +77,27 @@ do_rhevh_check()
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
fips_info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
nonfatal_modprobe()
|
||||
{
|
||||
modprobe $1 2>&1 > /dev/stdout |
|
||||
while read -r line || [ -n "$line" ]; do
|
||||
echo "${line#modprobe: FATAL: }" >&2
|
||||
done
|
||||
}
|
||||
|
||||
fips_load_crypto()
|
||||
{
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
fips_info "Loading and integrity checking all crypto modules"
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
|
||||
if ! nonfatal_modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
@@ -92,7 +112,7 @@ fips_load_crypto()
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
fips_info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
}
|
||||
@@ -106,7 +126,7 @@ do_fips()
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
fips_info "Checking integrity of kernel"
|
||||
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
|
||||
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
@@ -145,7 +165,7 @@ do_fips()
|
||||
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
fips_info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
|
38
modules.d/04watchdog-modules/module-setup.sh
Executable file
38
modules.d/04watchdog-modules/module-setup.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local -A _drivers
|
||||
local _alldrivers _wdtdrv _wdtppath _dir
|
||||
|
||||
for _wd in /sys/class/watchdog/*; do
|
||||
! [ -e $_wd ] && continue
|
||||
_wdtdrv=$(get_dev_module $_wd)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
|
||||
return 0
|
||||
}
|
@@ -7,7 +7,7 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
return "watchdog-modules"
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -27,53 +27,7 @@ install() {
|
||||
inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
fi
|
||||
|
||||
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local -A _drivers
|
||||
local _alldrivers _active _wdtdrv _wdtppath _dir
|
||||
[[ -d /sys/class/watchdog/ ]] || return
|
||||
for _dir in /sys/class/watchdog/*; do
|
||||
[[ -d "$_dir" ]] || continue
|
||||
[[ -f "$_dir/state" ]] || continue
|
||||
_active=$(< "$_dir/state")
|
||||
! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
|
||||
# device/modalias will return driver of this device
|
||||
_wdtdrv=$(< "$_dir/device/modalias")
|
||||
# There can be more than one module represented by same
|
||||
# modalias. Currently load all of them.
|
||||
# TODO: Need to find a way to avoid any unwanted module
|
||||
# represented by modalias
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
# however in some cases, we also need to check that if there is
|
||||
# a specific driver for the parent bus/device. In such cases
|
||||
# we also need to enable driver for parent bus/device.
|
||||
_wdtppath=$(readlink -f "$_dir/device")
|
||||
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
|
||||
_wdtppath=$(readlink -f "$_wdtppath/..")
|
||||
[[ -f "$_wdtppath/modalias" ]] || continue
|
||||
|
||||
_wdtdrv=$(< "$_wdtppath/modalias")
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -14,15 +14,16 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i _progs _path _busybox
|
||||
local _i _path _busybox
|
||||
local _progs=()
|
||||
_busybox=$(type -P busybox)
|
||||
inst $_busybox /usr/bin/busybox
|
||||
for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
|
||||
do
|
||||
_progs="$_progs $_i"
|
||||
for _i in $($_busybox --list); do
|
||||
[[ ${_i} == busybox ]] && continue
|
||||
_progs+=("${_i}")
|
||||
done
|
||||
|
||||
for _i in $_progs; do
|
||||
for _i in "${_progs[@]}"; do
|
||||
_path=$(find_binary "$_i")
|
||||
[ -z "$_path" ] && continue
|
||||
ln_r /usr/bin/busybox $_path
|
||||
|
70
modules.d/06dbus/module-setup.sh
Executable file
70
modules.d/06dbus/module-setup.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries dbus-daemon || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo systemd
|
||||
return 0
|
||||
}
|
||||
|
||||
adjust_dependencies() {
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target' \
|
||||
"$initdir"${1}
|
||||
|
||||
}
|
||||
|
||||
install() {
|
||||
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/dbus.service \
|
||||
$systemdsystemunitdir/dbus.socket \
|
||||
/usr/bin/dbus-send \
|
||||
/usr/bin/busctl
|
||||
adjust_dependencies $systemdsystemunitdir/dbus.service
|
||||
|
||||
if [[ -e /usr/bin/dbus-daemon ]]; then
|
||||
inst_multiple \
|
||||
/usr/bin/dbus-daemon
|
||||
fi
|
||||
|
||||
if [[ -e /usr/bin/dbus-broker ]]; then
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/dbus-broker.service \
|
||||
/usr/bin/dbus-broker \
|
||||
/usr/bin/dbus-broker-launch
|
||||
adjust_dependencies $systemdsystemunitdir/dbus-broker.service
|
||||
fi
|
||||
|
||||
inst_dir /etc/dbus-1/system.d
|
||||
inst_dir /usr/share/dbus-1/services
|
||||
inst_dir /usr/share/dbus-1/system-services
|
||||
inst_multiple /etc/dbus-1/system.conf
|
||||
inst_multiple /usr/share/dbus-1/system.conf \
|
||||
/usr/share/dbus-1/services/org.freedesktop.systemd1.service
|
||||
inst_multiple $(find /var/lib/dbus)
|
||||
|
||||
grep '^\(d\|message\)bus:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
grep '^\(d\|message\)bus:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target
|
||||
/^\[Socket\]/aRemoveOnStop=yes' \
|
||||
"$initdir"/usr/lib/systemd/system/dbus.socket
|
||||
|
||||
#We need to make sure that systemd-tmpfiles-setup.service->dbus.socket will not wait local-fs.target to start,
|
||||
#If swap is encrypted, this would make dbus wait the timeout for the swap before loading. This could delay sysinit
|
||||
#services that are dependent on dbus.service.
|
||||
sed -i -Ee \
|
||||
'/^After/s/(After[[:space:]]*=.*)(local-fs.target[[:space:]]*)(.*)/\1-\.mount \3/' \
|
||||
"$initdir"/usr/lib/systemd/system/systemd-tmpfiles-setup.service
|
||||
}
|
@@ -33,6 +33,8 @@ check() {
|
||||
install() {
|
||||
inst rngd
|
||||
inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
|
||||
# make sure dependant libs are installed too
|
||||
inst_libdir_file opensc-pkcs11.so
|
||||
|
||||
systemctl -q --root "$initdir" add-wants sysinit.target rngd.service
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
Description=Hardware RNG Entropy Gatherer Daemon
|
||||
DefaultDependencies=no
|
||||
Before=systemd-udevd.service
|
||||
ConditionVirtualization=!container
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/rngd -f
|
||||
|
@@ -230,9 +230,7 @@ install() {
|
||||
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
|
||||
inst_simple ${VCONFIG_CONF}
|
||||
else
|
||||
if ! dracut_module_included "systemd"; then
|
||||
mksubdirs ${initdir}${VCONFIG_CONF}
|
||||
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
|
||||
fi
|
||||
@@ -263,6 +261,11 @@ install() {
|
||||
if checks; then
|
||||
install_base
|
||||
|
||||
# https://github.com/dracutdevs/dracut/issues/796
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
|
||||
inst_simple ${VCONFIG_CONF}
|
||||
fi
|
||||
|
||||
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
|
||||
install_local_i18n || install_all_kbd
|
||||
else
|
||||
|
@@ -164,7 +164,7 @@ case $reason in
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
echo "dhcp: BOUND setting up $netif"
|
||||
unset layer2
|
||||
if [ -f /sys/class/net/$netif/device/layer2 ]; then
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
@@ -223,7 +223,7 @@ case $reason in
|
||||
;;
|
||||
|
||||
BOUND6)
|
||||
echo "dhcp: BOND6 setting $netif"
|
||||
echo "dhcp: BOUND6 setting up $netif"
|
||||
setup_interface6
|
||||
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
|
@@ -376,23 +376,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
for p in $(getargs ip=); do
|
||||
@@ -473,19 +456,37 @@ done
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then
|
||||
ret=1
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
BOOTDEV=$(cat /tmp/net.bootdev)
|
||||
if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
|
||||
load_ipv6
|
||||
do_dhcp
|
||||
ret=$?
|
||||
fi
|
||||
else
|
||||
if getargs 'ip=dhcp6'; then
|
||||
# No ip lines, no bootdev -> default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
if getargs 'ip=dhcp6' || [ -z "$ip" -a "$netroot" = "dhcp6" ]; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
ret=$?
|
||||
fi
|
||||
if getargs 'ip=dhcp'; then
|
||||
if getargs 'ip=dhcp' || [ -z "$ip" -a "$netroot" != "dhcp6" ]; then
|
||||
do_dhcp -4
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
if [ "$ret" -eq 0 ] && [ -n "$(ls /tmp/leaseinfo.${netif}*)" ]; then
|
||||
> /tmp/net.${netif}.did-setup
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).did-setup
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,9 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# team=<teammaster>:<teamslaves>
|
||||
# team=<teammaster>:<teamslaves>[:<teamrunner>]
|
||||
#
|
||||
# teamslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
# teamrunner is the runner type to be used (see teamd.conf(5)); defaults to activebackup
|
||||
#
|
||||
# team without parameters assumes team=team0:eth0,eth1:activebackup
|
||||
#
|
||||
|
||||
parseteam() {
|
||||
@@ -15,8 +18,11 @@ parseteam() {
|
||||
done
|
||||
|
||||
case $# in
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "team= requires two parameters" ;;
|
||||
0) teammaster=team0; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
|
||||
1) teammaster=$1; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner="activebackup" ;;
|
||||
3) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner=$3 ;;
|
||||
*) die "team= requires zero to three parameters" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
@@ -26,16 +32,18 @@ for team in $(getargs team); do
|
||||
|
||||
unset teammaster
|
||||
unset teamslaves
|
||||
unset teamrunner
|
||||
|
||||
parseteam "$team" || continue
|
||||
|
||||
echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info
|
||||
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info
|
||||
echo "teamrunner=\"$teamrunner\"" >> /tmp/team.${teammaster}.info
|
||||
|
||||
if ! [ -e /etc/teamd/${teammaster}.conf ]; then
|
||||
warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using activebackup."
|
||||
warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using $teamrunner."
|
||||
mkdir -p /etc/teamd
|
||||
printf -- "%s" '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}' > "/etc/teamd/${teammaster}.conf"
|
||||
printf -- "%s" "{\"runner\": {\"name\": \"$teamrunner\"}, \"link_watch\": {\"name\": \"ethtool\"}}" > "/tmp/${teammaster}.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -37,6 +37,7 @@ install() {
|
||||
inst_hook initqueue/settled 99 "$moddir/nm-run.sh"
|
||||
inst_rules 85-nm-unmanaged.rules
|
||||
inst_libdir_file "NetworkManager/$_nm_version/libnm-device-plugin-team.so"
|
||||
inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh"
|
||||
|
||||
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
|
||||
inst /usr/libexec/nm-dhcp-helper
|
||||
@@ -47,8 +48,11 @@ install() {
|
||||
fi
|
||||
|
||||
# We don't install the ifcfg files from the host automatically.
|
||||
# But if the user chooses to include them, we pull in the machinery to read them.
|
||||
if ! [[ -d "$initdir/etc/sysconfig/network-scripts" ]]; then
|
||||
# But the user might choose to include them, so we pull in the machinery to read them.
|
||||
inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
|
||||
fi
|
||||
|
||||
_arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
|
||||
|
||||
if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
|
||||
echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
|
||||
fi
|
||||
|
||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
||||
nm_generate_connections
|
||||
|
20
modules.d/35network-manager/nm-lib.sh
Normal file
20
modules.d/35network-manager/nm-lib.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
type getcmdline >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
nm_generate_connections()
|
||||
{
|
||||
rm -f /run/NetworkManager/system-connections/*
|
||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
||||
|
||||
if getargbool 0 rd.neednet; then
|
||||
for i in /usr/lib/NetworkManager/system-connections/* \
|
||||
/run/NetworkManager/system-connections/* \
|
||||
/etc/NetworkManager/system-connections/* \
|
||||
/etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -f "$i" ] || continue
|
||||
echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
|
||||
break
|
||||
done
|
||||
fi
|
||||
}
|
@@ -10,6 +10,10 @@ for i in /usr/lib/NetworkManager/system-connections/* \
|
||||
else
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
|
||||
fi
|
||||
|
||||
if [ -s /run/NetworkManager/initrd/hostname ]; then
|
||||
cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
@@ -22,3 +26,5 @@ do
|
||||
source_hook initqueue/online $ifname
|
||||
/sbin/netroot $ifname
|
||||
done
|
||||
|
||||
> /tmp/nm.done
|
||||
|
66
modules.d/35network-wicked/module-setup.sh
Executable file
66
modules.d/35network-wicked/module-setup.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries wicked || return 1
|
||||
|
||||
# do not add this module by default
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo systemd dbus
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_hook cmdline 99 "$moddir/wicked-config.sh"
|
||||
|
||||
# Seems to not execute if in initqueue/settled
|
||||
inst_hook pre-udev 99 "$moddir/wicked-run.sh"
|
||||
|
||||
# even with wicked configuring the interface, ip is useful
|
||||
inst_multiple ip
|
||||
|
||||
inst_dir /etc/wicked/extensions
|
||||
inst_dir /usr/share/wicked/schema
|
||||
inst_dir /usr/lib/wicked/bin
|
||||
inst_dir /var/lib/wicked
|
||||
|
||||
inst_multiple /etc/wicked/*.xml
|
||||
inst_multiple /etc/wicked/extensions/*
|
||||
inst_multiple /etc/dbus-1/system.d/org.opensuse.Network*
|
||||
inst_multiple /usr/share/wicked/schema/*
|
||||
inst_multiple /usr/lib/wicked/bin/*
|
||||
inst_multiple /usr/libexec/wicked/bin/*
|
||||
inst_multiple /usr/sbin/wicked*
|
||||
|
||||
wicked_units="
|
||||
$systemdsystemunitdir/wickedd.service \
|
||||
$systemdsystemunitdir/wickedd-auto4.service \
|
||||
$systemdsystemunitdir/wickedd-dhcp4.service \
|
||||
$systemdsystemunitdir/wickedd-dhcp6.service \
|
||||
$systemdsystemunitdir/wickedd-nanny.service"
|
||||
|
||||
inst_multiple $wicked_units
|
||||
|
||||
for unit in $wicked_units; do
|
||||
sed -i 's/^After=.*/After=dbus.service/g' $initdir/$unit
|
||||
sed -i 's/^Before=\(.*\)/Before=\1 dracut-pre-udev.service/g' $initdir/$unit
|
||||
sed -i 's/^Wants=\(.*\)/Wants=\1 dbus.service/g' $initdir/$unit
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target' \
|
||||
"$initdir"$unit
|
||||
done
|
||||
}
|
5
modules.d/35network-wicked/wicked-config.sh
Executable file
5
modules.d/35network-wicked/wicked-config.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
getcmdline > /tmp/cmdline.$$.conf
|
||||
wicked show-config --ifconfig dracut:cmdline:/tmp/cmdline.$$.conf > /tmp/dracut.xml
|
||||
rm -f /tmp/cmdline.$$.conf
|
6
modules.d/35network-wicked/wicked-run.sh
Executable file
6
modules.d/35network-wicked/wicked-run.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# ensure wickedd is running
|
||||
systemctl start wickedd
|
||||
# detection wrapper around ifup --ifconfig "final xml" all
|
||||
wicked bootstrap --ifconfig /tmp/dracut.xml all
|
@@ -7,12 +7,25 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo -n "kernel-network-modules "
|
||||
if ! dracut_module_included "network-legacy" && [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ] ; then
|
||||
echo "network-manager"
|
||||
else
|
||||
echo "network-legacy"
|
||||
is_qemu_virtualized && echo -n "qemu-net "
|
||||
|
||||
for module in network-wicked network-manager network-legacy ; do
|
||||
if dracut_module_included "$module" ; then
|
||||
network_handler="$module"
|
||||
break
|
||||
fi
|
||||
done;
|
||||
|
||||
if [ -z "$network_handler" ]; then
|
||||
if require_binaries wicked; then
|
||||
network_handler="network-wicked"
|
||||
elif [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ]; then
|
||||
network_handler="network-manager"
|
||||
else
|
||||
network_handler="network-legacy"
|
||||
fi
|
||||
fi
|
||||
echo "kernel-network-modules $network_handler"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -510,7 +510,7 @@ ip_to_var() {
|
||||
[ -n "$6" ] && dev=$6
|
||||
[ -n "$7" ] && autoconf=$7
|
||||
case "$8" in
|
||||
[0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
[0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
dns1="$8"
|
||||
[ -n "$9" ] && dns2="$9"
|
||||
;;
|
||||
@@ -570,6 +570,11 @@ parse_ifname_opts() {
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | sed 'y/ABCDEF/abcdef/')
|
||||
;;
|
||||
21)
|
||||
ifname_if=$1
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=$(echo $2:$3:$4:$5:$6:$7:$8:$9:${10}:${11}:${12}:${13}:${14}:${15}:${16}:${17}:${18}:${19}:${20}:${21} | sed 'y/ABCDEF/abcdef/')
|
||||
;;
|
||||
*)
|
||||
die "Invalid arguments for ifname="
|
||||
;;
|
||||
|
@@ -19,11 +19,13 @@ install() {
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
inst_multiple -o ctorrent
|
||||
inst_multiple curl
|
||||
if curl --version | grep -qi '\bNSS\b'; then
|
||||
# also install libs for curl https
|
||||
inst_libdir_file "libnsspem.so*"
|
||||
inst_libdir_file "libnsssysinit.so*"
|
||||
inst_libdir_file "libsoftokn3.so*"
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
fi
|
||||
|
||||
for _dir in $libdirs; do
|
||||
[[ -d $dracutsysrootdir$_dir ]] || continue
|
||||
|
@@ -31,15 +31,15 @@ installkernel() {
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
||||
# loading of the driver if needed
|
||||
if [[ $hostonly ]]; then
|
||||
for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
|
||||
for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
|
||||
[[ -e $i ]] || continue
|
||||
if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then
|
||||
if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
|
||||
if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register|drm_encoder_init" -S "iw_handler_get_spy" $(<"$i"); then
|
||||
if strstr "$(modinfo -F filename $(<"$i") 2>/dev/null)" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
dracut_instmods -o -s "drm_crtc_init|drm_dev_register" "=drivers/gpu/drm" "=drivers/staging"
|
||||
dracut_instmods -o -s "drm_crtc_init|drm_dev_register|drm_encoder_init" "=drivers/gpu/drm" "=drivers/staging"
|
||||
fi
|
||||
}
|
||||
|
@@ -35,4 +35,9 @@ fi
|
||||
IFACES="$IFACES $DEVICE"
|
||||
echo "$IFACES" >> /tmp/net.ifaces
|
||||
|
||||
exec ifup "$DEVICE"
|
||||
if [ -x /usr/libexec/nm-initrd-generator ]; then
|
||||
type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
|
||||
nm_generate_connections
|
||||
else
|
||||
exec ifup "$DEVICE"
|
||||
fi
|
||||
|
@@ -26,8 +26,6 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods btrfs
|
||||
# Make sure btfs can use fast crc32c implementations where available (bsc#1011554)
|
||||
instmods crc32c-intel
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -48,5 +46,7 @@ install() {
|
||||
|
||||
inst_multiple -o btrfsck btrfs-zero-log
|
||||
inst $(command -v btrfs) /sbin/btrfs
|
||||
# Hack for slow machines
|
||||
# see https://github.com/dracutdevs/dracut/issues/658
|
||||
echo "rd.driver.pre=btrfs" > ${initdir}/etc/cmdline.d/00-btrfs.conf
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
mkdir -m 0700 /run/cryptsetup
|
||||
mkdir -p -m 0700 /run/cryptsetup
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
@@ -20,8 +20,11 @@ fi
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# is_keysource - ask for passphrase even if a rd.luks.key argument is set
|
||||
is_keysource=${3:-0}
|
||||
|
||||
# number of tries
|
||||
numtries=${3:-10}
|
||||
numtries=${4:-10}
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
|
||||
@@ -134,9 +137,12 @@ unset allowdiscards
|
||||
ask_passphrase=1
|
||||
|
||||
if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
|
||||
if cryptsetup --key-file "$luksfile" $cryptsetupopts luksOpen "$device" "$luksname"; then
|
||||
if readkey "$luksfile" / "$device" \
|
||||
| cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname"; then
|
||||
ask_passphrase=0
|
||||
fi
|
||||
elif [ "$is_keysource" -ne 0 ]; then
|
||||
info "Asking for passphrase because $device is a keysource."
|
||||
else
|
||||
while [ -n "$(getarg rd.luks.key)" ]; do
|
||||
if tmp=$(getkey /tmp/luks.keys $device); then
|
||||
@@ -151,7 +157,7 @@ else
|
||||
info "No key found for $device. Will try $numtries time(s) more later."
|
||||
initqueue --unique --onetime --settled \
|
||||
--name cryptroot-ask-$luksname \
|
||||
$(command -v cryptroot-ask) "$device" "$luksname" "$(($numtries-1))"
|
||||
$(command -v cryptroot-ask) "$device" "$luksname" "$is_keysource" "$(($numtries-1))"
|
||||
exit 0
|
||||
fi
|
||||
unset tmp
|
||||
@@ -178,6 +184,15 @@ if [ $ask_passphrase -ne 0 ]; then
|
||||
unset _timeout
|
||||
fi
|
||||
|
||||
if [ "$is_keysource" -ne 0 -a ${luksname##luks-} != "$luksname" ]; then
|
||||
luks_close="$(command -v cryptsetup) close"
|
||||
{
|
||||
printf -- '[ -e /dev/mapper/%s ] && ' "$luksname"
|
||||
printf -- '%s "%s"\n' "$luks_close" "$luksname"
|
||||
} >> "$hookdir/cleanup/31-crypt-keysource.sh"
|
||||
unset luks_close
|
||||
fi
|
||||
|
||||
unset device luksname luksfile
|
||||
|
||||
# mark device as asked
|
||||
|
@@ -25,11 +25,32 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
hostonly="" instmods drbg
|
||||
arch=$(uname -m)
|
||||
[[ $arch == x86_64 ]] && arch=x86
|
||||
[[ $arch == s390x ]] && arch=s390
|
||||
[[ $arch == aarch64 ]] && arch=arm64
|
||||
instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto
|
||||
instmods dm_crypt
|
||||
|
||||
# in case some of the crypto modules moved from compiled in
|
||||
# to module based, try to install those modules
|
||||
# best guess
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
# dmsetup returns s.th. like
|
||||
# cryptvol: 0 2064384 crypt aes-xts-plain64 :64:logon:cryptsetup:....
|
||||
dmsetup table | while read name _ _ is_crypt cipher _; do
|
||||
[[ $is_crypt != "crypt" ]] && continue
|
||||
# get the device name
|
||||
name=/dev/$(dmsetup info -c --noheadings -o blkdevname ${name%:})
|
||||
# check if the device exists as a key in our host_fs_types
|
||||
if [[ ${host_fs_types[$name]+_} ]]; then
|
||||
# split the cipher aes-xts-plain64 in pieces
|
||||
_OLD_IFS=$IFS
|
||||
IFS='-:'
|
||||
set -- $cipher
|
||||
IFS=$_OLD_IFS
|
||||
# try to load the cipher part with "crypto-" prepended
|
||||
# in non-hostonly mode
|
||||
hostonly= instmods $(for k in "$@"; do echo "crypto-$k";done)
|
||||
fi
|
||||
done
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -92,6 +113,7 @@ install() {
|
||||
set -- ${luksoptions}
|
||||
IFS="${OLD_IFS}"
|
||||
|
||||
forceentry=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
force)
|
||||
@@ -122,6 +144,8 @@ install() {
|
||||
inst_script "$moddir/crypt-run-generator.sh" "/sbin/crypt-run-generator"
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
# the cryptsetup targets are already pulled in by 00systemd, but not
|
||||
# the enablement symlinks
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-cryptsetup-generator \
|
||||
$systemdutildir/systemd-cryptsetup \
|
||||
@@ -129,6 +153,8 @@ install() {
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
$systemdsystemunitdir/remote-cryptsetup.target \
|
||||
$systemdsystemunitdir/initrd-root-device.target.wants/remote-cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
fi
|
||||
|
||||
|
@@ -49,6 +49,12 @@ else
|
||||
if [ -n "$PARTUUID" ]; then
|
||||
for uuid in $PARTUUID; do
|
||||
|
||||
is_keysource=0
|
||||
_uuid=$uuid
|
||||
uuid=${uuid#keysource:}
|
||||
[ $uuid != $_uuid ] && is_keysource=1
|
||||
unset _uuid
|
||||
|
||||
uuid=${uuid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$uuid="); then
|
||||
luksname="${luksname#$uuid=}"
|
||||
@@ -61,7 +67,7 @@ else
|
||||
printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$is_keysource" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
@@ -81,6 +87,12 @@ else
|
||||
elif [ -n "$SERIAL" ]; then
|
||||
for serialid in $SERIAL; do
|
||||
|
||||
is_keysource=0
|
||||
_serialid=$serialid
|
||||
serialid=${serialid#keysource:}
|
||||
[ $serialid != $_serialid ] && is_keysource=1
|
||||
unset _serialid
|
||||
|
||||
serialid=${serialid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$serialid="); then
|
||||
luksname="${luksname#$serialid=}"
|
||||
@@ -93,7 +105,7 @@ else
|
||||
printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$is_keysource" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
@@ -113,6 +125,12 @@ else
|
||||
elif [ -n "$LUKS" ]; then
|
||||
for luksid in $LUKS; do
|
||||
|
||||
is_keysource=0
|
||||
_luksid=$luksid
|
||||
luksid=${luksid#keysource:}
|
||||
[ $luksid != $_luksid ] && is_keysource=1
|
||||
unset _luksid
|
||||
|
||||
luksid=${luksid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$luksid="); then
|
||||
luksname="${luksname#$luksid=}"
|
||||
@@ -126,7 +144,7 @@ else
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
@@ -143,15 +161,16 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $is_keysource -eq 0 ]; then
|
||||
uuid=$luksid
|
||||
while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
|
||||
printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
|
||||
>> "$hookdir/initqueue/finished/90-crypt.sh"
|
||||
|
||||
{
|
||||
printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
|
||||
printf -- 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
|
||||
} >> "$hookdir/emergency/90-crypt.sh"
|
||||
fi
|
||||
done
|
||||
elif getargbool 0 rd.auto; then
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
|
@@ -268,20 +268,6 @@ do_live_overlay() {
|
||||
}
|
||||
# end do_live_overlay()
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
||||
if [ -e /run/initramfs/live/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=/run/initramfs/live/${live_dir}/osmin.img
|
||||
# decompress the delta data
|
||||
dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null
|
||||
OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
|
||||
losetup -r $OSMIN_SQUASHED_LOOPDEV /run/initramfs/osmin.img
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs.osmin
|
||||
mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /run/initramfs/squashfs.osmin
|
||||
OSMIN_LOOPDEV=$( losetup -f )
|
||||
losetup -r $OSMIN_LOOPDEV /run/initramfs/squashfs.osmin/osmin
|
||||
umount -l /run/initramfs/squashfs.osmin
|
||||
fi
|
||||
|
||||
# we might have an embedded fs image on squashfs (compressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
||||
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
||||
@@ -370,12 +356,6 @@ if [ -n "$FSIMG" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
# set up the devicemapper snapshot device, which will merge
|
||||
# the normal live fs image, and the delta, into a minimzied fs image
|
||||
echo "0 $sz snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV P 8" | dmsetup create --readonly live-osimg-min
|
||||
fi
|
||||
|
||||
if [ -n "$reloadsysrootmountunit" ]; then
|
||||
eval "$reloadsysrootmountunit"
|
||||
systemctl daemon-reload
|
||||
|
@@ -22,6 +22,7 @@ do_iso_scan() {
|
||||
mount -t auto -o ro "$dev" "/run/initramfs/isoscan" || continue
|
||||
if [ -f "/run/initramfs/isoscan/$isofile" ]; then
|
||||
losetup -f "/run/initramfs/isoscan/$isofile"
|
||||
ln -s $dev /run/initramfs/isoscandev
|
||||
rm -f -- "$job"
|
||||
exit 0
|
||||
else
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
|
||||
local _hostonly_drvs
|
||||
|
||||
find_kernel_modules_external () {
|
||||
local _OLDIFS
|
||||
@@ -19,17 +20,24 @@ installkernel() {
|
||||
IFS=$_OLDIFS
|
||||
}
|
||||
|
||||
is_block_dev() {
|
||||
[ -e /sys/dev/block/$1 ] && return 0
|
||||
record_block_dev_drv() {
|
||||
for _mod in $(get_dev_module /dev/block/$1); do
|
||||
[[ " $_hostonly_drvs " != *$_mod* ]] && _hostonly_drvs+=" $_mod"
|
||||
done
|
||||
[[ "$_hostonly_drvs" ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
install_block_modules_strict () {
|
||||
hostonly='' instmods $_hostonly_drvs
|
||||
}
|
||||
|
||||
install_block_modules () {
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix
|
||||
instmods \
|
||||
scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
=ide nvme vmd nfit \
|
||||
virtio_blk
|
||||
=drivers/usb/storage \
|
||||
=ide nvme vmd \
|
||||
virtio_blk virtio_scsi
|
||||
|
||||
dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
}
|
||||
@@ -41,7 +49,6 @@ installkernel() {
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd \
|
||||
"=drivers/pinctrl" \
|
||||
${NULL}
|
||||
|
||||
hostonly=$(optional_hostonly) instmods \
|
||||
@@ -49,15 +56,15 @@ installkernel() {
|
||||
"=drivers/tty/serial" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard" \
|
||||
"=drivers/usb/storage" \
|
||||
"=drivers/pci/host" \
|
||||
"=drivers/pci/controller" \
|
||||
"=drivers/pinctrl" \
|
||||
${NULL}
|
||||
|
||||
instmods \
|
||||
yenta_socket \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
virtio virtio_ring virtio_pci virtio_scsi \
|
||||
virtio virtio_ring virtio_pci pci_hyperv \
|
||||
"=drivers/pcmcia"
|
||||
|
||||
if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then
|
||||
@@ -65,9 +72,11 @@ installkernel() {
|
||||
_blockfuncs+='|dw_mc_probe|dw_mci_pltfm_register'
|
||||
instmods \
|
||||
"=drivers/clk" \
|
||||
"=drivers/devfreq" \
|
||||
"=drivers/dma" \
|
||||
"=drivers/extcon" \
|
||||
"=drivers/gpio" \
|
||||
"=drivers/hwmon" \
|
||||
"=drivers/hwspinlock" \
|
||||
"=drivers/i2c/busses" \
|
||||
"=drivers/mfd" \
|
||||
@@ -91,9 +100,19 @@ installkernel() {
|
||||
|
||||
find_kernel_modules_external | instmods
|
||||
|
||||
if ! [[ $hostonly ]] || for_each_host_dev_and_slaves is_block_dev; then
|
||||
# if not on hostonly mode, or there are hostonly block device
|
||||
# install block drivers
|
||||
if ! [[ $hostonly ]] || \
|
||||
for_each_host_dev_and_slaves_all record_block_dev_drv;
|
||||
then
|
||||
hostonly='' instmods sg sr_mod sd_mod scsi_dh ata_piix
|
||||
|
||||
if [[ "$hostonly_mode" == "strict" ]]; then
|
||||
install_block_modules_strict
|
||||
else
|
||||
install_block_modules
|
||||
fi
|
||||
fi
|
||||
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
@@ -104,6 +123,15 @@ installkernel() {
|
||||
elif [[ "${host_fs_types[*]}" ]]; then
|
||||
hostonly='' instmods "${host_fs_types[@]}"
|
||||
fi
|
||||
|
||||
arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
|
||||
# We don't want to play catch up with hash and encryption algorithms.
|
||||
# To be safe, just use the hammer and include all crypto.
|
||||
[[ $arch == x86_64 ]] && arch=x86
|
||||
[[ $arch == s390x ]] && arch=s390
|
||||
[[ $arch == aarch64 ]] && arch=arm64
|
||||
instmods "=crypto" "=arch/$arch/crypto" "=drivers/crypto"
|
||||
fi
|
||||
:
|
||||
}
|
||||
|
@@ -14,22 +14,33 @@ depends() {
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _net_symbols='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
local _net_drivers
|
||||
|
||||
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
|
||||
_s390drivers="=drivers/s390/net"
|
||||
dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/s390/net"
|
||||
fi
|
||||
|
||||
dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
|
||||
if [[ $hostonly_mode == 'strict' ]] && [[ $hostonly_nics ]]; then
|
||||
for _nic in $hostonly_nics; do
|
||||
_net_drivers=$(get_dev_module /sys/class/net/$_nic)
|
||||
if ! [[ $_net_drivers ]]; then
|
||||
derror "--hostonly-nics contains invalid NIC '$_nic'"
|
||||
continue
|
||||
fi
|
||||
hostonly="" instmods $_net_drivers
|
||||
done
|
||||
return 0
|
||||
fi
|
||||
|
||||
dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/net"
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q ipvlan macvlan af_packet virtio_net xennet
|
||||
hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -91,7 +91,7 @@ export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
|
||||
if [ -n "$SNAPSHOT" ] ; then
|
||||
# HACK - this should probably be done elsewhere or turned into a function
|
||||
# Enable read-write LVM locking
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' ${initdir}/etc/lvm/lvm.conf
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' /etc/lvm/lvm.conf
|
||||
|
||||
# Expected SNAPSHOT format "<orig lv name>:<snap lv name>"
|
||||
ORIG_LV=${SNAPSHOT%%:*}
|
||||
|
@@ -36,7 +36,7 @@ cmdline() {
|
||||
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
|
||||
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
|
||||
if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then
|
||||
printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
|
||||
printf " rd.lvm.lv=%s " "${DM_VG_NAME}/${DM_LV_NAME} "
|
||||
_activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1
|
||||
fi
|
||||
done
|
||||
@@ -101,7 +101,7 @@ install() {
|
||||
sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \
|
||||
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||||
sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||||
sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||||
sed -i -e 's/^ENV{SYSTEMD_WANTS}+\?=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||||
else
|
||||
sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \
|
||||
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||||
|
@@ -83,11 +83,12 @@ install() {
|
||||
dmsetup \
|
||||
kpartx \
|
||||
mpath_wait \
|
||||
mpathconf \
|
||||
mpathpersist \
|
||||
multipath \
|
||||
multipathd \
|
||||
mpathpersist \
|
||||
xdrgetuid \
|
||||
xdrgetprio \
|
||||
xdrgetuid \
|
||||
/etc/xdrdevices.conf \
|
||||
/etc/multipath.conf \
|
||||
/etc/multipath/* \
|
||||
@@ -109,7 +110,9 @@ install() {
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service"
|
||||
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
||||
systemctl -q --root "$initdir" enable multipathd-configure.service
|
||||
systemctl -q --root "$initdir" enable multipathd.service
|
||||
else
|
||||
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||
@@ -122,6 +125,6 @@ install() {
|
||||
inst_rules 40-multipath.rules 56-multipath.rules \
|
||||
62-multipath.rules 65-multipath.rules \
|
||||
66-kpartx.rules 67-kpartx-compat.rules \
|
||||
11-dm-mpath.rules
|
||||
11-dm-mpath.rules 11-dm-parts.rules
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
for i in $(multipath -l -v1); do
|
||||
if ! dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1' ; then
|
||||
|
19
modules.d/90multipath/multipathd-configure.service
Normal file
19
modules.d/90multipath/multipathd-configure.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Device-Mapper Multipath Default Configuration
|
||||
Before=iscsi.service iscsid.service lvm2-activation-early.service
|
||||
Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target
|
||||
After=systemd-udev-trigger.service systemd-udev-settle.service
|
||||
Before=local-fs-pre.target multipathd.service
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
|
||||
ConditionKernelCommandLine=rd.multipath=default
|
||||
ConditionPathExists=!/etc/multipath.conf
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=-/usr/bin/mkdir -p /etc/multipath/multipath.conf.d
|
||||
ExecStart=/usr/sbin/mpathconf --enable
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@@ -1,5 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then
|
||||
mkdir -p /etc/multipath/multipath.conf.d
|
||||
mpathconf --enable
|
||||
fi
|
||||
|
||||
if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then
|
||||
modprobe dm-multipath
|
||||
multipathd -B || multipathd
|
||||
|
31
modules.d/90nvdimm/module-setup.sh
Executable file
31
modules.d/90nvdimm/module-setup.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
if [[ ! $hostonly ]]; then
|
||||
return 0
|
||||
fi
|
||||
[[ $DRACUT_KERNEL_MODALIASES && -f "$DRACUT_KERNEL_MODALIASES" ]] && \
|
||||
grep -q libnvdimm "$DRACUT_KERNEL_MODALIASES" && return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Directories to search for NVDIMM "providers" (firmware drivers)
|
||||
# These modules call "nvdimm_bus_register()".
|
||||
local _provider_dirs='=drivers/nvdimm =drivers/acpi =arch/powerpc'
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
dracut_instmods -o -s nvdimm_bus_register $_provider_dirs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple -o ndctl /etc/ndctl/keys/tpm.handle /etc/ndctl/keys/*.blob
|
||||
}
|
@@ -17,9 +17,9 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch="$(uname -m)"
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
# only for PowerPC Macs
|
||||
[[ "$_arch" == ppc* && "$_arch" != ppc*le ]] || return 1
|
||||
[[ "$_arch" == ppc* && "$_arch" != ppc64le ]] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ installkernel() {
|
||||
}
|
||||
|
||||
# only PowerMac3,6 has a module, special case
|
||||
if [[ "$(uname -m)" == ppc ]]; then
|
||||
if [[ "${DRACUT_ARCH:-$(uname -m)}" != ppc64* ]]; then
|
||||
if ! [[ $hostonly ]] || [[ "$(pmac_model)" == "PowerMac3,6" ]]; then
|
||||
instmods therm_windtunnel
|
||||
fi
|
||||
|
@@ -2,15 +2,20 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
if [[ $hostonly ]] || [[ $mount_needs ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
return 255
|
||||
fi
|
||||
|
||||
if [[ $mount_needs ]]; then
|
||||
is_qemu_virtualized && return 0
|
||||
return 255
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# qemu specific modules
|
||||
hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
|
||||
hostonly=$(optional_hostonly) instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
|
||||
}
|
||||
|
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries stratisd-init thin_check thin_repair mkfs.xfs xfs_admin xfs_growfs || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo dm
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods xfs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
|
||||
inst_multiple stratisd-init thin_check thin_repair mkfs.xfs xfs_admin xfs_growfs
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service"
|
||||
systemctl -q --root "$initdir" enable stratisd-init.service
|
||||
else
|
||||
inst_hook pre-mount 25 "$moddir/stratisd-start.sh"
|
||||
inst_hook cleanup 25 "$moddir/stratisd-stop.sh"
|
||||
fi
|
||||
}
|
||||
|
@@ -1,15 +0,0 @@
|
||||
[Unit]
|
||||
Description=A daemon that manages a pool of block devices to create flexible file systems
|
||||
Documentation=man:stratisd(8)
|
||||
Before=local-fs-pre.target
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/sbin/stratisd-init --debug
|
||||
KillSignal=SIGINT
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
stratisd-init --debug > /dev/kmsg 2>&1 &
|
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /lib/dracut-lib.sh ] && . /lib/dracut-lib.sh
|
||||
|
||||
pid=$(pidof stratisd-init)
|
||||
[ -n "$pid" ] && kill ${pid}
|
@@ -31,7 +31,7 @@ if [ -n "$zipl_arg" ] ; then
|
||||
esac
|
||||
if [ "$zipl_env" ] ; then
|
||||
{
|
||||
printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", RUN+="/sbin/initqueue --settled --onetime --unique --name install_zipl_cmdline /sbin/install_zipl_cmdline.sh %s"\n' \
|
||||
printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", ENV{SYSTEMD_READY}!="0", RUN+="/sbin/initqueue --settled --onetime --unique --name install_zipl_cmdline /sbin/install_zipl_cmdline.sh %s"\n' \
|
||||
${zipl_env} ${zipl_val} ${zipl_arg}
|
||||
echo "[ -f /tmp/install.zipl.cmdline-done ]" >$hookdir/initqueue/finished/wait-zipl-conf.sh
|
||||
} >> /etc/udev/rules.d/99zipl-conf.rules
|
||||
|
@@ -30,5 +30,5 @@ cifs_to_var() {
|
||||
if [ ! "$cifsuser" -o ! "$cifspass" ]; then
|
||||
die "For CIFS support you need to specify a cifsuser and cifspass either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL."
|
||||
fi
|
||||
options="user=$cifsuser,pass=$cifspass"
|
||||
options="user=$cifsuser,pass=$cifspass,$(getarg rootflags=)"
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ echo server: $server
|
||||
echo path: $path
|
||||
echo options: $options
|
||||
|
||||
mount.cifs //$server/$path $NEWROOT -o $options && { [ -e /dev/root ] || ln -s null /dev/root ; }
|
||||
mount.cifs "//$server/$path" "$NEWROOT" -o "$options" && { [ -e /dev/root ] || ln -s null /dev/root ; }
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > $hookdir/initqueue/cifs.sh
|
||||
|
@@ -25,11 +25,11 @@ depends() {
|
||||
installkernel() {
|
||||
instmods cifs ipv6
|
||||
# hash algos
|
||||
instmods md4 md5 sha256
|
||||
instmods md4 md5 sha256 sha512
|
||||
# ciphers
|
||||
instmods aes arc4 des ecb
|
||||
instmods aes arc4 des ecb gcm aead2
|
||||
# macs
|
||||
instmods hmac cmac
|
||||
instmods hmac cmac ccm
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -18,8 +18,9 @@ depends() {
|
||||
install() {
|
||||
inst_hook cmdline 30 "$moddir/parse-dasd.sh"
|
||||
inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg
|
||||
if [[ $hostonly ]]; then
|
||||
inst -H /etc/dasd.conf
|
||||
conf=/etc/dasd.conf
|
||||
if [[ $hostonly && -f $conf ]] ; then
|
||||
inst -H $conf
|
||||
fi
|
||||
inst_rules 56-dasd.rules
|
||||
inst_rules 59-dasd.rules
|
||||
|
0
modules.d/95dcssblk/module-setup.sh
Normal file → Executable file
0
modules.d/95dcssblk/module-setup.sh
Normal file → Executable file
0
modules.d/95dcssblk/parse-dcssblk.sh
Normal file → Executable file
0
modules.d/95dcssblk/parse-dcssblk.sh
Normal file → Executable file
@@ -2,22 +2,15 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _fcoe_ctlr
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
_fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$_fcoe_ctlr" ] && return 255
|
||||
is_fcoe() {
|
||||
block_is_fcoe $1 || return 1
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_and_slaves is_fcoe || return 255
|
||||
[ -d /sys/firmware/efi ] || return 255
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$fcoe_ctlr" ] && return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
return 0
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! getargbool 0 rd.nofcoe ; then
|
||||
if getargbool 0 rd.nofcoe ; then
|
||||
info "rd.nofcoe=0: skipping lldpad activation"
|
||||
exit 0
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
|
@@ -2,13 +2,12 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _fcoe_ctlr
|
||||
is_fcoe() {
|
||||
block_is_fcoe $1 || return 1
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
_fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$_fcoe_ctlr" ] && return 255
|
||||
for_each_host_dev_and_slaves is_fcoe || return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1
|
||||
@@ -23,7 +22,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods fcoe 8021q edd
|
||||
instmods fcoe libfcoe 8021q edd bnx2fc
|
||||
}
|
||||
|
||||
get_vlan_parent() {
|
||||
|
@@ -13,7 +13,7 @@
|
||||
# fcoe=eth0:nodcb:vn2vn
|
||||
# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
|
||||
|
||||
if ! getargbool 0 rd.nofcoe ; then
|
||||
if getargbool 0 rd.nofcoe ; then
|
||||
info "rd.nofcoe=0: skipping fcoe"
|
||||
return 0
|
||||
fi
|
||||
|
@@ -213,6 +213,9 @@ handle_netroot()
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
|
||||
fi
|
||||
|
||||
if strglobin $iscsi_target_ip '*:*:*' && ! strglobin $iscsi_target_ip '['; then
|
||||
iscsi_target_ip="[$iscsi_target_ip]"
|
||||
fi
|
||||
targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/')
|
||||
[ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
|
||||
|
||||
|
@@ -9,20 +9,9 @@ check() {
|
||||
# If hostonly was requested, fail the check if we are not actually
|
||||
# booting from root.
|
||||
|
||||
is_iscsi() {
|
||||
local _dev=$1
|
||||
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
cd "$(readlink -f "/sys/dev/block/$_dev")"
|
||||
until [[ -d sys || -d iscsi_session ]]; do
|
||||
cd ..
|
||||
done
|
||||
[[ -d iscsi_session ]]
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
pushd . >/dev/null
|
||||
for_each_host_dev_and_slaves is_iscsi
|
||||
for_each_host_dev_and_slaves block_is_iscsi
|
||||
local _is_iscsi=$?
|
||||
popd >/dev/null
|
||||
[[ $_is_iscsi == 0 ]] || return 255
|
||||
@@ -65,7 +54,7 @@ install_ibft() {
|
||||
if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then
|
||||
echo -n "rd.iscsi.ibft=1 "
|
||||
fi
|
||||
echo -n "rd.iscsi.firmware=1"
|
||||
echo -n "rd.iscsi.firmware=1 "
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -120,27 +109,7 @@ install_iscsiroot() {
|
||||
done
|
||||
|
||||
[ -z "$iscsi_address" ] && return
|
||||
local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
|
||||
ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
|
||||
# follow ifcfg settings for boot protocol
|
||||
for _path in \
|
||||
"/etc/sysconfig/network-scripts/ifcfg-$ifname" \
|
||||
"/etc/sysconfig/network/ifcfg-$ifname" \
|
||||
; do
|
||||
[ -f "$_path" ] && bootproto=$(sed -n "s/BOOTPROTO='\?\([[:alpha:]]*6\?\)4\?/\1/p" "$_path")
|
||||
done
|
||||
|
||||
if [ $bootproto ]; then
|
||||
printf 'ip=%s:%s ' ${ifname} ${bootproto}
|
||||
else
|
||||
printf 'ip=%s:static ' ${ifname}
|
||||
fi
|
||||
|
||||
if [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
ip_params_for_remote_addr "$iscsi_address"
|
||||
|
||||
if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
|
||||
if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
|
||||
@@ -243,6 +212,7 @@ install() {
|
||||
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
|
||||
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
|
||||
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
|
||||
else
|
||||
|
@@ -7,11 +7,9 @@ check() {
|
||||
# if an nbd device is not somewhere in the chain of devices root is
|
||||
# mounted on, fail the hostonly check.
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
|
||||
|
||||
_rootdev=$(find_root_block_device)
|
||||
[[ -b /dev/block/$_rootdev ]] || return 1
|
||||
check_block_and_slaves is_nbd "$_rootdev" || return 255
|
||||
check_block_and_slaves block_is_nbd "$_rootdev" || return 255
|
||||
}
|
||||
require_binaries nbd-client || return 1
|
||||
|
||||
|
@@ -1,5 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# return value:
|
||||
# 'nfs4': Only nfs4 founded
|
||||
# 'nfs': nfs with version < 4 founded
|
||||
# '': No nfs founded
|
||||
get_nfs_type() {
|
||||
local _nfs _nfs4
|
||||
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "nfs" ]] && _nfs=1
|
||||
[[ "$fs" == "nfs3" ]] && _nfs=1
|
||||
[[ "$fs" == "nfs4" ]] && _nfs4=1
|
||||
done
|
||||
|
||||
[[ "$_nfs" ]] && echo "nfs" && return
|
||||
[[ "$_nfs4" ]] && echo "nfs4" && return
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
# If our prerequisites are not met, fail anyways.
|
||||
@@ -7,11 +24,7 @@ check() {
|
||||
require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "nfs" ]] && return 0
|
||||
[[ "$fs" == "nfs3" ]] && return 0
|
||||
[[ "$fs" == "nfs4" ]] && return 0
|
||||
done
|
||||
[[ "$(get_nfs_type)" ]] && return 0
|
||||
return 255
|
||||
}
|
||||
return 0
|
||||
@@ -25,7 +38,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
hostonly='' instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files
|
||||
hostonly=$(optional_hostonly) instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files
|
||||
}
|
||||
|
||||
cmdline() {
|
||||
@@ -34,7 +47,6 @@ cmdline() {
|
||||
local nfs_root
|
||||
local nfs_address
|
||||
local lookup
|
||||
local ifname
|
||||
|
||||
### nfsroot= ###
|
||||
nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
|
||||
@@ -56,29 +68,16 @@ cmdline() {
|
||||
lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1)
|
||||
nfs_address=${lookup##* }
|
||||
fi
|
||||
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
if [ -d /sys/class/net/$ifname/bonding ]; then
|
||||
dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
|
||||
return
|
||||
elif [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
|
||||
bootproto=$(sed -n "/BOOTPROTO/s/BOOTPROTO='\([[:alpha:]]*6\?\)4\?'/\1/p" /etc/sysconfig/network/ifcfg-$ifname)
|
||||
if [ $bootproto ]; then
|
||||
printf 'ip=%s:%s ' ${ifname} ${bootproto}
|
||||
else
|
||||
printf 'ip=%s:static ' ${ifname}
|
||||
fi
|
||||
[[ $nfs_address ]] || return
|
||||
ip_params_for_remote_addr "$nfs_address"
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i
|
||||
local _nsslibs
|
||||
inst_multiple -o portmap rpcbind rpc.statd mount.nfs \
|
||||
mount.nfs4 umount rpc.idmapd sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf"
|
||||
inst_multiple -o rpc.idmapd mount.nfs mount.nfs4 umount sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf"
|
||||
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
@@ -106,10 +105,17 @@ install() {
|
||||
inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh"
|
||||
inst_hook cleanup 99 "$moddir/nfsroot-cleanup.sh"
|
||||
inst "$moddir/nfsroot.sh" "/sbin/nfsroot"
|
||||
|
||||
# For strict hostonly, only install rpcbind for NFS < 4
|
||||
if [[ $hostonly_mode != "strict" ]] || [[ "$(get_nfs_type)" != "nfs4" ]]; then
|
||||
inst_multiple -o portmap rpcbind rpc.statd
|
||||
fi
|
||||
|
||||
inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh"
|
||||
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
|
||||
mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
|
||||
mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
|
||||
[ -d "$initdir/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
|
||||
[ -d "$initdir/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm"
|
||||
|
||||
# Rather than copy the passwd file in, just set a user for rpcbind
|
||||
# We'll save the state and restart the daemon from the root anyway
|
||||
@@ -121,5 +127,6 @@ install() {
|
||||
chmod 770 "$initdir/var/lib/rpcbind"
|
||||
grep -q '^rpc:' $dracutsysrootdir/etc/passwd \
|
||||
&& grep -q '^rpc:' $dracutsysrootdir/etc/group
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -112,8 +112,8 @@ nfsroot_from_dhcp() {
|
||||
[ -n "$new_root_path" ] && nfsroot_to_var "$nfs:$new_root_path"
|
||||
[ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path=/tftpboot/%s
|
||||
[ -z "$server" ] && server=$srv
|
||||
[ -z "$server" ] && server=$new_dhcp_server_identifier
|
||||
[ -z "$server" ] && server=$new_next_server
|
||||
[ -z "$server" ] && server=$new_dhcp_server_identifier
|
||||
[ -z "$server" ] && server=${new_root_path%%:*}
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then
|
||||
|
||||
[ ! -d /var/lib/nfs/rpc_pipefs/nfs ] && \
|
||||
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
||||
|
||||
@@ -17,8 +15,8 @@ if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then
|
||||
# Start rpc.statd as mount won't let us use locks on a NFSv4
|
||||
# filesystem without talking to it. NFSv4 does locks internally,
|
||||
# rpc.lockd isn't needed
|
||||
[ -z "$(pidof rpc.statd)" ] && rpc.statd
|
||||
[ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
|
||||
command -v rpc.statd >/dev/null && [ -z "$(pidof rpc.statd)" ] && rpc.statd
|
||||
command -v rpc.idmapd >/dev/null && [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
|
||||
else
|
||||
warn 'Kernel module "sunrpc" not in the initramfs, or support for filesystem "rpc_pipefs" missing!'
|
||||
fi
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
. /lib/nfs-lib.sh
|
||||
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
|
10
modules.d/95nvmf/95-nvmf-initqueue.rules
Normal file
10
modules.d/95nvmf/95-nvmf-initqueue.rules
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# nvmf-initqueue.rules
|
||||
#
|
||||
# D-Bus doesn't run in the initrd, which means that we cannot use our
|
||||
# usual trick of starting custom systemd services.
|
||||
# So use a rule to create initqueue entries instead.
|
||||
|
||||
ACTION=="change", SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \
|
||||
ENV{NVMEFC_HOST_TRADDR}=="*", ENV{NVMEFC_TRADDR}=="*", \
|
||||
RUN+="/sbin/initqueue --onetime --unique --name nvmf-connect-$env{NVMEFC_TRADDR}-$env{NVMEFC_HOST_TRADDR} /usr/sbin/nvme connect-all --transport=fc --traddr=$env{NVMEFC_TRADDR} --host-traddr=$env{NVMEFC_HOST_TRADDR}"
|
120
modules.d/95nvmf/module-setup.sh
Executable file
120
modules.d/95nvmf/module-setup.sh
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries nvme || return 1
|
||||
[ -f /etc/nvme/hostnqn ] || return 255
|
||||
[ -f /etc/nvme/hostid ] || return 255
|
||||
|
||||
is_nvmf() {
|
||||
local _dev=$1
|
||||
local trtype
|
||||
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return 0
|
||||
cd -P "/sys/dev/block/$_dev" || return 0
|
||||
if [ -f partition ] ; then
|
||||
cd ..
|
||||
fi
|
||||
for d in device/nvme* ; do
|
||||
[ -L "$d" ] || continue
|
||||
if readlink "$d" | grep -q nvme-fabrics ; then
|
||||
trtype=$(cat "$d"/transport)
|
||||
break
|
||||
fi
|
||||
done
|
||||
[[ "$trtype" == "fc" ]] || [[ "$trtype" == "tcp" ]] || [[ "$trtype" == "rdma" ]]
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
pushd . >/dev/null
|
||||
for_each_host_dev_and_slaves is_nvmf
|
||||
local _is_nvmf=$?
|
||||
popd >/dev/null
|
||||
[[ $_is_nvmf == 0 ]] || return 255
|
||||
if [ ! -f /sys/class/fc/fc_udev_device/nvme_discovery ] ; then
|
||||
if [ ! -f /etc/nvme/discovery.conf ] ; then
|
||||
echo "No discovery arguments present"
|
||||
return 255
|
||||
fi
|
||||
fi
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo bash rootfs-block network
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods nvme_fc lpfc qla2xxx
|
||||
hostonly="" instmods nvme_tcp nvme_fabrics
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
local _hostnqn
|
||||
local _hostid
|
||||
|
||||
gen_nvmf_cmdline() {
|
||||
local _dev=$1
|
||||
local trtype
|
||||
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return 0
|
||||
cd -P "/sys/dev/block/$_dev" || return 0
|
||||
if [ -f partition ] ; then
|
||||
cd ..
|
||||
fi
|
||||
for d in device/nvme* ; do
|
||||
[ -L "$d" ] || continue
|
||||
if readlink "$d" | grep -q nvme-fabrics ; then
|
||||
trtype=$(cat "$d"/transport)
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
[ -z "$trtype" ] && return 0
|
||||
nvme list-subsys ${PWD##*/} | while read x dev trtype traddr host_traddr state ana; do
|
||||
[ "$trtype" != "${trtype#NQN}" ] && continue
|
||||
echo -n " nvmf.discover=$trtype,${traddr#traddr=},${host_traddr#host_traddr=}"
|
||||
done
|
||||
}
|
||||
|
||||
if [ -f /etc/nvme/hostnqn ] ; then
|
||||
_hostnqn=$(cat /etc/nvme/hostnqn)
|
||||
echo -n " nvmf.hostnqn=${_hostnqn}"
|
||||
fi
|
||||
if [ -f /etc/nvme/hostid ] ; then
|
||||
_hostid=$(cat /etc/nvme/hostid)
|
||||
echo -n " nvmf.hostid=${_hostid}"
|
||||
fi
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
pushd . >/dev/null
|
||||
for_each_host_dev_and_slaves gen_nvmf_cmdline
|
||||
popd >/dev/null
|
||||
}
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
local _nvmf_args=$(cmdline)
|
||||
[[ "$_nvmf_args" ]] && printf "%s" "$_nvmf_args" >> "${initdir}/etc/cmdline.d/95nvmf-args.conf"
|
||||
fi
|
||||
inst_simple "/etc/nvme/hostnqn"
|
||||
inst_simple "/etc/nvme/hostid"
|
||||
|
||||
inst_multiple ip sed
|
||||
|
||||
inst_script "${moddir}/nvmf-autoconnect.sh" /sbin/nvmf-autoconnect.sh
|
||||
|
||||
inst_multiple nvme
|
||||
inst_hook cmdline 99 "$moddir/parse-nvmf-boot-connections.sh"
|
||||
inst_simple "/etc/nvme/discovery.conf"
|
||||
inst_rules /usr/lib/udev/rules.d/71-nvmf-iopolicy-netapp.rules
|
||||
inst_rules "$moddir/95-nvmf-initqueue.rules"
|
||||
dracut_need_initqueue
|
||||
}
|
5
modules.d/95nvmf/nvmf-autoconnect.sh
Normal file
5
modules.d/95nvmf/nvmf-autoconnect.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ -f /sys/class/fc/fc_udev_device/nvme_discovery ] || exit 1
|
||||
echo add > /sys/class/fc/fc_udev_device/nvme_discovery
|
||||
exit 0
|
143
modules.d/95nvmf/parse-nvmf-boot-connections.sh
Executable file
143
modules.d/95nvmf/parse-nvmf-boot-connections.sh
Executable file
@@ -0,0 +1,143 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Supported formats:
|
||||
# nvmf.hostnqn=<hostnqn>
|
||||
# nvmf.hostid=<hostid>
|
||||
# nvmf.discover=<transport>,<traddr>,<host-traddr>,<trsvcid>
|
||||
#
|
||||
# Examples:
|
||||
# nvmf.hostnqn=nqn.2014-08.org.nvmexpress:uuid:37303738-3034-584d-5137-333230423843
|
||||
# nvmf.discover=rdma,192.168.1.3,,4420
|
||||
# nvmf.discover=tcp,192.168.1.3,,4420
|
||||
# nvmf.discover=tcp,192.168.1.3
|
||||
# nvmf.discover=fc,nn-0x200400a098d85236:pn-0x201400a098d85236,nn-0x200000109b7db455:pn-0x100000109b7db455
|
||||
# nvmf.discover=fc,auto
|
||||
#
|
||||
# Note: FC does autodiscovery, so typically there is no need to
|
||||
# specify any discover parameters for FC.
|
||||
#
|
||||
|
||||
type is_ip >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
if getargbool 0 rd.nonvmf ; then
|
||||
warn "rd.nonvmf=0: skipping nvmf"
|
||||
return 0
|
||||
fi
|
||||
|
||||
initqueue --onetime modprobe --all -b -q nvme nvme_tcp nvme_core nvme_fabrics
|
||||
|
||||
validate_ip_conn() {
|
||||
if ! getargbool 0 rd.neednet ; then
|
||||
warn "$trtype transport requires rd.neednet=1"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local_address=$(ip -o route get to $traddr | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
|
||||
|
||||
# confirm we got a local IP address
|
||||
if ! is_ip "$local_address" ; then
|
||||
warn "$traddr is an invalid address";
|
||||
return 1
|
||||
fi
|
||||
|
||||
ifname=$(ip -o route get to $local_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
|
||||
if ip l show "$ifname" >/dev/null 2>&1 ; then
|
||||
warn "invalid network interface $ifname"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# confirm there's a route to destination
|
||||
if ip route get "$traddr" >/dev/null 2>&1 ; then
|
||||
warn "no route to $traddr"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
parse_nvmf_discover() {
|
||||
traddr="none"
|
||||
trtype="none"
|
||||
hosttraddr="none"
|
||||
trsvcid=4420
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set $1
|
||||
IFS="$OLDIFS"
|
||||
|
||||
case $# in
|
||||
2)
|
||||
[ -n "$1" ] && trtype=$1
|
||||
[ -n "$2" ] && traddr=$2
|
||||
;;
|
||||
3)
|
||||
[ -n "$1" ] && trtype=$1
|
||||
[ -n "$2" ] && traddr=$2
|
||||
[ -n "$3" ] && hosttraddr=$3
|
||||
;;
|
||||
4)
|
||||
[ -n "$1" ] && trtype=$1
|
||||
[ -n "$2" ] && traddr=$2
|
||||
[ -n "$3" ] && hosttraddr=$3
|
||||
[ -n "$4" ] && trsvcid=$4
|
||||
;;
|
||||
*)
|
||||
warn "Invalid arguments for nvmf.discover=$1"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
if [ "$traddr" = "none" ] ; then
|
||||
warn "traddr is mandatory for $trtype"
|
||||
return 0;
|
||||
fi
|
||||
if [ "$trtype" = "fc" ] ; then
|
||||
if [ "$traddr" = "auto" ] ; then
|
||||
rm /etc/nvme/discovery.conf
|
||||
return 1
|
||||
fi
|
||||
if [ "$hosttraddr" = "none" ] ; then
|
||||
warn "host traddr is mandatory for fc"
|
||||
return 0
|
||||
fi
|
||||
elif [ "$trtype" != "rdma" ] && [ "$trtype" != "tcp" ] ; then
|
||||
warn "unsupported transport $trtype"
|
||||
return 0
|
||||
fi
|
||||
if [ "$trtype" = "tcp" ]; then
|
||||
validate_ip_conn
|
||||
fi
|
||||
if [ "$trtype" = "fc" ] ; then
|
||||
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr" >> /etc/nvme/discovery.conf
|
||||
else
|
||||
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr --trsvcid=$trsvcid" >> /etc/nvme/discovery.conf
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
nvmf_hostnqn=$(getarg nvmf.hostnqn=)
|
||||
if [ -n "$nvmf_hostnqn" ] ; then
|
||||
echo "$nvmf_hostnqn" > /etc/nvme/hostnqn
|
||||
fi
|
||||
nvmf_hostid=$(getarg nvmf.hostid=)
|
||||
if [ -n "$nvmf_hostid" ] ; then
|
||||
echo "$nvmf_hostid" > /etc/nvme/hostid
|
||||
fi
|
||||
|
||||
for d in $(getargs nvmf.discover=); do
|
||||
parse_nvmf_discover "$d" || break
|
||||
done
|
||||
|
||||
# Host NQN and host id are mandatory for NVMe-oF
|
||||
[ -f "/etc/nvme/hostnqn" ] || exit 0
|
||||
[ -f "/etc/nvme/hostid" ] || exit 0
|
||||
|
||||
if [ -f "/etc/nvme/discovery.conf" ] ; then
|
||||
/sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
|
||||
if [ "$trtype" = "tcp" ] ; then
|
||||
> /tmp/net.$ifname.did-setup
|
||||
fi
|
||||
else
|
||||
# No nvme command line arguments present, try autodiscovery
|
||||
if [ "$trtype" = "fc" ] ; then
|
||||
/sbin/initqueue --finished --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh
|
||||
fi
|
||||
fi
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user