0fe536b797
With BR2_REPRODUCIBLE, our 'fakedate' wrapper script will end up in host/bin/date. Currently, it iterates over all the 'date' found in PATH, until it finds one that is not the script itself, in an attempt to avoid infinite recursion by calling itself again and again. This heuristic works OK in Buildroot, because host/bin/ is first in the PATH, and so that means the first entry in the PATH is skipped. However, this is going to fail as soon as our wrapper is not the first in the PATH. Indeed, in that situation, the current heuristic will stop on the first 'date' in the PATH, as it is not the script itself, and since our script was executed, that probably means the first 'date' was itself a wrapper that ended up calling us. So, calling it again will eventually trickle to calling us again, and thus creating the loop our heuristic was made to avoid. This situation currently does not occur in Buildroot, because host/bin/ is first, *and* we have no package that provide their own 'date' wrapper during their build steps. But when we generate an SDK with BR2_REPRODUCIBLE, then our wrapper script will be in sdk/bin/, and there is no longer any guarantee this comes first in the PATH, thus opening the possibility that another buildsystem based on our SDK, but which has its own 'date' wrapper, will trigger this infinite recursion. We fix that by iterating, in reverse order, over all the 'date' we can find in PATH, and when we find ourselves, then we know the one we found in the iteration just before is the one that we should call. 'which -a' is old enough that we can expect it to be always available; it has been present at least since Debian Squeeze, released 2011. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> |
||
---|---|---|
arch | ||
board | ||
boot | ||
configs | ||
docs | ||
fs | ||
linux | ||
package | ||
support | ||
system | ||
toolchain | ||
utils | ||
.defconfig | ||
.flake8 | ||
.gitignore | ||
.gitlab-ci.yml | ||
CHANGES | ||
Config.in | ||
Config.in.legacy | ||
COPYING | ||
DEVELOPERS | ||
Makefile | ||
Makefile.legacy | ||
README |
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. The documentation can be found in docs/manual. You can generate a text document with 'make manual-text' and read output/docs/manual/manual.text. Online documentation can be found at http://buildroot.org/docs.html To build and use the buildroot stuff, do the following: 1) run 'make menuconfig' 2) select the target architecture and the packages you wish to compile 3) run 'make' 4) wait while it compiles 5) find the kernel, bootloader, root filesystem, etc. in output/images You do not need to be root to build or run buildroot. Have fun! Buildroot comes with a basic configuration for a number of boards. Run 'make list-defconfigs' to view the list of provided configurations. Please feed suggestions, bug reports, insults, and bribes back to the buildroot mailing list: buildroot@buildroot.org You can also find us on #buildroot on OFTC IRC. If you would like to contribute patches, please read https://buildroot.org/manual.html#submitting-patches