source: MondoRescue/devel/mindi/post-install.sh@ 2149

Last change on this file since 2149 was 2149, checked in by Bruno Cornec, 15 years ago

Begining f devl branch coding nd preliminary organisation

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1#!/bin/bash
2#
3# $Id: post-install.sh 2149 2009-02-16 16:50:07Z 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/PBPROJ
16 subconf=$CONFDIR/PBPROJ
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/bin/mindi ]; then
25 echo "WARNING: /usr/bin/mindi exists. You should probably remove the mindi package !"
26 fi
27 conf=$local/etc/PBPROJ
28 subconf=$conf
29fi
30
31if [ _"$CACHEDIR" = _"" ]; then
32 CACHEDIR=$local/var/cache/mindi
33else
34 CACHEDIR=${HEAD}$CACHEDIR
35fi
36locallib=$local/share/lib
37sublocallib="$locallib/PBPROJ"
38
39
40if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
41 local=/ramdisk/usr
42 sublocal=$local
43 conf=/ramdisk/etc
44 subconf=$conf
45 export PATH=/ramdisk/usr/sbin:/ramdisk/usr/bin:/$PATH
46fi
47
48MINDIVER=PBVER
49MINDIREV=PBREV
50ARCH=`/bin/uname -m`
51echo "mindi ${MINDIVER}-r${MINDIREV} will be installed under $local"
52
53echo "Creating target directories ..."
54install -m 755 -d $conf $sublocallib $CACHEDIR
55
56echo "Copying files ..."
57cp -af rootfs $sublocallib/mindi
58chmod 755 $sublocallib/mindi/rootfs/sbin/*
59install -m 644 msg-txt dev.tgz $sublocallib/mindi
60install -m 644 deplist.txt udev.files proliant.files $conf
61
62# Substitute variables for mindi
63sed -i -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" $local/bin/mindi
64sed -i -e "s~= "YYY"~= "$subconf"~" $local/bin/mindi-bkphw
65install -m 755 parted2fdisk.pl $local/sbin
66
67# Managing parted2fdisk
68if [ "$ARCH" = "ia64" ] ; then
69 (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
70 install -s -m 755 $local/sbin/parted2fdisk.pl $locallib/mindi/rootfs/sbin/parted2fdisk
71 # Try to avoid the need ot additional perl modules at the moment
72 perl -pi -e 's/use strict;//' $locallib/mindi/rootfs/sbin/parted2fdisk
73else
74 # FHS requires fdisk under /sbin
75 (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
76 echo "Symlinking fdisk to parted2fdisk"
77 ( cd $locallib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
78fi
79
80if [ "$PKGBUILDMINDI" != "true" ]; then
81 chown -R root:root $sublocallib/mindi $conf
82 chown root:root $local/sbin/parted2fdisk.pl
83 if [ "$ARCH" = "ia64" ] ; then
84 chown root:root $local/sbin/parted2fdisk
85 fi
86fi
87
88exit 0
Note: See TracBrowser for help on using the repository browser.