If there is a space in the base anywhere, the scripts fails to start.
This is due to the default separator used in bash (which is a space).
This default separator can be change by setting the variable $IFS.
In `build.sh`, the old IFS variable is saved and then replaced by
`\n\b`. At the end of the script, the saved IFS is set back.
In `build-docker.sh`, a simple double quote was enough.
Check that realpath is present. OS X doesn't have realpath. The RPi builds on Docker for Mac if you increase the VM size. I am using 256G for my image. See the Docker for Mac preferences.
* Use `&&` instead of `;` in Docker pipeline
* In case of error, `&&` does not continue execution
* Silence shellcheck warning
* SC2086: Double quote to prevent globbing and word splitting.
* Ensure that the configuration file is an absolute path in Docker build
The specific problem is in commit 2ddd7c1, where the passed config file
(using the `-c` option) is now mounted inside the container using the
`--volume src:dest:opt` Docker option.
The problem is that Docker requires absolute paths for mounting single
files inside the container, otherwise it silently tries to mount a volume
name instead as an empty directory. Therefore the Docker build no longer
works with the following invocation forms (relative config-paths):
./build-docker.sh -c myconfig
/path/to/build-docker.sh -c myconfig # also doesn't work
This commit uses `realpath` (included in coreutils) in the Docker build
script to ensure that the passed configuration file is always an
absolute path before passing it to Docker.
Last commit made the script break on macOS.
From `man sed` (On Linux):
```
-E, -r, --regexp-extended
use extended regular expressions in the script (for portability use POSIX -E).
```
* bash variables in build-docker.sh are wrapped by curly brackets
* Ensure presence of config file while running build-docker.sh
* Do not assume that build-docker.sh is run from the repository root directory
* Mount config file in predictable location in docker container
* SC1091: the `config` file might not be present, which is normal.
* SC2086: Double quote to prevent globbing and word splitting.
Tested clean output using: `find -name "*.sh" -exec shellcheck -x {} \;`
* Made more specific shellcheck disables
* Fixed variable quoting (SC2086,SC2064)
* Use `$*` expansion instead of `$@` when not using arrays (SC2124)
* Use cleaner `$()` syntax instead of back quotes (SC2006)
* Improved comparator (SC2166)
* Minor improvements in coding style
Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`.
Fixes#253
Rather than use --env-file, which gets overwritten by the regular config file, pass the any arguments to build-docker.sh through to build.sh.
* Added Docker support
- replaced necessity for devicemapper (through kpartx) by using parted and
losetup with offsets
- added Dockerfile
- added dependency for parted and grep
- added hints to README.md
- common: loop through unmounts, fix shellcheck warnings
* stage2: use debconf instead of console-setup patch. Fixes#41