forked from amazonlinux/amazon-ec2-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds support for early boot by creating a Dracut module and rewriting the ebsnvme-id script in Bash using nvme-cli >= 1.13 (not provided by Amazon Linux). It also changes the udev rules so they use udev env vars to set the block device mapping up, which should make the rules more resilient on failure.
- Loading branch information
1 parent
8daaae9
commit c5c593c
Showing
9 changed files
with
336 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.rpm | ||
*.tar | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the MIT License. See the LICENSE accompanying this file | ||
# for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
RPM_BUILD_DIR := $(shell mktemp -d /tmp/amazon-linux-utils.rpm-XXXXXXXX) | ||
|
||
.PHONY: rpm | ||
rpm: | ||
git archive --format=tar HEAD > amazon-ec2-utils.tar | ||
gzip -f -9 amazon-ec2-utils.tar | ||
rpmbuild --define "%_topdir $(RPM_BUILD_DIR)" -ta amazon-ec2-utils.tar.gz -v | ||
cp -fv $(RPM_BUILD_DIR)/RPMS/**/*.rpm $(RPM_BUILD_DIR)/SRPMS/*.rpm . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the MIT License. See the LICENSE accompanying this file | ||
# for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
add_dracutmodules+=" ec2-utils " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the MIT License. See the LICENSE accompanying this file | ||
# for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
# called by dracut | ||
check() { | ||
# don't install this module unless the configuration explicitly requests it | ||
return 255 | ||
} | ||
|
||
# called by dracut | ||
depends() { | ||
echo bash udev-rules | ||
return 0 | ||
} | ||
|
||
# called by dracut | ||
install() { | ||
# Install udev rules | ||
inst_rules \ | ||
51-ec2-hvm-devices.rules \ | ||
51-ec2-xen-vbd-devices.rules \ | ||
53-ec2-read-ahead-kb.rules \ | ||
70-ec2-nvme-devices.rules | ||
|
||
# Install scripts | ||
inst_multiple \ | ||
ebsnvme-id \ | ||
ec2nvme-nsid \ | ||
ec2udev-vbd | ||
} |
Oops, something went wrong.