move support files to /boot
[bootmanager.git] / build.sh
1 #!/bin/bash
2
3 # build a bash script that can be executed by the boot cd,
4 # and contains embedded in it the boot manager.
5
6 DEST_SCRIPT=bootmanager.sh
7
8 cat > $DEST_SCRIPT << '_EOF_'
9 #!/bin/bash
10 set -e
11
12 UUDECODE=/usr/bin/uudecode
13
14 # once we get the beta cds out of use, this can be removed
15 if [ ! -x $UUDECODE ]; then
16   UUDECODE=/tmp/uudecode
17   curl -s http://boot.planet-lab.org/boot/uudecode.gz | gzip -d -c > $UUDECODE
18   chmod +x $UUDECODE
19 fi
20
21 _EOF_
22 echo '($UUDECODE | /bin/tar -C /tmp -xj) << _EOF_' >> $DEST_SCRIPT
23 tar -cj source/ | uuencode -m - >> $DEST_SCRIPT
24 echo '_EOF_' >> $DEST_SCRIPT
25 echo 'cd /tmp/source' >> $DEST_SCRIPT
26 echo 'chmod +x BootManager.py && ./BootManager.py' >> $DEST_SCRIPT