Skip to contentSkip to conversation

tools/configure: drop BASH configure variable

PATCH Superseded Andrew Cooper 4 participants 13 messages Jun 26, 2020 – Jul 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/configure: drop BASH configure variable

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Daniel De Graaf <[email protected]>
CC: Paul Durrant <[email protected]>

./autogen.sh needs rerunning on commit.

RFC for 4.14. This is a cleanup to the build system.

There is a separate check for [BASH] in the configure script, which is checking the requirement for the Linux hotplug scripts. Really, that is a runtime requirement not a build time requirement, and it is rude to require bash in a build environment on this basis. IMO, that check wants dropping as well.

---
 config/Tools.mk.in                      | 1 -
 tools/configure.ac                      | 1 -
 xen/xsm/flask/Makefile                  | 8 ++------
 xen/xsm/flask/policy/mkaccess_vector.sh | 0
 xen/xsm/flask/policy/mkflask.sh         | 0
 5 files changed, 2 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 xen/xsm/flask/policy/mkaccess_vector.sh
 mode change 100644 => 100755 xen/xsm/flask/policy/mkflask.sh
config/Tools.mk.in +0 -1
index 23df47af8d..48bd9ab731 100644
@@ -12,7 +12,6 @@ PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
 PY_NOOPT_CFLAGS     := @PY_NOOPT_CFLAGS@
 PERL                := @PERL@
-BASH                := @BASH@
 XGETTTEXT           := @XGETTEXT@
 AS86                := @AS86@
 LD86                := @LD86@
tools/configure.ac +0 -1
index 9d126b7a14..6614a4f130 100644
@@ -297,7 +297,6 @@ AC_ARG_VAR([PYTHON], [Path to the Python parser])
 AC_ARG_VAR([PERL], [Path to Perl parser])
 AC_ARG_VAR([BISON], [Path to Bison parser generator])
 AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
-AC_ARG_VAR([BASH], [Path to bash shell])
 AC_ARG_VAR([XGETTEXT], [Path to xgetttext tool])
 AC_ARG_VAR([AS86], [Path to as86 tool])
 AC_ARG_VAR([LD86], [Path to ld86 tool])
xen/xsm/flask/Makefile +2 -6
index 07f36d075d..ba8f31a02c 100644
@@ -8,10 +8,6 @@ CFLAGS-y += -I./include
 
 AWK = awk
 
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
 FLASK_H_DEPEND = policy/security_classes policy/initial_sids
 AV_H_DEPEND = policy/access_vectors
 
@@ -24,14 +20,14 @@ extra-y += $(ALL_H_FILES)
 
 mkflask := policy/mkflask.sh
 quiet_cmd_mkflask = MKFLASK $@
-cmd_mkflask = $(CONFIG_SHELL) $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
+cmd_mkflask = $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
 
 $(subst include/,%/,$(FLASK_H_FILES)): $(FLASK_H_DEPEND) $(mkflask) FORCE
 	$(call if_changed,mkflask)
 
 mkaccess := policy/mkaccess_vector.sh
 quiet_cmd_mkaccess = MKACCESS VECTOR $@
-cmd_mkaccess = $(CONFIG_SHELL) $(mkaccess) $(AWK) $(AV_H_DEPEND)
+cmd_mkaccess = $(mkaccess) $(AWK) $(AV_H_DEPEND)
 
 $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 	$(call if_changed,mkaccess)
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.11.0
#1 lore raw
Quoted 24 lines

-----Original Message-----
From: Andrew Cooper <[email protected]>
Sent: 26 June 2020 18:01
To: Xen-devel <[email protected]>
Cc: Andrew Cooper <[email protected]>; Ian Jackson <[email protected]>; Wei Liu <[email protected]>; Daniel De Graaf <[email protected]>; Paul Durrant <[email protected]>
Subject: [PATCH] tools/configure: drop BASH configure variable

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Daniel De Graaf <[email protected]>
CC: Paul Durrant <[email protected]>

