Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/clovershell-daemon.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-03 15:21:31 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-03 15:26:13 +0300
commit781bb7de380252916b8154c15a5bb38b47ad1239 (patch)
tree41b83e17682f78e9b59a24b5b39d07ec2b80018b
parent464734c22a846084f8b1e520ea2ad69b5ae3b80a (diff)
Release
-rw-r--r--Makefile23
-rw-r--r--clovershell.c6
-rwxr-xr-xmod/etc/init.d/S91clovershell41
-rw-r--r--mod/install4
4 files changed, 64 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 0b22818..828cbb3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,21 @@
###
-### I think it's not worth to make such a small project
-### modular. So this is a simple gnu Makefile...
+### clovershell daemon (c) Cluster, 2017
+### http://clusterrr.com
+### clusterrr@clusterrr.com
###
-.DELETE_ON_ERROR:
-.PHONY: install clean all
-
-CFLAGS-NES += -L../nesmini/lib -L../nesmini/usr/lib -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3,-sysroot=/usr/home/cluster/nesmini,-rpath,-nostartfiles
+CFLAGS-NES += -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3,-rpath,-nostartfiles
CC-NES = arm-linux-gnueabihf-gcc
+TARGET=mod/bin/clovershell
+HMOD=clovershell.hmod
+
+all: $(HMOD)
-all: clovershell
+$(HMOD): $(TARGET)
+ cd mod && tar -czvf ../$(HMOD) *
-clovershell: clovershell.c
- $(CC-NES) -g -Wall $(CFLAGS-NES) $(LDFLAGS-NES) $< -o clovershell
+$(TARGET): clovershell.c
+ $(CC-NES) -g -Wall $(CFLAGS-NES) $(LDFLAGS-NES) $< -o $(TARGET)
clean:
- -$(RM) clovershell *~ \#*\#
+ rm -f $(TARGET) $(HMOD) *~ \#*\#
diff --git a/clovershell.c b/clovershell.c
index a55fa0c..23b64ec 100644
--- a/clovershell.c
+++ b/clovershell.c
@@ -1,3 +1,9 @@
+/*
+*** clovershell daemon (c) Cluster, 2017
+*** http://clusterrr.com
+*** clusterrr@clusterrr.com
+*/
+
#define _XOPEN_SOURCE 600
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/mod/etc/init.d/S91clovershell b/mod/etc/init.d/S91clovershell
new file mode 100755
index 0000000..14624b6
--- /dev/null
+++ b/mod/etc/init.d/S91clovershell
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+CONFIGFS="/sys/devices/virtual/android_usb/android0"
+VENDOR_ID="1f3a"
+PRODUCT_ID="efe8"
+
+start() {
+ echo "0" > "$CONFIGFS/enable"
+ echo "VENDOR_ID" > "$CONFIGFS/idVendor"
+ echo "$PRODUCT_ID" > "$CONFIGFS/idProduct"
+ echo "clover" > "$CONFIGFS/functions"
+ echo "1" > "$CONFIGFS/enable"
+ echo "done"
+ /bin/clovershell --daemon
+}
+
+stop() {
+ killall clovershell
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/mod/install b/mod/install
new file mode 100644
index 0000000..1d2d0d5
--- /dev/null
+++ b/mod/install
@@ -0,0 +1,4 @@
+transfer_default
+chmod +x $rootfs/bin/*
+chmod +x $rootfs/etc/init.d/S91clovershell
+return 1