[prev in list] [next in list] [prev in thread] [next in thread] 

List:       moblin-commits
Subject:    [Moblin-Commits] moblin-settings: Changes to 'master'
From:       tebrandt () moblin ! org (Todd E Brandt)
Date:       2008-06-18 22:31:59
Message-ID: 20080618223159.E45F01E74003 () moblin ! org
[Download RAW message or body]

This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 ChangeLog                     |    7 ++
 Makefile.am                   |    2 +-
 configure.in                  |   16 +++--
 m4/hildon-control-panel.m4    |   22 -------
 m4/moblin-settings.m4         |   18 ++++++
 scripts/Makefile.am           |    7 ++
 scripts/install.sh            |   37 ++++++++++++
 scripts/moblin-kernel-modules |  124 +++++++++++++++++++++++++++++++++++++++++
 scripts/moblin-system-daemon  |   58 +++++++++++++++++++
 scripts/uninstall.sh          |   38 +++++++++++++
 10 files changed, 300 insertions(+), 29 deletions(-)

New commits:
commit 137c6db4415251f82c89531ff0dfdeea33c82822
Author: Todd Brandt <todd.e.brandt@intel.com>
Date:   Wed Jun 18 15:29:43 2008 -0700

    Added the install for the init.d scripts


Diff in this email is a maximum of 400 lines.
diff --git a/ChangeLog b/ChangeLog
index 01c5556..dd85105 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+moblin-settings (2.3)
+
+  * Added the moblin-system-daemon install and execute script
+  * Added the kernel modules install and execute script
+
+ -- Todd Brandt <todd.e.brandt@intel.com>  Wed Jun 18 15:28:29 PDT 2008
+
 moblin-settings (2.2)
 
   * Added the battery module and API
diff --git a/Makefile.am b/Makefile.am
index f3814e7..14d9bbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = moblin-system-daemon
+SUBDIRS = scripts moblin-system-daemon
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/configure.in b/configure.in
index e5c3407..4f4ec10 100644
--- a/configure.in
+++ b/configure.in
@@ -2,8 +2,8 @@
 # identification info #
 #######################
 
