source: branches/2.05/mindi/install.sh @ 196

Last change on this file since 196 was 196, checked in by bcornec, 14 years ago

Usage of parted2fdisk instead of fdisk everywhere.
on ia64 this is mandatory, and simplifies the infrastructure
on other archs, it doesn't change anything as parted2fdisk here is a link to fdisk

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#!/bin/bash
2
3if [ ! -f "mindi" ] ; then
4    echo "Please 'cd' to the directory you have just untarred." >> /dev/stderr
5    exit 1
6fi
7
8if [ "_$PREFIX" != "_" ]; then
9    local=$PREFIX/usr
10    if [ -f /usr/local/sbin/mindi ]; then
11        echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !"
12    fi
13    conf=$PREFIX/etc/mindi
14    echo $PATH | grep /usr/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add /usr/sbin to your PATH."
15else
16    local=/usr/local
17    if [ -f /usr/sbin/mindi ]; then
18        echo "WARNING: /usr/sbin/mindi exists. You should probably remove the mindi package !"
19    fi
20    conf=$local/etc/mindi
21    echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
22
23fi
24
25if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
26    local=/ramdisk/usr
27    export PATH=/ramdisk/usr/sbin:/ramdisk/usr/bin:/$PATH
28fi
29
30echo "mindi will be installed under $local"
31
32echo "Creating target directories ..."
33mkdir -p $local/lib/mindi
34mkdir -p $local/share/man/man8
35mkdir -p $local/sbin
36mkdir -p $conf
37
38echo "Copying files ..."
39cp -a deplist.txt $conf
40cp -af rootfs aux-tools isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg parted2fdisk.pl syslinux.cfg syslinux-H.cfg dev.tgz Mindi $local/lib/mindi
41chmod 755 $local/lib/mindi/rootfs/bin/*
42chmod 755 $local/lib/mindi/rootfs/sbin/*
43chmod 755 $local/lib/mindi/aux-tools/sbin/*
44
45cp -af analyze-my-lvm parted2fdisk.pl $local/sbin
46if [ "$RPMBUILDMINDI" = "true" ]; then
47    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" mindi > $local/sbin/mindi
48else
49    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$local~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$conf~" mindi > $local/sbin/mindi
50fi
51chmod 755 $local/sbin/mindi
52chmod 755 $local/sbin/analyze-my-lvm
53chmod 755 $local/sbin/parted2fdisk.pl
54
55cp -a mindi.8 $local/share/man/man8
56cp -a CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/lib/mindi
57
58echo "Extracting symlinks ..."
59( cd $local/lib/mindi/rootfs && tar -xzf symlinks.tgz )
60
61ARCH=`/bin/arch`
62echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386
63export ARCH
64
65if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH ]; then
66        echo "Installing busybox ..."
67        mv $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
68else
69        echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
70fi
71
72if [ "$ARCH" = "i386" ] ; then
73    (cd $local/sbin && ln -s fdisk parted2fdisk)
74    if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
75        echo "Installing busybox.net ..."
76        mv $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
77    else
78        echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
79    fi
80fi
81
82if [ "$ARCH" = "ia64" ] ; then
83    (cd $local/sbin && ln -s parted2fdisk.pl parted2fdisk)
84    make -f Makefile.parted2fdisk DEST=$local/lib/mindi install
85    if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
86        echo "Installing parted2fdisk ..."
87        mv $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
88    else
89        echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
90    fi
91else
92    echo "Symlinking fdisk to parted2fdisk"
93    ( cd $local/lib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
94fi
95
96exit 0
Note: See TracBrowser for help on using the repository browser.