A couple of bugfixes and install script

This commit is contained in:
Neale Pickett 2011-02-10 17:07:48 -07:00
parent 59eb9d4689
commit e25515dc56
4 changed files with 60 additions and 1 deletions

View File

@ -13,6 +13,13 @@ BIN = bin
all: packages all: packages
dist: ctf-install.zip
ctf-install.zip: packages.zip /usr/lib/syslinux/mbr.bin
zip --junk-paths $@ packages.zip /usr/lib/syslinux/mbr.bin install.sh
packages.zip: packages bzImage rootfs.squashfs
zip --junk-paths $@ bin/*.pkg bzImage rootfs.squashfs
clean: packages-clean clean: packages-clean
rm -rf $(BUILD) $(TARGET) $(BIN) rm -rf $(BUILD) $(TARGET) $(BIN)

49
install.sh Executable file
View File

@ -0,0 +1,49 @@
#! /bin/sh -e
DRIVE=$1
if ! [ -b "$DRIVE" ]; then
echo "Usage: $0 DEVICE"
echo
echo "Prepares DEVICE with Capture The Flag goodness"
exit
fi
FATFS=${DRIVE}1
EXTFS=${DRIVE}2
sfdisk $DRIVE <<EOF
0,60,6,*
,,L
EOF
sync
mkdir -p /mnt/ctf-install
mkdosfs -n PACKAGES $FATFS
mke2fs -j -L VAR $EXTFS
cat mbr.bin > $DRIVE
mount $FATFS /mnt/ctf-install
mkdir /mnt/ctf-install/syslinux
umount /mnt/ctf-install
syslinux -d syslinux $FATFS
mount $FATFS /mnt/ctf-install
cp rootfs.squashfs /mnt/ctf-install/syslinux/dbtl.squashfs
cp bzImage /mnt/ctf-install/syslinux/
cat <<EOD >/mnt/ctf-install/syslinux/syslinux.cfg
DEFAULT ctf
LABEL ctf
KERNEL bzImage
INITRD dbtl.squashfs
EOD
cp $(basename $0)/../bin/*.pkg /mnt/ctf-install
umount /mnt/ctf-install
rmdir /mnt/ctf-install
sync
echo "Done"

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
if [ "$1" -ne "-f" ]; then if [ "$1" != "-f" ]; then
echo "Usage: $0 -f" echo "Usage: $0 -f"
echo echo
echo "Wipes out the current contest. This operation is not" echo "Wipes out the current contest. This operation is not"

View File

@ -2,4 +2,7 @@ posters-source:
posters-build: posters-build:
posters-install: packages/posters/tokens.txt posters-install: packages/posters/tokens.txt
mkdir -p $(TARGET)/posters/
cp $< $(TARGET)/posters/ cp $< $(TARGET)/posters/
PACKAGES += posters