./autogen.sh needs rerunning on commit.

Quoted 7 lines

RFC for 4.14. This is a cleanup to the build system.

There is a separate check for [BASH] in the configure script, which is checking the requirement for the Linux hotplug scripts. Really, that is a runtime requirement not a build time requirement, and it is rude to require bash in a build environment on this basis. IMO, that check wants dropping as well.

That sounds quite reasonable.

Quoted 74 lines
---
 config/Tools.mk.in                      | 1 -
 tools/configure.ac                      | 1 -
 xen/xsm/flask/Makefile                  | 8 ++------
 xen/xsm/flask/policy/mkaccess_vector.sh | 0
 xen/xsm/flask/policy/mkflask.sh         | 0
 5 files changed, 2 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 xen/xsm/flask/policy/mkaccess_vector.sh
 mode change 100644 => 100755 xen/xsm/flask/policy/mkflask.sh
config/Tools.mk.in +0 -1
index 23df47af8d..48bd9ab731 100644
@@ -12,7 +12,6 @@ PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
 PY_NOOPT_CFLAGS     := @PY_NOOPT_CFLAGS@
 PERL                := @PERL@
-BASH                := @BASH@
 XGETTTEXT           := @XGETTEXT@
 AS86                := @AS86@
 LD86                := @LD86@
tools/configure.ac +0 -1
index 9d126b7a14..6614a4f130 100644
@@ -297,7 +297,6 @@ AC_ARG_VAR([PYTHON], [Path to the Python parser])
 AC_ARG_VAR([PERL], [Path to Perl parser])
 AC_ARG_VAR([BISON], [Path to Bison parser generator])
 AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
-AC_ARG_VAR([BASH], [Path to bash shell])
 AC_ARG_VAR([XGETTEXT], [Path to xgetttext tool])
 AC_ARG_VAR([AS86], [Path to as86 tool])
 AC_ARG_VAR([LD86], [Path to ld86 tool])
xen/xsm/flask/Makefile +2 -6
index 07f36d075d..ba8f31a02c 100644
@@ -8,10 +8,6 @@ CFLAGS-y += -I./include
 
 AWK = awk
 
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
 FLASK_H_DEPEND = policy/security_classes policy/initial_sids
 AV_H_DEPEND = policy/access_vectors
 
@@ -24,14 +20,14 @@ extra-y += $(ALL_H_FILES)
 
 mkflask := policy/mkflask.sh
 quiet_cmd_mkflask = MKFLASK $@
-cmd_mkflask = $(CONFIG_SHELL) $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
+cmd_mkflask = $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
 
 $(subst include/,%/,$(FLASK_H_FILES)): $(FLASK_H_DEPEND) $(mkflask) FORCE
 	$(call if_changed,mkflask)
 
 mkaccess := policy/mkaccess_vector.sh
 quiet_cmd_mkaccess = MKACCESS VECTOR $@
-cmd_mkaccess = $(CONFIG_SHELL) $(mkaccess) $(AWK) $(AV_H_DEPEND)
+cmd_mkaccess = $(mkaccess) $(AWK) $(AV_H_DEPEND)
 
 $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 	$(call if_changed,mkaccess)
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -1
old mode 100644
new mode 100755
--

2.11.0

#2 lore raw
In reply to Andrew Cooper

xen/xsm/flask/Makefile extra-y += $(ALL_H_FILES) · line 23

Quoted 6 lines · Andrew Cooper
xen/xsm/flask/Makefile +1 -1
@@ -24,14 +20,14 @@ extra-y += $(ALL_H_FILES)
 
 mkflask := policy/mkflask.sh
 quiet_cmd_mkflask = MKFLASK $@
-cmd_mkflask = $(CONFIG_SHELL) $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
+cmd_mkflask = $(mkflask) $(AWK) include $(FLASK_H_DEPEND)

This and ...

xen/xsm/flask/Makefile extra-y += $(ALL_H_FILES) · line 30

