Comments (11)
from toybox.
If /bin/bash isn't a reliable absolute path, why would /usr/bin/env be a reliable absolute path?
Toybox has scripts/prereq/build.sh to produce prerequisite commands in a portable way (commit 3bbc31c has an example invocation used to build toybox outside homebrew on macos, for example). It doesn't include toysh yet because it's still in pending, but once that's promoted it should include that and you should be able to "sh scripts/make.sh". There's a planned rewrite/replacement of kconfig that should also allow .config file generation to run portably.
It's not finished yet, but that's the plan.
from toybox.
Because not all people have installed bash at /bin/bash. And an error message that reads: make: scripts/genconfig.sh: No such file or directory
when scripts/genconfig.sh DOES indeed exist is not quite useful for such people (me including).
/usr/bin/env should be used if you want to run under bash
because env will lookup bash
in the user's $PATH and run it.
For example, I have bash under ~/.local/bin
because my package manager (bigdl
) installed it there when I ran it as a user.
from toybox.
If /bin/bash can't be trusted to be at that location, why would /usr/bin/env be any different?
from toybox.
If /bin/bash can't be trusted to be at that location, why would /usr/bin/env be any different?
Because env searches your path, doing a direct /bin/bash does not, doing
bash scripts/make.sh
either directly or telling the makefile to do it would work I think.
from toybox.
Because env searches your path, doing a direct /bin/bash does not, doing
his point is "if /bin/bash
isn't there, what reason do i have to assume /usr/bin/env
exists?".
from toybox.
from toybox.
env is a pretty standard POSIX utility that’s on most-everything that runs UNIX, bash is not
Absolutely! But that's not the problem, since Landley wants to use Bash syntax, the only problem is that some people may have bash installed in other directories. For example; I wouldn't install software such as Bash into my system, instead, I put such software under ~/.local/bin or /opt/compat/*
from toybox.
The solution is to tell your makefile to run a scriptwith bash (Searches path) instead of calling the shebang.
The following diff fixes this:
@@ -14,7 +14,7 @@ all: toybox
KCONFIG_CONFIG ?= .config
toybox generated/unstripped/toybox: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*/*.c scripts/*.sh Config.in
- scripts/make.sh
+ bash scripts/make.sh
.PHONY: clean distclean baseline bloatcheck install install_flat \
uninstall uninstall_flat tests help change \
@@ -32,7 +32,7 @@ $(KCONFIG_CONFIG): $(KCONFIG_TOP)
$(KCONFIG_TOP): generated/Config.in generated/Config.probed
generated/Config.probed: generated/Config.in
generated/Config.in: toys/*/*.c scripts/genconfig.sh
- scripts/genconfig.sh
+ bash scripts/genconfig.sh
# Development targets
baseline: generated/unstripped/toybox
from toybox.
Its the same. However, it is better to fix the scripts shebang instead of modifying the Makefile to call them with bash
.
from toybox.
See previous discussion here: #77
from toybox.
Related Issues (20)
- Request diff -I/--ignore-matching-lines
- [Documentation] Differences to busybox? HOT 3
- [Feature request] Could a static-option be added to the menu interface? HOT 5
- [Documentation / Question] Can toybox be combined with e. g. mruby? HOT 9
- building a rootfs without a kernel HOT 10
- [Q] Can `bash` compatibility in toysh be turned off during build time and during run time? HOT 2
- building 0.8.11 with ssl and tls is broken HOT 15
- When running shell scripts, the process coredump.
- POSIX deviation: test arithmetic operands must support decimal only HOT 12
- find -size <number-without-suffix> not POSIX HOT 7
- Can you include oksh? HOT 1
- On incremental builds' reproducibility HOT 1
- ASAN failures in various file processing commands HOT 2
- [Feature Suggestion] progress meter (pv subcommand) HOT 5
- [FR] envsubst HOT 4
- getty: does not display issue HOT 1
- command unshare broken HOT 1
- tar honor umask test fails on Android HOT 4
- Building Toybox for J2 Turtleboard fails since 650ff11a HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toybox.