From a8d503e5b971b1c36648ec3d42d46f946f5b1bf4 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Mon, 23 Aug 2021 11:25:11 +0200 Subject: [PATCH] RHEL-85/90: modify the x86_64 EC2 images dracut configuration Change the x86_64-specific dracut configuration of RHEL-8.5 and RHEL-9.0 EC2 and AMI images to not include `xen-netfront` driver and add `nvme` driver, which was previously not included. Since the configuration is no longer Xen-specific, rename the configuration file to `ec2.conf`. Justification: There is no reason to put `xen-netfront` to initramfs as EC2 images don't boot from network root. In addition, add `nvme` driver to handle the case when initramfs is getting forcefully rebuild on a Xen instance (and not able to boot on Nitro after that). Related to https://issues.redhat.com/browse/COMPOSER-1096. Signed-off-by: Tomas Hozza --- internal/distro/rhel85/pipelines.go | 6 ++++-- internal/distro/rhel90/pipelines.go | 6 ++++-- test/data/manifests/rhel_85-x86_64-ami-boot.json | 4 ++-- test/data/manifests/rhel_85-x86_64-ec2-boot.json | 4 ++-- test/data/manifests/rhel_85-x86_64-ec2_ha-boot.json | 4 ++-- test/data/manifests/rhel_90-x86_64-ami-boot.json | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/distro/rhel85/pipelines.go b/internal/distro/rhel85/pipelines.go index 702870f68..3452f1079 100644 --- a/internal/distro/rhel85/pipelines.go +++ b/internal/distro/rhel85/pipelines.go @@ -389,11 +389,13 @@ func ec2X86_64BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.Packag } // EC2 x86_64-specific stages + // Add 'nvme' driver to handle the case when initramfs is getting forcefully + // rebuild on a Xen instance (and not able to boot on Nitro after that). treePipeline.AddStage(osbuild.NewDracutConfStage(&osbuild.DracutConfStageOptions{ - Filename: "xen.conf", + Filename: "ec2.conf", Config: osbuild.DracutConfigFile{ AddDrivers: []string{ - "xen-netfront", + "nvme", "xen-blkfront", }, }, diff --git a/internal/distro/rhel90/pipelines.go b/internal/distro/rhel90/pipelines.go index bd5ade2e7..3c4b7acd0 100644 --- a/internal/distro/rhel90/pipelines.go +++ b/internal/distro/rhel90/pipelines.go @@ -370,11 +370,13 @@ func ec2X86_64BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.Packag } // EC2 x86_64-specific stages + // Add 'nvme' driver to handle the case when initramfs is getting forcefully + // rebuild on a Xen instance (and not able to boot on Nitro after that). treePipeline.AddStage(osbuild.NewDracutConfStage(&osbuild.DracutConfStageOptions{ - Filename: "xen.conf", + Filename: "ec2.conf", Config: osbuild.DracutConfigFile{ AddDrivers: []string{ - "xen-netfront", + "nvme", "xen-blkfront", }, }, diff --git a/test/data/manifests/rhel_85-x86_64-ami-boot.json b/test/data/manifests/rhel_85-x86_64-ami-boot.json index 310a36010..a564f6193 100644 --- a/test/data/manifests/rhel_85-x86_64-ami-boot.json +++ b/test/data/manifests/rhel_85-x86_64-ami-boot.json @@ -1073,10 +1073,10 @@ { "type": "org.osbuild.dracut.conf", "options": { - "filename": "xen.conf", + "filename": "ec2.conf", "config": { "add_drivers": [ - "xen-netfront", + "nvme", "xen-blkfront" ] } diff --git a/test/data/manifests/rhel_85-x86_64-ec2-boot.json b/test/data/manifests/rhel_85-x86_64-ec2-boot.json index 4440dfe8c..f2e388c14 100644 --- a/test/data/manifests/rhel_85-x86_64-ec2-boot.json +++ b/test/data/manifests/rhel_85-x86_64-ec2-boot.json @@ -1077,10 +1077,10 @@ { "type": "org.osbuild.dracut.conf", "options": { - "filename": "xen.conf", + "filename": "ec2.conf", "config": { "add_drivers": [ - "xen-netfront", + "nvme", "xen-blkfront" ] } diff --git a/test/data/manifests/rhel_85-x86_64-ec2_ha-boot.json b/test/data/manifests/rhel_85-x86_64-ec2_ha-boot.json index 15e357b25..60dc2761c 100644 --- a/test/data/manifests/rhel_85-x86_64-ec2_ha-boot.json +++ b/test/data/manifests/rhel_85-x86_64-ec2_ha-boot.json @@ -1251,10 +1251,10 @@ { "type": "org.osbuild.dracut.conf", "options": { - "filename": "xen.conf", + "filename": "ec2.conf", "config": { "add_drivers": [ - "xen-netfront", + "nvme", "xen-blkfront" ] } diff --git a/test/data/manifests/rhel_90-x86_64-ami-boot.json b/test/data/manifests/rhel_90-x86_64-ami-boot.json index 67edf0330..fd4e5e4d3 100644 --- a/test/data/manifests/rhel_90-x86_64-ami-boot.json +++ b/test/data/manifests/rhel_90-x86_64-ami-boot.json @@ -973,10 +973,10 @@ { "type": "org.osbuild.dracut.conf", "options": { - "filename": "xen.conf", + "filename": "ec2.conf", "config": { "add_drivers": [ - "xen-netfront", + "nvme", "xen-blkfront" ] }