view common/bootstrap/init @ 0:bcd2e358d57f

Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
author Rob Landley <rob@landley.net>
date Sun, 03 Jul 2011 17:23:26 -0500
parents
children 31d7462a8649
line wrap: on
line source

#!/bin/bash

# Start running here, and hand off to run-build-stages.sh in chroot.

. /mnt/functions.sh

[ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot

# Is the root filesystem already writeable?

if touch /.amiwrite 2>/dev/null && rm /.amiwrite 2>/dev/null
then
  # build and install stuff on the writable filesystem

  /mnt/run-build-stages.sh
else
  # Create a new writeable chroot, build and install stuff in there

  setup-chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh

  # Upload a tarball of the result to the host

  if [ $? -eq 0 ]
  then
    set_titlebar "upload tarball"
    tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress &&
    upload_result "$NATIVE_BUILD".tar.gz
  fi
fi