source: MondoRescue/branches/2.2.9/mindi/rootfs/sbin/install-additional-tools@ 2371

Last change on this file since 2371 was 2371, checked in by Bruno Cornec, 15 years ago
  • Fix a problem a error detection in evaluate_mountlist which casued nuke mode to abort. Error string should also be better now.
  • Property svn:keywords set to Id
File size: 1.9 KB
RevLine 
[1]1#!/bin/sh
2#
[866]3# $Id: install-additional-tools 2371 2009-09-08 11:40:25Z bruno $
[1]4#
5########################################################################
6
7
8Die() {
9 echo "Fatal error! $1" >> /dev/stderr
10 exit 1
11}
12
13
14
15# ------------ main -----------
16
17# if the file '/tmp/CDROM-LIVES-HERE' exists then we should use the CD
18
19LogIt "Starting install-additional-tools"
[1997]20
21if [ ! "$GROOVY" ] ; then
22 LogIt "I'm not groovy!"
23 exit 1
24fi
25
[2371]26mountdir=$GROOVY
27
[1998]28if [ $mountdir = "/" ]; then
29 LogIt "mountdir shouldn't be /"
30 exit 1
31fi
32
[1734]33# Should be the same as in mindi => conf param
[1]34mkdir -p $mountdir
35res=0
36if [ -e "/tmp/TAPEDEV-HAS-DATA-DISKS" ] ; then
37 LogIt "I am assuming the data disks' contents are already in $mountdir."
38else
[1902]39 LogIt "PLEASE WAIT. Untarring data content" 2
40
41 mountpoint=/dev/null
42 [ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images
43 tarball=$mountpoint/all.tar.gz
44 if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then
45 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1
46 fi
47
48 old_pwd=`pwd`
49 cd $mountdir
50 counter=0
51 for fname in `tar -zxvf $tarball` ; do
52 counter=$(($counter+1))
53 [ "$(($counter % 4))" -eq "0" ] && echo -en "\r\t\t\t\t\t\t\t\\"
54 [ "$(($counter % 4))" -eq "1" ] && echo -en "\r\t\t\t\t\t\t\t|"
55 [ "$(($counter % 4))" -eq "2" ] && echo -en "\r\t\t\t\t\t\t\t/"
56 [ "$(($counter % 4))" -eq "3" ] && echo -en "\r\t\t\t\t\t\t\t-"
57 done
58 cd $old_pwd
59 echo -e -n "\r"
60 [ ! -e "/tmp/CDROM-LIVES-HERE" ] && umount $mountpoint
61 sleep 1
[1]62fi
63
[1734]64LogIt "Populating / with tar file content..." 1
[1]65
66cd $mountdir
[1748]67if [ -f etc/fstab ]; then
[1841]68 cp etc/fstab /tmp
[1748]69fi
70if [ -f etc/raidtab ]; then
[1841]71 cp etc/raidtab /tmp
[1748]72fi
[1]73
[1734]74liste=`ls`
75if [ "$liste" ]; then
[2363]76 LogIt "Installing and removing $liste"
[1734]77 tar cf - $liste | (cd / ; tar xf -)
78 rm -fr $liste
79fi
[229]80cd /
[1]81
82sync;sync;sync
83
[1734]84LogIt "Done." 1
[1]85
86which gawk 2> /dev/null > /dev/null
87[ "$?" -ne "0" ] && which awk 2> /dev/null > /dev/null && ln -sf `which awk` /usr/bin/gawk
88
89LogIt "Exiting install-additional-tools"
90exit 0
Note: See TracBrowser for help on using the repository browser.