From 40acfe07cc430536cdd5fcf136b05ece4d69beab Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 9 Jun 2012 14:42:46 -0600 Subject: [PATCH] p2client package --- packages/p2client/dumbterm.map | 55 ++++++++++++++++++++ packages/p2client/p2client.mk | 14 +++++ packages/p2client/service/eth0/log/run | 3 ++ packages/p2client/service/eth0/run | 5 ++ packages/p2client/service/p2client/log/run | 3 ++ packages/p2client/service/p2client/p2connect | 7 +++ packages/p2client/service/p2client/run | 22 ++++++++ 7 files changed, 109 insertions(+) create mode 100644 packages/p2client/dumbterm.map create mode 100644 packages/p2client/p2client.mk create mode 100755 packages/p2client/service/eth0/log/run create mode 100644 packages/p2client/service/eth0/run create mode 100755 packages/p2client/service/p2client/log/run create mode 100755 packages/p2client/service/p2client/p2connect create mode 100755 packages/p2client/service/p2client/run diff --git a/packages/p2client/dumbterm.map b/packages/p2client/dumbterm.map new file mode 100644 index 0000000..3886b68 --- /dev/null +++ b/packages/p2client/dumbterm.map @@ -0,0 +1,55 @@ +keymaps 0-2 +keycode 2 = one exclam +keycode 3 = two at +keycode 4 = three numbersign +keycode 5 = four dollar +keycode 6 = five percent +keycode 7 = six asciicircum +keycode 8 = seven ampersand +keycode 9 = eight asterisk +keycode 10 = nine parenleft +keycode 11 = zero parenright +keycode 12 = minus underscore +keycode 13 = equal plus +keycode 14 = Delete +keycode 16 = q +keycode 17 = w +keycode 18 = e +keycode 19 = r +keycode 20 = t +keycode 21 = y +keycode 22 = u +keycode 23 = i +keycode 24 = o +keycode 25 = p +keycode 26 = bracketleft braceleft +keycode 27 = bracketright braceright +keycode 28 = Return +keycode 30 = a +keycode 31 = s +keycode 32 = d +keycode 33 = f +keycode 34 = g +keycode 35 = h +keycode 36 = j +keycode 37 = k +keycode 38 = l +keycode 39 = semicolon colon +keycode 40 = apostrophe quotedbl +keycode 41 = grave asciitilde +keycode 42 = Shift +keycode 43 = backslash bar +keycode 44 = z +keycode 45 = x +keycode 46 = c +keycode 47 = v +keycode 48 = b +keycode 49 = n +keycode 50 = m +keycode 51 = comma less +keycode 52 = period greater +keycode 53 = slash question +keycode 54 = Shift +keycode 57 = space +keycode 86 = less greater +keycode 111 = Delete diff --git a/packages/p2client/p2client.mk b/packages/p2client/p2client.mk new file mode 100644 index 0000000..9afa597 --- /dev/null +++ b/packages/p2client/p2client.mk @@ -0,0 +1,14 @@ +P2CLIENT_PKGDIR = $(TARGET)/p2client + +p2client-source: +p2client-build: +p2client-install: + mkdir -p $(P2CLIENT_PKGDIR) + + $(call COPYTREE, packages/p2client/service, $(P2CLIENT_PKGDIR)/service) + loadkeys -b packages/p2client/dumbterm.map > $(P2CLIENT_PKGDIR)/dumbterm.kmap + +p2client-clean: + rm -rf $(P2CLIENT_PKGDIR) + +PACKAGES += p2client \ No newline at end of file diff --git a/packages/p2client/service/eth0/log/run b/packages/p2client/service/eth0/log/run new file mode 100755 index 0000000..1e7bd9d --- /dev/null +++ b/packages/p2client/service/eth0/log/run @@ -0,0 +1,3 @@ +#! /bin/sh + +exec svlogd -tt $PWD diff --git a/packages/p2client/service/eth0/run b/packages/p2client/service/eth0/run new file mode 100644 index 0000000..563485f --- /dev/null +++ b/packages/p2client/service/eth0/run @@ -0,0 +1,5 @@ +#! /bin/sh + +exec 2>&1 + +exec udhcpc -f eth0 diff --git a/packages/p2client/service/p2client/log/run b/packages/p2client/service/p2client/log/run new file mode 100755 index 0000000..1e7bd9d --- /dev/null +++ b/packages/p2client/service/p2client/log/run @@ -0,0 +1,3 @@ +#! /bin/sh + +exec svlogd -tt $PWD diff --git a/packages/p2client/service/p2client/p2connect b/packages/p2client/service/p2client/p2connect new file mode 100755 index 0000000..7ccae18 --- /dev/null +++ b/packages/p2client/service/p2client/p2connect @@ -0,0 +1,7 @@ +#! /bin/sh + +# Try hard to look like a serial connection + +reset +echo 'RS232/0:1200-N81' +exec nc 10.0.0.2 56352 2>/dev/null diff --git a/packages/p2client/service/p2client/run b/packages/p2client/service/p2client/run new file mode 100755 index 0000000..1f3b00f --- /dev/null +++ b/packages/p2client/service/p2client/run @@ -0,0 +1,22 @@ +#! /bin/sh + +exec 2>&1 + +# Turn off default gettys +sv d tty1 tty2 tty3 tty4 +if ! sv s tty1 | grep down; then + exit +fi + +# Disable magic sysrq key +echo 0 > /proc/sys/kernel/sysrq + +# Make this like a VT52; including disabling ctrl-alt-del +loadkmap /opt/p2client/dumbterm.kmap + +# Simulate a green-phosphor CRT +printf '\033]P0111122\033]P788ff00\033]Pfff8800' + +# Run the console! +exec getty -n -l ./p2connect 38400 tty1 +