[Unstable][PATCH 2/2] UBUNTU: [Packaging] abi-check: Process modules.builtin

Juerg Haefliger juerg.haefliger at canonical.com
Tue May 11 07:28:34 UTC 2021


The previous commit introduced a new file modules.builtin that lists all
built-in modules. Take the content of that file into account during the ABI
check so that modules that changed from 'm' to 'y' don't result in a build
failure.

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian/scripts/module-check | 56 ++++++++++++++++++++++---------------
 1 file changed, 34 insertions(+), 22 deletions(-)

diff --git a/debian/scripts/module-check b/debian/scripts/module-check
index c754ea368cfb..fe2717044426 100755
--- a/debian/scripts/module-check
+++ b/debian/scripts/module-check
@@ -52,38 +52,50 @@ if (-f "$prev_abidir/../modules.ignore") {
 # Read new modules first
 print "   reading new modules...";
 $new_count = 0;
-open(NEW, "< $abidir/$flavour.modules") or
-	die "Could not open $abidir/$flavour.modules";
-while (<NEW>) {
-	chomp;
-	$modules{$_} = 1;
-	$new_count++;
+ at files = ("$abidir/$flavour.modules");
+if (-f "$abidir/$flavour.modules.builtin") {
+	push(@files, "$abidir/$flavour.modules.builtin");
+}
+for $file (@files) {
+	open(NEW, "< $file") or
+		die "Could not open $file";
+	while (<NEW>) {
+		chomp;
+		$modules{$_} = 1;
+		$new_count++;
+	}
+	close(NEW);
 }
-close(NEW);
 print "read $new_count modules.\n";
 
 # Now the old modules, checking for missing ones
 print "   reading old modules...";
 $old_count = 0;
-open(OLD, "< $prev_abidir/$flavour.modules") or
-	die "Could not open $prev_abidir/$flavour.modules";
-while (<OLD>) {
-	chomp;
-	if (not defined($modules{$_})) {
-		print "\n" if not $missing;
-		$missing++;
-		if (not defined($modules_ignore{$_})) {
-			print "      MISS: $_\n";
-			$errors++;
+ at files = ("$prev_abidir/$flavour.modules");
+if (-f "$prev_abidir/$flavour.modules.builtin") {
+	push(@files, "$prev_abidir/$flavour.modules.builtin");
+}
+for $file (@files) {
+	open(OLD, "< $file") or
+		die "Could not open $file";
+	while (<OLD>) {
+		chomp;
+		if (not defined($modules{$_})) {
+			print "\n" if not $missing;
+			$missing++;
+			if (not defined($modules_ignore{$_})) {
+				print "      MISS: $_\n";
+				$errors++;
+			} else {
+				print "      MISS: $_ (ignored)\n";
+			}
 		} else {
-			print "      MISS: $_ (ignored)\n";
+			$modules{$_}++;
 		}
-	} else {
-		$modules{$_}++;
+		$old_count++;
 	}
-	$old_count++;
+	close(OLD);
 }
-close(OLD);
 # Check for new modules
 foreach $mod (keys(%modules)) {
 	if ($modules{$mod} < 2) {
-- 
2.27.0




More information about the kernel-team mailing list