summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-09-25 19:13:32 +0000
committerOlivier Blin <oblin@mandriva.com>2008-09-25 19:13:32 +0000
commita8e57f1d5a3d440e68459468fedde1781a061fd7 (patch)
tree8e32b89dfdd86949c1a838ae07cd9022dad6f428
parent8235cf8d86639a1b42d33e8037cf189b725e1616 (diff)
downloaddrakx-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar
drakx-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.gz
drakx-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.bz2
drakx-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.xz
drakx-a8e57f1d5a3d440e68459468fedde1781a061fd7.zip
support more compression types (from Miura?)
-rwxr-xr-xrescue/restore-image.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index 9336b50e6..4e2f06708 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -102,7 +102,14 @@ function detect_root()
function write_image()
{
root=$(detect_root)
- bzcat $images_dir/$image | dd of=/dev/$root bs=4096 > /tmp/backup.out 2>&1 &
+ image=$(cat $images_dir/list | cut -d ',' -f 3)
+ extension=$(echo $image | cut -d '.' -f 3)
+ case $extension in
+ gz) uncomp=zcat ;;
+ bz2) uncomp=bzcat ;;
+ *) uncomp=cat ;;
+ esac
+ $uncomp $images_dir/$image | dd of=/dev/$root bs=4M > /tmp/backup.out 2>&1 &
sleep 3
pid=$(ps ax | grep 'dd of' | grep -v grep | awk '{ print $1 }')