]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scripts: get_feat.pl: substitute s390x with s390
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 12 Mar 2025 15:52:19 +0000 (16:52 +0100)
committerJonathan Corbet <corbet@lwn.net>
Wed, 12 Mar 2025 22:25:50 +0000 (16:25 -0600)
Both get_feat.pl and list-arch.sh use uname -m to get the machine hardware
name to figure out the current architecture if no architecture is specified
with a command line option.

This doesn't work for s390, since for 64 bit kernels the hardware name is
s390x, while the architecture name within the kernel, as well as in all
feature files is s390.

Therefore substitute s390x with s390 similar to what is already done for
x86_64 and i386.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250312155219.3597768-1-hca@linux.ibm.com
Documentation/features/list-arch.sh
scripts/get_feat.pl

index e73aa35848f077f439b2e4919be9caad956e27a5..ac8ff7f6f859e10f409dd55b76244f05f1695181 100755 (executable)
@@ -6,6 +6,6 @@
 # (If no arguments are given then it will print the host architecture's status.)
 #
 
-ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')}
+ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/')}
 
 $(dirname $0)/../../scripts/get_feat.pl list --arch $ARCH
index 5c5397eeb237db7eb21e6257fc7d7e029b9b4d73..40fb28c8424edfb47b367b6c05df9db7cc2d3a98 100755 (executable)
@@ -512,13 +512,13 @@ print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug);
 # Handles the command
 #
 if ($cmd eq "current") {
-       $arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/');
+       $arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/');
        $arch =~s/\s+$//;
 }
 
 if ($cmd eq "ls" or $cmd eq "list") {
        if (!$arch) {
-               $arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/');
+               $arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/');
                $arch =~s/\s+$//;
        }