summaryrefslogtreecommitdiffstats
path: root/move/tree
diff options
context:
space:
mode:
Diffstat (limited to 'move/tree')
-rwxr-xr-xmove/tree/mdk_behind_totem71
-rwxr-xr-xmove/tree/mdk_totem14
2 files changed, 85 insertions, 0 deletions
diff --git a/move/tree/mdk_behind_totem b/move/tree/mdk_behind_totem
new file mode 100755
index 000000000..11ef2ae22
--- /dev/null
+++ b/move/tree/mdk_behind_totem
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+ok=1
+
+boot_loop=loop0
+main_loop=loop3
+
+while [ -n "$1" ]; do
+ case "$1" in
+ --boot-loop)
+ boot_loop="$1"
+ shift
+ shift
+ ;;
+ --main-loop)
+ main_loop="$2"
+ shift
+ shift
+ ;;
+ --totem-pid)
+ totem_pid="$2"
+ shift
+ shift
+ ;;
+ *)
+ ok=''
+ shift
+ esac
+done
+
+if [ -z "$totem_pid" -o -z "$ok" ]; then
+ printf "Usage: mdk_behind_totem [--boot-loop <loop>] [--main-loop <loop>] --totem-pid <pid>\n"
+ exit 1
+fi
+
+exec 2> /tmp/mdk_behind_totem.log
+
+trap 'umount_cd' USR1
+
+umount_cd() {
+ echo umount_cd
+ busy-files | grep /image/
+ busy-files | grep /image_boot/
+
+ umount /image_boot
+ losetup -d /dev/$boot_loop
+
+ ln -sf /image_always/lib /
+ umount /image
+ /image_always/sbin/losetup -d /dev/$main_loop
+}
+
+mount_cd() {
+ echo mount_cd
+ /image_always/sbin/losetup -r -e gz /image_raw/live_tree.clp /dev/$main_loop
+ /image_always/bin/mount /dev/$main_loop /image
+
+ losetup -r -e gz /image_raw/live_tree_boot.clp /dev/$boot_loop
+ mount /dev/$boot_loop /image_boot
+
+ ln -sf /image/lib /
+
+ mdk_move_loop to_cdrom always totem
+}
+
+while [ -e "/proc/$totem_pid" ]; do
+ echo "waiting..."
+ sleep 1
+done
+
+mount_cd
diff --git a/move/tree/mdk_totem b/move/tree/mdk_totem
new file mode 100755
index 000000000..857089a1c
--- /dev/null
+++ b/move/tree/mdk_totem
@@ -0,0 +1,14 @@
+#!/bin/sh -x
+
+# kill 15, fuzzy_pidofs(qr/\bkded\b/);
+# kdesud
+
+# done ASAP since it needs to be done and will speed up totem launch
+mdk_move_loop to_memory always totem
+
+cp -a /image_raw/{totem,mdk_behind_totem} /tmp
+
+sudo /tmp/mdk_behind_totem --totem-pid $$ &
+export MDKMOVE=$!
+
+exec /tmp/totem "$@"