File: subroutines-sunos

package info (click to toggle)
fai 2.8.4sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,284 kB
  • ctags: 176
  • sloc: sh: 3,362; perl: 1,591; makefile: 142
file content (135 lines) | stat: -rw-r--r-- 4,282 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#! /bin/bash

# $Id: subroutines-sunos 3027 2005-11-10 22:37:16Z lange $
#*********************************************************************
#
# subroutines-sunos 
#
# useful subroutines for SunOS installation with FAI on Sun systems
#
# This script is part of FAI (Fully Automatic Installation)
# (c) 2000-2003 by Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
#
#*********************************************************************
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# A copy of the GNU General Public License is available as
# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
# can also obtain it by writing to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#*********************************************************************

# source this file, then you have these function available in the shell

# - - - - - - - - - - - - - - - - - - - - - - - - - - -
task_partition() {

if [ -s $SI_PROFILE ]; then

    echo "SI_PROFILE already exists."
    return
fi
    # we have to create the SI_PROFILE which contains information about the
    # partitioning and the list of software that will be installed 

    # first read one disk_config file
    for class in $classes; do
	revclasses="$class $revclasses"
    done
    for c in $revclasses ; do
	if [ -f $FAI/disk_config/$c ]; then
	    echo "Using disk_config/$c"
	    cat $FAI/disk_config/$c >> $SI_PROFILE
	    break
	fi
    done

    # now read all package_config matching a class name
    for c in $classes; do
       if [ -f $FAI/package_config/$c ]; then
	   echo "Using package_config/$c"
	   cat $FAI/package_config/$c >> $SI_PROFILE
       fi
    done

    cp $SI_PROFILE $LOGDIR
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
task_confdir() {

    if [ ! -d /fai/class ]; then
	mount -F lofs $SI_CONFIG_DIR/fai /fai
    fi

    mount -F lofs $SI_CONFIG_DIR/scripts/usr-local /usr/local
#    define_fai_flags
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
jobsrunning() {

    # test if jobs are running
    ps -el | egrep ' O | R ' | egrep -v 'TIME CMD|grep|ps'
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fai_init() {

    # default classes before calling task defvar. Will be overwritten by task defvar
    # the type of operating system (linux, sunos)
    oclass=$(uname -s | tr /a-z/ /A-Z/)
    classes="DEFAULT $oclass $HOSTNAME LAST"

    umask 022
    target=/a
    FAI_ROOT=$target
    stamp=/tmp/FAI_INSTALLATION_IN_PROGRESS
    FAI_VERSION=FAIVERSIONSTRING
    osname="Sun Solaris"
    ROOTCMD="chroot $target"
    FAI=/fai
    debug=
    verbose=1
#    createvt=1
    [ -z "$LOGDIR" ] && LOGDIR=/tmp/fai
    mkdir -p $LOGDIR
    rcslog=$LOGDIR/rcS.log

    PATH=$SI_CONFIG_DIR/bin:/usr/local/bin:$PATH
    LD_LIBRARY_PATH=$SI_CONFIG_DIR/lib:$LD_LIBRARY_PATH

    if [ -z "$IPADDR" ]; then
	IPADDR=`ifconfig $_INIT_NET_IF | grep inet | awk '{ print $2 }'`
    fi

    # commands that are not used on solaris
    defnop openvt wait_for_jobs save_dmesg task_mountdisks task_extrbase sndmon
    defnop task_mirror task_updatebase task_instsoft task_finish task_chboot
    cat <<-EOF

             -----------------------------------------------------
               Fully Automatic Installation for $osname
               $FAI_VERSION

               Copyright (c) 1999-2003 Thomas Lange
               <lange@informatik.uni-koeln.de>
             -----------------------------------------------------

EOF
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
task_sysinfo() {

    constype >> $LOGDIR/prtconf.log
    fai-savelog -r
    task_faiend
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - -