source: client/boot-tools/includes/etc/initramfs-tools/scripts/oginit @ ea0b6cf

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since ea0b6cf was 790d8bc, checked in by ramon <ramongomez@…>, 12 years ago

#573: Añadir mensaje de versión al iniciar el cliente OpenGnSys.

git-svn-id: https://opengnsys.es/svn/branches/version1.0@3580 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 4.9 KB
Line 
1# OpenGnsys oginit                      -*- shell-script -*-
2
3#@file    oginit
4#@brief   Guion modificador inicio initrd para OpenGnSys
5#@warning
6#@version 0.1 - basado en ROOTfs - rootfs over nfs -
7#@author  Antonio J. Doblas Viso. Universidad de Málaga
8#@date    2009/00/00
9#@version 0.2 - basado en RAMFS - instalador de ubunto -
10#@author  Alejandro Castillo, Ramón Gómez, Irina, Antonio Doblas
11#@date    2010/00/00
12#@version 0.7 - Hibrido en RAMFS + ROOTFS -mkinitrd, busybox, deboostrap-
13#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
14#@date    2010/05/24
15#@version 0.8 - Soporte smb, asignación ip estática
16#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
17#@date    2010/06/24
18#@version 0.8.1 - Integración RAMFS+ROOTFS con UnionFS y squasfs
19#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
20#@date    2010/06/29
21#@version 1.0. - Adaptacion variables. Corrección enlace red
22#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
23#@date    2011/06/16
24#@version 1.0.1 - Logica para inicio multiples dispositivos, usb, red, cd
25#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
26#@date    2011/07/4
27#@version 1.0.2 - RAMFS: instalación y actualización automatica en cache
28#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
29#@date    2011/08/4
30#*/
31
32
33
34
35
36# Parameter: Where to mount the filesystem
37mountroot ()
38{
39        [ -f /scripts/VERSION.txt ] && OGVERSION=$(cat /scripts/VERSION.txt)
40        OGVERSION=${OGVERSION:-"OpenGnSys Client"}
41        echo; echo; echo "$OGVERSION"; echo; echo
42
43        [ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
44        run_scripts /scripts/og-top
45        [ "$quiet" != "y" ] && log_end_msg
46
47        # If the root device hasn't shown up yet, give it a little while
48        # to deal with removable devices
49
50        . /scripts/functions
51        . /scripts/ogfunctions
52
53        sleep 2
54
55        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before get OG variables: y/N "
56    [ $? == 0 ] && sh || echo " "
57        set -a
58        log_success_msg "Checking kernel parameters"
59        ogExportKernelParameters
60        log_success_msg "Checking Opengnys Environmnet"
61        ogExportVarEnvironment
62       
63        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure ramfs structure for OG: y/N "
64    [ $? == 0 ] && sh || echo " "
65        ogConfigureRamfs
66
67        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure netmoule specified in kernel parameters: y/N "
68    [ $? == 0 ] && sh || echo " "
69        ogLoadNetModule
70
71        #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
72        #run_scripts /scripts/og-premount
73        #[ "$quiet" != "y" ] && log_end_msg
74
75        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure networking: y/N "
76    [ $? == 0 ] && sh || echo " "
77        if [ -n "$oglive" ]
78        then
79                while !(ping -c 1 $oglive &> /dev/null)
80                do
81                        ogConfigureNetworking
82                done
83        fi
84        log_success_msg "config networking"
85        ogConfigureLoopback
86        log_success_msg "config loopback"
87
88
89        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before detect rootserver: y/N "
90    [ $? == 0 ] && sh || echo " "
91        ogGetROOTSERVER && log_success_msg "Get Info from pxe server and ckeck distribuited OG services "
92
93
94        if [ "$ogdebug" == "true" -a "$ogupdateinitrd" == "true" ]; then
95                ogYesNo --timeout 5 --default no "Stop before check updating initrd: y/N "
96        [ $? == 0 ] && sh || echo " "           
97        fi
98        # Actualizar Initrd si se solicita o si no se corresponde con su kernel.
99        if [ "$ogupdateinitrd" == "true" -o ! -d /lib/modules/$(uname -r) ]; then
100                ogUpdateInitrd
101        fi
102
103        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N "
104    [ $? == 0 ] && sh || echo " "
105        ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh
106    # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE
107
108        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N "
109    [ $? == 0 ] && sh || echo " "
110        ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE
111       
112        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N "
113    [ $? == 0 ] && sh || echo " "
114        ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG
115       
116        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N "
117    [ $? == 0 ] && sh || echo " "
118        ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro
119         
120
121        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N "
122    [ $? == 0 ] && sh || echo " "
123        ogPostConfigureFS
124        setupcon -k
125
126        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before calling oginit with /etc/inittab: y/N "
127    [ $? == 0 ] && sh || echo " "
128   
129if [ "$oginit" ]
130then
131        exec $oginit
132else
133        exec init
134fi
135
136
137
138
139
140}
Note: See TracBrowser for help on using the repository browser.