source: MondoRescue/branches/2.2.2/mindi/install.sh@ 1236

Last change on this file since 1236 was 1236, checked in by Bruno Cornec, 17 years ago

Port from stable important patches for 2.2.2:
mindi-busybox:

  • Improve Gentoo packaging

mindi:

  • Better messages for analyze-my-lvm
  • Add support for newer Qlogic drivers (qla2300 & 2400), mpt, dm and ohci
  • Fix a bug in mindi for the FAILSAFE support
  • PATH fixed for init in restore (/usr/games added for petris)
  • Fiw a bug where restore failing because no archive files are found when -G is used
  • /media is now completely excluded as per StandardsCompliance

mondo:

  • Handle no compression + verify correctly
  • various HOWTO fixes
  • Fix temporarily a bug when a biggiefile > 32MB was compressed below the size

of a slice (16MB)

  • Better module loading in insmod_crucial_modules
  • Improve Gentoo packaging
  • Small typo fix for mondorestore man page
  • Small memory management improvements
  • Store NFS config only once
  • Fix a flaw in libmondo-mountlist.c (there since rev [1] !!)
  • Increased MAX_STR_LEN to 384 to make it divisible without remainder by eight

for 64 bits platforms

  • Fix a bug where no bzip2 format file would be found when supporting gzip
  • CentOS fixes
  • Property svn:keywords set to Id
File size: 4.2 KB
RevLine 
[179]1#!/bin/bash
[916]2#
3# $Id: install.sh 1236 2007-03-11 23:23:16Z bruno $
4#
[1]5
6if [ ! -f "mindi" ] ; then
7 echo "Please 'cd' to the directory you have just untarred." >> /dev/stderr
8 exit 1
9fi
[179]10
[184]11if [ "_$PREFIX" != "_" ]; then
[936]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
[179]21else
22 local=/usr/local
[936]23 sublocal=$local
[179]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
[936]28 subconf=$conf
[185]29 echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
[179]30fi
31
[1]32if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
33 local=/ramdisk/usr
[936]34 sublocal=$local
35 conf=/ramdisk/etc
36 subconf=$conf
[1]37 export PATH=/ramdisk/usr/sbin:/ramdisk/usr/bin:/$PATH
38fi
39
[237]40MINDIVER=`cat VERSION`
[243]41MINDIREV=`cat REVISION`
42echo "mindi ${MINDIVER}-r${MINDIREV} will be installed under $local"
[179]43
[933]44if [ _"$MANDIR" == _"" ]; then
45 MANDIR=$local/share/man/man8
46else
[936]47 MANDIR=${HEAD}$MANDIR/man8
[933]48fi
49if [ _"$DOCDIR" == _"" ]; then
50 DOCDIR=$local/share/doc/mindi-$MINDIVER
51else
[936]52 DOCDIR=${HEAD}$DOCDIR/mindi-$MINDIVER
[933]53fi
54if [ _"$LIBDIR" == _"" ]; then
55 ARCH=`/bin/arch`
56 echo $ARCH | grep -E '^i[0-9]86$' &> /dev/null && ARCH=i386 && locallib=$local/lib
57 echo $ARCH | grep -E '^x86_64$' &> /dev/null && locallib=$local/lib64
58 echo $ARCH | grep -E '^ia64$' &> /dev/null && locallib=$local/lib
[937]59 sublocallib="$locallib/mindi"
[936]60else
61 locallib=${HEAD}$LIBDIR
[937]62 sublocallib="$LIBDIR/mindi"
[933]63fi
[241]64
[179]65echo "Creating target directories ..."
[541]66install -m 755 -d $conf $locallib/mindi $MANDIR $local/sbin $DOCDIR
[1]67
[179]68echo "Copying files ..."
[306]69install -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $locallib/mindi
[237]70install -m 644 deplist.txt $conf
[235]71
[311]72cp -af rootfs aux-tools $locallib/mindi
[306]73chmod 755 $locallib/mindi/rootfs/sbin/*
74chmod 755 $locallib/mindi/aux-tools/sbin/*
[1]75
[898]76# Substirute variables for init
77perl -pi -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~ ; s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" $locallib/mindi/rootfs/sbin/init
78
[934]79# Substitute variables for mindi
[936]80sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~" -e "s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" mindi > $local/sbin/mindi
[179]81chmod 755 $local/sbin/mindi
[543]82install -m 755 parted2fdisk.pl $local/sbin
83install -m 755 analyze-my-lvm $locallib/mindi
[179]84
[248]85install -m 644 mindi.8 $MANDIR
[315]86install -m 644 ChangeLog COPYING README README.busybox README.ia64 README.pxe TODO INSTALL svn.log $DOCDIR
[179]87
[1236]88if [ "_$PREFIX" = "_" ] && [ ! -f $locallib/mindi/rootfs/bin/busybox ]; then
[179]89 echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
90fi
91
[235]92# Managing parted2fdisk
[1]93if [ "$ARCH" = "ia64" ] ; then
[235]94 (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
[306]95 make -f Makefile.parted2fdisk DEST=$locallib/mindi install
96 if [ -f $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
[179]97 echo "Installing parted2fdisk ..."
[306]98 install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $locallib/mindi/rootfs/sbin/parted2fdisk
99 install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk
[179]100 else
101 echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
102 fi
[1]103else
[235]104 # FHS requires fdisk under /sbin
105 (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
[179]106 echo "Symlinking fdisk to parted2fdisk"
[306]107 ( cd $locallib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
[1]108fi
[235]109# Remove left parted2fdisk
[306]110rm -f $locallib/mindi/rootfs/sbin/parted2fdisk-*
[179]111
[237]112if [ "$RPMBUILDMINDI" != "true" ]; then
[306]113 chown -R root:root $locallib/mindi $conf $DOCDIR
[543]114 chown root:root $local/sbin/mindi $MANDIR/mindi.8 $locallib/mindi/analyze-my-lvm $local/sbin/parted2fdisk.pl
[237]115 if [ "$ARCH" = "ia64" ] ; then
116 chown root:root $local/sbin/parted2fdisk
117 fi
118fi
119
[542]120# Special case for SuSE family where doc is put elsewhere in the RPM
[626]121if [ -e /etc/SuSE-release ]; then
[542]122 rm -rf $DOCDIR
123fi
124
[581]125# Special case for Debian family where doc is put elsewhere in the DEB
[626]126if [ -e /etc/debian_version ]; then
[581]127 rm -rf $DOCDIR
128fi
129
[1]130exit 0
Note: See TracBrowser for help on using the repository browser.