diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-11-06 21:33:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-11-06 21:33:17 +0000 |
commit | b64692ddd130c43f3b0ba9665bb3945bc46ff485 (patch) | |
tree | db2f495379ac5d9616940ee764a0e88e38796f17 /move/tree/mdk_behind_totem | |
parent | 7b45a9b3b0e6afda5f9af72fa264ced22121d9e5 (diff) | |
download | drakx-b64692ddd130c43f3b0ba9665bb3945bc46ff485.tar drakx-b64692ddd130c43f3b0ba9665bb3945bc46ff485.tar.gz drakx-b64692ddd130c43f3b0ba9665bb3945bc46ff485.tar.bz2 drakx-b64692ddd130c43f3b0ba9665bb3945bc46ff485.tar.xz drakx-b64692ddd130c43f3b0ba9665bb3945bc46ff485.zip |
add mdk_totem & mdk_behind_totem
Diffstat (limited to 'move/tree/mdk_behind_totem')
-rwxr-xr-x | move/tree/mdk_behind_totem | 71 |
1 files changed, 71 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 |