Quoted 7 lines
xen/xsm/flask/Makefile +1 -1
 $(subst include/,%/,$(FLASK_H_FILES)): $(FLASK_H_DEPEND) $(mkflask) FORCE
 	$(call if_changed,mkflask)
 
 mkaccess := policy/mkaccess_vector.sh
 quiet_cmd_mkaccess = MKACCESS VECTOR $@
-cmd_mkaccess = $(CONFIG_SHELL) $(mkaccess) $(AWK) $(AV_H_DEPEND)
+cmd_mkaccess = $(mkaccess) $(AWK) $(AV_H_DEPEND)

... this should still use $(SHELL) though, as ...

xen/xsm/flask/policy/mkflask.sh

Quoted 6 lines
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -0
old mode 100644
new mode 100755

... this may or may not take effect on the file system the sources are stored on.

Jan

#3 lore raw

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 10 lines · Andrew Cooper

xen/xsm/flask/policy/mkflask.sh

Quoted 6 lines
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -0
old mode 100644
new mode 100755

... this may or may not take effect on the file system the sources are stored on.

In what circumstances might this not take effect ?

IME all changes to files are properly replicated by git. Tarball distributions replicate the permissions of course.

The only difficulty would be if this change were to be carried as a patch somewhere, by a downstream, but that seems unlikely, and can be avoided by that downstream not taking this patch.

Ian.

#4 lore raw
Quoted 12 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 10 lines · Andrew Cooper

xen/xsm/flask/policy/mkflask.sh

Quoted 6 lines
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -0
old mode 100644
new mode 100755

... this may or may not take effect on the file system the sources are stored on.

Quoted 1 line

In what circumstances might this not take effect ?

When the file system is incapable of recording execute permissions? It has been a common workaround for this in various projects that I've worked with to use $(SHELL) to account for that, so the actual permissions from the fs don't matter. (There may be mount options to make everything executable on such file systems, but people may be hesitant to use them.)

Jan

Quoted 9 lines

IME all changes to files are properly replicated by git. Tarball distributions replicate the permissions of course.

The only difficulty would be if this change were to be carried as a patch somewhere, by a downstream, but that seems unlikely, and can be avoided by that downstream not taking this patch.

Ian.

Acked-by
#5 lore raw

Re: [PATCH] tools/configure: drop BASH configure variable [and 1 more messages]

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 6 lines · Ian Jackson
Quoted 5 lines

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines · Andrew Cooper

... this may or may not take effect on the file system the sources are stored on.

Quoted 8 lines
Quoted 1 line

In what circumstances might this not take effect ?

When the file system is incapable of recording execute permissions? It has been a common workaround for this in various projects that I've worked with to use $(SHELL) to account for that, so the actual permissions from the fs don't matter. (There may be mount options to make everything executable on such file systems, but people may be hesitant to use them.)

I don't think we support building from sources which have been unpacked onto such filesystems. Other projects which might actually need to build on Windows or something do do this $(SHELL) thing or an equivalent, but I don't think that's us.

But obviously that opinion of mine is not a blocker for Andy's patch since Andy is going in the right direction, regardless.

Andrew Cooper writes ("[PATCH v2] tools/configure: drop BASH configure variable"):

Quoted 6 lines

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

Quoted 5 lines · In response to this commit message, I wrote:
Quoted 5 lines

Andrew Cooper writes ("[PATCH] tools/configure: drop BASH configure variable"):
Thanks for this cleanup. I agree with the basic idea.

However, did you run these scripts with dash, or review them, to check for bashisms ?

And you replied:

Quoted 4 lines

Yes, to all of the above.

They are both very thin wrappers (doing some argument shuffling) around large AWK scripts.

Can you please put this information in the commit message where it belongs ? As a rule we should know in future what we were thinking when a change was made, and as I say "are shebang sh anyway, so don't need bash in the first place" is weak evidence.

With that change,

Thanks,
Ian.

#6 lore raw

