From 362663c08261b209da1ffd418c7472f010283eb9 Mon Sep 17 00:00:00 2001 From: Angelo Arrifano Date: Wed, 4 Mar 2009 00:47:48 +0000 Subject: [PATCH] [quickstart] Import v1.00r1 released on 2008/03/06 - Little changes to support linux-2.6.23 and newer. - Added example autostart scripts. - Going stable, version bump. - Fixed Makefile for linux-2.6.24. --- quickstart/CHANGELOG | 8 +++++++ quickstart/Makefile | 43 +++++++++++++++-------------------- quickstart/README | 12 +++++++--- quickstart/quickstart | 27 ++++++++++++++++++++++ quickstart/quickstart.c | 11 ++++++--- quickstart/quickstart.desktop | 11 +++++++++ 6 files changed, 81 insertions(+), 31 deletions(-) create mode 100755 quickstart/quickstart create mode 100644 quickstart/quickstart.desktop diff --git a/quickstart/CHANGELOG b/quickstart/CHANGELOG index 29f9ded..48d9190 100644 --- a/quickstart/CHANGELOG +++ b/quickstart/CHANGELOG @@ -1,3 +1,11 @@ +* version 1.00-r1 2008/03/06 + - Fixed Makefile for linux-2.6.24 + +* version 1.00 2008/03/03 + - Little changes to support linux-2.6.23 and newer. + - Added example autostart scripts. + - Going stable, version bump. + * version 0.04 2007/11/17 - Added reporting of runtime key presses (hotkeys) for testing. diff --git a/quickstart/Makefile b/quickstart/Makefile index 70e6a50..91ae310 100644 --- a/quickstart/Makefile +++ b/quickstart/Makefile @@ -1,28 +1,28 @@ # # Makefile borrowed from acer_acpi # -KERNELSRC?=/lib/modules/`uname -r`/build -KERNELVERSION=$(shell awk -F\" '/REL/ {print $$2}' $(shell grep -s -l REL $(KERNELSRC)/include/linux/version.h $(KERNELSRC)/include/linux/utsrelease.h)) -KERNELMAJOR=$(shell echo $(KERNELVERSION)|head -c3) -KBUILD_BASENAME= +ifneq ($(KERNELRELEASE),) obj-m += quickstart.o -CC=gcc -CFLAGS+=-c -Wall -Wstrict-prototypes -Os -pipe -INCLUDE=-I$(KERNELSRC)/include +else + +KERNELVERSION = `uname -r` +KERNELSRC := /lib/modules/$(KERNELVERSION)/build +KERNELMAJOR = $(shell echo $(KERNELVERSION) | head -c3) + +obj-m += quickstart.o + +INCLUDE = -I$(KERNELSRC)/include ifneq ($(KERNELMAJOR), 2.6) -exit: +exit_24: endif -TARGET := quickstart.ko -SOURCE := quickstart.c - -all: $(TARGET) +all: quickstart.ko -exit: +exit_24: @echo "No support for 2.4 series kernels" help: @@ -31,23 +31,16 @@ help: @echo -e install\\t- copies module binary to /lib/modules/$(KERNELVERSION)/extra/ @echo -e clean\\t- removes all binaries and temporary files -quickstart.ko: $(SOURCE) +quickstart.ko: $(MAKE) -C $(KERNELSRC) SUBDIRS=$(PWD) modules -quickstart.o: $(SOURCE) - $(CC) $(INCLUDE) $(CFLAGS) -DMODVERSIONS -DMODULE -D__KERNEL__ -o $(TARGET) $(SOURCE) - clean: rm -f *~ *.o *.s *.ko *.mod.c .*.cmd Module.symvers rm -rf .tmp_versions -load: $(TARGET) - insmod $(TARGET) - -unload: - rmmod quickstart - -install: $(TARGET) +install: mkdir -p ${DESTDIR}/lib/modules/$(KERNELVERSION)/extra - cp -v $(TARGET) ${DESTDIR}/lib/modules/$(KERNELVERSION)/extra/ + cp -v quickstart.ko ${DESTDIR}/lib/modules/$(KERNELVERSION)/extra/ depmod -a + +endif diff --git a/quickstart/README b/quickstart/README index ad8be87..3ec9a3b 100644 --- a/quickstart/README +++ b/quickstart/README @@ -54,10 +54,16 @@ WHAT FOR? load the entire system. * Here are some ideas.. It's up to you! +DEPENDENCIES: +* You will need CONFIG_ACPI enabled on your kernel. + INSTALL -* Just make this module autoload at boot and add some init script - to launch apps according to the button name displayed on - pressed_button file. +* Unpack + tar -xvjf quickstart-{version}.tar.bz2 +* Compile and install + cd quickstart; make && make install +* Copy quickstart and quickstart.desktop into ~/.config/autostart to + get your applications launched when your session starts. REFERENCES * http://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/DirAppLaunch_Vista.doc diff --git a/quickstart/quickstart b/quickstart/quickstart new file mode 100755 index 0000000..ee424fd --- /dev/null +++ b/quickstart/quickstart @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Sample application launcher. +# Angelo Arrifano +# http://quickstart.sourceforge.net +# +# Put this script on ~/.config/autostart. +# + +# Add your button actions here +LAUNCH["QBTN"]="freevo" +LAUNCH["DBTN"]="amarok -l ~/playlist.m3u -p" + +# The sysfs file telling which button was pressed +PRESSEDFILE="/sys/devices/platform/quickstart/pressed_button" + +if [[ ! -e "$PRESSEDFILE" ]]; then + exit 1 +fi + +PRESSEDBUTTON="$(cat "$PRESSEDFILE")" + +if [[ "$PRESSEDBUTTON" != "none" ]]; then + echo -n "none" > "$PRESSEDFILE" + ${LAUNCH[$PRESSEDBUTTON]}; exit $? +fi +exit 1 diff --git a/quickstart/quickstart.c b/quickstart/quickstart.c index dfb52fc..e4977d6 100644 --- a/quickstart/quickstart.c +++ b/quickstart/quickstart.c @@ -24,7 +24,7 @@ * */ -#define QUICKSTART_VERSION "0.04" +#define QUICKSTART_VERSION "1.00" #include #include @@ -75,10 +75,15 @@ struct quickstart_acpi { }; static int quickstart_acpi_add(struct acpi_device *device); static int quickstart_acpi_remove(struct acpi_device *device, int type); +static const struct acpi_device_id quickstart_device_ids[] = { + {QUICKSTART_ACPI_HID, 0}, + {"", 0}, +}; + static struct acpi_driver quickstart_acpi_driver = { .name = "quickstart", .class = QUICKSTART_ACPI_CLASS, - .ids = QUICKSTART_ACPI_HID, + .ids = quickstart_device_ids, .ops = { .add = quickstart_acpi_add, .remove = quickstart_acpi_remove, @@ -385,7 +390,7 @@ static int __init quickstart_init(void) if(ret) goto fail_dev_file2; - printk("quickstart: ACPI Hotstart button %s\n", QUICKSTART_VERSION); + printk("quickstart: ACPI Direct App Launch ver %s\n", QUICKSTART_VERSION); if(enable_runtime_btns) printk("quickstart: Runtime button reporting is enabled."); diff --git a/quickstart/quickstart.desktop b/quickstart/quickstart.desktop new file mode 100644 index 0000000..30d6049 --- /dev/null +++ b/quickstart/quickstart.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Name=Quickstart +Comment=Quickstart +Exec=~/.config/autostart/quickstart +StartupNotify=false +Terminal=false +Hidden=false + -- 2.32.0.93.g670b81a890