Mercurial > hg > aboriginal
comparison more/control-in-chroot.sh @ 1213:65d1e11679af
Script to wrap up a control image and arch root filesystem into a tarball runnable on a host.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 18 Aug 2010 17:07:13 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1212:19f3be2b4d04 | 1213:65d1e11679af |
---|---|
1 #!/bin/bash | |
2 | |
3 # Combine a control image and a root-filesystem image into an $ARCH-specific | |
4 # chroot containing native build control files in /mnt. | |
5 | |
6 if [ $# -ne 2 ] | |
7 then | |
8 echo 'usage: ./control-in-chroot.sh $ARCH $CONTROL_IMAGE' >&2 | |
9 exit 1 | |
10 fi | |
11 | |
12 # Zap old stuff (if any) | |
13 | |
14 rm -rf build/root-filesystem-"$1" build/chroot-"$1" && | |
15 | |
16 # Make sure the root filesystem is there for this $ARCH | |
17 | |
18 ./root-filesystem.sh "$1" && | |
19 | |
20 # Build control image. | |
21 | |
22 mkdir -p build/host-temp && | |
23 rm -rf build/host-temp/"$2".hdc && | |
24 sources/native-builds/"$2".sh build/host-temp/"$2".hdc && | |
25 | |
26 # Combine the control image's files with the root filesystem and rename result. | |
27 | |
28 rm -rf build/control-in-chroot-"$1" build/root-filesystem-"$1"/mnt && | |
29 mv build/host-temp/"$2" build/root-filesystem-"$1"/mnt && | |
30 mv build/root-filesystem-"$1" build/control-in-chroot-"$1" && | |
31 | |
32 # Tar it up | |
33 | |
34 tar -cvj -f build/control-in-chroot-"$1".tar.bz2 -C build control-in-chroot-"$1" && | |
35 | |
36 # Output some usage hints | |
37 | |
38 echo "export CPUS=1 HOST=$1 && cd /home && /mnt/init" && | |
39 echo "sudo chroot build/control-in-chroot-"$1" /sbin/init.sh" |