summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/make_partimage_save_rest_all37
-rwxr-xr-xrescue/make_rescue_img16
2 files changed, 53 insertions, 0 deletions
diff --git a/rescue/make_partimage_save_rest_all b/rescue/make_partimage_save_rest_all
new file mode 100755
index 000000000..cf4c79d2c
--- /dev/null
+++ b/rescue/make_partimage_save_rest_all
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+[ $# != 1 ] && {
+ echo "usage: make_partimage_save_rest_all <partimage special rpm>" ;
+ exit 1
+}
+
+rpm=$1
+where=/data/box
+
+rm -rf .tmp
+mkdir -p .tmp/isolinux
+cp -f /usr/lib/syslinux/isolinux.bin ../isolinux/alt0/* .tmp/isolinux
+
+PARTIMAGE_DIR="$where" PARTIMAGE_RPM=$rpm DISTRIB_DESCR="partimage save/restore all" ./make_rescue_img
+mkdir -p .tmp/install/stage2
+mv -f rescue.clp .tmp/install/stage2
+
+for action in save_all rest_all; do
+
+ cat <<EOF > .tmp/isolinux/isolinux.cfg
+default $action
+prompt 1
+timeout 150
+
+label save_all
+ kernel vmlinuz
+ append initrd=all.rdz rescue save_all automatic=method:cdrom
+label rest_all
+ kernel vmlinuz
+ append initrd=all.rdz rescue rest_all automatic=method:cdrom
+EOF
+
+ mkisofs -o part_$action.iso -r -J -hide-rr-moved -nobak -cache-inodes -publisher Mandrakesoft -V 'mdk part save/rest' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .tmp
+done
+
+rm -rf .tmp
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 12cd9287c..0bf9ba05f 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -112,6 +112,22 @@ installown("../mdk-stage1/dhcp-client", "/usr/sbin");
#- note that on biarch systems, we may need to have both /lib and /lib64
__ "strip $tmp/{lib,$lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null";
+if ($ENV{PARTIMAGE_DIR}) {
+ _ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)";
+ my $server = 'partimaged';
+ $server = 'leia';
+ substInFile {
+ $_ = <<EOF if /^\s*rescue-gui/;
+ if grep -q save_all /proc/cmdline; then
+ drvinst ; dhcp-client ; partimage -s $server -b save_all $ENV{PARTIMAGE_DIR}; reboot
+ fi
+ if grep -q rest_all /proc/cmdline; then
+ drvinst ; dhcp-client ; partimage -s $server -b rest_all $ENV{PARTIMAGE_DIR}; reboot
+ fi
+EOF
+ } "$tmp/etc/rc.sysinit";
+}
+
exit 0 if $ARGV[0];
_ "mkisofs -quiet -D -R $tmp | create_compressed_fs - 65536 $rescue 200 2>/dev/null";