diff --git a/packer.conf b/packer.conf index 6571e8d..dafb071 100644 --- a/packer.conf +++ b/packer.conf @@ -67,8 +67,8 @@ builders = [ provisioners = [ { type = "file" - source = "../scripts/nvme/" - destination = "/tmp" + source = "../scripts/nvme-ebs-links" + destination = "/tmp/nvme-ebs-links" } { type = "shell" diff --git a/scripts/nvme/nvme-ebs-links b/scripts/nvme-ebs-links similarity index 100% rename from scripts/nvme/nvme-ebs-links rename to scripts/nvme-ebs-links diff --git a/scripts/nvme/nvme-ebs-mdev.conf b/scripts/nvme/nvme-ebs-mdev.conf deleted file mode 100644 index c30b6fd..0000000 --- a/scripts/nvme/nvme-ebs-mdev.conf +++ /dev/null @@ -1,3 +0,0 @@ -# ebs nvme links -nvme[0-9]+n[0-9]+.* root:root 0660 */lib/mdev/nvme-ebs-links - diff --git a/scripts/setup-ami b/scripts/setup-ami index aaa0472..1b43495 100755 --- a/scripts/setup-ami +++ b/scripts/setup-ami @@ -149,8 +149,12 @@ install_core_packages() { setup_mdev() { cp /tmp/nvme-ebs-links "$TARGET/lib/mdev" + # insert nvme ebs mdev configs just above "# fallback" comment - sed -n -i -e '/# fallback/r /tmp/nvme-ebs-mdev.conf' -e 1x -e '2,${x;p}' -e '${x;p}' "$TARGET/etc/mdev.conf" + sed -n -i \ + -e '/# fallback/i \\n# ebs nvme links\nnvme[0-9]+n[0-9]+.* root:root 0660 */lib/mdev/nvme-ebs-links' \ + -e 1x -e '2,${x;p}' -e '${x;p}' \ + "$TARGET/etc/mdev.conf" } create_initfs() {