annotate common/bootstrap/init @ 33:a051c841d782

Add command recording ability (via record-commands wrapper).
author Rob Landley <rob@landley.net>
date Fri, 22 Mar 2013 22:54:03 -0500
parents bcd2e358d57f
children 31d7462a8649
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Start running here, and hand off to run-build-stages.sh in chroot.
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 . /mnt/functions.sh
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 [ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
8
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 # Is the root filesystem already writeable?
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 if touch /.amiwrite 2>/dev/null && rm /.amiwrite 2>/dev/null
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
12 then
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 # build and install stuff on the writable filesystem
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
14
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 /mnt/run-build-stages.sh
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 else
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
17 # Create a new writeable chroot, build and install stuff in there
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
18
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 setup-chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
20
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 # Upload a tarball of the result to the host
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
22
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 if [ $? -eq 0 ]
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 then
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 set_titlebar "upload tarball"
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress &&
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 upload_result "$NATIVE_BUILD".tar.gz
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 fi
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 fi