Changes between Version 26 and Version 27 of ClienteInitrdDSGenerarloV1.0.2


Ignore:
Timestamp:
Jul 4, 2012, 12:55:27 PM (12 years ago)
Author:
adv
Comment:

info ogLive

Legend:

Unmodified
Added
Removed
Modified
  • ClienteInitrdDSGenerarloV1.0.2

    v26 v27  
    9696
    9797
    98 
    99 
    100 
    101 
    102 
    103 
    104 
    105 
    106 == Exportar el sqfs del ogLive a formato IMG para su modificación ==
    107 
    108 
    109 {{{
    110 Advertencia previa:
    111 6       -----------------------------
    112 7       - No usar este proceso en un sistema OpenGnNys en producción.
    113 8       - Se puede ejecutar este script desde un sistema Ubuntu 10.04, 11.04, 11.10, 12.04
    114 11     
    115 12      Requisitos iniciales
    116 13      --------------------
    117 14      - Utilizar el usuario "root" para ejecutar el proceso de exportación sqfs a img.
    118 15      - Comprobar la conexión a Internet, sobre todo si usas proxy:
    119               -- apt           # /etc/apt.conf
    120               -- subversion    # /etc/subversion/servers
    121               -- otras  # variable http_proxy
    122 16      - /var/lib/tftpboot  espacio libre 2 GB.
    123 }}}
    124 
    125 
    126 * Requisitos previos
    127 
    128 {{{
    129 * Detección kernel del ogLive a modificar.
    130 root@ogTRUNK:/# ls /opt/opengnsys/lib/
    131 ogLive-precise-3.2.0-23-generic-pae-r3017.iso
    132 
    133 * Usar en equipo mismo kernel que el ogLive a moficiar.
    134 root@ogTRUNK:/opt/opengnsys/lib# uname -a
    135 Linux ogTRUNK 3.2.0-20-generic #33-Ubuntu SMP Tue Mar 27 16:42:26 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
    136 
    137 apt-get install linux-image-3.0.0-23-generic-pae  linux-image-3.0.0-23-generic-pae
    138 
    139 root@ogTRUNK:/opt/opengnsys/lib# cat /etc/lsb-release
    140 DISTRIB_ID=Ubuntu
    141 DISTRIB_RELEASE=12.04
    142 DISTRIB_CODENAME=precise
    143 DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
    144 
    145 
    146 
    147 }}
    148 
    149 NOTA: este procedimiento se ha comprobado en una ubuntu server 12.04 32bits "copy & paste".
    150 {{{
    151 apt-get install schroot subversion wget;
    152 export OGCLIENTBASEDIR=/var/lib/tftpboot/ogclient/;
    153 export OGCLIENTFILE=${OGCLIENTBASEDIR}ogclient.img;
    154 export OGCLIENTMOUNT=${OGCLIENTBASEDIR}ogclientmount;
    155 export OGCLIENTSIZEMB=1900;
    156 export OGCLIENTLABEL=ogClient;
    157 
    158 mkdir -p $OGCLIENTMOUNT;
    159 dd if=/dev/zero of=$OGCLIENTFILE bs=1048576 count=$OGCLIENTSIZEMB;
    160 DISKLOOP=$(losetup -f);
    161 losetup $DISKLOOP $OGCLIENTFILE;
    162 echo -e "n\np\n1\n\n\nt\n83\nw" | fdisk $DISKLOOP;
    163 losetup -d $DISKLOOP ;
    164 PARTLOOP=$(losetup -f);
    165 losetup -o 32256 $PARTLOOP $OGCLIENTFILE && mkfs.ext3 -b 4096 -L $OGCLIENTLABEL $PARTLOOP;
    166 losetup -d $PARTLOOP ;
    167 losetup -d $PARTLOOP ;
    168 
    169 mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256;
    170 
    171 unsquashfs  -d /opt/opengnsys/tftpboot/ogclient/ogclientmount/ -f /opt/opengnsys/tftpboot/ogclient/ogclient.sqfs ;
    172 umount $OGCLIENTMOUNT;
    173 echo "fin";
    174 
    175 }}}
    176 
    177 {{{
    178 echo "Configurando acceso al disco virtual ogLive, formato IMG";
    179 cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.`getDateTime`;
    180 cat << EOF > /etc/schroot/schroot.conf
    181 [IMGogclient]
    182 type=loopback
    183 file=/var/lib/tftpboot/ogclient/ogclient.img
    184 description=ogclient ubuntu luc IMGi
    185 #priority=1
    186 users=root
    187 groups=root
    188 root-groups=root
    189 mount-options=-o offset=32256
    190 root-users=root
    191 #[IMGogclient]
    192 #type=loopback
    193 #file=/var/lib/tftpboot/ogclient/ogclient.img
    194 #description=ogclient ubuntu luc IMGi
    195 #priority=1
    196 #users=root
    197 #groups=root
    198 #root-groups=root
    199 #mount-options=-o offset=32256
    200 #root-users=root
    201 #[DIRogclient]
    202 #type=directory
    203 #directory=/var/lib/tftpboot/ogclient/ogclientmount
    204 #description=ogclient ubuntu lucid DIR
    205 #priority=2
    206 #users=root
    207 #groups=root
    208 #root-groups=root
    209 #root-users=root
    210 EOF
    211 echo "Configurando montajes automáticos del sistema ogLive en formato IMG";
    212 cp /etc/schroot/mount-defaults /etc/schroot/mount-defaults.`getDateTime`;
    213 cat << EOF > /etc/schroot/mount-defaults
    214 # mount.defaults: static file system information for chroots.
    215 # Note that the mount point will be prefixed by the chroot path
    216 # (CHROOT_PATH)
    217 #
    218 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    219 proc            /proc           proc    defaults        0       0
    220 #procbususb      /proc/bus/usb   usbfs   defaults        0       0
    221 #/dev            /dev            none    rw,bind         0       0
    222 /dev/pts        /dev/pts        none    rw,bind         0       0
    223 /dev/shm        /dev/shm        none    rw,bind         0       0
    224 #/home          /home           none    rw,bind         0       0
    225 /tmp            /tmp            none    rw,bind         0       0                                                               
    226 EOF
    227 
    228 echo "Fin configuración acceso al ogLive formato IMG";
    229 
    230 }}}
    231 
    23298== Procesos a evaluar ==
    23399=== A través de live-helper ===