op_startupmanager: Included configuration for services on bootup
authorMichael Mrozek <EvilDragon@openpandora.de>
Thu, 17 Jun 2010 03:20:33 +0000 (05:20 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Thu, 17 Jun 2010 03:20:33 +0000 (05:20 +0200)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_startupmanager.sh
recipes/pandora-system/pandora-scripts/service.conf [new file with mode: 0644]

index 3246fa8..236a0d6 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r26"
+PR = "r27"
 
 SRC_URI = " \
           file://op_bright.sh \
@@ -39,6 +39,7 @@ SRC_URI = " \
 #        file://op_nubmode.desktop \
           file://gui.conf \
           file://gamma.conf \
+          file://service.conf \
           file://op_env.sh \
           file://pandorascripts.pnd \
          file://abiword.pnd \
@@ -107,6 +108,7 @@ do_install() {
           install -d ${D}${sysconfdir}/pandora/conf/
           install -m 0644 ${WORKDIR}/gui.conf ${D}${sysconfdir}/pandora/conf/gui.conf
           install -m 0644 ${WORKDIR}/gamma.conf ${D}${sysconfdir}/pandora/conf/gamma.conf
+          install -m 0644 ${WORKDIR}/service.conf ${D}${sysconfdir}/pandora/conf/service.conf
 
           install -d ${D}${sysconfdir}/profile.d/
           install -m 0755 ${WORKDIR}/op_env.sh ${D}${sysconfdir}/profile.d/
index 7c0c336..54ce1c5 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/bash
 # Released under the GPL
-# Startup-Manager, v1.0, written by Michael Mrozek aka EvilDragon 2010 with some help by vimacs.
+# Startup-Manager, v1.1, written by Michael Mrozek aka EvilDragon 2010 with some help by vimacs.
 # This scripts allows you to change various settings of the Pandora startup process.
 
-while mainsel=$(zenity --title="Startup manager" --width="400" --height="250" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "gui" "Change Default GUI for current user" "login" "Enable/Disable auto login" "user" "Select default user" "wifi" "Enable/Disable WiFi on boot"); do
+while mainsel=$(zenity --title="Startup manager" --width="400" --height="250" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "gui" "Change Default GUI for current user" "login" "Enable/Disable auto login" "user" "Select default user" "service" "Enable/Disable services on boot"); do
 
 
 case $mainsel in
@@ -43,16 +43,27 @@ case $mainsel in
         zenity --info --title="Changed default user" --text "The default user disabled" --timeout 6
        fi;;
 
-# Enable / Disable WiFi on boot
-     "wifi")
-      if zenity --question --title="Start WiFi on Bootup" --text="Do you wish to automatically start the WiFi driver on bootup?" --ok-label="Yes" --cancel-label="No"; then            
-        ln -s ../init.d/wl1251-init /etc/rc5.d/S30wl1251-init
-        ln -s ../init.d/wl1251-init /etc/rc2.d/S30wl1251-init
-        zenity --info --title="Changed WiFi startup" --text "WiFi on boot is now enabled." --timeout 6
-      else
-        rm /etc/rc2.d/S30wl1251-init
-         rm /etc/rc5.d/S30wl1251-init
-         zenity --info --title="Changed WiFi startup" --text "WiFi on boot is now disabled." --timeout 6
-      fi;;
+# Enable / Disable services on boot
+      
+     "service")
+        while servsel=$((
+               cat /etc/pandora/conf/service.conf|awk -F\# '{
+               if (system("test -f "$1))
+                   print "FALSE"
+               else
+                   print "TRUE";print NR;print $2
+               }'
+               )|
+               zenity --title='Service Manager' --width=500 --height=300 --list --checklist --hide-column=2 --column Enabled --column line --column 'Please select'  --text='Enable / Disable Service:' --separator='#'); do
+
+       cat /etc/pandora/conf/service.conf|awk -F\# -v pat="$servsel" '{
+       if (match(pat,NR))
+           system ($4)
+       else
+           system ($3)
+       }'
+       zenity --info --title="Done" --text "The startup services have been changed." --timeout 6
+       done
+;;
 esac
 done 
\ No newline at end of file
diff --git a/recipes/pandora-system/pandora-scripts/service.conf b/recipes/pandora-system/pandora-scripts/service.conf
new file mode 100644 (file)
index 0000000..6962630
--- /dev/null
@@ -0,0 +1,7 @@
+/etc/rc5.d/S20samba#Start Samba on bootup#update-rc.d -f samba remove#update-rc.d -f samba defaults 20
+/etc/rc5.d/S30wl1251-init#Start Wifi on bootup#update-rc.d -f wl1251-init remove#update-rc.d -f wl1251-init defaults 30 40
+/etc/rc5.d/S10dropbear#Start Dropbear (SSH login) on bootup#update-rc.d -f dropbear remove#update-rc.d -f dropbear defaults 10
+/etc/rcS.d/S39alsa-state#Save/Restore ALSA Mixer Settings#update-rc.d -f alsa-state remove#update-rc.d -f alsa-state start 39 S . stop 31 0 1 6 .
+/etc/rcS.d/S39pandora-lcd-state#Save/Restore Nub and LCD Settings on bootup#update-rc.d -f pandora-lcd-state remove#update-rc.d -f pandora-lcd-state start 39 S . stop 31 0 1 6 .
+/etc/rc5.d/S10dropbear#Mount remote filesystems on bootup#update-rc.d -f mountnfs.sh remove;update-rc.d -f umountnfs.sh remove#update-rc.d -f mountnfs.sh start 45 S . ;update-rc.d -f umountnfs.sh start 31 0 6 .
+/etc/rc5.d/S50usb-gadget#Start USB Network on bootup#update-rc.d -f usb-gadget remove#update-rc.d -f usb-gadget defaults 50
\ No newline at end of file