summaryrefslogtreecommitdiffstats
path: root/target/device/valka/target_skeleton/etc/rc.d
diff options
context:
space:
mode:
Diffstat (limited to 'target/device/valka/target_skeleton/etc/rc.d')
-rwxr-xr-xtarget/device/valka/target_skeleton/etc/rc.d/dbus30
-rwxr-xr-xtarget/device/valka/target_skeleton/etc/rc.d/gui39
-rwxr-xr-xtarget/device/valka/target_skeleton/etc/rc.d/nbd_swap31
3 files changed, 31 insertions, 69 deletions
diff --git a/target/device/valka/target_skeleton/etc/rc.d/dbus b/target/device/valka/target_skeleton/etc/rc.d/dbus
deleted file mode 100755
index 4b81d3c38..000000000
--- a/target/device/valka/target_skeleton/etc/rc.d/dbus
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-. /etc/rc.subr
-
-start() {
- [ -x /usr/bin/dbus-daemon ] || exit 0
- [ -d /var/run/dbus ] || mkdir -p /var/run/dbus
- [ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys
-
- echo -n " * Starting dbus: "
-
- dbus-uuidgen --ensure
- dbus-daemon --system
- RETVAL=$?
- echo "Ok"
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon
-}
-
-stop() {
- echo -n " * Stopping dbus: "
-
- killall dbus-daemon
- RETVAL=$?
- echo "Ok"
- if [ $RETVAL -eq 0 ]; then
- rm -f /var/lock/subsys/dbus-daemon
- rm -f /var/run/messagebus.pid
- fi
-}
-
-rc_run_command "$1" "dbus"
diff --git a/target/device/valka/target_skeleton/etc/rc.d/gui b/target/device/valka/target_skeleton/etc/rc.d/gui
deleted file mode 100755
index 494d11377..000000000
--- a/target/device/valka/target_skeleton/etc/rc.d/gui
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-. /etc/rc.subr
-
-firsttime() {
- if [ -e /var/db/gui.done ]; then
- return 0
- fi
- echo -n " * Running fc-cache: "
- /usr/bin/fc-cache -v > /dev/null
- echo "Ok"
-
- echo -n " * Querying PANGO modules: "
- /usr/bin/pango-querymodules > /etc/pango/pango.modules
- echo "Ok"
-
- echo -n " * Querying GTK Modules: "
- /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
- echo "Ok"
-
- echo -n " * Querying Pixbuf loaders: "
- /usr/bin/gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
- echo "Ok"
-
- touch /var/db/gui.done
-}
-
-start() {
- firsttime
-
- echo -n " * Starting XOrg: "
- ${xorg_program} ${xorg_flags} > ${xorg_log} 2>&1 &
- echo "Ok"
-}
-
-stop() {
- return 0
-}
-
-rc_run_command "$1" "gui"
diff --git a/target/device/valka/target_skeleton/etc/rc.d/nbd_swap b/target/device/valka/target_skeleton/etc/rc.d/nbd_swap
new file mode 100755
index 000000000..b2a4a9c25
--- /dev/null
+++ b/target/device/valka/target_skeleton/etc/rc.d/nbd_swap
@@ -0,0 +1,31 @@
+#!/bin/ash
+. /etc/rc.subr
+
+start() {
+ echo -n " * Starting nbd swap: "
+ if [ ! -x ${nbd_swap_program} ]; then
+ log_error "Missing 'nbd_client' program (${nbd_swap_program})"
+ echo "Failed"
+ return 1
+ fi
+
+ mknod ${nbd_swap_device} b 43 0
+ ${nbd_swap_program} ${nbd_swap_server} ${nbd_swap_port} ${nbd_swap_device} &
+ pid=$!
+ if [ "$?" -eq 0 ]; then
+ echo "${pid}" > ${nbd_swap_pidfile}
+ mkswap ${nbd_swap_device}
+ swapon ${nbd_swap_device}
+ echo "Ok"
+ else
+ echo "Failed"
+ fi
+}
+
+stop() {
+ echo " * Stopping nbd swap..."
+ swapoff ${nbd_swap_device}
+ killpid ${nbd_swap_pidfile}
+}
+
+rc_run_command "$1" "nbd_swap"