source: MondoRescue/branches/2.2.10/mindi/install.sh @ 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.5 KB
Line 
1#!/bin/bash
2#
3# $Id: install.sh 2462 2009-10-20 14:07:00Z bruno $
4#
5
6if [ ! -f "mindi" ] ; then
7    echo "Please 'cd' to the directory you have just untarred." >> /dev/stderr
8    exit 1
9fi
10
11if [ "_$PREFIX" != "_" ]; then
12    local=${HEAD}$PREFIX
13    sublocal=$PREFIX
14    if [ "_$CONFDIR" != "_" ]; then
15        conf=${HEAD}$CONFDIR/mindi
16        subconf=$CONFDIR/mindi
17    else
18        echo "CONFDIR should be defined if PREFIX is defined"
19        exit -1
20    fi
21else
22    local=/usr/local
23    sublocal=$local
24    if [ -f /usr/sbin/mindi ]; then
25        echo "WARNING: /usr/sbin/mindi exists. You should probably remove the mindi package !"
26    fi
27    conf=$local/etc/mindi
28    subconf=$conf
29    echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
30fi
31
32if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
33    local=/ramdisk/usr
34    sublocal=$local
35    conf=/ramdisk/etc
36    subconf=$conf
37    export PATH=/ramdisk/usr/sbin:/ramdisk/usr/bin:/$PATH
38fi
39
40MINDIVER=PBVER
41MINDIREV=PBREV
42ARCH=`/bin/uname -m`
43echo "mindi ${MINDIVER}-r${MINDIREV} will be installed under $local"
44
45if [ _"$MINDI_CACHE" = _"" ]; then
46    localcache=$local/var/cache/mindi
47else
48    localcache=${HEAD}$MINDI_CACHE
49fi
50if [ _"$MANDIR" = _"" ]; then
51    MANDIR=$local/share/man/man8
52else
53    MANDIR=${HEAD}$MANDIR/man8
54fi
55if [ _"$DOCDIR" = _"" ]; then
56    DOCDIR=$local/share/doc/mindi-$MINDIVER
57else
58    DOCDIR=${HEAD}$DOCDIR/mindi-$MINDIVER
59fi
60if [ _"$DATADIR" = _"" ]; then
61    localdata="$local/share"
62    sublocaldata="$localdata/mindi"
63else
64    localdata=${HEAD}$DATADIR
65    sublocaldata="$DATADIR/mindi"
66fi
67
68echo "Creating target directories ..."
69install -m 755 -d $conf $localdata/mindi $MANDIR $local/sbin $localcache $conf/deplist.d
70
71echo "Copying files ..."
72cp -af rootfs $localdata/mindi
73chmod 755 $localdata/mindi/rootfs/sbin/*
74install -m 755 analyze-my-lvm $localdata/mindi
75install -m 644 msg-txt dev.tgz $localdata/mindi
76install -m 644 deplist.conf deplist-minimal.conf udev.files proliant.files mindi.conf $conf
77for f in deplist.d/*.conf; do
78    install -m 644 $f $conf/deplist.d
79done
80for f in mindi-bkphw mindi-get-perl-modules parted2fdisk.pl; do
81    install -m 755 $f $local/sbin
82done
83
84# Substitute variables for mindi
85sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_DATA=LLL~MINDI_DATA=$sublocaldata~" -e "s~^MINDI_CACHE=CCC~MINDI_CACHE=$MINDI_CACHE~" mindi > $local/sbin/mindi
86sed -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^export MINDI_CACHE=CCC~export MINDI_CACHE=$MINDI_CACHE~" rootfs/sbin/init > $localdata/mindi/rootfs/sbin/init
87chmod 755 $local/sbin/mindi $local/sbin/mindi-bkphw
88
89install -m 644 mindi.8 $MANDIR
90#install -m 644 ChangeLog COPYING README README.ia64 README.pxe TODO INSTALL svn.log $DOCDIR
91
92# Managing parted2fdisk
93if [ "$ARCH" = "ia64" ] ; then
94    (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
95    install -s -m 755 $local/sbin/parted2fdisk.pl $localdata/mindi/rootfs/sbin/parted2fdisk
96else
97    # FHS requires fdisk under /sbin
98    (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
99    echo "Symlinking fdisk to parted2fdisk"
100    ( cd $localdata/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
101fi
102
103if [ "$PKGBUILDMINDI" != "true" ]; then
104    chown -R root:root $localdata/mindi $conf # $DOCDIR
105    chown root:root $local/sbin/mindi $MANDIR/mindi.8 $localdata/mindi/analyze-my-lvm $local/sbin/parted2fdisk.pl
106    if [ "$ARCH" = "ia64" ] ; then
107        chown root:root $local/sbin/parted2fdisk
108    fi
109fi
110
111# Generate the list of perl modules needed at restore time for mindi
112cat > $conf/perl-scripts << EOF
113$sublocal/sbin/mindi-get-perl-modules
114$sublocal/sbin/mindi-bkphw
115$sublocal/sbin/parted2fdisk.pl
116EOF
117
118exit 0
Note: See TracBrowser for help on using the repository browser.