summaryrefslogtreecommitdiffstats
path: root/broot.sh
blob: 1daf19387dc698473ab596c89ddd74118b8131ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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


case $1 in
  "setup")
    if [ ! -e $buildrootpath/bootstraped ]; then
      bootstrap
    else
      echo " * Found existing buildroot - running update instead"
      updatebuildroot 
    fi
    ;;
  "update")
    if [ ! -e $buildrootpath/bootstraped ]; then
      echo " * Can't find existing buildroot - running setup instead"
      bootstrap
    else
      updatebuildroot  
    fi
    ;;
   "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-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
    ;;
  *)
   echo "Usage: broot (setup|update|build-bb)" 
esac