Repository: osbuild/osbuild-composer
Pull request #2856 (2022-07-26 08:34:04)

distro/rhel7: blacklist skx_edac,intel_cstate kernel modules on azure
This was done in RHEL 8, 9 but RHEL 7 was not yet merged so this was missed there. See e.g. 5c1530ee53fec2649eda24bd635e4a75275b12e2

See also  #2706 and #2717

jrusz: > warning This PR introduces changes in at least one manifest (when comparing PR HEAD 8061539f0c507be90b573a437b6dfb904d164f46 with the main merge-base [74bf3aa](https://github.com/osbuild/osbuild-composer/commit/74bf3aa3df5dfffd58fbe8085d84b10d20497851)). Please review the changes. The changes can be found in the [artifacts of the `Manifest-diff` job [0]](THE_URL/artifacts/browse) as `manifests.diff`.
> 
> [0] THE_URL/artifacts/browse

Ups, sorry, I didn't expect Shutzbot to write here from my VM.

Patch:
diff --git a/cmd/osbuild-service-maintenance/db.go b/cmd/osbuild-service-maintenance/db.go
index 79ce79399..548938d0e 100644
--- a/cmd/osbuild-service-maintenance/db.go
+++ b/cmd/osbuild-service-maintenance/db.go
@@ -131,6 +131,12 @@ func DBCleanup(dbURL string, dryRun bool, cutoff time.Time) error {
 			return err
 		}
 
+		err = db.VacuumAnalyze()
+		if err != nil {
+			logrus.Errorf("Error running vacuum analyze: %v", err)
+			return err
+		}
+
 		if rows == 0 {
 			break
 		}
@@ -138,11 +144,6 @@ func DBCleanup(dbURL string, dryRun bool, cutoff time.Time) error {
 		logrus.Infof("Deleted results for %d", rows)
 	}
 
-	err = db.VacuumAnalyze()
-	if err != nil {
-		logrus.Errorf("Error running vacuum analyze: %v", err)
-	}
-
 	err = db.LogVacuumStats()
 	if err != nil {
 		logrus.Errorf("Error running vacuum stats: %v", err)
diff --git a/internal/distro/rhel7/azure.go b/internal/distro/rhel7/azure.go
index 958406ce5..5210d9505 100644
--- a/internal/distro/rhel7/azure.go
+++ b/internal/distro/rhel7/azure.go
@@ -256,6 +256,24 @@ var azureRhuiImgType = imageType{
 			},
 		},
 		Modprobe: []*osbuild.ModprobeStageOptions{
+			{
+				Filename: "blacklist-amdgpu.conf",
+				Commands: osbuild.ModprobeConfigCmdList{
+					osbuild.NewModprobeConfigCmdBlacklist("amdgpu"),
+				},
+			},
+			{
+				Filename: "blacklist-intel-cstate.conf",
+				Commands: osbuild.ModprobeConfigCmdList{
+					osbuild.NewModprobeConfigCmdBlacklist("intel_cstate"),
+				},
+			},
+			{
+				Filename: "blacklist-floppy.conf",
+				Commands: osbuild.ModprobeConfigCmdList{
+					osbuild.NewModprobeConfigCmdBlacklist("floppy"),
+				},
+			},
 			{
 				Filename: "blacklist-nouveau.conf",
 				Commands: osbuild.ModprobeConfigCmdList{
@@ -264,9 +282,9 @@ var azureRhuiImgType = imageType{
 				},
 			},
 			{
-				Filename: "blacklist-floppy.conf",
+				Filename: "blacklist-skylake-edac.conf",
 				Commands: osbuild.ModprobeConfigCmdList{
-					osbuild.NewModprobeConfigCmdBlacklist("floppy"),
+					osbuild.NewModprobeConfigCmdBlacklist("skx_edac"),
 				},
 			},
 		},


Test patch:
diff --git a/test/data/manifests/rhel_7-x86_64-azure_rhui-boot.json b/test/data/manifests/rhel_7-x86_64-azure_rhui-boot.json
index 28ac15b54..0d9354750 100644
--- a/test/data/manifests/rhel_7-x86_64-azure_rhui-boot.json
+++ b/test/data/manifests/rhel_7-x86_64-azure_rhui-boot.json
@@ -2379,6 +2379,42 @@
               }
             }
           },
+          {
+            "type": "org.osbuild.modprobe",
+            "options": {
+              "filename": "blacklist-amdgpu.conf",
+              "commands": [
+                {
+                  "command": "blacklist",
+                  "modulename": "amdgpu"
+                }
+              ]
+            }
+          },
+          {
+            "type": "org.osbuild.modprobe",
+            "options": {
+              "filename": "blacklist-intel-cstate.conf",
+              "commands": [
+                {
+                  "command": "blacklist",
+                  "modulename": "intel_cstate"
+                }
+              ]
+            }
+          },
+          {
+            "type": "org.osbuild.modprobe",
+            "options": {
+              "filename": "blacklist-floppy.conf",
+              "commands": [
+                {
+                  "command": "blacklist",
+                  "modulename": "floppy"
+                }
+              ]
+            }
+          },
           {
             "type": "org.osbuild.modprobe",
             "options": {
@@ -2398,11 +2434,11 @@
           {
             "type": "org.osbuild.modprobe",
             "options": {
-              "filename": "blacklist-floppy.conf",
+              "filename": "blacklist-skylake-edac.conf",
               "commands": [
                 {
                   "command": "blacklist",
-                  "modulename": "floppy"
+                  "modulename": "skx_edac"
                 }
               ]
             }