8.26. dash stage 2 0.5.13.3
Rebuild dash in the final target environment and link it against the final libedit.
Input assumption: dash-0.5.13.3.tar.gz is already present in /sources from the chapter 4 source staging step.
Source URL: http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.13.3.tar.gz
Release note: this upstream release tarball includes a generated configure script and Makefile.in files, so no autotools bootstrap is needed.
Upstream build note: the generated configure script supports --with-libedit for editline support and accepts CC_FOR_BUILD for the small build-time generators used by the shell parser tables.
Licenses:
- BSD-3-Clause
- GPL-2.0-or-later for the
mksignames.cgenerator input noted by upstream
Dependencies:
- musl (libc)
- make
- libedit
- ncurses
dash is a small POSIX-compliant Bourne shell implementation. we need it to provide the final target dash and sh commands for fast script execution, interactive recovery work, and a shell linked against the final libedit.
Extract and Enter the Source Tree
cd /sources
rm -rf dash-0.5.13.3
tar -xf dash-0.5.13.3.tar.gz
cd dash-0.5.13.3
Configure dash
lbi_configure \
--with-libedit \
CC_FOR_BUILD=cc
Build dash
make $LWI_MAKE_FLAGS
Install dash
make install
ln -sf dash /system/binaries/sh
Verify the Shell
dash -c 'echo dash-ok'
sh -c 'echo sh-ok'
/sources if you do not plan to rebuild dash again.
Command Explanations
rm -rf dash-...andtar -xf: Recreate a clean dash source tree.lbi_configure: Applies the book's/systeminstall layout.--with-libedit: Builds dash with line-editing support from libedit.CC_FOR_BUILD=cc: Uses the target compiler for build helpers inside the self-hosted target.make $LWI_MAKE_FLAGSandmake install: Build and install dash.ln -sf dash /system/binaries/sh: Provides the standardshcommand name.dash -candsh -c: Smoke-test both command names.