musl_root/pkgs/build-all.sh

51 lines
792 B
Bash
Raw Normal View History

2018-11-10 00:42:27 +02:00
#!/bin/bash
set -e
TARGET="${1}"
if [ -z "${TARGET}" ]; then
echo "You must specify rootfs where packages should be unpacked"
fi
TARGET="$(realpath "${TARGET}")"
source ./prepare-musl.sh
build_and_install () {
local pkg="${1}"
local ver="$(grep ^pkgver < "${pkg}/build.sh" | sed 's/pkgver="\(.*\)"/\1/')"
pushd "${pkg}" > /dev/null
local pkgfile="$(realpath "./${pkg}-${ver}.pkg.tar.xz")"
if [ ! -f "${pkgfile}" ]; then
echo ">>> Building '${pkg}'"
./build.sh
fi
tar -C "${TARGET}" -xf "${pkgfile}"
popd > /dev/null
}
b () {
build_and_install "${@}"
return "${?}"
}
# Absulutely needed
b filesystem
b musl-libc
b libexecinfo
b mksh
# Networking
b zlib
b libressl
b curl
# Init
b sabotage-kernel-headers
b runit
b eudev