diff options
Diffstat (limited to 'tasks/bootstrap.task.sh')
-rw-r--r-- | tasks/bootstrap.task.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tasks/bootstrap.task.sh b/tasks/bootstrap.task.sh new file mode 100644 index 0000000..2f0624b --- /dev/null +++ b/tasks/bootstrap.task.sh @@ -0,0 +1,47 @@ +bootstrap_append="update update_chrootscripts locales" +bootstrap_runtime_dependencies="bootstrap_precheck" + +bootstrap () { + + local ME=bootstrap + + [ ! -d $BROOT_BUILDROOT_PATH ] && mkdir -p $BROOT_BUILDROOT_PATH + + 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" + + # create directory for scripts to be run inside the buildroot + mkdir -p "$BROOT_BUILDROOT_PATH/root/bin" + + # create bindmount outside to apt cache outside chroot + mkdir -p "/tmp/deb/partial" + mkdir -p "$BROOT_BUILDROOT_PATH/var/cache/apt/archives" + mount -o bind "/tmp/deb" "$BROOT_BUILDROOT_PATH/var/cache/apt/archives" + + # run bootstrap itself + echo -n " debootstrap running: " + $DEBOOTSTRAP_DIR/debootstrap --arch="i386" squeeze $BROOT_BUILDROOT_PATH http://ftp.de.debian.org/debian | tee $BROOT_LOG.$ME - | awk '{printf "."}' + lastline=$(tail -n 1 $BROOT_LOG.$ME) + echo "done" + echo " debootstrap finished with: $lastline" + + # write bootstrap lock + touch $BROOT_BUILDROOT_PATH/bootstraped + + # add non-free to apt sources + sed -i -e "s,main,main non-free," $BROOT_BUILDROOT_PATH/etc/apt/sources.list + + echo " update package list" + # update package list + chroot-exec aptitude update >> $BROOT_LOG.$ME + echo " finished all for bootstrap" +} |