#!/usr/bin/env bash set -e; readonly WORKDIR="/_workdir" # Install base utils required for downloading latest void packages and running xbps-src xbps-remote xtools base-devel chroot-git chroot-util-linux tar wget coreutils # Clone void-packages into workdir, with depth 1, as template history is irrelevant git clone --depth 1 'https://github.com/void-linux/void-packages.git' "${WORKDIR}"; cd "${WORKDIR}"; # If masterdir exists: remove it, because we will replace it with a symlink if [ -d "${WORKDIR}/masterdir" ]; then rm "${WORKDIR}/masterdir"; fi # Make $WORKDIR/masterdir point to / ln -s / "${WORKDIR}/masterdir"; # Tell xbps-src to use the ehtereal build style echo XBPS_CHROOT_CMD=ethereal >> etc/conf; echo XBPS_ALLOW_CHROOT_BREAKOUT=yes >> etc/conf # Install the non-conflicting dependencies of base-chroot anyway xbps-install -Sy $(xbps-query -Rx base-chroot | grep -v 'bash\|texinfo'); # Clean up cache rm -rf /var/cache/xbps/*;