source: MondoRescue/branches/2.2.10/mindi/rootfs/sbin/post-init @ 2462

Last change on this file since 2462 was 2462, checked in by Bruno Cornec, 11 years ago

r3548@localhost: bruno | 2009-10-16 19:18:27 +0200

  • mindi now boots in a QEMU VM without busybox
  • mindi is now noarch as a consequence
  • MINDI_LIB becomes MINDI_DATA for coherency and as a consequence
  • CACHEDIR becomes MINDI_CACHE for coherency and it's a build parameter and not hardcoded anymore in mindi
  • THat variable is also used at restore time for mondorestore.cfg e.g.
  • FAILSAFE kernel is gone. Just use another kernel of your choice. Most std kernels work anyway
  • TurnTgzIntoRdz? rewritten and now really computes data disk size and not suppose its size
  • Interface mondo/mindi changed again => incompatible
  • Non-bootable media not supported anymore.
  • Mondorescue adapted to these changes but not tested yet
  • Doc updated as well
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1#!/bin/sh
2#
3# $Id: post-init 2462 2009-10-20 14:07:00Z bruno $
4#
5#------------------------------------------------------------
6
7sleep 1
8
9echo "Here is my $MINDI_CACHE/mountlist.txt" >> $LOGFILE
10cat $MINDI_CACHE/mountlist.txt >> $LOGFILE
11echo "-----------------------------------" >> $LOGFILE
12
13
14iso=`grep iso $CMDLINE`
15nuke=`grep nuke $CMDLINE`
16if [ "$nuke" = "" ] ; then
17    nuke=`grep -i "RESTORE " $CMDLINE`
18fi
19expert=`grep expert $CMDLINE`
20compare=`grep compare $CMDLINE`
21interactive=`grep interactive $CMDLINE`
22pxe=`grep pxe $CMDLINE`
23[ "$interactive" ]  && expert=""; # in case 'expert' crops up somewhere
24if which mondorestore > /dev/null 2> /dev/null ; then
25    LogIt "mondorestore found; cool..."
26else
27    if [ "$iso$nuke$compare$interactive$pxe" != "" ] ; then
28        LogIt "FYI, this CD was made by Mindi, not Mondo." 1
29        exit 0
30    else
31        LogIt "Mindi-Linux has finished booting."
32    fi
33fi
34
35if which bootstrap > /dev/null 2> /dev/null ; then
36    LogIt "Calling bootstrap script" 1
37    bootstrap
38fi
39
40for i in mount-me unmount-me ; do
41    if which $i > /dev/null 2> /dev/null ; then
42        LogIt "$i found"
43    else
44        LogIt "Warning - $i not found on ramdisk."
45    fi
46done
47
48mondoopt=""
49if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ]; then
50    mondoopt="$mondoopt -o -d $TAPEDEV"
51fi
52
53if [ "`grep -i 'debug' $CMDLINE`" ]; then
54    mondoopt="$mondoopt -K 99"
55fi
56
57if [ "$compare" ] ; then
58    LogIt "------------------COMPARE MODE-----------------" 1
59    mondorestore $mondoopt -Z compare
60elif [ "$nuke" ] ; then
61    LogIt "-------------------NUKE MODE-------------------" 1
62    mondorestore $mondoopt -Z nuke
63elif [ "$expert" ] ; then
64    if [ "`grep tapedev $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ] ; then
65    LogIt "-------------------TAPE MODE-------------------" 1
66    loc=`which mondorestore 2> /dev/null`
67    if [ "$loc" = "" ] ; then
68        LogIt "I presume you backed up with Mindi, not Mondo." 1
69    else
70        LogIt "Tape Mode -- calling mondorestore..."
71            if [ "$nuke" ] ; then
72                mondorestore $mondoopt -Z nuke
73            else
74                mondorestore $mondoopt; # MR will detect & access the tape
75            fi
76    fi
77    elif [ "`grep using-cdstream $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ] ; then
78        LogIt "------------------CDSTREAM MODE------------------" 1
79        loc=`which mondorestore 2> /dev/null`
80        if [ "$loc" = "" ] ; then
81            LogIt "I presume you backed up with Mindi, not Mondo." 1
82        else
83            LogIt "Cdstream Mode -- calling mondorestore..."
84            if [ "$nuke" ] ; then
85                mondorestore -Z nuke $mondoopt
86            else
87                mondorestore $mondoopt; # MR will detect & access the cdstream
88            fi
89        fi
90    else
91        LogIt "------------------EXPERT MODE------------------" 1
92        LogIt "You do all the work. :-)" 1
93        if which mondorestore > /dev/null 2> /dev/null ; then
94            LogIt "Type 'mondorestore' to begin the restore/compare process." 1
95        fi
96    fi
97else
98    LogIt "------------------INTERACTIVE------------------" 1
99    mondorestore -Z interactive $mondoopt
100fi
101
102[ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
103
104exit 0
Note: See TracBrowser for help on using the repository browser.