]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
lib/raid6/test: fix build on distros whose /bin/sh is not bash
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 26 Mar 2020 08:00:49 +0000 (17:00 +0900)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:41:37 +0000 (10:41 +0200)
commit2d57f797585ba675e22e29c0e0bc5d89548200f5
tree82ff9ae5f6b621bffd20ceef925c59b1e95af62b
parent039f3282b0fed33ca9de0bf4936c69a53ad9a4b8
lib/raid6/test: fix build on distros whose /bin/sh is not bash

BugLink: https://bugs.launchpad.net/bugs/1876361
[ Upstream commit 06bd48b6cd97ef3889b68c8e09014d81dbc463f1 ]

You can build a user-space test program for the raid6 library code,
like this:

  $ cd lib/raid6/test
  $ make

The command in $(shell ...) function is evaluated by /bin/sh by default.
(or, you can specify the shell by passing SHELL=<shell> from command line)

Currently '>&/dev/null' is used to sink both stdout and stderr. Because
this code is bash-ism, it only works when /bin/sh is a symbolic link to
bash (this is the case on RHEL etc.)

This does not work on Ubuntu where /bin/sh is a symbolic link to dash.

I see lots of

  /bin/sh: 1: Syntax error: Bad fd number

and

  warning "your version of binutils lacks ... support"

Replace it with portable '>/dev/null 2>&1'.

Fixes: 4f8c55c5ad49 ("lib/raid6: build proper files on corresponding arch")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
lib/raid6/test/Makefile