summaryrefslogtreecommitdiffstats
path: root/broot.sh
diff options
context:
space:
mode:
authorSebastian2010-04-09 23:56:28 +0200
committerSebastian2010-04-09 23:56:28 +0200
commitbbf39bd59f31084d499c2cdd064274093b39dad8 (patch)
tree6715dffc0fc60fec9df5efdbe6a127faf454881b /broot.sh
parentadded caching (diff)
downloadbroot-bbf39bd59f31084d499c2cdd064274093b39dad8.tar.gz
broot-bbf39bd59f31084d499c2cdd064274093b39dad8.tar.xz
broot-bbf39bd59f31084d499c2cdd064274093b39dad8.zip
added dependency based system to run defined tasks
Diffstat (limited to 'broot.sh')
-rwxr-xr-xbroot.sh66
1 files changed, 32 insertions, 34 deletions
diff --git a/broot.sh b/broot.sh
index 1daf193..e3d2c74 100755
--- a/broot.sh
+++ b/broot.sh
@@ -1,48 +1,46 @@
#!/bin/bash
. ./inc/env.inc.sh # read slx config to find paths
-. ./inc/chroot-functions.inc.sh # chroot wrapper
-. ./inc/bootstrap.inc.sh # bootsrap buildroot
-. ./inc/helper.inc.sh # misc functions (setup bindmounts, etc)
-. ./inc/color.inc.sh # functions for color ouput
-. ./inc/update.inc.sh # buildroot update functions
+. ./inc/functions.inc.sh
case $1 in
"setup")
- if [ ! -e $buildrootpath/bootstraped ]; then
- bootstrap
- else
- echo " * Found existing buildroot - running update instead"
- updatebuildroot
- fi
+ tasks="bootstrap locales update buildtools"
;;
"update")
- if [ ! -e $buildrootpath/bootstraped ]; then
- echo " * Can't find existing buildroot - running setup instead"
- bootstrap
- else
- updatebuildroot
- fi
+ tasks="update update_chrootscripts"
;;
- "build-bb")
- if [ ! -e $buildrootpath/bootstraped ]; then
- echo " * Error: didn't find existing buildroot"
- else
- echo " * Building busybox"
- updateScripts
- chroot-exec /root/bin/build-bb.sh
- fi
+ "build-bb")
+ tasks="build_busybox"
+ # chroot-exec /root/bin/build-bb.sh
;;
- "build-initramfs-pkgs")
- if [ ! -e $buildrootpath/bootstraped ]; then
- echo " * Error: didn't find existing buildroot"
- else
- echo " * Building preboot packages"
- updateScripts
- chroot-exec /root/bin/build-preboot.sh
- fi
+ "build-initramfs-pkgs")
+ tasks="build_busybox build_packages build_kernel"
+ # 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|build-bb)"
+ echo "Usage: broot (setup|update|build-bb)"
+ exit 23
esac
+
+cleanup_tmp
+[ "x$tasks" != "x" ] && runtasks
+
+exit 0