view common/bootstrap/init @ 40:ef471ef37665 draft default tip

Yank reliance on ash.
author Rob Landley <rob@landley.net>
date Sat, 18 Jul 2015 01:39:24 -0500
parents 31d7462a8649
children
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 and same or more storage than /

if touch /.amiwrite 2>/dev/null && rm /.amiwrite 2>/dev/null &&
 [ $(($(stat -fc "%a*%S" /))) -ge $(($(stat -fc "%a*%S" /home))) ]
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