Skip to contentSkip to conversation

scripts: make some scripts executable

PATCH In review Masahiro Yamada 3 participants 5 messages Jul 27, 2021 – Jul 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: make some scripts executable

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'.

The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/[email protected]/

---

 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh
scripts/checkdeclares.pl +0 -0
old mode 100644
new mode 100755
scripts/gcc-plugins/gen-random-seed.sh +0 -0
old mode 100644
new mode 100755
scripts/syscallnr.sh +0 -0
old mode 100644
new mode 100755
scripts/xen-hypercalls.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.27.0
#1 lore raw
Quoted 15 lines · Masahiro Yamada

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'.

The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/[email protected]/

---

Quoted 9 lines
 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

Please no, as other tools (i.e. patch), can not set mode bits, and some people still rely on patch in places.

If these need to be called by other parts of the build, we should execute them properly, not rely on the mode settings.

thanks,

greg k-h

#2 lore raw
Quoted 30 lines · Greg KH
Quoted 15 lines · Masahiro Yamada

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'.

The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/[email protected]/

---

Quoted 9 lines
 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

Please no, as other tools (i.e. patch), can not set mode bits, and some people still rely on patch in places.

Quoted 6 lines

If these need to be called by other parts of the build, we should execute them properly, not rely on the mode settings.

thanks,

greg k-h

I believe tools should be executable.

If the x bit were missing in scripts/checkpatch.pl for example, we would need to run 'perl scripts/checkpatch.pl' instead of 'scripts/checkpatch.pl'. That is annoying.

Most of the scripts under the scripts/ directory are already executable, and we rely on that fact. Some of them are run directly, and I do not hear from anyone who complains about that.

BTW, my 'patch' command on Ubuntu can handle the x bit. Doesn't it work on your 'patch' ?

masahiro@grover:~/x-bit-test$ ls -l test.sh
-rw-rw-r-- 1 masahiro masahiro 7 Jul 28 09:50 test.sh
masahiro@grover:~/x-bit-test$ cat set-x.patch
test.sh +0 -0
old mode 100644
new mode 100755
masahiro@grover:~/x-bit-test$ patch -p1 < set-x.patch
patching file test.sh
masahiro@grover:~/x-bit-test$ ls -l test.sh
-rwxr-xr-x 1 masahiro masahiro 7 Jul 28 09:51 test.sh

Even if it did not work on somebody's tools, the diff files are provided for bug-fix releases (for example, 5.13.x), not the entire source.

Developers (except Andrew Morton) use git to merge patches like this, so I see no issue on changing the mode.

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 51 lines · Masahiro Yamada
Quoted 29 lines · Greg KH
Quoted 14 lines · Masahiro Yamada

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'.>>>
The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/[email protected]/

---

Quoted 9 lines
 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

Please no, as other tools (i.e. patch), can not set mode bits, and some people still rely on patch in places.

Quoted 6 lines

If these need to be called by other parts of the build, we should execute them properly, not rely on the mode settings.

thanks,

greg k-h

I believe tools should be executable.

If the x bit were missing in scripts/checkpatch.pl for example, we would need to run 'perl scripts/checkpatch.pl' instead of 'scripts/checkpatch.pl'. That is annoying.

Most of the scripts under the scripts/ directory
are already executable, and we rely on that fact.
Some of them are run directly, and I do not hear
from anyone who complains about that.

...

Quoted 9 lines

Even if it did not work on somebody's tools, the diff files are provided for bug-fix releases (for example, 5.13.x), not the entire source.

Developers (except Andrew Morton) use git
to merge patches like this, so I see no issue
on changing the mode.

Sure, once the changes are in a git tree, it's not an issue, so I don't see a problem with it.
Someone may have to go a few weeks without such a change, but that's not a big deal.

Signature · 1 line
~Randy
#4 lore raw
In reply to Masahiro Yamada
Quoted 46 lines · Masahiro Yamada
Quoted 30 lines · Greg KH
Quoted 15 lines · Masahiro Yamada

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone. It should be executable since it is tedious to type 'perl scripts/checkdeclares.pl'.

The original patch [1] set the x bit properly, but it was lost when it was merged as commit 21917bded72c ("scripts: a new script for checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/[email protected]/

---

Quoted 9 lines
 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

Please no, as other tools (i.e. patch), can not set mode bits, and some people still rely on patch in places.

Quoted 6 lines

If these need to be called by other parts of the build, we should execute them properly, not rely on the mode settings.

thanks,

greg k-h

I believe tools should be executable.

If the x bit were missing in scripts/checkpatch.pl for example, we would need to run 'perl scripts/checkpatch.pl' instead of 'scripts/checkpatch.pl'. That is annoying.

Quoted 4 lines

Most of the scripts under the scripts/ directory
are already executable, and we rely on that fact.
Some of them are run directly, and I do not hear
from anyone who complains about that.

Ok, fair enough, I just run into problems when dealing with this with backports to stable trees, and I know Andrew has also had problems when dealing with patches like this.

Quoted 2 lines

BTW, my 'patch' command on Ubuntu can handle the
x bit. Doesn't it work on your 'patch' ?

Somehow quilt can not handle it, I do not know if that is a problem with patch not knowing how to read the git-generated-patch or not, but we have had issues in the past here.

thanks,

greg k-h