apenwarr-redo/docs/cookbook/container/simple.fs.do
Avery Pennarun 537866b871 cookbook/container: remove unexplained "exec >&2" lines.
These are often a good idea, but not necessary here and are distracting
to the tutorial, so let's just take them out.

Reported-by: Jeff Stearns <jeff.stearns@gmail.com>
2019-01-14 02:03:19 -05:00

23 lines
514 B
Text

# We can pull in the 'hello' binary built in an earlier
# example. Notice that it's safe to have dependencies
# that cross directory boundaries, even when we're building
# both of those directories in parallel.
FILES="
/bin/sh
../hello/hello
"
if [ -x /bin/busybox ]; then
# Optional, except for runkvm
FILES="$FILES /bin/busybox"
else
redo-ifcreate /bin/busybox
fi
redo-ifchange $FILES
fs=${1%.fs}
rm -rf "$fs"
mkdir -p "$fs/bin"
cp $FILES "$fs/bin/"
ln -s bin/hello "$fs/init"
redo-ifchange "$fs/bin/sh"