From 0dae1980e721fd6028b708a01d3bab43d33c67ea Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 12 Jul 2012 17:15:43 -0600 Subject: [PATCH] lots of little fixups, caught up with todo after trail run in ACS --- go | 2 +- packages/00common/src/puzzles.cgi.c | 2 ++ packages/p2/p2.mk | 2 +- packages/p2/www/index.html | 8 +++++ packages/p2client/p2client.mk | 1 + packages/p2client/service/eth0/run | 3 +- packages/p2client/service/p2client/p2connect | 20 +++++++++---- packages/p2client/service/p2client/run | 31 +++++++++++++------- 8 files changed, 50 insertions(+), 19 deletions(-) diff --git a/go b/go index c1c089b..415affc 100755 --- a/go +++ b/go @@ -10,7 +10,7 @@ case ${1:-$TYPE} in packages='router' ;; p2) - packages='p2 gs p2steg archaeology ' + packages='p2 gs archaeology nocode steg js proto' ;; p2cli) packages='p2client' diff --git a/packages/00common/src/puzzles.cgi.c b/packages/00common/src/puzzles.cgi.c index 07e28e6..a8d6bd9 100644 --- a/packages/00common/src/puzzles.cgi.c +++ b/packages/00common/src/puzzles.cgi.c @@ -148,6 +148,8 @@ main(int argc, char *argv[]) closedir(opt); printf("\n"); + + printf("

New puzzles are unlocked when any team answers the highest-scoring puzzle in a category.

"); cgi_foot(); return 0; diff --git a/packages/p2/p2.mk b/packages/p2/p2.mk index b8c55bf..665de4b 100644 --- a/packages/p2/p2.mk +++ b/packages/p2/p2.mk @@ -19,7 +19,7 @@ p2-install: packages/p2/src/modem eris ctfbase $(call COPYTREE, packages/p2/www, $(P2_PKGDIR)/www) p2-clean: - $(MAKE) -C packages/p2/src + $(MAKE) -C packages/p2/src clean PACKAGES += p2 diff --git a/packages/p2/www/index.html b/packages/p2/www/index.html index 5606c6f..70a9de4 100644 --- a/packages/p2/www/index.html +++ b/packages/p2/www/index.html @@ -20,6 +20,14 @@ +

+ Project 2 is a puzzle-based game for individuals or teams. + Get started by creating a new team at the console, then start + working on the puzzles. + When you have solved a puzzle, enter the answer at the console + to change your ranking on the scoreboard. +

+

This event would not be possible without the help of many people. Thank you, people. diff --git a/packages/p2client/p2client.mk b/packages/p2client/p2client.mk index 9afa597..a750ffa 100644 --- a/packages/p2client/p2client.mk +++ b/packages/p2client/p2client.mk @@ -7,6 +7,7 @@ p2client-install: $(call COPYTREE, packages/p2client/service, $(P2CLIENT_PKGDIR)/service) loadkeys -b packages/p2client/dumbterm.map > $(P2CLIENT_PKGDIR)/dumbterm.kmap + cp packages/p2client/lite-16.fnt $(P2CLIENT_PKGDIR) p2client-clean: rm -rf $(P2CLIENT_PKGDIR) diff --git a/packages/p2client/service/eth0/run b/packages/p2client/service/eth0/run index 4047474..537a8cd 100755 --- a/packages/p2client/service/eth0/run +++ b/packages/p2client/service/eth0/run @@ -2,8 +2,9 @@ exec 2>&1 +ip link set dev eth0 up + if grep 'debug' /proc/cmdline; then - ip link set dev eth0 up ip addr add dev eth0 10.0.0.110/24 exec sleep 8d else diff --git a/packages/p2client/service/p2client/p2connect b/packages/p2client/service/p2client/p2connect index 5b3bb4d..1a4321c 100755 --- a/packages/p2client/service/p2client/p2connect +++ b/packages/p2client/service/p2client/p2connect @@ -3,16 +3,24 @@ # Try hard to look like a serial terminal reset -# Maybe this is some startup code -sleep 0.4 +# Simulate a green-phosphor CRT +printf '\033]P0111122\033]P788ff00\033]Pfff8800' # Print some bullshit to confuse people printf 'S0:1200N81 ' -# Simulate a green-phosphor CRT -printf '\033]P0111122\033]P788ff00\033]Pfff8800' +# Some diagnostic codes +printf '[' -# More bullshit -printf '[68]\n' +ip addr list dev eth0 | awk ' +(/inet /) { printf("A"); } +(/NO-CARRIER/) { printf("l"); } +(/state UP/) { printf("C"); } +' + +printf ']\n' + +# Pretend to run initialization routines +sleep 3 exec nc 10.0.0.2 5555 2>/dev/null diff --git a/packages/p2client/service/p2client/run b/packages/p2client/service/p2client/run index 9d679eb..a7e7c3c 100755 --- a/packages/p2client/service/p2client/run +++ b/packages/p2client/service/p2client/run @@ -2,23 +2,34 @@ exec 2>&1 -# Turn off default gettys -sv d tty1 tty2 tty3 tty4 +# Turn off conflicting getty +sv d tty1 + if ! sv s tty1 | grep down; then exit fi -# Don't let C-A-F2 switch away -deallocvt +# Cool font +setfont -C /dev/tty1 /opt/p2client/lite-16.fnt -# Disable magic sysrq key -echo 0 > /proc/sys/kernel/sysrq -# Turn off screen blanking -setterm -blank 0 -powersave off -powerdown 0 +if ! grep -q debug /proc/cmdline; then + # Don't let C-A-F2 switch away + sv d tty2 tty3 tty4 + deallocvt -# Make this like a VT52; including disabling ctrl-alt-del -loadkmap < /opt/p2client/dumbterm.kmap + # Disable magic sysrq key + echo 0 > /proc/sys/kernel/sysrq + + # Turn off screen blanking + setterm -blank 0 -powersave off -powerdown 0 + + # Make this like a VT52; including disabling ctrl-alt-del + loadkmap < /opt/p2client/dumbterm.kmap + + # Disable console logging + echo 1 4 1 4 > /proc/sys/kernel/printk +fi # Run the console! exec getty -n -l ./p2connect 38400 tty1