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 |
---|
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 | |
---|
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 " |
---|
91 | [ $? == 0 ] && sh || echo " " |
---|
92 | ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh |
---|
93 | # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE |
---|
94 | |
---|
95 | [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N " |
---|
96 | [ $? == 0 ] && sh || echo " " |
---|
97 | ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE |
---|
98 | |
---|
99 | [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N " |
---|
100 | [ $? == 0 ] && sh || echo " " |
---|
101 | ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG |
---|
102 | |
---|
103 | [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N " |
---|
104 | [ $? == 0 ] && sh || echo " " |
---|
105 | ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro |
---|
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 | } |
---|