Changeset 236 for trunk/mindi/install.sh


Ignore:
Timestamp:
Dec 19, 2005, 7:31:56 PM (13 years ago)
Author:
bcornec
Message:

merge -r229:235 $SVN_M/branches/2.05

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/install.sh

    r219 r236  
    77
    88if [ "_$PREFIX" != "_" ]; then
    9     local=$PREFIX/usr
     9    local=$PREFIX
    1010    if [ -f /usr/local/sbin/mindi ]; then
    1111        echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !"
    1212    fi
    13     conf=$PREFIX/etc/mindi
     13    conf=$CONFDIR/mindi
    1414    echo $PATH | grep /usr/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add /usr/sbin to your PATH."
    1515else
     
    2020    conf=$local/etc/mindi
    2121    echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
    22 
    2322fi
    2423
     
    3130
    3231echo "Creating target directories ..."
    33 mkdir -p $local/lib/mindi
    34 mkdir -p $local/share/man/man8
    35 mkdir -p $local/sbin
    36 mkdir -p $conf
     32install -g root -o root -m 755 -d $conf $local/lib/mindi $local/share/man/man8 $local/sbin $local/doc/mindi
    3733
    3834echo "Copying files ..."
    39 cp deplist.txt $conf
    40 cp -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
     35install -g root -o root -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $local/lib/mindi
     36install -g root -o root -m 644 deplist.txt $conf
     37
     38cp -af rootfs aux-tools Mindi $local/lib/mindi
    4139chmod 755 $local/lib/mindi/rootfs/bin/*
    4240chmod 755 $local/lib/mindi/rootfs/sbin/*
    4341chmod 755 $local/lib/mindi/aux-tools/sbin/*
     42chown -R root:root $local/lib/mindi
    4443
    45 cp -af analyze-my-lvm parted2fdisk.pl $local/sbin
    4644if [ "$RPMBUILDMINDI" = "true" ]; then
    4745    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" mindi > $local/sbin/mindi
     
    5048fi
    5149chmod 755 $local/sbin/mindi
    52 chmod 755 $local/sbin/analyze-my-lvm
    53 chmod 755 $local/sbin/parted2fdisk.pl
     50chown root:root $local/sbin/mindi
     51install -g root -o root -m 755 analyze-my-lvm parted2fdisk.pl $local/sbin
    5452
    55 cp -a mindi.8 $local/share/man/man8
    56 cp -a CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/share/lib/mindi
    57 
    58 echo "Extracting symlinks ..."
    59 ( cd $local/lib/mindi/rootfs && tar -xzf symlinks.tgz )
     53install -g root -o root -m 644 mindi.8 $local/share/man/man8
     54install -g root -o root -m 644 CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/doc/mindi
    6055
    6156ARCH=`/bin/arch`
    6257echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386
     58# For the moment, we don't build specific x86_64 busybox binaries
     59echo $ARCH | grep -x "x86_64" &> /dev/null && ARCH=i386
    6360export ARCH
    6461
     62# Managing busybox
    6563if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH ]; then
    6664        echo "Installing busybox ..."
    67         mv $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
     65        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
    6866else
    6967        echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
    7068fi
    71 
    7269if [ "$ARCH" = "i386" ] ; then
    73     # FHS requires fdisk under /sbin
    74     (cd $local/sbin && ln -s /sbin/fdisk parted2fdisk)
    7570    if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
    7671        echo "Installing busybox.net ..."
    77         mv $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
     72        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
    7873    else
    7974        echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
    8075    fi
    8176fi
     77# Remove left busybox
     78rm -f $local/lib/mindi/rootfs/bin/busybox-*
    8279
     80# Managing parted2fdisk
    8381if [ "$ARCH" = "ia64" ] ; then
    84     (cd $local/sbin && ln -s parted2fdisk.pl parted2fdisk)
     82    (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
    8583    make -f Makefile.parted2fdisk DEST=$local/lib/mindi install
    8684    if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
    8785        echo "Installing parted2fdisk ..."
    88         mv $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
     86        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
     87        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk
    8988    else
    9089        echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
    9190    fi
    9291else
     92    # FHS requires fdisk under /sbin
     93    (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
    9394    echo "Symlinking fdisk to parted2fdisk"
    9495    ( cd $local/lib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
    9596fi
     97# Remove left parted2fdisk
     98rm -f $local/lib/mindi/rootfs/sbin/parted2fdisk-*
    9699
    97100exit 0
Note: See TracChangeset for help on using the changeset viewer.