diff options
author | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
commit | c3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch) | |
tree | 96fce1db6bf64fee2845d3a48abcbe07d9937562 /client/boot-tools/includes | |
parent | 4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff) |
Congelar versión 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/boot-tools/includes')
52 files changed, 1970 insertions, 0 deletions
diff --git a/client/boot-tools/includes/etc/apt/sources.list.debian b/client/boot-tools/includes/etc/apt/sources.list.debian new file mode 100644 index 00000000..495e48d4 --- /dev/null +++ b/client/boot-tools/includes/etc/apt/sources.list.debian @@ -0,0 +1,4 @@ +deb http://ftp.us.debian.org/debian lenny main contrib non-free + +deb http://security.debian.org/ lenny/updates main contrib non-free +deb-src http://security.debian.org/ lenny/updates main contrib non-free diff --git a/client/boot-tools/includes/etc/apt/sources.list.ubuntu b/client/boot-tools/includes/etc/apt/sources.list.ubuntu new file mode 100644 index 00000000..29348ccc --- /dev/null +++ b/client/boot-tools/includes/etc/apt/sources.list.ubuntu @@ -0,0 +1,56 @@ +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME main restricted +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME main restricted +## Major bug fix updates produced after the final release of the +## distribution. +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates main restricted +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates main restricted +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME universe +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME universe +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates universe +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME multiverse +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME multiverse +deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates multiverse +deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates multiverse + +## Uncomment the following two lines to add software from the 'backports' +## repository. +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +# deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-backports main restricted universe multiverse +# deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu OSCODENAME partner +# deb-src http://archive.canonical.com/ubuntu OSCODENAME partner + + +deb http://security.ubuntu.com/ubuntu OSCODENAME-security main restricted +deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security main restricted +deb http://security.ubuntu.com/ubuntu OSCODENAME-security universe +deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security universe +deb http://security.ubuntu.com/ubuntu OSCODENAME-security multiverse +deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security multiverse + + +deb http://archive.ubuntu.com/ubuntu OSCODENAME main +deb http://free.nchc.org.tw/drbl-core drbl stable +deb http://free.nchc.org.tw/ubuntu OSCODENAME-security main restricted universe multiverse +deb http://ppa.launchpad.net/freenx-team/ubuntu/ OSCODENAME main +deb http://ppa.launchpad.net/randomaction/ppa/ubuntu OSCODENAME main +deb-src http://ppa.launchpad.net/randomaction/ppa/ubuntu OSCODENAME main diff --git a/client/boot-tools/includes/etc/environment b/client/boot-tools/includes/etc/environment new file mode 100644 index 00000000..bb529d99 --- /dev/null +++ b/client/boot-tools/includes/etc/environment @@ -0,0 +1,4 @@ +LC_TYPE=es_ES@euro +LC_ALL=es_ES@euro +LANG=es_ES@euro +LANGUAGE=es_ES@euro
\ No newline at end of file diff --git a/client/boot-tools/includes/etc/fstab b/client/boot-tools/includes/etc/fstab new file mode 100644 index 00000000..d7473df4 --- /dev/null +++ b/client/boot-tools/includes/etc/fstab @@ -0,0 +1,13 @@ +# /etc/fstab: static file system information. +# +# Use 'blkid -o value -s UUID' to print the universally unique identifier +# for a device; this may be used with UUID= as a more robust way to name +# devices that works even if disks are added and removed. See fstab(5). +# +# <file system> <mount point> <type> <options> <dump> <pass> +proc /proc proc 0 0 +/dev/sda1 ext3 errors=remount-ro 0 1 + + + + diff --git a/client/boot-tools/includes/etc/initramfs-tools/hooks/oghooks b/client/boot-tools/includes/etc/initramfs-tools/hooks/oghooks new file mode 100755 index 00000000..67f807ab --- /dev/null +++ b/client/boot-tools/includes/etc/initramfs-tools/hooks/oghooks @@ -0,0 +1,62 @@ +#!/bin/sh -e +# initramfs hook for OpenGnsys + +#@file oghooks +#@brief configuración initrd para OpenGnSys +#@warning +#@version 0.9 - estrucura opengnsys, bash-static, unionfs, atheros +#@author Antonio J. Doblas Viso. +#@date 2010/05/24 +#*/ + +PREREQ="og" + +# Output pre-requisites +prereqs() +{ + echo "$PREREQ" +} + +case "$1" in + prereqs) + prereqs + exit 0 + ;; +esac + + +. /usr/share/initramfs-tools/hook-functions + +mkdir -p ${DESTDIR}/scripts/og-top +mkdir -p ${DESTDIR}/scripts/og-premount +mkdir -p ${DESTDIR}/scripts/og-bottom +mkdir -p ${DESTDIR}/mnt/ +mkdir -p ${DESTDIR}/net/ +mkdir -p ${DESTDIR}/usr +mkdir -p ${DESTDIR}/var/lock +mkdir -p ${DESTDIR}/var/log +mkdir -p ${DESTDIR}/opt/opengnsys; +mkdir -p ${DESTDIR}/ogboot; +mkdir -p ${DESTDIR}/boot; + +# Insert basic binaries +copy_exec /bin/bash-static /bin/bash +copy_exec /usr/bin/unionfs-fuse +copy_exec /sbin/mount.cifs +copy_exec /sbin/mount.smbfs +copy_exec /bin/lsmod + + +# Insert OpenGnsys Engine +#mkdir -p ${DESTDIR}/opt/opengnsys/lib/engine +#cp -prv /opt/opengnsys/client/lib/engine ${DESTDIR}/opt/opengnsys/lib/engine + +#rm -fr ${DESTDIR}/lib/modules/2.6.32-21-generic-pae/kernel/drivers/net/atl* +manual_add_modules cifs +manual_add_modules smbfs +manual_add_modules atl1e +manual_add_modules squashfs +manual_add_modules md4 + + + diff --git a/client/boot-tools/includes/etc/initramfs-tools/modules b/client/boot-tools/includes/etc/initramfs-tools/modules new file mode 100644 index 00000000..8bac1d4b --- /dev/null +++ b/client/boot-tools/includes/etc/initramfs-tools/modules @@ -0,0 +1,14 @@ +# List of modules that you want to include in your initramfs. +# +# Syntax: module_name [args ...] +# +# You must run update-initramfs(8) to effect this change. +# +# Examples: +# +# raid1 +# sd_mod +vga16b +vesafb +fbcon + diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions new file mode 100644 index 00000000..773e4137 --- /dev/null +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions @@ -0,0 +1,669 @@ +#@file ogfunctions.lib +#@brief Librería o clase para la gestion del sistema operativo de los clientes OpenGnsys +#@class client +#@brief Librería o clase para la gestion del sistema operativo de los clientes OpenGnsys +#@version 0.91 +#@warning License: GNU GPLv3+ + +#/** +# ogExportKernelParameters +#@brief Exporta los parametros pasados al kernel +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.7 - +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogExportKernelParameters () +{ + GLOBAL="cat /proc/cmdline" + for i in `${GLOBAL}` + do + echo $i | grep "=" > /dev/null && export $i + done + return 0 +} + +#/** +# ogExportVarEnvironment +#@brief Exporta las variables usadas en el proceso de inicio OpenGnsys y las almacena en /tmp +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +#*/ ## +ogExportVarEnvironment () +{ + export CFGINITRD="/tmp/initrd.cfg" + OGPROTOCOL="${ogprotocol:-smb}" + case "$OGPROTOCOL" in + nfs|NFS) + export SRCOGLIVE="/var/lib/tftpboot" && echo "SRCOGLIVE=$SRCOGLIVE" >> $CFGINITRD + export SRCOGSHARE="/opt/opengnsys/client" && echo "SRCOGSHARE=$SRCOGSHARE" >> $CFGINITRD + export SRCOGLOG="/opt/opengnsys/log/clients" && echo "SRCOGLOG=$SRCOGLOG" >> $CFGINITRD + export SRCOGIMAGES="/opt/opengnsys/images" && echo "SRCOGIMAGES=$SRCOGIMAGES" >> $CFGINITRD + ;; + smb|SMB|cifs|CIFS|samba|SAMBA) + export OPTIONS=" -o user=opengnsys,pass=og" + export SRCOGLIVE="tftpboot" && echo "SRCOGLIVE=$SRCOGLIVE" >> $CFGINITRD + export SRCOGSHARE="ogclient" && echo "SRCOGSHARE=$SRCOGSHARE" >> $CFGINITRD + export SRCOGLOG="oglog" && echo "SRCOGLOG=$SRCOGLOG" >> $CFGINITRD + export SRCOGIMAGES="ogimages" && echo "SRCOGIMAGES=$SRCOGIMAGES" >> $CFGINITRD + ;; + local|LOCAL) + export SRCOGLIVE="local" + ;; + esac + #punto de acceso al boot-tools live + export DSTOGLIVE="/opt/oglive/tftpboot" + #punto de montaje para unionfs + export OGLIVERAMFS="/opt/oglive/ramfs" && echo "OGLIVERAMFS=$OGLIVERAMFS" >> $CFGINITRD + #punto de montaje donde se accede al 2nd FS mediante loop + export OGLIVEROOTFS="/opt/oglive/rootfs" && echo "OGLIVEROOTFS=$OGLIVEROOTFS" >> $CFGINITRD + #punto de union entre LOCALROOTIMG y LOCALROOTRAM + export OGLIVEUNIONFS="/opt/oglive/unionfs" && echo "OGLIVEUNIONFS=$OGLIVEUNIONFS" >> $CFGINITRD + #etiquta para los dispositivos offline + export OGLIVELABEL="ogClient" + + #echo "puntos de montajes para los demas accesos" + #echo "acceso al client, engine, scritps, interfaz" + export DSTOGSHARE="/opt/opengnsys" && echo "DSTOGSHARE=$DSTOGSHARE" >> $CFGINITRD + export DSTOGLOG="/opt/opengnsys/log" && echo "DSTOGLOG=$DSTOGLOG" >> $CFGINITRD + export DSTOGIMAGES="/opt/opengnsys/images" && echo "DSTOGIMAGES=$DSTOGIMAGES" >> $CFGINITRD + + ##INFORMACION DE OTRAS VARIABLES OBTENDIAS EN OTRAS FUNCIONES ogConfigureNetwork. + #DEVICE + #IPV4DDR + #IPV4BROADCAST + #IPV4NETMASK + #IPV4GATEWAY + #HOSTNAME + #INFORMACION de otras variasbles obteneidas desde ogGetROOTSERVER + #ROOTSERVER si ip=dhcp -> ROOTSERVER=NEXT-SERVER; si ip=host:rootserver:gw:mask:hostname:interfaz -> ROOTSERVER=rootserver + #BOOTIF -> si el gestor remoto es pxelinux.0 y se añade una linea más tipo "IPAPPEND 2" esta variable tendrá la mac de la interfaz. + #$OGSERVERLIVE + #$OGSERVERSHARE + #$OGSERVERLOG + #$OGSERVERIMAGES + return 0 +} + + +#/** +# ogConfigureRamfs +#@brief Configura el initrd para adaptarlo al sistema raiz. +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogConfigureRamfs () +{ + mkdir -p $DSTOGLIVE + mkdir -p $OGLIVERAMFS + mkdir -p $OGLIVEROOTFS + mkdir -p $OGLIVEUNIONFS +} + + +#/** +# ogLoadNetModule +#@brief Carga en un demerminado modulo de red, requiere compilación previo del modulo +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogLoadNetModule () +{ + if [ -n "$ognetmodule" ] + then + echo "Cargando modulo de red $netmodule" + insmod `find /lib/modules/ -name ${netmodule}*` + fi +} + + +#/** +# ogPostConfigureFS +#@brief Configura el sistema raiz, para independizarlo entre los clientes. +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogPostConfigureFS() +{ + # configuramos el /etc/hostname. + echo $HOSTNAME > /etc/hostname + + #configuramos el /etc/hosts + echo "127.0.0.1 localhost" > /etc/hosts + echo "$IPV4ADDR $HOSTNAME" >> /etc/hosts + + #configuramos el host.conf + echo "order hosts,bind" > /etc/host.conf + echo "multi on" >> /etc/host.conf + + #configuramos el dns + echo "nameserver $ogdns" > /etc/resolv.conf + + + # configuramos el /etc/networks + #read -e NETIP NETDEFAULT <<<$(route -n | grep eth0 | awk -F" " '{print $1}') + NETIP=$(route -n | grep eth0 | awk -F" " '{print $1}') && NETIP=$(echo $NETIP | cut -f1 -d" ") + echo "default 0.0.0.0" > /etc/networks + echo "loopback 127.0.0.0" >> /etc/networks + echo "link-local 169.254.0.0" >> /etc/networks + echo "localnet $NETIP" >> /etc/networks + #route + + #echo "ogLive1.0.2" > /etc/debian_chroot + + #enlace si iniciamos desde ogprotocolo=local { cdrom, usb, cache } . + # monta el raiz del dispositivo local en /opt/og2fs/tftpboot - acceso al fichero .sqfs + # y monta el sistema root sqfs en /opt/og2fs/2ndfs + [ "$LOCALMEDIA" == "CACHE" ] && ln -s $DSTOGLIVE /opt/opengnsys/cache + [ "$ogprotocol" == "local" ] && ln -s ${OGLIVEROOTFS}/opt/opengnsys/* /opt/opengnsys/ + + #Montamos un directorio temporal para el apt-get + mount tmpfs /var/cache/apt/archives -t tmpfs -o size=15M + mkdir -p /var/cache/apt/archives/partial + +} + + +#/** +# ogGetROOTSERVER +#@brief Determina los puntos de accesos a los distintos recursos. +#Requiere ogConfigureNetworking. +#Exporta ROOTSERVER +# si la red ha sido configurada con dhcp el valor de ROOTSERVER será el valor de next-server del dhcp +# si la red ha sido configurada con el parametro de kernel ip, será el segundo valor. +## ip=iphost:ipnext-server:ipgateway:netmask:hostname:iface:none +## ip=172.17.36.21:62.36.225.150:172.17.36.254:255.255.255.0:prueba1:eth0:none +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogGetROOTSERVER () +{ + # get nfs root from dhcp + if [ "x${NFSROOT}" = "xauto" ]; then + # check if server ip is part of dhcp root-path + if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then + NFSROOT=${ROOTSERVER}:${ROOTPATH} + else + NFSROOT=${ROOTPATH} + fi + + # nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] + elif [ -n "${NFSROOT}" ]; then + # nfs options are an optional arg + if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then + NFSOPTS="-o ${NFSROOT#*,}" + fi + NFSROOT=${NFSROOT%%,*} + if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then + NFSROOT=${ROOTSERVER}:${NFSROOT} + fi + fi + export ROOTSERVER + echo "ROOTSERVER=$ROOTSERVER" >> $CFGINITRD + + #si oglive no oglive=R + export OGSERVERIMAGES="${ogrepo:-$ROOTSERVER}" && echo "OGSERVERIMAGES=$OGSERVERIMAGES" >> $CFGINITRD + export OGSERVERSHARE="${ogshare:-$ROOTSERVER}" && echo "OGSERVERSHARE=$OGSERVERSHARE" >> $CFGINITRD + export OGSERVERLOG="${oglog:-$ROOTSERVER}" && echo "OGSERVERLOG=$OGSERVERLOG" >> $CFGINITRD + export OGSERVERLIVE="${oglive:-$OGSERVERIMAGES}" && echo "OGSERVERLIVE=$OGSERVERLIVE" >> $CFGINITRD + + return 0 +} + + + +# ogUpdateInitrd +#@brief Actualiza el intird de la cache desde el servidor. Si el arranque ha disdo desde cache, compueba desde el servidor nueva version del initird. +#@param1 +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +#*/ ## + +ogUpdateInitrd () +{ + cd /tmp + mkdir /tmp/cache + mount -t reiserfs LABEL=CACHE /tmp/cache || return + mkdir /tmp/cache/boot + + + # comparamos los del server + busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER + busybox tftp -g -r oginitrd.img.sum $ROOTSERVER + SERVERVMLINUZ=`cat ogvmlinuz.sum` + SERVERINITRD=`cat oginitrd.img.sum` + + + #comparamos los de la cache + CACHEVMLINUZ=`cat /tmp/cache/boot/ogvmlinuz.sum` + CACHEINITRD=`cat /tmp/cache/boot/oginitrd.img.sum` + + echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD" + echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD" + + cd /tmp/cache/boot + + if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ] + then + echo "ogvmlinuz updating" + busybox tftp -g -r ogvmlinuz $ROOTSERVER + busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER + DOREBOOT=true + fi + if [ "$CACHEINITRD" != "$SERVERINITRD" ] + then + echo "oginitrd updating" + busybox tftp -g -r oginitrd.img $ROOTSERVER + busybox tftp -g -r oginitrd.img.sum $ROOTSERVER + DOREBOOT=true + fi + + cd /; umount /tmp/cache + + [ "$DOREBOOT" == "true" ] && busybox reboot -f + +} + +#/** +# ogConnect +#@brief Conecta con los recursos necesarios para opengnsys +#@param1 ip del servidor TODO:dns +#@param2 protocolo +#@param3 punto de acceso remoto +#@param4 punto de montaje local +#@param5 acceso de lectura tipo ",ro" +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +#*/ ## + +ogConnect () +{ + SERVER=$1 + PROTOCOL=$2 + SRC=$3 + DST=$4 + READONLY=$5 + + case "$PROTOCOL" in + nfs) + nfsmount -o nolock${READONLY} ${SERVER}:${SRC} ${DST} + ;; + smb) + mount.cifs //${SERVER}/${SRC} ${DST} ${OPTIONS}${READONLY} + ;; + esac +} + + +#/** +# ogConnectOgLive +#@brief Conecta con el recurso para usar el sistema raiz externo, remoto o local +#@param1 +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +ogConnectOgLive () +{ +# Si ogprotocol=local, la funcion ogExportVar => SRCOGLIVE=local + if [ "$SRCOGLIVE" == "local" ] + then + echo "Montar imagen del sistema root desde dispositivo local" + for i in $(blkid /dev/s* | grep $OGLIVELABEL | awk -F: '{print $2}' | tr -d \"); do export $i; done + mount -t $TYPE LABEL=$LABEL $DSTOGLIVE + if [ $? != 0 ] + then + mount -t reiserfs LABEL=CACHE $DSTOGLIVE + export LOCALMEDIA=CACHE + fi + else +# Si ogprotocol es remoto. TODO en smb rw y en nfs ro?? + ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE + fi +# Si el montaje ha sido correcto, tanto en local como en remoto. Procedemos con la union + ogMergeLive +} + + +#/** +# ogMergeLive +#@brief Metafuncion para fusionar el initrd con el sistema raiz. +#@param1 +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +ogMergeLive() +{ +#Si existe en el punto de acceso del del oglive el fichero ogclient.sqfs +if [ -f $DSTOGLIVE/ogclient/ogclient.sqfs ] +then + cat /proc/mounts > /tmp/mtab.preunion + if [ "$og2nd" == "img" ] + then + #Montamos el ROOTFS tipo img, para desarrolladores + #TODO: comprobar que se tiene acceso de escritura + losetup /dev/loop0 $DSTOGLIVE/ogclient/ogclient.img -o 32256 + mount /dev/loop0 $OGLIVEROOTFS + else + ## Montamos el ROOTFS tipo squashfs + mount $DSTOGLIVE/ogclient/ogclient.sqfs $OGLIVEROOTFS -t squashfs -o loop + fi +# Realizamos la union entre el ogliveram(initrd) y el ogliverootfs(ogclient.sqfs) + for i in etc var lib bin sbin usr root boot; do + ogUnionLiveDir $i + done + cat /tmp/mtab.preunion > /etc/mtab +else + echo "Fichero imagen del cliente no encontrado" + return 1 +fi +} + + + +#/** +# ogUnionLiveDir +#@brief fusiona dos directorios con unionfs +#@param1 +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +ogUnionLiveDir() +{ + TMPDIR=/$1 #dir + FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid" + UNION_OPT="-o cow -o noinitgroups" + UBIN="unionfs-fuse" + + mkdir -p $OGLIVERAMFS$TMPDIR + U1STDIR="${OGLIVERAMFS}${TMPDIR}=RW" + U2NDDIR="${OGLIVEROOTFS}${TMPDIR}=RO" + UNIONDIR=${OGLIVEUNIONFS}${TMPDIR} + mkdir -p $UNIONDIR + $UBIN $FUSE_OPT $UNION_OPT ${U1STDIR}:${U2NDDIR} $UNIONDIR + mount --bind $UNIONDIR $TMPDIR +} + + + +#/** +# ogConfigureLoopback +#@brief Configura la interfaz loopback para cliente torrent +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 Usando funciones generales de ubuntu +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#@version 1.0.1 Deteccion automatica de interfaz con enlace activo. +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +#*/ ## +ogConfigureLoopback() +{ + # for the portmapper we need localhost + ifconfig lo 127.0.0.1 + #/etc/init.d/portmap start +} + +#/** +# ogConfigureNetworking +#@brief Configura la interfaz de red usada en el pxe +#@param +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2010/05/24 +#*/ ## +ogConfigureNetworking() +{ +#echo "ogConfigureNetworking: Buscando interfaz a configurar DEVICE" +if [ -n "${BOOTIF}" ] +then + #echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF" + IP=$IPOPTS + temp_mac=${BOOTIF#*-} + # convert to typical mac address format by replacing "-" with ":" + bootif_mac="" + IFS='-' + for x in $temp_mac ; do + if [ -z "$bootif_mac" ]; then + bootif_mac="$x" + else + bootif_mac="$x:$bootif_mac" + fi + done + unset IFS + # look for devices with matching mac address, and set DEVICE to + # appropriate value if match is found. + for device in /sys/class/net/* ; do + if [ -f "$device/address" ]; then + current_mac=$(cat "$device/address") + if [ "$bootif_mac" = "$current_mac" ]; then + DEVICE=${device##*/} + break + fi + fi + done +else + #echo "variable BOOTIF no exportada, intentamos detectar que interfaz se ha iniciado" + IP=$ip + #TODO Detectar que interfaz se ha iniciado + case ${IP} in + none|off) + return 0 + ;; + ""|on|any) + # Bring up device + DEVICE=eth0 + ;; + dhcp|bootp|rarp|both) + DEVICE=eth0 + ;; + *) + DEVICE=`echo $IP | cut -f6 -d:` + ;; + esac +fi +if [ -z "${DEVICE}" ]; then + echo "variable DEVICE con valor $DEVICE no encontrada, llamamos de nuevo a ogconfigure_networking" + ogConfigureNetworking +fi + +[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0 +#if [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ]; then +# echo "variable DEVICE con valor $DEVICE y fichero /tmp/net-$DEVICE encontrados" +# return 0 +#else +# echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /tmp/net-$DEVICE" +#fi + +# Activamos la interfaz antes de configurar. +ip address flush $DEVICE +ip link set dev $DEVICE up +# Si no se detecta señal portadora volver a configurar. +sleep 1 +CARRIER=$(cat /sys/class/net/${DEVICE}/carrier) +if [ "$CARRIER" != "1" ] +then + ogConfigureNetworking +fi + +# support ip options see linux sources +# Documentation/filesystems/nfsroot.txt +# Documentation/frv/booting.txt +for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do + # The NIC is to be configured if this file does not exist. + # Ip-Config tries to create this file and when it succeds + # creating the file, ipconfig is not run again. + if [ -e /tmp/net-"${DEVICE}".conf ]; then + break; + fi + case ${IP} in + none|off) + return 0 + ;; + ""|on|any) + # Bring up device + echo "Setting $DEVICE with option:on|any and Variable IP= $IP: ipconfig -t ${ROUNDTTT} ${DEVICE} " + ipconfig -t ${ROUNDTTT} ${DEVICE} + ;; + dhcp|bootp|rarp|both) + echo "Setting $DEVICE with option:dhcp|bootp|rarp|both and Variable IP= $IP: ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} " + ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} + ;; + *) + echo "Setting $DEVICE with option * and Variable IP= $IP: ipconfig -t ${ROUNDTTT} -d $IP " + ipconfig -t ${ROUNDTTT} -d $IP + # grab device entry from ip option + NEW_DEVICE=${IP#*:*:*:*:*:*} + if [ "${NEW_DEVICE}" != "${IP}" ]; then + NEW_DEVICE=${NEW_DEVICE%:*} + else + # wrong parse, possibly only a partial string + NEW_DEVICE= + fi + if [ -n "${NEW_DEVICE}" ]; then + DEVICE="${NEW_DEVICE}" + fi + ;; + esac +done + +# source ipconfig output +if [ -n "${DEVICE}" ]; then + . /tmp/net-${DEVICE}.conf + DEVICECFG="/tmp/net-${DEVICE}.conf" + export DEVICECFG + export DEVICE + echo "DEVICE=$DEVICE" >> $CFGINITRD + echo "DEVICECFG=$DEVICECFG" >> $CFGINITRD + echo "exportando variable DEVICE con valor = $DEVICE y el DEVICECFG con valor $DEVICECFG" +else + # source any interface as not exaclty specified + . /tmp/net-*.conf +fi +} + + +#/** +# ogYesNo +#@brief Gestion de peticiones de usuario en modo ogdebug=true +#@param1 OPTIONS --timeout N --default ANSWER +#@param1 Questions +#@return 1=yes 0=no +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author: +#@date 2010/05/24 +#*/ ## +ogYesNo() +{ + local ans + local ok=0 + local timeout=0 + local default + local t + + while [[ "$1" ]] + do + case "$1" in + --default) + shift + default=$1 + if [[ ! "$default" ]]; then error "Missing default value"; fi + t=$(echo $default | tr '[:upper:]' '[:lower:]') + + if [[ "$t" != 'y' && "$t" != 'yes' && "$t" != 'n' && "$t" != 'no' ]]; then + error "Illegal default answer: $default" + fi + default=$t + shift + ;; + + --timeout) + shift + timeout=$1 + if [[ ! "$timeout" ]]; then error "Missing timeout value"; fi + #if [[ ! "$timeout" =~ ^[0-9][0-9]*$ ]]; then error "Illegal timeout value: $timeout"; fi + shift + ;; + + -*) + error "Unrecognized option: $1" + ;; + + *) + break + ;; + esac + done + + if [[ $timeout -ne 0 && ! "$default" ]]; then + error "Non-zero timeout requires a default answer" + fi + + if [[ ! "$*" ]]; then error "Missing question"; fi + + while [[ $ok -eq 0 ]] + do + if [[ $timeout -ne 0 ]]; then + if ! read -t $timeout -p "$*" ans; then + ans=$default + else + # Turn off timeout if answer entered. + timeout=0 + if [[ ! "$ans" ]]; then ans=$default; fi + fi + else + read -p "$*" ans + if [[ ! "$ans" ]]; then + ans=$default + else + ans=$(echo $ans | tr '[:upper:]' '[:lower:]') + fi + fi + + if [[ "$ans" == 'y' || "$ans" == 'yes' || "$ans" == 'n' || "$ans" == 'no' ]]; then + ok=1 + fi + + if [[ $ok -eq 0 ]]; then warning "Valid answers are: yes y no n"; fi + done + [[ "$ans" = "y" || "$ans" == "yes" ]] +} + diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/oginit b/client/boot-tools/includes/etc/initramfs-tools/scripts/oginit new file mode 100755 index 00000000..cc179f9f --- /dev/null +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/oginit @@ -0,0 +1,127 @@ +# OpenGnsys oginit -*- shell-script -*- + +#@file oginit +#@brief Guion modificador inicio initrd para OpenGnSys +#@warning +#@version 0.1 - basado en ROOTfs - rootfs over nfs - +#@author Antonio J. Doblas Viso. Universidad de Málaga +#@date 2009/00/00 +#@version 0.2 - basado en RAMFS - instalador de ubunto - +#@author Alejandro Castillo, Ramón Gómez, Irina, Antonio Doblas +#@date 2010/00/00 +#@version 0.7 - Hibrido en RAMFS + ROOTFS -mkinitrd, busybox, deboostrap- +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2010/05/24 +#@version 0.8 - Soporte smb, asignación ip estática +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2010/06/24 +#@version 0.8.1 - Integración RAMFS+ROOTFS con UnionFS y squasfs +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2010/06/29 +#@version 1.0. - Adaptacion variables. Corrección enlace red +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2011/06/16 +#@version 1.0.1 - Logica para inicio multiples dispositivos, usb, red, cd +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2011/07/4 +#@version 1.0.2 - RAMFS: instalación y actualización automatica en cache +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2011/08/4 +#*/ + + + + + +# Parameter: Where to mount the filesystem +mountroot () +{ + [ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top" + run_scripts /scripts/og-top + [ "$quiet" != "y" ] && log_end_msg + + # If the root device hasn't shown up yet, give it a little while + # to deal with removable devices + + . /scripts/functions + . /scripts/ogfunctions + + sleep 2 + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before get OG variables: y/N " + [ $? == 0 ] && sh || echo " " + set -a + log_success_msg "Checking kernel parameters" + ogExportKernelParameters + log_success_msg "Checking Opengnys Environmnet" + ogExportVarEnvironment + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure ramfs structure for OG: y/N " + [ $? == 0 ] && sh || echo " " + ogConfigureRamfs + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure netmoule specified in kernel parameters: y/N " + [ $? == 0 ] && sh || echo " " + ogLoadNetModule + + #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount" + #run_scripts /scripts/og-premount + #[ "$quiet" != "y" ] && log_end_msg + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure networking: y/N " + [ $? == 0 ] && sh || echo " " + ogConfigureNetworking + log_success_msg "config networking" + ogConfigureLoopback + log_success_msg "config loopback" + + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before detect rootserver: y/N " + [ $? == 0 ] && sh || echo " " + ogGetROOTSERVER && log_success_msg "Get Info from pxe server and ckeck distribuited OG services " + + + if [ "$ogdebug" == "true" -a "$ogupdateinitrd" == "true" ]; then + ogYesNo --timeout 5 --default no "Stop before check updating initrd: y/N " + [ $? == 0 ] && sh || echo " " + fi + [ "$ogupdateinitrd" == "true" ] && ogUpdateInitrd + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N " + [ $? == 0 ] && sh || echo " " + ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh + # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N " + [ $? == 0 ] && sh || echo " " + ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N " + [ $? == 0 ] && sh || echo " " + ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N " + [ $? == 0 ] && sh || echo " " + ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES + + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N " + [ $? == 0 ] && sh || echo " " + ogPostConfigureFS + setupcon -k + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before calling oginit with /etc/inittab: y/N " + [ $? == 0 ] && sh || echo " " + +if [ "$oginit" ] +then + exec $oginit +else + exec init +fi + + + + + +} diff --git a/client/boot-tools/includes/etc/inittab b/client/boot-tools/includes/etc/inittab new file mode 100644 index 00000000..6d3277fc --- /dev/null +++ b/client/boot-tools/includes/etc/inittab @@ -0,0 +1,14 @@ +# This is run first except when booting in single-user mode +# +#::sysinit:/opt/opengnsys/etc/preinit/defaultTESTING.sh +# /bin/sh invocations on selected ttys +# +# Start an "askfirst" shell on the console (whatever that may be) +#::askfirst:/bin/sh +# Start an "askfirst" shell on /dev/tty2-4 +#tty1::respawn:/sbin/getty 38400 tty1 +tty1::respawn:/opt/opengnsys/etc/preinit/default.sh +tty2::respawn:/sbin/getty 38400 tty2 +tty3::respawn:/sbin/getty 38400 tty3 +tty4::respawn:/sbin/getty 38400 tty4 +tty5::respawn:/sbin/getty 38400 tty5 diff --git a/client/boot-tools/includes/etc/modprobe.d/blacklist-framebuffer.conf b/client/boot-tools/includes/etc/modprobe.d/blacklist-framebuffer.conf new file mode 100644 index 00000000..8b047e4e --- /dev/null +++ b/client/boot-tools/includes/etc/modprobe.d/blacklist-framebuffer.conf @@ -0,0 +1,30 @@ +# Framebuffer drivers are generally buggy and poorly-supported, and cause +# suspend failures, kernel panics and general mayhem. For this reason we +# never load them automatically. +blacklist aty128fb +blacklist atyfb +#blacklist radeonfb +blacklist cirrusfb +blacklist cyber2000fb +blacklist cyblafb +blacklist gx1fb +blacklist hgafb +blacklist i810fb +blacklist intelfb +blacklist kyrofb +blacklist lxfb +blacklist matroxfb_base +blacklist neofb +blacklist nvidiafb +blacklist pm2fb +blacklist rivafb +blacklist s1d13xxxfb +blacklist savagefb +blacklist sisfb +blacklist sstfb +blacklist tdfxfb +blacklist tridentfb +#blacklist vesafb +blacklist vfb +blacklist viafb +blacklist vt8623fb diff --git a/client/boot-tools/includes/etc/mtab b/client/boot-tools/includes/etc/mtab new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/client/boot-tools/includes/etc/mtab diff --git a/client/boot-tools/includes/etc/network/interfaces b/client/boot-tools/includes/etc/network/interfaces new file mode 100644 index 00000000..dbe43582 --- /dev/null +++ b/client/boot-tools/includes/etc/network/interfaces @@ -0,0 +1,4 @@ +auto lo +iface lo inet loopback +auto eth0 +iface eth0 inet dhcp
\ No newline at end of file diff --git a/client/boot-tools/includes/etc/profile.d/loadenviron.sh b/client/boot-tools/includes/etc/profile.d/loadenviron.sh new file mode 100755 index 00000000..e2ad0144 --- /dev/null +++ b/client/boot-tools/includes/etc/profile.d/loadenviron.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +### NOTA este archivo se debe de copiar desde el fichero etc/init/default + diff --git a/client/boot-tools/includes/etc/securetty.template b/client/boot-tools/includes/etc/securetty.template new file mode 100644 index 00000000..491d8f52 --- /dev/null +++ b/client/boot-tools/includes/etc/securetty.template @@ -0,0 +1,142 @@ +# /etc/securetty: list of terminals on which root is allowed to login. +# See securetty(5) and login(1). +console + + +pts/0 +pts/1 +pts/2 +pts/3 + + +# Standard serial ports +ttyS0 +ttyS1 +ttyS2 +ttyS3 +ttyS4 +ttyS5 + +# USB dongles +ttyUSB0 +ttyUSB1 +ttyUSB2 + +# PowerMac +ttyPZ0 +ttyPZ1 +ttyPZ2 +ttyPZ3 + +# Embedded MPC platforms +ttyPSC0 +ttyPSC1 +ttyPSC2 +ttyPSC3 +ttyPSC4 +ttyPSC5 + +# PA-RISC mux ports +ttyB0 +ttyB1 + +# Standard hypervisor virtual console +hvc0 + +# Oldstyle Xen console +xvc0 + +# Standard consoles +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +tty12 +tty13 +tty14 +tty15 +tty16 +tty17 +tty18 +tty19 +tty20 +tty21 +tty22 +tty23 +tty24 +tty25 +tty26 +tty27 +tty28 +tty29 +tty30 +tty31 +tty32 +tty33 +tty34 +tty35 +tty36 +tty37 +tty38 +tty39 +tty40 +tty41 +tty42 +tty43 +tty44 +tty45 +tty46 +tty47 +tty48 +tty49 +tty50 +tty51 +tty52 +tty53 +tty54 +tty55 +tty56 +tty57 +tty58 +tty59 +tty60 +tty61 +tty62 +tty63 + +# Local X displays (allows empty passwords with pam_unix's nullok_secure) +:0 +:0.0 +:0.1 +:1 +:1.0 +:1.1 +:2 +:2.0 +:2.1 +:3 +:3.0 +:3.1 + +# Embedded Freescale i.MX ports +ttymxc0 +ttymxc1 +ttymxc2 +ttymxc3 +ttymxc4 +ttymxc5 + +# Embedded Renesas SuperH ports +ttySC0 +ttySC1 +ttySC2 +ttySC3 +ttySC4 +ttySC5
\ No newline at end of file diff --git a/client/boot-tools/includes/etc/ssh/ssh_config b/client/boot-tools/includes/etc/ssh/ssh_config new file mode 100644 index 00000000..7f9319dc --- /dev/null +++ b/client/boot-tools/includes/etc/ssh/ssh_config @@ -0,0 +1,56 @@ + +# This is the ssh client system-wide configuration file. See +# ssh_config(5) for more information. This file provides defaults for +# users, and the values can be changed in per-user configuration files +# or on the command line. + +# Configuration data is parsed as follows: +# 1. command line options +# 2. user-specific file +# 3. system-wide file +# Any configuration value is only changed the first time it is set. +# Thus, host-specific definitions should be at the beginning of the +# configuration file, and defaults at the end. + +# Site-wide defaults for some commonly used options. For a comprehensive +# list of available options, their meanings and defaults, please see the +# ssh_config(5) man page. + +Host * +# ForwardAgent no +# ForwardX11 no +# ForwardX11Trusted yes +# RhostsRSAAuthentication no +# RSAAuthentication yes +# PasswordAuthentication yes + HostbasedAuthentication no +# GSSAPIAuthentication no +# GSSAPIDelegateCredentials no +# GSSAPIKeyExchange no +# GSSAPITrustDNS no +# BatchMode no +# CheckHostIP yes +# AddressFamily any +# ConnectTimeout 0 +# StrictHostKeyChecking ask +# IdentityFile ~/.ssh/identity +# IdentityFile ~/.ssh/id_rsa +# IdentityFile ~/.ssh/id_dsa +# Port 22 +# Protocol 2,1 +# Cipher 3des +# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc +# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 +# EscapeChar ~ +# Tunnel no +# TunnelDevice any:any +# PermitLocalCommand no +# VisualHostKey no + SendEnv LANG LC_* +# HashKnownHosts yes + GSSAPIAuthentication yes + GSSAPIDelegateCredentials no + + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null + diff --git a/client/boot-tools/includes/etc/ssh/sshd_config b/client/boot-tools/includes/etc/ssh/sshd_config new file mode 100644 index 00000000..80900684 --- /dev/null +++ b/client/boot-tools/includes/etc/ssh/sshd_config @@ -0,0 +1,86 @@ +# Package generated configuration file +# See the sshd_config(5) manpage for details + +# What ports, IPs and protocols we listen for +Port 22 +# Use these options to restrict which interfaces/protocols sshd will bind to +#ListenAddress :: +#ListenAddress 0.0.0.0 +Protocol 2 +# HostKeys for protocol version 2 +HostKey /etc/ssh/ssh_host_rsa_key +HostKey /etc/ssh/ssh_host_dsa_key +#Privilege Separation is turned on for security +UsePrivilegeSeparation no + +# Lifetime and size of ephemeral version 1 server key +KeyRegenerationInterval 3600 +ServerKeyBits 768 + +# Logging +SyslogFacility AUTH +LogLevel INFO + +# Authentication: +LoginGraceTime 120 +PermitRootLogin yes +StrictModes yes + +RSAAuthentication yes +PubkeyAuthentication yes +#AuthorizedKeysFile %h/.ssh/authorized_keys + +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes +# For this to work you will also need host keys in /etc/ssh_known_hosts +RhostsRSAAuthentication no +# similar for protocol version 2 +HostbasedAuthentication no +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication +#IgnoreUserKnownHosts yes + +# To enable empty passwords, change to yes (NOT RECOMMENDED) +PermitEmptyPasswords no + +# Change to yes to enable challenge-response passwords (beware issues with +# some PAM modules and threads) +ChallengeResponseAuthentication no + +# Change to no to disable tunnelled clear text passwords +#PasswordAuthentication yes + +# Kerberos options +#KerberosAuthentication no +#KerberosGetAFSToken no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd no +PrintLastLog yes +TCPKeepAlive yes +#UseLogin no + +#MaxStartups 10:30:60 +#Banner /etc/issue.net + +# Allow client to pass locale environment variables +AcceptEnv LANG LC_* + +Subsystem sftp /usr/lib/openssh/sftp-server + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +UsePAM yes diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/box.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/box.png Binary files differnew file mode 100644 index 00000000..54876e68 --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/box.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/bullet.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/bullet.png Binary files differnew file mode 100644 index 00000000..dd527369 --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/bullet.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/entry.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/entry.png Binary files differnew file mode 100644 index 00000000..a9f4157b --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/entry.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/lock.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/lock.png Binary files differnew file mode 100644 index 00000000..a0f8c12f --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/lock.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/logoopengnsys.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/logoopengnsys.png Binary files differnew file mode 100644 index 00000000..c87ca25e --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/logoopengnsys.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.plymouth b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.plymouth new file mode 100644 index 00000000..a974b70c --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.plymouth @@ -0,0 +1,11 @@ +[Plymouth Theme] +Name=Script +Description=Script example plugin. +ModuleName=script + +[script] +ImageDir=/lib/plymouth/themes/opengnsys +ScriptFile=/lib/plymouth/themes/opengnsys/opengnsys.script + +[script-env-vars] +example_env_var=example env var value diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.png Binary files differnew file mode 100644 index 00000000..c87ca25e --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.script b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.script new file mode 100644 index 00000000..dc0c8541 --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/opengnsys.script @@ -0,0 +1,203 @@ +# This is an example plymouth plugin script + +Window.SetBackgroundTopColor(0, 0, 0); +Window.SetBackgroundBottomColor(0, 0, 0); + +#logo.image = Image("special://logo"); +logo.image = Image ("opengnsys.png"); +logo.sprite = Sprite(logo.image); +logo.opacity_angle = 0; + +fun refresh_callback () + { + if (status == "normal") + { + logo.opacity_angle += ((2 * 3.14) / 50) * 0.5; # 0.5 HZ + min_opacity = 0.3; + opacity = (Math.Cos(logo.opacity_angle) + 1) / 2; + opacity *= 1 - min_opacity; + opacity += min_opacity; + logo.sprite.SetX (Window.GetX() + Window.GetWidth() / 2 - logo.image.GetWidth() / 2); + logo.sprite.SetY (Window.GetY() + Window.GetHeight() / 2 - logo.image.GetHeight() / 2); + logo.sprite.SetOpacity (opacity); + } + else + { + logo.sprite.SetX (0); + logo.sprite.SetY (0); + logo.sprite.SetOpacity (1); + } + } + +Plymouth.SetRefreshFunction (refresh_callback); + +#----------------------------------------- Dialogue -------------------------------- + +status = "normal"; + +fun dialog_setup() + { + local.box; + local.lock; + local.entry; + + box.image = Image("box.png"); + lock.image = Image("lock.png"); + entry.image = Image("entry.png"); + + box.sprite = Sprite(box.image); + box.x = Window.GetX() + Window.GetWidth() / 2 - box.image.GetWidth ()/2; + box.y = Window.GetY() + Window.GetHeight() / 2 - box.image.GetHeight()/2; + box.z = 10000; + box.sprite.SetPosition(box.x, box.y, box.z); + + lock.sprite = Sprite(lock.image); + lock.x = box.x + box.image.GetWidth()/2 - (lock.image.GetWidth() + entry.image.GetWidth()) / 2; + lock.y = box.y + box.image.GetHeight()/2 - lock.image.GetHeight()/2; + lock.z = box.z + 1; + lock.sprite.SetPosition(lock.x, lock.y, lock.z); + + entry.sprite = Sprite(entry.image); + entry.x = lock.x + lock.image.GetWidth(); + entry.y = box.y + box.image.GetHeight()/2 - entry.image.GetHeight()/2; + entry.z = box.z + 1; + entry.sprite.SetPosition(entry.x, entry.y, entry.z); + + global.dialog.box = box; + global.dialog.lock = lock; + global.dialog.entry = entry; + global.dialog.bullet_image = Image("bullet.png"); + dialog_opacity (1); + } + +fun dialog_opacity(opacity) + { + dialog.box.sprite.SetOpacity (opacity); + dialog.lock.sprite.SetOpacity (opacity); + dialog.entry.sprite.SetOpacity (opacity); + for (index = 0; dialog.bullet[index]; index++) + { + dialog.bullet[index].sprite.SetOpacity(opacity); + } + } + +fun display_normal_callback () + { + global.status = "normal"; + if (global.dialog) + dialog_opacity (0); + } + +fun display_password_callback (prompt, bullets) + { + global.status = "password"; + if (!global.dialog) + dialog_setup(); + else + dialog_opacity(1); + for (index = 0; dialog.bullet[index] || index < bullets; index++) + { + if (!dialog.bullet[index]) + { + dialog.bullet[index].sprite = Sprite(dialog.bullet_image); + dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth(); + dialog.bullet[index].y = dialog.entry.y + dialog.entry.image.GetHeight() / 2 - dialog.bullet_image.GetHeight() / 2; + dialog.bullet[index].z = dialog.entry.z + 1; + dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z); + } + if (index < bullets) + dialog.bullet[index].sprite.SetOpacity(1); + else + dialog.bullet[index].sprite.SetOpacity(0); + } + } + +Plymouth.SetDisplayNormalFunction(display_normal_callback); +Plymouth.SetDisplayPasswordFunction(display_password_callback); + +#----------------------------------------- Progress Bar -------------------------------- + +progress_box.original_image = Image("progress_box.png"); +progress_box.image = progress_box.original_image.Scale(Window.GetWidth (), progress_box.original_image.GetHeight()); +progress_box.sprite = Sprite(progress_box.image); + +progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; +progress_box.y = Window.GetY() + Window.GetHeight() - progress_box.image.GetHeight(); +progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0); + +progress_bar.original_image = Image("progress_bar.png"); +progress_bar.image = progress_bar.original_image.Scale(0, progress_box.image.GetHeight()); +progress_bar.sprite = Sprite(); + +progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2; +progress_bar.y = Window.GetY() + Window.GetHeight() - progress_box.image.GetHeight(); +progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1); + +fun progress_callback (duration, progress) + { + if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress)) + { + progress_bar.image = progress_bar.original_image.Scale(progress_box.image.GetWidth(progress_box.image) * progress, progress_box.image.GetHeight()); + progress_bar.sprite.SetImage (progress_bar.image); + } + } + +Plymouth.SetBootProgressFunction(progress_callback); + +#----------------------------------------- Quit -------------------------------- + +fun quit_callback () +{ + logo.sprite.SetOpacity (1); +} + +Plymouth.SetQuitFunction(quit_callback); + +#----------------------------------------- Message -------------------------------- + +message_sprite = Sprite(); +message_sprite.SetPosition(10, 10, 10000); + +fun message_callback (text) +{ + my_image = Image.Text(text, 0.6, 0.6, 0.6); + message_sprite.SetImage(my_image); + message_sprite.SetX(Window.GetWidth () / 2 - my_image.GetWidth() / 2); + message_sprite.SetY((Window.GetHeight () * 0.7) - (2 * my_image.GetHeight())); + message.sprite.SetZ(11); +} + +Plymouth.SetMessageFunction(message_callback); + + +#----------------------------------------- Status Update -------------------------------- + +statusupdate_sprite = Sprite(); + +fun StringLength(string) { + + index = 0; + str = String(string); + while(str.CharAt(index)) index++; + return index; +} + +fun status_callback (text) +{ + // Truncate the message if too long + if (StringLength(text) > (Window.GetHeight () / 4 )) { + text = text.SubString(0, (Window.GetHeight () / 4 ) - 3); + text += "..."; + } + + my_image = Image.Text(text, 0.4, 0.4, 0.4); + statusupdate_sprite.SetPosition(10, 10 + (i * 20), 10000); + statusupdate_sprite.SetImage(my_image); + statusupdate_sprite.SetX(Window.GetWidth () / 2 - my_image.GetWidth() / 2); + statusupdate_sprite.SetY((Window.GetHeight () * 0.7) - my_image.GetHeight()); + statusupdate.sprite.SetZ(11); +} + +Plymouth.SetUpdateStatusFunction(status_callback); + + diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_bar.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_bar.png Binary files differnew file mode 100644 index 00000000..fad2e3f9 --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_bar.png diff --git a/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_box.png b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_box.png Binary files differnew file mode 100644 index 00000000..bdc029e1 --- /dev/null +++ b/client/boot-tools/includes/lib/plymouth/themes/opengnsys/progress_box.png diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh new file mode 100644 index 00000000..edd0dc00 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#TODO Comprobar si esta los source. +#svn checkout http://www.opengnsys.es/svn/branches/version1.0/client /tmp/opengnsys_installer/opengnsys/client/; +#svn checkout http://www.opengnsys.es/svn/branches/version2/ /tmp/opengnsys_installer/opengnsys2 +find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null; + +#plymouth +apt-get -y install plymouth plymouth-theme-script + + +#plymoutyh +update-alternatives --install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/opengnsys/opengnsys.plymouth 100 +update-alternatives --set default.plymouth /lib/plymouth/themes/opengnsys/opengnsys.plymouth + +mkdir -p /etc/initramfs-tools/conf.d +echo "FRAMEBUFFER=y" > /etc/initramfs-tools/conf.d/splash + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsLocales.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsLocales.sh new file mode 100755 index 00000000..63d36943 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsLocales.sh @@ -0,0 +1,6 @@ +#!/bin/bash +dpkg-reconfigure console-data +dpkg-reconfigure console-setup +dpkg-reconfigure locales + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh new file mode 100644 index 00000000..21b7a54d --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh @@ -0,0 +1,124 @@ +#!/bin/bash +#TODO Comprobar si esta los source. + +#svn checkout http://www.opengnsys.es/svn/branches/version1.0/client /tmp/opengnsys_installer/opengnsys/client/; +#svn checkout http://www.opengnsys.es/svn/branches/version2/ /tmp/opengnsys_installer/opengnsys2 +find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null; + +apt-get -y --force-yes install subversion +export SVNURL="http://opengnsys.es/svn/branches/version1.0/client/" +VERSIONSVN=$(LANG=C svn info $SVNURL | awk '/Revision:/ {print "r"$2}') + +VERSIONBOOTTOOLS=ogLive + +NAMEISOCLIENT="/tmp/opengnsys_info_rootfs" +NAMEHOSTCLIENT="/tmp/opengnsys_chroot" + +SVNCLIENTDIR=/tmp/opengnsys_installer/opengnsys/client/boot-tools +SVNCLIENTSTRUCTURE=/tmp/opengnsys_installer/opengnsys/client/shared +SVNCLIENTENGINE=/tmp/opengnsys_installer/opengnsys/client/engine +SVNOG2=/tmp/opengnsys_installer/opengnsys2 + +OGCLIENTMOUNT="" + + +OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null +OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}') +OSRELEASE=$(uname -a | awk '{print $3}') +uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386 +OSHTTP="http://es.archive.ubuntu.com/ubuntu/" + +echo $OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP + + +LERROR=TRUE + +echo "$FUNCNAME: Iniciando la personalización con datos del SVN " + +# parseamos del apt.source +sed -e "s/OSCODENAME/$OSCODENAME/g" ${SVNCLIENTDIR}/includes/etc/apt/sources.list.ubuntu > ${SVNCLIENTDIR}/includes/etc/apt/sources.list +if [ $? -ne 0 ] +then + echo "$FUNCNAME(): Parsing apt.sources : ERROR" + exit 1 +fi + + + +#damos permiso al directorio de scripts +chmod -R 775 ${SVNCLIENTDIR}/includes/usr/bin/* + +# los copiamos +cp -prv ${SVNCLIENTDIR}/includes/* / +mkdir -p ${OGCLIENTMOUNT}/opt/opengnsys/ +cp -prv ${SVNCLIENTSTRUCTURE}/* ${OGCLIENTMOUNT}/opt/opengnsys/ +cp -prv ${SVNCLIENTENGINE}/* ${OGCLIENTMOUNT}/opt/opengnsys/lib/engine/bin/ + +if [ $? -ne 0 ] +then + echo "$FUNCNAME(): Copying client data : ERROR" + exit 1 +fi + +# copiamos algunas cosas del nfsexport + +#### Tipos de letra para el Browser. +cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/lib/fonts +#### Crear enlaces para compatibilidad con las distintas versiones del Browser. +mkdir -p $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/ +mkdir -p $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/ +mkdir -p $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.3/lib/ +cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/fonts +cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/fonts +cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.3/lib/fonts +if [ $? -ne 0 ] +then + echo "$FUNCNAME(): Linking Browser fonts : ERROR" + exit 1 +fi + +######################################################### +cp -pr ${SVNCLIENTSTRUCTURE}/lib/pci.ids $OGCLIENTMOUNT/etc +if [ $? -ne 0 ] +then + echo "$FUNCNAME(): Copying pci.ids : ERROR" + exit 1 +fi +####### Browsser +cp ${SVNCLIENTSTRUCTURE}/bin/browser $OGCLIENTMOUNT/bin +if [ $? -ne 0 ] +then + echo "$FUNCNAME(): Copying Browser : ERROR" + exit 1 +fi + + +#Compatiblidad con og2 +cp ${SVNCLIENTSTRUCTURE}/bin/browser2 $OGCLIENTMOUNT/bin + +cp -prv ${SVNOG2}/ogr/ogr $OGCLIENTMOUNT/opt/opengnsys/bin/ + +cp -prv ${SVNOG2}/ogr/libogr.py $OGCLIENTMOUNT/usr/lib/python2.7/libogr.py +cp -prv ${SVNOG2}/ogr/libogr.py $OGCLIENTMOUNT/usr/lib/python2.6/libogr.py +cp -prv ${SVNOG2}/ogr/libogr.py $OGCLIENTMOUNT/opt/opengnsys/lib/python + + +echo "mkdir -p /opt/opengnsys/lib/engine/" +mkdir -p /opt/opengnsys/engine/ +echo "cp -prv ${SVNOG2}/engine/2.0/* $OGCLIENTMOUNT/opt/opengnsys/engine/" +cp -prv ${SVNOG2}/engine/2.0/* $OGCLIENTMOUNT/opt/opengnsys/engine/ + + +cp -prv ${SVNOG2}/job_executer $OGCLIENTMOUNT/opt/opengnsys/bin/ + + +cp ${SVNCLIENTSTRUCTURE}/bin/ogAdmClient $OGCLIENTMOUNT/bin + + +echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${VERSIONSVN} > $NAMEISOCLIENT +echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > $NAMEHOSTCLIENT +echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > /etc/debian_chroot +echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > /etc/opengnsys_chroot + +history -c + diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh new file mode 100755 index 00000000..140cffb9 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh new file mode 100755 index 00000000..fe9fe4ff --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh @@ -0,0 +1,18 @@ +#!/bin/bash +export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null +#OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null +export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}') +export OSRELEASE=$(uname -a | awk '{print $3}') +uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386 +export OSHTTP="http://es.archive.ubuntu.com/ubuntu/" + + + +cd /usr/lib/initramfs-tools/bin/ +rm * +cp /bin/busybox ./ +cd /tmp/ +mkinitramfs -o /tmp/initrd.img-$OSRELEASE -v $OSRELEASE +cp /boot/vmlinuz-$OSRELEASE /tmp + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh new file mode 100755 index 00000000..568548f2 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh @@ -0,0 +1,32 @@ +#!/bin/bash +################################################################ +##################### SOFTWARE ##################### +################################################################ +export LANGUAGE=C +export LC_ALL=C +export LANG=C + + +source /opt/opengnsys/lib/engine/bin/ToolsGNU.c &>/dev/null +cd /tmp + +echo "ctorrent " +which ctorrent || ctorrent install &>/dev/null + +echo "udp-sender " +which udp-sender || udpcast install &>/dev/null + +echo "ms-sys " +which ms-sys || ms-sys install &>/dev/null + +echo "echo partclone " +#which partclone.ntfs || $(wget -O partclone_0.2.16_i386.deb http://downloads.sourceforge.net/project/partclone/stable/0.2.16/partclone_0.2.16_i386.deb?use_mirror=ovh &>/dev/null; gdebi -n partclone_0.2.16_i386.deb &>/dev/null) +which partclone.ntfs || gdebi -n /var/cache/apt/archivesOG/partclone_0.2.8_i386.deb + +echo "spartlnx" +which spartlnx.run || $(wget http://damien.guibouret.free.fr/savepart.zip &>/dev/null; unzip -o savepart.zip -d /sbin/) + +echo "xvesa" +gdebi -n /var/cache/apt/archivesOG/xvesa.deb + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh new file mode 100755 index 00000000..9af72199 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh @@ -0,0 +1,69 @@ +#!/bin/bash +export LANGUAGE=C +export LC_ALL=C +export LANG=C +#LOG_FILE=/tmp/boot-tools-software.txt + +#Desactivamos upstart +dpkg-divert --local --rename --add /sbin/initctl +ln -s /bin/true /sbin/initctl + +#cp /tmp/sources.list /etc/apt/sources.list +#Limpiamos y actualizamos los repositorios apt +apt-get clean +apt-get update + +#Desactivamos el hook del oginitrd.img para evitar problemas. +mv /etc/initramfs-tools/hooks/oghooks /etc/initramfs-tools/ + +echo " /dev/sda1 / ext4 rw,errors=remount-ro 0 0 " > /etc/mtab + + +#Instalamos el kernel. +export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null +export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}') +export OSRELEASE=$(uname -a | awk '{print $3}') +uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386 +export OSHTTP="http://es.archive.ubuntu.com/ubuntu/" +# software Kernel +apt-get -y --force-yes install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} linux-image-$RELEASE + +#Eliminamos cualquier busybox previo: antes del busybox. +apt-get -y --force-yes remove busybox + +#estos paquetes ofrecen interaccion. +# si es actualización, ya existe el fichero /etc/ssh/ssh_config +apt-get -y install sshfs + +apt-get -y install console-data + +for group in `find /usr/bin/boot-tools/listpackages/ -name sw.*` +do + echo "Instalando el grupo de paquetes almacenados en $group" + for package in ` awk /^install/'{print $2}' $group ` + do + echo -n $package + apt-get -y --force-yes install $package &>/dev/null + RETVAL=$? + if [ $RETVAL == 0 ] + then + echo " : OK - Paquete instalado correctamente (codigo interno de apt-get $RETVAL)" + else + echo " : Error Paquete $package del grupo $group (codigo interno de apt-get $RETVAL) " + echo "Pulse pause para continuar" + read + fi + done +done + + +#Activamos el hook del oginitrd.img +mv /etc/initramfs-tools/oghooks /etc/initramfs-tools/hooks/ + +echo " " > /etc/mtab + +apt-get clean +apt-get autoclean +apt-get autoremove + +history -c diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows new file mode 100644 index 00000000..41824f18 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows @@ -0,0 +1,14 @@ +#!/bin/bash + +export LANGUAGE=C +export LC_ALL=C +export LANG=C + +apt-get clean +apt-get -y update + +apt-get -y --force-yes install xorg-dev xorg lxde roxterm + +apt-get clean + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshClient.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshClient.sh new file mode 100755 index 00000000..10aa673e --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshClient.sh @@ -0,0 +1,25 @@ +#!/bin/bash +echo "comprobando directorio .ssh del root" +if [ ! -d /root/.ssh ] +then + echo "creando directorio .ssh 600" + mkdir -p /root/.ssh + chmod 700 /root/.ssh +fi + + +echo "comprobando el fichero authorized_keys .ssh del root" +if [ ! -f /root/.ssh/authorized_keys ] +then + echo "creando el fichero authorized_keys" + touch /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys +fi + +ssh-keygen -q -f /root/.ssh/id_rsa -N "" +cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys + +## TODO: exportamos la publica a los repos +cp /root/.ssh/id_rsa.pub /tmp/rsa.ogclient.pub + +history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshServer.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshServer.sh new file mode 100755 index 00000000..02ea71cd --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSshServer.sh @@ -0,0 +1,18 @@ +#!/bin/bash +echo "comprobando directorio .ssh del root" +if [ ! -d /root/.ssh ] +then + echo "creando directorio .ssh 600" + mkdir -p /root/.ssh + chmod 700 /root/.ssh +fi +echo "creando el fichero authorized_keys" +touch /root/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys + +echo "importando la clave publica del servidor OG" +cat /tmp/id_rsa.pub + +[ -f /tmp/id_rsa.pub ] && cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys || echo "no key publica og" + + history -c
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Xwindow b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Xwindow new file mode 100644 index 00000000..25356820 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Xwindow @@ -0,0 +1,10 @@ +#sw.X +#+300M +#install xorg-dev +#install xorg +#install lxde +#+80M roxterm y gparted +install roxterm +install gparted +#xvesa en compilacion +install openbox
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd new file mode 100644 index 00000000..48438791 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd @@ -0,0 +1,3 @@ +#sw.zinitrd +install busybox-static +install bash-static diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic new file mode 100644 index 00000000..4286d652 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic @@ -0,0 +1,13 @@ +#Format install paquete +install dialog +install man-db +install fbset +install gdebi-core +install busybox-static +install console-data +install locales +install lshw +install gawk +install subversion +install python-openssl +install python
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.cloning b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.cloning new file mode 100644 index 00000000..9eda4b6b --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.cloning @@ -0,0 +1,16 @@ +#sw.cloning +install drbl-partimage +install fsarchiver +install pv +install kexec-tools +install mbuffer +install parted +install drbl-chntpw +install chntpw +install clonezilla +install registry-tools +install reglookup +install libparse-win32registry-perl +install grokevt +install libhivex0 +install libhivex-bin
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compile b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compile new file mode 100644 index 00000000..8b1d1001 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compile @@ -0,0 +1,10 @@ +install build-essential +install libattr* +install attr +install make +install m4 +install gettext +install libmhash-dev +install gdebi-core +install gawk + diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compresor b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compresor new file mode 100644 index 00000000..113e885e --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.compresor @@ -0,0 +1,12 @@ +#sw.compressor +install lzma +install zip +install unzip +install gzip +install lzop +install drbl-lzop +install pigz +install pbzip2 +install lbzip2 +install rzip +install p7zip-full
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local new file mode 100644 index 00000000..16d67da5 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local @@ -0,0 +1,21 @@ +#sw.filesystem.local +install squashfs-tools +install unionfs-fuse +install drbl-ntfsprogs +install ntfsprogs +install ntfs-3g +install dosfstools +install dmraid +install dmsetup +install lvm2 +install e2fsprogs +install jfsutils +install reiserfsprogs +install xfsprogs +install mhddfs +install hfsplus +install hfsprogs +install hfsutils +install nilfs-tools +install reiser4progs +install ufsutils
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote new file mode 100644 index 00000000..192a4017 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote @@ -0,0 +1,9 @@ +#sw.filesystem.remote +install nfs-common +install sshfs +install smbfs +install smbclient +install davfs2 +install open-iscsi +install openssh-server +install bittornado
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.monitoring b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.monitoring new file mode 100644 index 00000000..49adc6f3 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.monitoring @@ -0,0 +1,12 @@ +#sw.monitoring +install htop +install ncdu +install bwbar +install bmon +install iftop +install ifstat +install dstat +install hdparm +install sdparm +install blktool +install testdisk
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.networking b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.networking new file mode 100644 index 00000000..d8efd04e --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.networking @@ -0,0 +1,14 @@ +#sw.networking +install netpipes +install wget +install tftp +install dnsutils +install trickle +install lighttpd +install ethtool +install ssmping +install mii-diag +install tcpdump +install nmap +install arping +install iptraf
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.testing b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.testing new file mode 100644 index 00000000..282de9e8 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.testing @@ -0,0 +1,4 @@ +#sw.other +install screen +install schroot +install grub
\ No newline at end of file diff --git a/client/boot-tools/includes/usr/bin/boot-tools/qemu.sh b/client/boot-tools/includes/usr/bin/boot-tools/qemu.sh new file mode 100755 index 00000000..49031670 --- /dev/null +++ b/client/boot-tools/includes/usr/bin/boot-tools/qemu.sh @@ -0,0 +1,12 @@ +#/bin/bash + +mount -o rw,remount / +mount proc /proc -t proc +export PATH=$PATH dpkg -i *.deb +modprobe 8139too +modprobe 8139cp +dhclient +/etc/init.d/ssh restart + + +#qemu -hda ogclient.img -kernel ./ogvmlinuz -initrd ./oginitrd.img -append "root=/dev/sda1 rw init=false" -boot c
\ No newline at end of file diff --git a/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.7-1drbl_i386.deb b/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.7-1drbl_i386.deb Binary files differnew file mode 100755 index 00000000..870b021f --- /dev/null +++ b/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.7-1drbl_i386.deb diff --git a/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.8_i386.deb b/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.8_i386.deb Binary files differnew file mode 100755 index 00000000..9dbe2e9e --- /dev/null +++ b/client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.8_i386.deb diff --git a/client/boot-tools/includes/var/cache/apt/archivesOG/xvesa.deb b/client/boot-tools/includes/var/cache/apt/archivesOG/xvesa.deb Binary files differnew file mode 100644 index 00000000..72433e76 --- /dev/null +++ b/client/boot-tools/includes/var/cache/apt/archivesOG/xvesa.deb diff --git a/client/boot-tools/includes/var/lib/locales/supported.d/local b/client/boot-tools/includes/var/lib/locales/supported.d/local new file mode 100644 index 00000000..be3f2a41 --- /dev/null +++ b/client/boot-tools/includes/var/lib/locales/supported.d/local @@ -0,0 +1,5 @@ +es_ES ISO-8859-1 +es_ES@euro ISO-8859-15 +es_ES.UTF-8 UTF-8 +es_ES.UTF-8@euro UTF-8 +en_US.UTF-8 UTF-8
\ No newline at end of file |