[oe-commits] Tim 'timtim' Ellis : piccontrol: Add piccontrol, missing dep of ts109 and ts209 (tsx09) machines - led/fan/etc control

GIT User account git at amethyst.openembedded.net
Sat Jan 17 18:05:56 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: dc10abcda446ad5b1628134797eddedea814f5e3
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=dc10abcda446ad5b1628134797eddedea814f5e3

Author: Tim 'timtim' Ellis <tim.ellis at foonas.org>
Date:   Sat Jan 17 18:04:39 2009 +0000

piccontrol: Add piccontrol, missing dep of ts109 and ts209 (tsx09) machines - led/fan/etc control

---

 packages/piccontrol/files/configlocation.patch |   13 +++++++
 packages/piccontrol/files/luafix-0.4.patch     |   20 ++++++++++
 packages/piccontrol/files/piccontrol-0.4.conf  |   45 ++++++++++++++++++++++++
 packages/piccontrol/piccontrol_0.4.bb          |   25 +++++++++++++
 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 0000000..08cb600
--- /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 0000000..453582c
--- /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 0000000..2504d75
--- /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 0000000..7ec7e4c
--- /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
+}
+





More information about the Openembedded-commits mailing list