summaryrefslogtreecommitdiffstats
path: root/inc/bootstrap.inc.sh
blob: 7822b9619644fb3648abd89820ec696e0c67c5f0 (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

bootstrap () {
  [ ! -d $buildrootpath ] && mkdir -p $buildrootpath

  echo "broot is going to run debootsrap now:                        ~-_"
  echo "   depending on your machine/connection this can            _-~ "
  echo "   take up to 20min.. time enough for a coffee ;)         c|_|  "
  echo "press Strg-c to abbort"
  echo -n "Starting debootsrap in .. "
  echo -en "${R}3${NONE} " && sleep 1 && \
  echo -en "${R}2${NONE} " && sleep 1 && \
  echo -en "${R}1${NONE} " && sleep 1 && \
  echo ".. go "
  
  export DEBOOTSTRAP_DIR="$BROOT_BASE_DIR/contrib/debootstrap"

  mkdir -p "$buildrootpath/root/bin"
  
  mkdir -p "/tmp/deb/partial"
  mkdir -p "$buildrootpath/var/cache/apt/archives"
  mount -o bind "/tmp/deb" "$buildrootpath/var/cache/apt/archives"

  $DEBOOTSTRAP_DIR/debootstrap --arch="i386" squeeze $buildrootpath http://ftp.de.debian.org/debian

  touch $buildrootpath/bootstraped
  
  sed -i -e "s,main,main non-free," $buildrootpath/etc/apt/sources.list
  setupBindmounts $buildrootpath
  updatebuildroot $buildrootpath
  chroot-exec aptitude update

  chroot-aptinstall locales
  sed -i -e "s,^#.*\(en_US.*\)$,\1," $buildrootpath/etc/locale.gen
  chroot-exec locale-gen
  chroot-aptinstall build-essential
  chroot-aptinstall git-core subversion
  chroot-aptinstall firmware-iwlwifi firmware-linux firmware-linux-free firmware-linux-nonfree linux-image-2.6.32-trunk-686-bigmem

  cp ./chroot-scripts/* $buildrootpath/root/bin/
  chmod 700 $buildrootpath/root/bin/*
  
  # chroot-exec /root/bin/build-bb.sh

  destroyBindmounts 

}