Re: [PATCH] tools/configure: drop BASH configure variable [and 1 more messages]

Quoted 16 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 6 lines · Ian Jackson
Quoted 5 lines

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines · Andrew Cooper

... this may or may not take effect on the file system the sources are stored on.

Quoted 8 lines
Quoted 1 line

In what circumstances might this not take effect ?

When the file system is incapable of recording execute permissions? It has been a common workaround for this in various projects that I've worked with to use $(SHELL) to account for that, so the actual permissions from the fs don't matter. (There may be mount options to make everything executable on such file systems, but people may be hesitant to use them.)

Quoted 4 lines

I don't think we support building from sources which have been unpacked onto such filesystems. Other projects which might actually need to build on Windows or something do do this $(SHELL) thing or an equivalent, but I don't think that's us.

It's not unexpected that you think of Windows here, but my thoughts were more towards building from sources on a CD or DVD, where iirc execute permissions also don't exist. The latest when we have out-of-tree builds fully working, this ought to be something that people should be able to do, imo. (Even without out-of-tree builds, my "next best" alternative of using a tree of symlinks to build in would similarly have an issue with the links pointing at a mounted CD/DVD, if the $(SHELL) wasn't present.)

Jan

#7 lore raw

Re: [PATCH] tools/configure: drop BASH configure variable [and 1 more messages]

Quoted 18 lines · Jan Beulich
Quoted 13 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 5 lines · Ian Jackson
Quoted 4 lines

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines · Andrew Cooper

... this may or may not take effect on the file system the sources are stored on.

Quoted 7 lines
Quoted 1 line

In what circumstances might this not take effect ?

When the file system is incapable of recording execute permissions? It has been a common workaround for this in various projects that I've worked with to use $(SHELL) to account for that, so the actual permissions from the fs don't matter. (There may be mount options to make everything executable on such file systems, but people may be hesitant to use them.)

Quoted 4 lines

I don't think we support building from sources which have been unpacked onto such filesystems. Other projects which might actually need to build on Windows or something do do this $(SHELL) thing or an equivalent, but I don't think that's us.

Quoted 8 lines

It's not unexpected that you think of Windows here, but my thoughts were more towards building from sources on a CD or DVD, where iirc execute permissions also don't exist. The latest when we have out-of-tree builds fully working, this ought to be something that people should be able to do, imo. (Even without out-of-tree builds, my "next best" alternative of using a tree of symlinks to build in would similarly have an issue with the links pointing at a mounted CD/DVD, if the $(SHELL) wasn't present.)

See v2.  I put $(SHELL) in, because it isn't a worthwhile use of our time to continue arguing over this point.

~Andrew

#8 lore raw

Re: [PATCH] tools/configure: drop BASH configure variable [and 1 more messages]

Quoted 28 lines · Andrew Cooper
Quoted 18 lines · Jan Beulich
Quoted 13 lines · Ian Jackson

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 5 lines · Ian Jackson
Quoted 4 lines

Jan Beulich writes ("Re: [PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines · Andrew Cooper

... this may or may not take effect on the file system the sources are stored on.

Quoted 7 lines
Quoted 1 line

In what circumstances might this not take effect ?

When the file system is incapable of recording execute permissions? It has been a common workaround for this in various projects that I've worked with to use $(SHELL) to account for that, so the actual permissions from the fs don't matter. (There may be mount options to make everything executable on such file systems, but people may be hesitant to use them.)

Quoted 4 lines

I don't think we support building from sources which have been unpacked onto such filesystems. Other projects which might actually need to build on Windows or something do do this $(SHELL) thing or an equivalent, but I don't think that's us.

Quoted 8 lines

It's not unexpected that you think of Windows here, but my thoughts were more towards building from sources on a CD or DVD, where iirc execute permissions also don't exist. The latest when we have out-of-tree builds fully working, this ought to be something that people should be able to do, imo. (Even without out-of-tree builds, my "next best" alternative of using a tree of symlinks to build in would similarly have an issue with the links pointing at a mounted CD/DVD, if the $(SHELL) wasn't present.)

Quoted 2 lines

See v2.  I put $(SHELL) in, because it isn't a worthwhile use of our time to continue arguing over this point.

I had seen you did; I was merely replying back to Ian's comments.

Jan

#9 lore raw

PATCH 1/1 tools/configure: drop BASH configure variable

In reply to Andrew Cooper

Andrew Cooper writes ("[PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Thanks for this cleanup. I agree with the basic idea.

However, did you run these scripts with dash, or review them, to check for bashisms ? It is not unusual to find scripts which need bash but which mistaken have #!/bin/sh - especially if the usual arrangements for running them always use bash anyway. So the presence of the #!/bin/sh is only rather weak evidence that these scripts will be fine when run with sh.

Quoted 2 lines

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

Since the build currently uses bash for these, a more neutral change would be to change to #!/bin/bash at the same time.

Quoted 1 line

RFC for 4.14. This is a cleanup to the build system.

I see this already has a release-ack. However, I would not have recommended granting one at least on the basis of the description above.

I agree that this is cleanup. But the current situation is not buggy. I'm not sure exactly what the release criteria are but ISTM that this patch adds risk to the release rather than removing it.

Thanks for your attention.

Ian.

#10 lore raw
Quoted 8 lines · Ian Jackson

Andrew Cooper writes ("[PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Thanks for this cleanup. I agree with the basic idea.

However, did you run these scripts with dash, or review them, to check for bashisms ?

Yes, to all of the above.

They are both very thin wrappers (doing some argument shuffling) around large AWK scripts.

Quoted 4 lines
Quoted 2 lines

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

Since the build currently uses bash for these, a more neutral change would be to change to #!/bin/bash at the same time.

That will break FreeBSD, which has no bash in sight.

Quoted 8 lines
Quoted 1 line

RFC for 4.14. This is a cleanup to the build system.

I see this already has a release-ack. However, I would not have recommended granting one at least on the basis of the description above.

I agree that this is cleanup. But the current situation is not buggy. I'm not sure exactly what the release criteria are but ISTM that this patch adds risk to the release rather than removing it.

I agree that the current state of play isn't a major issue, but having ./configure check for bash is buggy for both uses.

~Andrew

#11 lore raw
Quoted 35 lines

-----Original Message-----
From: Andrew Cooper <[email protected]>
Sent: 29 June 2020 14:51
To: Ian Jackson <[email protected]>
Cc: Xen-devel <[email protected]>; Wei Liu <[email protected]>; Daniel De Graaf <[email protected]>; Paul Durrant <[email protected]>
Subject: Re: [PATCH] tools/configure: drop BASH configure variable

Quoted 8 lines · Ian Jackson

Andrew Cooper writes ("[PATCH] tools/configure: drop BASH configure variable"):

Quoted 3 lines

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Thanks for this cleanup. I agree with the basic idea.

However, did you run these scripts with dash, or review them, to check for bashisms ?

Yes, to all of the above.

They are both very thin wrappers (doing some argument shuffling) around large AWK scripts.

Quoted 4 lines
Quoted 2 lines

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

Since the build currently uses bash for these, a more neutral change would be to change to #!/bin/bash at the same time.

That will break FreeBSD, which has no bash in sight.

Quoted 5 lines
Quoted 1 line

RFC for 4.14. This is a cleanup to the build system.

I see this already has a release-ack. However, I would not have recommended granting one at least on the basis of the description above.

Quoted 7 lines
Quoted 3 lines

I agree that this is cleanup. But the current situation is not buggy. I'm not sure exactly what the release criteria are but ISTM that this patch adds risk to the release rather than removing it.

I agree that the current state of play isn't a major issue, but having ./configure check for bash is buggy for both uses.

Even if it is not buggy, it is pointless complexity since FreeBSD would clearly have been broken all this time had there been bash-isms in the scripts.

Paul

Quoted 1 line

~Andrew

#12 lore raw

PATCH v2 1/1 tools/configure: drop BASH configure variable

This is a weird variable to have in the first place. The only user of it is XSM's CONFIG_SHELL, which opencodes a fallback to sh, and the only two scripts run with this are shebang sh anyway, so don't need bash in the first place.

Make the mkflask.sh and mkaccess_vector.sh scripts executable, drop the CONFIG_SHELL, and drop the $BASH variable to prevent further use.

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Daniel De Graaf <[email protected]>

./autogen.sh needs rerunning on commit.

v2:
* Use $(SHELL)

There is a separate check for [BASH] in the configure script, which is checking the requirement for the Linux hotplug scripts. Really, that is a runtime requirement not a build time requirement, and it is rude to require bash in a build environment on this basis. IMO, that check wants dropping as well.

---
 config/Tools.mk.in                      | 1 -
 tools/configure.ac                      | 1 -
 xen/xsm/flask/Makefile                  | 8 ++------
 xen/xsm/flask/policy/mkaccess_vector.sh | 0
 xen/xsm/flask/policy/mkflask.sh         | 0
 5 files changed, 2 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 xen/xsm/flask/policy/mkaccess_vector.sh
 mode change 100644 => 100755 xen/xsm/flask/policy/mkflask.sh
config/Tools.mk.in +0 -1
index 23df47af8d..48bd9ab731 100644
@@ -12,7 +12,6 @@ PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
 PY_NOOPT_CFLAGS     := @PY_NOOPT_CFLAGS@
 PERL                := @PERL@
-BASH                := @BASH@
 XGETTTEXT           := @XGETTEXT@
 AS86                := @AS86@
 LD86                := @LD86@
tools/configure.ac +0 -1
index 9d126b7a14..6614a4f130 100644
@@ -297,7 +297,6 @@ AC_ARG_VAR([PYTHON], [Path to the Python parser])
 AC_ARG_VAR([PERL], [Path to Perl parser])
 AC_ARG_VAR([BISON], [Path to Bison parser generator])
 AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
-AC_ARG_VAR([BASH], [Path to bash shell])
 AC_ARG_VAR([XGETTEXT], [Path to xgetttext tool])
 AC_ARG_VAR([AS86], [Path to as86 tool])
 AC_ARG_VAR([LD86], [Path to ld86 tool])
xen/xsm/flask/Makefile +2 -6
index 07f36d075d..50bec20a1e 100644
@@ -8,10 +8,6 @@ CFLAGS-y += -I./include
 
 AWK = awk
 
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-          else if [ -x /bin/bash ]; then echo /bin/bash; \
-          else echo sh; fi ; fi)
-
 FLASK_H_DEPEND = policy/security_classes policy/initial_sids
 AV_H_DEPEND = policy/access_vectors
 
@@ -24,14 +20,14 @@ extra-y += $(ALL_H_FILES)
 
 mkflask := policy/mkflask.sh
 quiet_cmd_mkflask = MKFLASK $@
-cmd_mkflask = $(CONFIG_SHELL) $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
+cmd_mkflask = $(SHELL) $(mkflask) $(AWK) include $(FLASK_H_DEPEND)
 
 $(subst include/,%/,$(FLASK_H_FILES)): $(FLASK_H_DEPEND) $(mkflask) FORCE
 	$(call if_changed,mkflask)
 
 mkaccess := policy/mkaccess_vector.sh
 quiet_cmd_mkaccess = MKACCESS VECTOR $@
-cmd_mkaccess = $(CONFIG_SHELL) $(mkaccess) $(AWK) $(AV_H_DEPEND)
+cmd_mkaccess = $(SHELL) $(mkaccess) $(AWK) $(AV_H_DEPEND)
 
 $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 	$(call if_changed,mkaccess)
xen/xsm/flask/policy/mkaccess_vector.sh +0 -0
old mode 100644
new mode 100755
xen/xsm/flask/policy/mkflask.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.11.0