-AC_INIT([moblin-settings], [0.2.0], [http://moblin.org/playground/?q=node/57])
-AM_INIT_AUTOMAKE(moblin-settings, 0.2.0)
+AC_INIT([moblin-settings], [2.0.0], [http://moblin.org/playground/?q=node/57])
+AM_INIT_AUTOMAKE(moblin-settings, 2.0.0)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
 
@@ -34,6 +34,9 @@ if test "x$GCC" = "xyes"; then
 fi
 changequote([,])dnl
 
+# Use m4/moblin-settings.m4
+MOBLIN_SETTINGS
+
 ################################
 # Internationalization support #
 ################################
@@ -65,10 +68,10 @@ AC_SUBST(DBUS_LIBS)
 SYMBOL_DEFINES=" dnl
 -DLOCALEDIR=\\\"\$(datadir)/locale\\\" dnl
 -DDATADIR=\\\"\$(datadir)\\\" dnl
--DPKG_DATA_DIR=\\\"\$(madatadir)\\\" dnl
--DPKG_GLADE_DIR=\\\"\$(magladedir)\\\" dnl
--DPKG_XML_DIR=\\\"\$(maxmldir)\\\" dnl
--DPKG_PIXMAPS_DIR=\\\"\$(mapixmapsdir)\\\" dnl
+-DPKG_DATA_DIR=\\\"\$(mdatadir)\\\" dnl
+-DPKG_GLADE_DIR=\\\"\$(mgladedir)\\\" dnl
+-DPKG_XML_DIR=\\\"\$(mxmldir)\\\" dnl
+-DPKG_PIXMAPS_DIR=\\\"\$(mpixmapsdir)\\\" dnl
 "
 
 COMMON_CFLAGS="${SYMBOL_DEFINES} ${DBUS_CFLAGS}"
@@ -147,6 +150,7 @@ AC_CONFIG_FILES([
 Makefile
 moblin-system-daemon/Makefile
 moblin-system-daemon/moblin-system-daemon.pc
+scripts/Makefile
 ])
 
 #######################
diff --git a/m4/hildon-control-panel.m4 b/m4/hildon-control-panel.m4
deleted file mode 100644
index afafeb6..0000000
--- a/m4/hildon-control-panel.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-AC_DEFUN([HILDON_CONTROL_PANEL],
-[
-AC_SUBST([autostartdir], ['${datadir}/autostart'])
-AC_SUBST([hcplibdir], ['${libdir}/hildon-control-panel'])
-AC_SUBST([hsblibdir], ['${libdir}/hildon-status-bar'])
-AC_SUBST([desktopdir], ['$(datadir)/applications'])
-AC_SUBST([hcpdesktopdir], ['$(datadir)/applications/hildon-control-panel'])
-AC_SUBST([hsbdesktopdir], ['$(datadir)/applications/hildon-status-bar'])
-AC_SUBST([magladedir], ['$(pkgdatadir)/glade'])
-AC_SUBST([maxmldir], ['$(pkgdatadir)/xml'])
-AC_SUBST([mapixmapsdir], ['$(pkgdatadir)/pixmaps'])
-AC_SUBST([hcpicons48dir], ['$(datadir)/icons/gnome/48x48/apps'])
-AC_SUBST([madatadir], ['$(pkgdatadir)'])
-AC_SUBST([schemadir], ['${datadir}/gconf/schemas'])
-AC_SUBST([initdir], ['/etc/init.d'])
-AC_SUBST([maicons16dir], ['$(datadir)/icons/hicolor/16x16/status'])
-AC_SUBST([maicons22dir], ['$(datadir)/icons/hicolor/22x22/status'])
-AC_SUBST([maicons24dir], ['$(datadir)/icons/hicolor/24x24/status'])
-AC_SUBST([maicons48dir], ['$(datadir)/icons/hicolor/48x48/status'])
-AC_SUBST([maiconsscdir], ['$(datadir)/icons/hicolor/scalable/status'])
-AC_SUBST([mabgdir], ['$(pkgdatadir)/backgrounds'])
-])
diff --git a/m4/moblin-settings.m4 b/m4/moblin-settings.m4
new file mode 100644
index 0000000..4761538
--- /dev/null
+++ b/m4/moblin-settings.m4
@@ -0,0 +1,18 @@
+AC_DEFUN([MOBLIN_SETTINGS],
+[
+AC_SUBST([autostartdir], ['${datadir}/autostart'])
+AC_SUBST([desktopdir], ['$(datadir)/applications'])
+AC_SUBST([mgladedir], ['$(pkgdatadir)/glade'])
+AC_SUBST([mxmldir], ['$(pkgdatadir)/xml'])
+AC_SUBST([mpixmapsdir], ['$(pkgdatadir)/pixmaps'])
+AC_SUBST([hcpicons48dir], ['$(datadir)/icons/gnome/48x48/apps'])
+AC_SUBST([mdatadir], ['$(pkgdatadir)'])
+AC_SUBST([schemadir], ['${datadir}/gconf/schemas'])
+AC_SUBST([initdir], ['${sysconfdir}/init.d'])
+AC_SUBST([micons16dir], ['$(datadir)/icons/hicolor/16x16/status'])
+AC_SUBST([micons22dir], ['$(datadir)/icons/hicolor/22x22/status'])
+AC_SUBST([micons24dir], ['$(datadir)/icons/hicolor/24x24/status'])
+AC_SUBST([micons48dir], ['$(datadir)/icons/hicolor/48x48/status'])
+AC_SUBST([miconsscdir], ['$(datadir)/icons/hicolor/scalable/status'])
+AC_SUBST([mbgdir], ['$(pkgdatadir)/backgrounds'])
+])
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..042d1a2
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,7 @@
+install:
+	./install.sh $(DESTDIR)
+
+uninstall:
+	./uninstall.sh $(DESTDIR)
+
+init_DATA = moblin-kernel-modules moblin-system-daemon
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..3c6083a
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+print_usage() {
+    echo "Usage: install.sh <dir>"
+    exit 0
+}
+
+APATH=""
+if [ $# -ge 1 ]; then
+    if [ ! -d $1 ]; then
+	print_usage
+    else
+	APATH=$1
+    fi
+fi
+
+SYSDIR=/etc
+INITDIR=/etc/init.d
+RCPATHS="rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d"
+
+cp -f  moblin-kernel-modules moblin-system-daemon $INITDIR
+
+if [ -x "${INITDIR}/moblin-kernel-modules" ]; then
+    update-rc.d moblin-kernel-modules defaults 10 21 >/dev/null
+fi
+
+if [ -x "${INITDIR}/moblin-system-daemon" ]; then
+    update-rc.d moblin-system-daemon defaults 99 21 >/dev/null
+fi
+
+if [ -n $APATH ]; then
+    cp -f moblin-kernel-modules moblin-system-daemon $APATH/$INITDIR
+    for i in $RCPATHS; do
+	cp -f $SYSDIR/$i/*moblin-system-daemon $APATH/$SYSDIR/$i
+	cp -f $SYSDIR/$i/*moblin-kernel-modules $APATH/$SYSDIR/$i
+    done
+fi
diff --git a/scripts/moblin-kernel-modules b/scripts/moblin-kernel-modules
new file mode 100755
index 0000000..1342bc2
--- /dev/null
+++ b/scripts/moblin-kernel-modules
@@ -0,0 +1,124 @@
+#! /bin/sh -e
+
+# Check for ACPI support on kernel side
+[ -d /proc/acpi ] || exit 0
+
+# Get lsb functions
+. /lib/lsb/init-functions
+. /etc/default/rcS
+
+if [ "x$VERBOSE" = "xno" ]; then
+        MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
+        export MODPROBE_OPTIONS
+fi
+
+load_modules() {
+        PRINTK=`cat /proc/sys/kernel/printk`
+        [ "$VERBOSE" = no ] && echo "0 0 0 0" > /proc/sys/kernel/printk
+        
+        LIST=`/sbin/lsmod|awk '!/Module/ {print $1}'`
+
+	# Get list of available modules
+        LOC="/lib/modules/`uname -r`/kernel/drivers/acpi"
+        LOC2="/lib/modules/`uname -r`/kernel/ubuntu/acpi"
+        if [ -d $LOC ]; then
+	  MODAVAIL=`( find $LOC -type f -name "*.o" -printf "basename %f .o\n"; \
+		find $LOC -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`
+	else
+	  MODAVAIL=""
+	fi
+
+        if [ -d $LOC2 ]; then
+	  MODAVAIL="$MODAVAIL `( find $LOC2 -type f -name "*.o" -printf "basename %f .o\n"; \
\ +		find $LOC2 -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`"
+	fi
+
+	MODULES="$MODAVAIL"
+
+	if [ -n "$MODULES" ]; then
+		log_begin_msg "Loading ACPI modules..."
+		STATUS=0
+	        for mod in $MODULES; do
+			echo $MODAVAIL | grep -q -w "$mod" || continue
+		        if echo $LIST | grep -q -w "$mod"; then
+				[ "$VERBOSE" != no ] && log_success_msg "Module already loaded: $mod"
+			else
+				if modprobe -b $mod 2>/dev/null; then
+					[ "$VERBOSE" != no ] && log_success_msg "Loaded module: $mod"
+				else
+					if [ "$VERBOSE" != no ]; then
+						log_warning_msg "Unable to load module: $mod"
+					fi
+				fi
+			fi		
+	        done
+		log_end_msg $STATUS
+	fi
+        echo "$PRINTK" > /proc/sys/kernel/printk
+}
+
+unload_modules() {
+        PRINTK=`cat /proc/sys/kernel/printk`
+        [ "$VERBOSE" = no ] && echo "0 0 0 0" > /proc/sys/kernel/printk
+        
+        LIST=`/sbin/lsmod|awk '!/Module/ {print $1}'`
+
+	# Get list of available modules
+        LOC="/lib/modules/`uname -r`/kernel/drivers/acpi"
+        LOC2="/lib/modules/`uname -r`/kernel/ubuntu/acpi"
+        if [ -d $LOC ]; then
+	  MODAVAIL=`( find $LOC -type f -name "*.o" -printf "basename %f .o\n"; \
+		find $LOC -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`
+	else
+	  MODAVAIL=""
+	fi
+
+        if [ -d $LOC2 ]; then
+	  MODAVAIL="$MODAVAIL `( find $LOC2 -type f -name "*.o" -printf "basename %f .o\n"; \
\ +		find $LOC2 -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`"
+	fi
+
+	MODULES="$MODAVAIL"
+
+	if [ -n "$MODULES" ]; then
+		log_begin_msg "Unloading ACPI modules..."
+		STATUS=0
+	        for mod in $MODULES; do
+			echo $MODAVAIL | grep -q -w "$mod" || continue
+		        if echo $LIST | grep -q -w "$mod"; then
+				if modprobe -r $mod 2>/dev/null; then
+					[ "$VERBOSE" != no ] && log_success_msg "Unloaded module: $mod"
+				else
+					if [ "$VERBOSE" != no ]; then
+						log_warning_msg "Unable to unload module: $mod"
+					fi
+				fi
+			else
+				[ "$VERBOSE" != no ] && log_success_msg "Module already unloaded: $mod"
+			fi		
+	        done
+		log_end_msg $STATUS
+	fi
+        echo "$PRINTK" > /proc/sys/kernel/printk
+}
+
+case "$1" in
+  start)
+    [ -f /proc/modules ] && load_modules
+    ;;
+  stop)
+#    [ -f /proc/modules ] && unload_modules
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  reload|force-reload) 
+    ;;
+  *)
+    log_success_msg "Usage: /etc/init.d/moblin-applets \
{start|stop|restart|reload|force-reload}" +    exit 1
+esac
+
+exit 0
diff --git a/scripts/moblin-system-daemon b/scripts/moblin-system-daemon
new file mode 100755
index 0000000..73008d1
--- /dev/null
+++ b/scripts/moblin-system-daemon
@@ -0,0 +1,58 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/moblin-system-daemon
+NAME=moblin-system-daemon
+DESC="MoblinSystemDaemon"
+PROCESSES=`ps xo pid,args | grep /usr/sbin/$NAME | grep -v grep | grep -v invoke-rc \
| tr ' ' '\n' | sed -n -e "/[0-9]/p" | tr '\n' ' '` +ALLPROCESSES=`ps axo pid,args | \
grep /usr/sbin/$NAME | grep -v grep | grep -v invoke-rc | tr ' ' '\n' | sed -n -e \
"/[0-9]/p" | tr '\n' ' '` +
+. /lib/lsb/init-functions
+
+test -x $DAEMON || exit 0
+
+set -e
+
+do_start() {
+	if [ -z "$PROCESSES" ]; then
+		start-stop-daemon --start --oknodo \
+			--exec $DAEMON -- $DAEMON_OPTS
+	fi
+}
+
+do_stop() {
+	for i in $ALLPROCESSES; do
+		kill $i
+	done
+}
+
+case "$1" in
+  start)
+	if [ ! -e /var/run/dbus/system_bus_socket ]; then
+		log_failure_msg "Can't start $DESC - please ensure dbus is running"
+		exit 0
+	fi
+	
+	log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	log_end_msg $?
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	log_end_msg $?
+	;;
+  restart|force-reload)
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	sleep 1
+	do_start
+	log_end_msg $?
+	;;
+  *)
+	log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh
new file mode 100755
index 0000000..1df7e65
--- /dev/null
+++ b/scripts/uninstall.sh
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+print_usage() {
+    echo "Usage: install.sh <dir>"
+    exit 0
+}
+
+APATH=""
+if [ $# -ge 1 ]; then
+    if [ ! -d $1 ]; then
+        print_usage
+    else
+        APATH=$1
+    fi
+fi
+
+SYSDIR=/etc
+INITDIR=/etc/init.d
+RCPATHS="rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d"
_______________________________________________
Commits mailing list
Commits@moblin.org
https://www.moblin.org/mailman/listinfo/commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic