#!/bin/sh CMD_DIR="$(realpath $(dirname $0))" PROJ_DIR="$(realpath $CMD_DIR/..)" export CC="${CC:=musl-gcc --static}" export ROOT="${ROOT:=/opt/muslack64-14.2}" export TMP="${TMP:=/tmp/muslack}" export USE_STATIC="${USE_STATIC:=true}" export PKGTYPE="txz" export PS1="[muslack-dev] $PS1" TARGET="bash" if [ $# -gt 0 ]; then TARGET=$@ fi if [ ! -d "$ROOT" ]; then >&2 echo "This script expects $ROOT to exist. Maybe you should create it?" exit 1 fi bwrap \ --unshare-all \ --uid 0 \ --gid 0 \ --ro-bind / / \ --bind /tmp /tmp \ --bind "$PROJ_DIR" "$PROJ_DIR" \ --ro-bind "$ROOT/usr/include" /usr/include/musl \ --ro-bind "$ROOT/usr/lib64" /usr/lib64/musl \ --bind "$ROOT" "$ROOT" \ --dev-bind /dev /dev \ $TARGET