Skip to content

Commit 78da89c

Browse files
hcahcaJonathan Corbet
authored andcommitted
scripts: get_feat.pl: substitute s390x with s390
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 <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 19b100b commit 78da89c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/features/list-arch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# (If no arguments are given then it will print the host architecture's status.)
77
#
88

9-
ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')}
9+
ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/')}
1010

1111
$(dirname $0)/../../scripts/get_feat.pl list --arch $ARCH

scripts/get_feat.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,13 @@ sub output_matrix {
512512
# Handles the command
513513
#
514514
if ($cmd eq "current") {
515-
$arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/');
515+
$arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/');
516516
$arch =~s/\s+$//;
517517
}
518518

519519
if ($cmd eq "ls" or $cmd eq "list") {
520520
if (!$arch) {
521-
$arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/');
521+
$arch = qx(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/' | sed 's/s390x/s390/');
522522
$arch =~s/\s+$//;
523523
}
524524

0 commit comments

Comments
 (0)