summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-17 18:04:39 +0000
committerTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-17 18:04:39 +0000
commitdc10abcda446ad5b1628134797eddedea814f5e3 (patch)
treefd186fc03f18bba35c673527922608ef5cded413 /packages
parent33172ddea53386be40b4177fce3dcdee4456e209 (diff)
piccontrol: Add piccontrol, missing dep of ts109 and ts209 (tsx09) machines - led/fan/etc control
Diffstat (limited to 'packages')
-rw-r--r--packages/piccontrol/files/configlocation.patch13
-rw-r--r--packages/piccontrol/files/luafix-0.4.patch20
-rw-r--r--packages/piccontrol/files/piccontrol-0.4.conf45
-rw-r--r--packages/piccontrol/piccontrol_0.4.bb25
4 files changed, 103 insertions, 0 deletions
diff --git a/packages/piccontrol/files/configlocation.patch b/packages/piccontrol/files/configlocation.patch
new file mode 100644
index 0000000000..08cb60096b
--- /dev/null
+++ b/packages/piccontrol/files/configlocation.patch
@@ -0,0 +1,13 @@
+diff --git a/piccontrol.c.orig b/piccontrol.c
+index 6c2fba3..e29eb33 100644
+--- a/piccontrol.c.orig
++++ b/piccontrol.c
+@@ -231,7 +231,7 @@ static int pic_lua_setup()
+ lua_register(lua, "register", register_module);
+ lua_register(lua, "piccmd", run_command_lua);
+
+- luaL_dofile(lua, "config.lua");
++ luaL_dofile(lua, "/etc/piccontrol.conf");
+
+ return 0;
+ }
diff --git a/packages/piccontrol/files/luafix-0.4.patch b/packages/piccontrol/files/luafix-0.4.patch
new file mode 100644
index 0000000000..453582cad9
--- /dev/null
+++ b/packages/piccontrol/files/luafix-0.4.patch
@@ -0,0 +1,20 @@
+diff -urN qcontrol-0.4.old//Makefile qcontrol-0.4//Makefile
+--- qcontrol-0.4.old//Makefile 2008-05-11 23:32:11.000000000 +0100
++++ qcontrol-0.4//Makefile 2008-10-25 23:53:15.820091908 +0100
+@@ -1,5 +1,5 @@
+-CFLAGS=-Os -Wall -I /usr/include/lua5.1
+-LDFLAGS=-llua5.1 -lpthread
++CFLAGS=-Os -Wall
++LDFLAGS=-lpthread -lm -ldl
+ SOURCES=piccontrol.c ts209.c evdev.c
+ OBJECTS=$(SOURCES:.c=.o)
+ EXECUTABLE=piccontrol
+@@ -7,7 +7,7 @@
+ all: $(SOURCES) $(EXECUTABLE)
+
+ $(EXECUTABLE): $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
++ $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
+
+ .cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
diff --git a/packages/piccontrol/files/piccontrol-0.4.conf b/packages/piccontrol/files/piccontrol-0.4.conf
new file mode 100644
index 0000000000..2504d75c66
--- /dev/null
+++ b/packages/piccontrol/files/piccontrol-0.4.conf
@@ -0,0 +1,45 @@
+register("ts209")
+
+register("evdev", "/dev/event0",
+ 116, "restart_button",
+ 408, "media_button")
+
+function power_button( time )
+ os.execute("poweroff")
+end
+
+fanfail = 0
+
+function fan_error( )
+ fanfail = fanfail + 1
+ if fanfail == 3 then
+ print("ts209: fan error")
+ piccmd("statusled", "red2hz")
+ piccmd("buzzer", "long")
+ else
+ if fanfail == 10 then
+ fanfail = 0
+ end
+ end
+end
+
+function fan_normal( )
+ piccmd("statusled", "greenon")
+ fanfail = 0
+end
+
+function temp_low( )
+ piccmd("fanspeed", "silence")
+end
+
+function temp_high( )
+ piccmd("fanspeed", "full")
+end
+
+function restart_button( time )
+ os.execute("reboot")
+end
+
+function media_button( time )
+ piccmd("usbled", "8hz")
+end \ No newline at end of file
diff --git a/packages/piccontrol/piccontrol_0.4.bb b/packages/piccontrol/piccontrol_0.4.bb
new file mode 100644
index 0000000000..7ec7e4c7d9
--- /dev/null
+++ b/packages/piccontrol/piccontrol_0.4.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "Microcontroller utility for ARM turbostations by Byron Bradley"
+SECTION = "console/network"
+DEPENDS = "lua5.1"
+FILE_PR = "r0"
+LICENSE = "GPL"
+
+COMPATIBLE_MACHINE = "tsx09"
+
+LDFLAGS += " ${STAGING_LIBDIR}/liblua5.1.a -lpthread -lm -ldl "
+CFLAGS += " -I${STAGING_INCDIR}/lua5.1 "
+
+S = "${WORKDIR}/qcontrol-${PV}"
+
+SRC_URI = "http://byronbradley.co.uk/piccontrol/qcontrol-0.4.tar.gz \
+ file://luafix-0.4.patch;patch=0 \
+ file://configlocation.patch;patch=1 \
+ file://piccontrol-0.4.conf"
+
+do_install() {
+ install -d ${D}${sbindir} \
+ ${D}${sysconfdir}
+ install -c -m 755 ${S}/piccontrol ${D}${sbindir}/piccontrol
+ install -m 0644 ${WORKDIR}/piccontrol-0.4.conf ${D}${sysconfdir}/piccontrol.conf
+}
+