source: ogLive-Builder-Git/includes/etc/initramfs-tools/scripts/oginit

filebeat-installer
Last change on this file was 71517ae, checked in by ramon <ramongomez@…>, 8 years ago

#768: ogLive usa subdirectorio por defecto si no encuentra el solicitado en la variable del kernel oglivedir.

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

  • Property mode set to 100755
File size: 5.4 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#@version 1.0.5 - Cambiar resolución de pantalla para Kernel con parámetro "video".
31#@author  Ramón Gómez, ETSII Universidad de Sevilla
32#@date    2013/02/18
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        # Cambiar resolución de vídeo para kernels que usan el parámetro "video".
61        [ -n "$video" ] && ogChangeVideoResolution
62        log_success_msg "Checking OpenGnsys Environmnet"
63        ogExportVarEnvironment
64       
65        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure ramfs structure for OG: y/N "
66    [ $? == 0 ] && sh || echo " "
67        ogConfigureRamfs
68
69        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure netmoule specified in kernel parameters: y/N "
70    [ $? == 0 ] && sh || echo " "
71        ogLoadNetModule
72
73        #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
74        #run_scripts /scripts/og-premount
75        #[ "$quiet" != "y" ] && log_end_msg
76
77        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure networking: y/N "
78    [ $? == 0 ] && sh || echo " "
79        if [ -n "$oglive" ]
80        then
81                while !(ping -c 1 $oglive &> /dev/null)
82                do
83                        ogConfigureNetworking
84                done
85        fi
86        log_success_msg "config networking"
87        ogConfigureLoopback
88        log_success_msg "config loopback"
89
90
91        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before detect rootserver: y/N "
92    [ $? == 0 ] && sh || echo " "
93        ogGetROOTSERVER && log_success_msg "Get Info from pxe server and ckeck distribuited OG services "
94
95
96        if [ "$ogdebug" == "true" -a "$ogupdateinitrd" == "true" ]; then
97                ogYesNo --timeout 5 --default no "Stop before check updating initrd: y/N "
98        [ $? == 0 ] && sh || echo " "           
99        fi
100        # Actualizar Initrd si se solicita o si no se corresponde con su kernel.
101        if [ "$ogupdateinitrd" == "true" -o ! -d /lib/modules/$(uname -r) ]; then
102                ogUpdateInitrd
103        fi
104
105        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N "
106    [ $? == 0 ] && sh || echo " "
107        ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh
108    # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE
109
110        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N "
111    [ $? == 0 ] && sh || echo " "
112        ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE
113        if [ $? -ne 0 -a "$SRCOGSHARE" != "$DEFOGSHARE" ]; then
114                ogConnect $OGSERVERSHARE $OGPROTOCOL $DEFOGSHARE $DSTOGSHARE && SRCOGSHARE=$DEFOGSHARE
115        fi
116        unset DEFOGSHARE
117       
118        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N "
119    [ $? == 0 ] && sh || echo " "
120        ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG
121       
122        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N "
123    [ $? == 0 ] && sh || echo " "
124        ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro
125         
126
127        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N "
128    [ $? == 0 ] && sh || echo " "
129        ogPostConfigureFS
130        setupcon -k
131
132        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before calling oginit with /etc/inittab: y/N "
133    [ $? == 0 ] && sh || echo " "
134   
135if [ "$oginit" ]
136then
137        exec $oginit
138else
139        exec init
140fi
141
142
143
144
145
146}
Note: See TracBrowser for help on using the repository browser.