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