summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-06-13 13:15:31 +0000
committerOlivier Blin <oblin@mandriva.com>2008-06-13 13:15:31 +0000
commit385b63be3fa69d662759e5751a7817cca6b7e44d (patch)
tree7c6d90933ba6404f8686056575fca8bd6bc2b510
parentcf3444998b33f1003af565d4cfe152fbe042f503 (diff)
downloaddrakx-385b63be3fa69d662759e5751a7817cca6b7e44d.tar
drakx-385b63be3fa69d662759e5751a7817cca6b7e44d.tar.gz
drakx-385b63be3fa69d662759e5751a7817cca6b7e44d.tar.bz2
drakx-385b63be3fa69d662759e5751a7817cca6b7e44d.tar.xz
drakx-385b63be3fa69d662759e5751a7817cca6b7e44d.zip
merge partimage hooks in real rc.sysinit (and drop hardcoded leia)
-rwxr-xr-xrescue/make_rescue_img26
-rwxr-xr-xrescue/tree/etc/rc.sysinit19
2 files changed, 16 insertions, 29 deletions
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 863f45371..a58cb0b79 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -55,31 +55,7 @@ if (my ($LANGUAGE) = map { if_(/LANGUAGE_(.*)/, $1) } keys %ENV) {
}
if ($ENV{PARTIMAGE_RPM}) {
-
- _ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)";
- my $server = 'partimaged';
- $server = 'leia';
-
- my $default_dir = '/data/box';
-
- substInFile {
- $_ = " server=$server\n" . " default_dir=$default_dir\n" . <<'EOF' if /^\s*rescue-gui/;
-
- partimage_dir=`perl -lne 'print $1 if /BOX=(\S+)/' /proc/cmdline`
- [ -z "$partimage_dir" ] && partimage_dir=$default_dir
-
- if grep -q save_all /proc/cmdline; then
- partimage_whole_disk -s $server save_all $default_dir
- fi
- if grep -q rest_all /proc/cmdline; then
- if [ -d /tmp/image$partimage_dir ]; then
- partimage_whole_disk rest_all /tmp/image$partimage_dir
- else
- partimage_whole_disk -s $server rest_all $partimage_dir
- fi
- fi
-EOF
- } "$tmp/etc/rc.sysinit";
+ #_ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)";
}
exit 0 if $ARGV[0];
diff --git a/rescue/tree/etc/rc.sysinit b/rescue/tree/etc/rc.sysinit
index cbb42aed3..9828ba324 100755
--- a/rescue/tree/etc/rc.sysinit
+++ b/rescue/tree/etc/rc.sysinit
@@ -53,7 +53,20 @@ stty sane
grep -q noauto /proc/cmdline || drvinst SERIAL_USB
-if grep kamethod /proc/cmdline; then
+partimage_default_dir=/data/box
+partimage_dir=`perl -lne 'print $1 if /BOX=(\S+)/' /proc/cmdline`
+[ -z "$partimage_dir" ] && partimage_dir=$partimage_default_dir
+partimage_server=`perl -lne 'print $1 if /\bpserver=(\S+)/' /proc/cmdline`
+
+if grep -q save_all /proc/cmdline; then
+ partimage_whole_disk -s $partimage_server save_all $partimage_default_dir
+elif grep -q rest_all /proc/cmdline; then
+ if [ -d /tmp/image$partimage_dir ]; then
+ partimage_whole_disk rest_all /tmp/image$partimage_dir
+ else
+ partimage_whole_disk -s $partimage_server rest_all $partimage_dir
+ fi
+elif grep kamethod /proc/cmdline; then
echo "Welcome to Ka"
drvinst
ln -sf /tmp/stage2/ka $KADIR
@@ -62,8 +75,6 @@ if grep kamethod /proc/cmdline; then
echo "-------- Starting LOG server -------------"
perl send_status.pl > /tmp/kacmd &
exec ./ka_replication.sh > /tmp/ka_log-$HOSTNAME-$DATE 2>&1
-fi
-
-if ! grep -q expert /proc/cmdline; then
+elif ! grep -q expert /proc/cmdline; then
rescue-gui
fi