musl_root/pkgs/build-all.sh

52 lines
803 B
Bash
Executable File

#!/bin/bash
set -e
TARGET="${1}"
if [ -z "${TARGET}" ]; then
echo "You must specify rootfs where packages should be unpacked"
exit 1
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