#!/bin/bash . ./inc/env.inc.sh # read slx config to find paths . ./inc/functions.inc.sh if [ "$(whoami)" != "root" ]; then echo " You need to be root" exit 12 fi case $1 in "setup") tasks="bootstrap locales update buildtools" ;; "update") tasks="update update_chrootscripts" ;; "build-busybox") tasks="build_busybox" # chroot-exec /root/bin/build-bb.sh ;; "shell") tasks="shell" ;; "build-core-pkgs") tasks="update_chrootscripts build_core" # updateScripts # chroot-exec /root/bin/build-preboot.sh ;; "purge") destroyBindmounts >/dev/null 2>&1 # just to be sure nothing is mounted anymore destroyBindmounts >/dev/null 2>&1 # now we're hopefully on the safe side destroyBindmounts >/dev/null 2>&1 # better safe than sorry destroyBindmounts >/dev/null 2>&1 rm -rf $BROOT_BUILDROOT_PATH echo "Buildroot was removed successfully." ;; "resume") [ -f $BROOT_BUILDROOT_PATH/.resume ] && . $BROOT_BUILDROOT_PATH/.resume ;; *) echo "Usage: broot (setup|update|shell|build-busybox|build-core-pks)" exit 23 esac cleanup_tmp [ "x$tasks" != "x" ] && runtasks exit 0