source: MondoRescue/branches/2.2.10/mindi/rootfs/sbin/install-additional-tools@ 2592

Last change on this file since 2592 was 2592, checked in by Bruno Cornec, 14 years ago

r3724@localhost: bruno | 2010-03-10 00:46:58 +0100

  • Remove more busyboix references
  • Avoid some actions when called standalone
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#!/bin/sh
2#
3# $Id: install-additional-tools 2592 2010-03-11 01:56:03Z bruno $
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 '$MINDI_CACHE/CDROM-LIVES-HERE' exists then we should use the CD
18
19LogIt "Starting install-additional-tools"
20
21if [ ! "$GROOVY" ] ; then
22 LogIt "I'm not groovy!"
23 exit 1
24fi
25
26mountdir=$GROOVY
27
28if [ $mountdir = "/" ]; then
29 LogIt "mountdir shouldn't be /"
30 exit 1
31fi
32
33# Should be the same as in mindi => conf param
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
39 LogIt "PLEASE WAIT. Untarring data content" 2
40
41 mountpoint=/dev/null
42 [ -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images
43 tarball=$mountpoint/all.tar.gz
44 if [ -e "$MINDI_CACHE/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 if [ -f $tarball ]; then
52 for fname in `tar -zxvf $tarball` ; do
53 counter=$(($counter+1))
54 [ "$(($counter % 4))" -eq "0" ] && echo -en "\r\t\t\t\t\t\t\t\\"
55 [ "$(($counter % 4))" -eq "1" ] && echo -en "\r\t\t\t\t\t\t\t|"
56 [ "$(($counter % 4))" -eq "2" ] && echo -en "\r\t\t\t\t\t\t\t/"
57 [ "$(($counter % 4))" -eq "3" ] && echo -en "\r\t\t\t\t\t\t\t-"
58 done
59 fi
60 cd $old_pwd
61 echo -e -n "\r"
62 [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && umount $mountpoint
63 sleep 1
64fi
65
66LogIt "Populating / with tar file content..." 1
67
68cd $mountdir
69if [ -f etc/fstab ]; then
70 cp etc/fstab /tmp
71fi
72if [ -f etc/raidtab ]; then
73 cp etc/raidtab /tmp
74fi
75
76liste=`ls`
77if [ "$liste" ]; then
78 LogIt "Installing and removing $liste"
79 tar cf - $liste | (cd / ; tar xf -)
80 rm -fr $liste
81fi
82cd /
83
84LogIt "Done." 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.