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

browserbuild-browserdeps-vadimfilebeat-installerimprove-versionlgromero-testsmainno-apt-moduleoglive-ipv6pull-from-cloning-enginepybuilderqndtest
Last change on this file since 4cb1a5b 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
RevLine 
[2cffa56]1# OpenGnsys oginit                      -*- shell-script -*-
2
3#@file    oginit
[71b5b6c]4#@brief   Guion modificador inicio initrd para OpenGnsys
[2cffa56]5#@warning
[e0efe8a]6#@version 0.1 - basado en ROOTfs - rootfs over nfs -
[2cffa56]7#@author  Antonio J. Doblas Viso. Universidad de Málaga
8#@date    2009/00/00
[e0efe8a]9#@version 0.2 - basado en RAMFS - instalador de ubunto -
10#@author  Alejandro Castillo, Ramón Gómez, Irina, Antonio Doblas
[2cffa56]11#@date    2010/00/00
[e0efe8a]12#@version 0.7 - Hibrido en RAMFS + ROOTFS -mkinitrd, busybox, deboostrap-
[2cffa56]13#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
14#@date    2010/05/24
[e0efe8a]15#@version 0.8 - Soporte smb, asignación ip estática
[2cffa56]16#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
17#@date    2010/06/24
[e0efe8a]18#@version 0.8.1 - Integración RAMFS+ROOTFS con UnionFS y squasfs
[2cffa56]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
[e0efe8a]24#@version 1.0.1 - Logica para inicio multiples dispositivos, usb, red, cd
[ad828d4]25#@author  Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
26#@date    2011/07/4
[e0efe8a]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
[31dbe1f]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
[2cffa56]33#*/
34
35
36# Parameter: Where to mount the filesystem
37mountroot ()
38{
[423c622]39        [ -f /scripts/VERSION.txt ] && OGVERSION=$(cat /scripts/VERSION.txt)
[71b5b6c]40        OGVERSION=${OGVERSION:-"OpenGnsys Client"}
[423c622]41        echo; echo; echo "$OGVERSION"; echo; echo
42
[71b5b6c]43        #[ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
44        #run_scripts /scripts/og-top
45        #[ "$quiet" != "y" ] && log_end_msg
[2cffa56]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
[31dbe1f]60        # Cambiar resolución de vídeo para kernels que usan el parámetro "video".
61        [ -n "$video" ] && ogChangeVideoResolution
[71b5b6c]62        log_success_msg "Checking OpenGnsys Environmnet"
[2cffa56]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 " "
[7bb85b2]79        if [ -n "$oglive" ]
80        then
81                while !(ping -c 1 $oglive &> /dev/null)
82                do
83                        ogConfigureNetworking
84                done
85        fi
[2cffa56]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
[e0efe8a]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
[f3057ca]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
[e0efe8a]104
105        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N "
[2cffa56]106    [ $? == 0 ] && sh || echo " "
[e0efe8a]107        ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh
[2cffa56]108    # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE
109
[e0efe8a]110        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N "
[2cffa56]111    [ $? == 0 ] && sh || echo " "
112        ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE
[71517ae]113        if [ $? -ne 0 -a "$SRCOGSHARE" != "$DEFOGSHARE" ]; then
[06f8bae]114                ogConnect $OGSERVERSHARE $OGPROTOCOL $DEFOGSHARE $DSTOGSHARE && SRCOGSHARE=$DEFOGSHARE
115        fi
116        unset DEFOGSHARE
[2cffa56]117       
[e0efe8a]118        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N "
[2cffa56]119    [ $? == 0 ] && sh || echo " "
120        ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG
121       
[e0efe8a]122        [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N "
[2cffa56]123    [ $? == 0 ] && sh || echo " "
[b4e1bf5]124        ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro
[2cffa56]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.