refs #596 move isolinux.cfg template and debconf settings to the config
parent
bf16103817
commit
305e6209bf
|
@ -10,31 +10,26 @@ import configparser
|
|||
from boottoolsfunctions import _run
|
||||
|
||||
config = configparser.ConfigParser (inline_comment_prefixes='#')
|
||||
if not os.path.exists ('boottoolsgenerator.cfg'): ## si pongo uno que no existe,
|
||||
print ('configuration file "boottoolsgenerator.cfg" not found') ## este error no llega al caller...
|
||||
if not os.path.exists ('boottoolsgenerator.cfg'):
|
||||
print ('configuration file "boottoolsgenerator.cfg" not found')
|
||||
sys.exit (1)
|
||||
config.read ('boottoolsgenerator.cfg')
|
||||
|
||||
debconf_settings = """
|
||||
kexec-tools kexec-tools/load_kexec boolean true
|
||||
openssh-server openssh-server/permit-root-login boolean true
|
||||
refind refind/install_to_esp boolean false
|
||||
""".strip()
|
||||
debconf_settings = config['debconf'].get ('settings')
|
||||
|
||||
def _aptget_clean():
|
||||
_run (['apt-get', 'clean'])
|
||||
_run (['apt-get', '--yes', 'clean'])
|
||||
|
||||
def _aptget_autoclean():
|
||||
_run (['apt-get', 'autoclean'])
|
||||
_run (['apt-get', '--yes', 'autoclean'])
|
||||
|
||||
def _aptget_autoremove():
|
||||
_run (['apt-get', 'autoremove'])
|
||||
_run (['apt-get', '--yes', 'autoremove'])
|
||||
|
||||
def _aptget_update():
|
||||
_run (['apt-get', 'update'])
|
||||
_run (['apt-get', '--yes', 'update'])
|
||||
|
||||
def _aptget_upgrade():
|
||||
_run (['apt-get', 'upgrade', '--yes'])
|
||||
_run (['apt-get', '--yes', 'upgrade'])
|
||||
|
||||
def _aptget_install (pkgs, opts=[]):
|
||||
_run (['apt-get', '--yes'] + opts + ['install'] + pkgs)
|
||||
|
|
|
@ -10,61 +10,6 @@ import datetime
|
|||
|
||||
logger = logging.getLogger ('boottools')
|
||||
|
||||
isolinux_tpl = """
|
||||
DEFAULT menu.c32
|
||||
PROMPT 0
|
||||
ALLOWOPTIONS 1
|
||||
|
||||
MENU TITLE OpenGnsys __NAMEISOCLIENT__
|
||||
|
||||
|
||||
LABEL 0
|
||||
MENU LABEL ogLive vga irqpool acpi ogdebug ip:none
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=none
|
||||
|
||||
LABEL 1
|
||||
MENU LABEL ogLive irqpoll acpi ip:none
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=none
|
||||
|
||||
LABEL 2
|
||||
MENU LABEL ogLive acpi debug ip=dhcp
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=dhcp
|
||||
|
||||
LABEL 3
|
||||
MENU LABEL ogLive ip=dhcp
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro acpi=off boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=dhcp
|
||||
|
||||
LABEL 4
|
||||
MENU LABEL local
|
||||
localboot 0x80
|
||||
append -
|
||||
|
||||
label 5
|
||||
MENU LABEL Network boot via gPXE lkrn
|
||||
KERNEL __PXEPKG__.lkrn
|
||||
|
||||
label 6
|
||||
MENU LABEL Network boot via gPXE usb
|
||||
KERNEL __PXEPKG__.usb
|
||||
|
||||
label 7
|
||||
MENU LABEL Network boot via gPXE pxe
|
||||
KERNEL __PXEPKG__.pxe
|
||||
|
||||
label 8
|
||||
MENU LABEL Network boot via gPXE iso
|
||||
KERNEL __PXEPKG__.iso
|
||||
|
||||
label 9
|
||||
MENU LABEL pxe
|
||||
KERNEL /clonezilla/live/vmlinuz1
|
||||
APPEND initrd=/clonezilla/live/initrd1.img boot=live union=aufs noswap vga=788 ip=frommedia
|
||||
"""
|
||||
|
||||
def _run (args):
|
||||
cp = subprocess.run (args, text=True, capture_output=True)
|
||||
if cp.returncode:
|
||||
|
@ -477,7 +422,7 @@ def btogFsSqfs (bttargetdir, btrootfsmnt):
|
|||
fd.write (md5)
|
||||
|
||||
# btogIsoGenerator genera la iso del cliente
|
||||
def btogIsoGenerator (pxepkg, bttargetdir, nameisoclient):
|
||||
def btogIsoGenerator (pxepkg, isolinux_tpl, bttargetdir, nameisoclient):
|
||||
#Preparamos los gestores de arranque
|
||||
try: os.makedirs ('/tmp/iso/isolinux', exist_ok=True)
|
||||
except: raise
|
||||
|
@ -534,3 +479,11 @@ def btogIsoGenerator (pxepkg, bttargetdir, nameisoclient):
|
|||
|
||||
os.rename ('/tmp/{}.iso' .format (nameisoclient), '/var/lib/tftpboot/ogclient/{}.iso' .format (nameisoclient))
|
||||
os.rename ('/tmp/{}.iso.sum'.format (nameisoclient), '/var/lib/tftpboot/ogclient/{}.iso.sum'.format (nameisoclient))
|
||||
|
||||
#def __unused_boottoolsBootGraphics():
|
||||
# find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null;
|
||||
# apt-get -y install plymouth plymouth-theme-script
|
||||
# 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
|
||||
|
|
|
@ -62,3 +62,65 @@ xwindows =
|
|||
#roxterm gparted #+80M
|
||||
#openbox midori #xvesa en compilacion
|
||||
|
||||
[debconf]
|
||||
|
||||
settings =
|
||||
kexec-tools kexec-tools/load_kexec boolean true
|
||||
openssh-server openssh-server/permit-root-login boolean true
|
||||
refind refind/install_to_esp boolean false
|
||||
|
||||
[ISOLinux]
|
||||
|
||||
template =
|
||||
DEFAULT menu.c32
|
||||
PROMPT 0
|
||||
ALLOWOPTIONS 1
|
||||
|
||||
MENU TITLE OpenGnsys __NAMEISOCLIENT__
|
||||
|
||||
|
||||
LABEL 0
|
||||
MENU LABEL ogLive vga irqpool acpi ogdebug ip:none
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=none
|
||||
|
||||
LABEL 1
|
||||
MENU LABEL ogLive irqpoll acpi ip:none
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=none
|
||||
|
||||
LABEL 2
|
||||
MENU LABEL ogLive acpi debug ip=dhcp
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=dhcp
|
||||
|
||||
LABEL 3
|
||||
MENU LABEL ogLive ip=dhcp
|
||||
KERNEL /ogclient/linuxISO
|
||||
APPEND initrd=/ogclient/oginitrd.img ro acpi=off boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=dhcp
|
||||
|
||||
LABEL 4
|
||||
MENU LABEL local
|
||||
localboot 0x80
|
||||
append -
|
||||
|
||||
label 5
|
||||
MENU LABEL Network boot via gPXE lkrn
|
||||
KERNEL __PXEPKG__.lkrn
|
||||
|
||||
label 6
|
||||
MENU LABEL Network boot via gPXE usb
|
||||
KERNEL __PXEPKG__.usb
|
||||
|
||||
label 7
|
||||
MENU LABEL Network boot via gPXE pxe
|
||||
KERNEL __PXEPKG__.pxe
|
||||
|
||||
label 8
|
||||
MENU LABEL Network boot via gPXE iso
|
||||
KERNEL __PXEPKG__.iso
|
||||
|
||||
label 9
|
||||
MENU LABEL pxe
|
||||
KERNEL /clonezilla/live/vmlinuz1
|
||||
APPEND initrd=/clonezilla/live/initrd1.img boot=live union=aufs noswap vga=788 ip=frommedia
|
||||
|
|
|
@ -24,8 +24,12 @@ logging.basicConfig (
|
|||
)
|
||||
logger = logging.getLogger ('boottools')
|
||||
|
||||
#config = configparser.ConfigParser()
|
||||
#config.read ('boottoolsgenerator.cfg')
|
||||
config = configparser.ConfigParser (inline_comment_prefixes='#')
|
||||
if not os.path.exists ('boottoolsgenerator.cfg'):
|
||||
print ('configuration file "boottoolsgenerator.cfg" not found')
|
||||
sys.exit (1)
|
||||
config.read ('boottoolsgenerator.cfg')
|
||||
isolinux_tpl = config['ISOLinux'].get ('template')
|
||||
|
||||
if not os.path.exists ('/tmp/opengnsys_installer/opengnsys/client/engine'):
|
||||
branch = 'main'
|
||||
|
@ -213,6 +217,6 @@ btogFsSqfs (bttargetdir, btrootfsmnt)
|
|||
_run (['umount', btrootfsmnt])
|
||||
|
||||
logger.info ('Fase 7.3 Generar la ISO')
|
||||
btogIsoGenerator (pxepkg, bttargetdir, nameisoclient)
|
||||
btogIsoGenerator (pxepkg, isolinux_tpl, bttargetdir, nameisoclient)
|
||||
|
||||
logger.info ('OpenGnsys installation finished')
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
#!/bin/bash
|
||||
#@file boottoolsgenerator.sh
|
||||
#@brief Script generación del sistema opertativo cliente OpenGnsys
|
||||
#@warning
|
||||
#@version 0.9 - Prototipo de sistema operativo multiarranque de opengnsys.
|
||||
#@author Antonio J. Doblas Viso. Universidad de Malaga.
|
||||
#@date 2010/05/24
|
||||
#@version 1.0 - Compatibilidad OpengGnsys X.
|
||||
#@author Antonio J. Doblas Viso. Universidad de Malaga.
|
||||
#@date 2011/08/03
|
||||
#*/
|
||||
|
||||
|
||||
BRANCH="branches/master"
|
||||
svn export --force https://github.com/opengnsys/OpenGnsys/$BRANCH/client /tmp/opengnsys_installer/opengnsys/client || exit 1
|
||||
|
||||
#Variables
|
||||
TYPECLIENT="${1:-host}"
|
||||
WORKDIR=/tmp/opengnsys_installer
|
||||
INSTALL_TARGET=/opt/opengnsys
|
||||
PROGRAMDIR=$(readlink -e $(dirname "$0"))
|
||||
|
||||
# Solo ejecutable por usuario root
|
||||
if [ "$(whoami)" != 'root' ]
|
||||
then
|
||||
echo "ERROR: this program must run under root privileges!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cambiar a directorio temporal.
|
||||
cd /tmp
|
||||
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
|
||||
|
||||
#funciones especificas del cliente.
|
||||
source $PROGRAMDIR/boottoolsfunctions.lib
|
||||
|
||||
####################################################################3
|
||||
echo "FASE 1 - Asignación de variables"
|
||||
#obtenemos las variables necesarias y la información del host.
|
||||
btogGetVar
|
||||
echoAndLog "OpenGnsys CLIENT installation begins at $(date)"
|
||||
btogGetOsInfo $TYPECLIENT
|
||||
##########################################################################
|
||||
echo "FASE 2 - Instalación de software adicional."
|
||||
#grep "http://free.nchc.org.tw/drbl-core" /etc/apt/sources.list || echo "deb http://free.nchc.org.tw/drbl-core drbl stable" >> /etc/apt/sources.list
|
||||
apt-get update
|
||||
[ -n "$(apt-cache search gpxe)" ] && PXEPKG="gpxe"
|
||||
[ -n "$(apt-cache search ipxe)" ] && PXEPKG="ipxe"
|
||||
apt-get -y install debootstrap subversion schroot squashfs-tools syslinux genisoimage $PXEPKG qemu qemu-utils lsof
|
||||
###################################################################3
|
||||
echo "FASE 3 - Creación del Sistema raiz RootFS (Segundo Sistema archivos (img)) "
|
||||
echo "Fase 3.1 Generar y formatear el disco virtual. Generar el dispositivo loop."
|
||||
file $BTROOTFSIMG | grep "partition 1: ID=0x83"
|
||||
if [ $? == 1 ]
|
||||
then
|
||||
btogSetFsVirtual || exit 2
|
||||
fi
|
||||
echo "Fase 3.2 Generar sistema de archivos con debootstrap"
|
||||
schroot -p -c IMGogclient -- touch /tmp/ogclientOK
|
||||
if [ -f /tmp/ogclientOK ]
|
||||
then
|
||||
rm /tmp/ogclientOK
|
||||
else
|
||||
btogSetFsBase || exit 3
|
||||
fi
|
||||
###################################################################3
|
||||
echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)"
|
||||
cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
|
||||
###########################################################################
|
||||
echo "FASE 5 - Incorporando ficheros OpenGnsys al sistema raíz rootfs "
|
||||
cp -a ${BTDIR}/includes/usr/bin/* /tmp
|
||||
chmod +x /tmp/boot-tools/*.sh
|
||||
# Incluir revisión.
|
||||
sed -i "1 s/$/ $GITRELEASE ($OSRELEASE)/" ${BTDIR}/includes/etc/initramfs-tools/scripts/VERSION.txt
|
||||
# En Ubuntu 13.04+ es necesario matar proceso de "udev" antes de desmontar.
|
||||
umount $BTROOTFSMNT 2>/dev/null || (kill -9 $(lsof -t $BTROOTFSMNT); umount $BTROOTFSMNT) 2>/dev/null
|
||||
schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh
|
||||
############################################################################################
|
||||
echo "FASE 6 - Instalar software"
|
||||
echo "Fase 6.1 instalar paquetes deb con apt-get"
|
||||
schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh
|
||||
echo "Fase 6.2 compilar software."
|
||||
cd /
|
||||
schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
|
||||
cd -
|
||||
|
||||
echo "FASE 7 - Personalizar el sistema creado"
|
||||
echo "Fase 7.1 Incorporar la clave publica del servidor"
|
||||
cd /
|
||||
ssh-keygen -q -f /root/.ssh/id_rsa -N ""
|
||||
cp /root/.ssh/id_rsa.pub /tmp
|
||||
schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh
|
||||
cd -
|
||||
echo "Fase 7.2. Incorpoar la clave publica del propio cliente"
|
||||
schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh
|
||||
|
||||
echo "Fase 7.3. Configurando las locales"
|
||||
schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh
|
||||
|
||||
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
|
||||
|
||||
#########################################################################
|
||||
echo "FASE 8 - Generar distribucion"
|
||||
echo "Fase 8.1 Generar el initrd"
|
||||
btogFsInitrd
|
||||
echo "Fase 8.2 Generar fichero sqfs a partir del fichero img"
|
||||
btogFsSqfs
|
||||
umount $BTROOTFSMNT 2>/dev/null
|
||||
echo "Fase 8.3 Generar la ISO"
|
||||
btogIsoGenerator
|
||||
######################################################################3
|
||||
########################################################################
|
||||
echoAndLog "OpenGnsys installation finished at $(date)"
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
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
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
cat << EOT | debconf-set-selections --
|
||||
console-setup console-setup/charmap47 select UTF-8
|
||||
console-setup console-setup/codeset47 select . Combined - Latin; Slavic Cyrillic; Greek
|
||||
console-setup console-setup/fontface47 select VGA
|
||||
console-setup console-setup/fontsize-fb47 select 8x16
|
||||
EOT
|
||||
dpkg-reconfigure console-setup locales
|
||||
|
||||
history -c
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
VERSIONBOOTTOOLS="ogLive"
|
||||
|
||||
NAMEISOCLIENTFILE="/tmp/opengnsys_info_rootfs"
|
||||
NAMEHOSTCLIENTFILE="/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
|
||||
|
||||
OGCLIENTMOUNT=""
|
||||
|
||||
OGCLIENTCFG=${OGCLIENTCFG:-/tmp/ogclient.cfg}
|
||||
[ -f $OGCLIENTCFG ] && source $OGCLIENTCFG
|
||||
OSDISTRIB=${OSDISTRIB:-$(lsb_release -is)}
|
||||
OSCODENAME=${OSCODENAME:-$(lsb_release -cs)}
|
||||
OSRELEASE=${OSRELEASE:-$(uname -r)}
|
||||
OSARCH=${OSARCH:-$(dpkg --print-architecture)}
|
||||
OSHTTP=${OSHTTP:-"http://es.archive.ubuntu.com/ubuntu/"}
|
||||
|
||||
echo "$OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP"
|
||||
|
||||
|
||||
LERROR=TRUE
|
||||
|
||||
echo "$FUNCNAME: Iniciando la personalización con datos del repositorio"
|
||||
|
||||
# parseamos el apt.source de la distribución (en minúsculas)
|
||||
sed -e "s/OSCODENAME/$OSCODENAME/g" ${SVNCLIENTDIR}/includes/etc/apt/sources.list.${OSDISTRIB,,} > ${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 -av ${SVNCLIENTDIR}/includes/* ${OGCLIENTMOUNT}/
|
||||
mkdir -p ${OGCLIENTMOUNT}/opt/opengnsys/
|
||||
cp -av ${SVNCLIENTSTRUCTURE}/* ${OGCLIENTMOUNT}/opt/opengnsys/
|
||||
mkdir -p ${OGCLIENTMOUNT}/opt/opengnsys/lib/engine/bin/
|
||||
cp -av ${SVNCLIENTENGINE}/* ${OGCLIENTMOUNT}/opt/opengnsys/lib/engine/bin/
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "$FUNCNAME(): Copying client data : ERROR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Si no existe, copiar pci.ids.
|
||||
[ -f $OGCLIENTMOUNT/etc/pci.ids ] || cp -va ${SVNCLIENTSTRUCTURE}/lib/pci.ids $OGCLIENTMOUNT/etc
|
||||
|
||||
# Dependencias Qt para el Browser.
|
||||
mkdir -p $OGCLIENTMOUNT/usr/local/{etc,lib,plugins}
|
||||
cp -av ${SVNCLIENTSTRUCTURE}/lib/qtlib/* $OGCLIENTMOUNT/usr/local/lib
|
||||
cp -av ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/lib
|
||||
cp -av ${SVNCLIENTSTRUCTURE}/lib/qtplugins/* $OGCLIENTMOUNT/usr/local/plugins
|
||||
cp -av ${SVNCLIENTSTRUCTURE}/etc/*.qmap $OGCLIENTMOUNT/usr/local/etc
|
||||
|
||||
# Browser y ogAdmClient.
|
||||
[ -x ${SVNCLIENTSTRUCTURE}/bin/browser ] && cp -av ${SVNCLIENTSTRUCTURE}/bin/browser $OGCLIENTMOUNT/bin
|
||||
[ -x ${SVNCLIENTSTRUCTURE}/bin/ogAdmClient ] && cp -av ${SVNCLIENTSTRUCTURE}/bin/ogAdmClient $OGCLIENTMOUNT/bin
|
||||
|
||||
# El fichero de configuración debe sustituir a los 2 ficheros (borrar las 2 líneas).
|
||||
echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${GITRELEASE}" > /$NAMEISOCLIENTFILE
|
||||
echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${GITRELEASE}" > $NAMEHOSTCLIENTFILE
|
||||
|
||||
|
||||
history -c
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
|
||||
history -c
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
OGCLIENTCFG=${OGCLIENTCFG:-/tmp/ogclient.cfg}
|
||||
[ -f $OGCLIENTCFG ] && source $OGCLIENTCFG
|
||||
OSRELEASE=${OSRELEASE:-$(uname -r)}
|
||||
|
||||
rm -f /usr/lib/initramfs-tools/bin/*
|
||||
cp /bin/busybox /usr/lib/initramfs-tools/bin
|
||||
cd /tmp
|
||||
mkinitramfs -o /tmp/initrd.img-$OSRELEASE -v $OSRELEASE
|
||||
cp -v /boot/vmlinuz-$OSRELEASE /tmp
|
||||
|
||||
history -c
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/bash
|
||||
################################################################
|
||||
##################### SOFTWARE #####################
|
||||
################################################################
|
||||
OLDLANGUAGE=$LANGUAGE
|
||||
OLDLC_ALL=$LC_ALL
|
||||
OLDLANG=$LANG
|
||||
export LANGUAGE=C
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
|
||||
|
||||
source /opt/opengnsys/lib/engine/bin/ToolsGNU.c &>/dev/null
|
||||
pushd /tmp
|
||||
|
||||
echo "ms-sys"
|
||||
which ms-sys || (wget https://sourceforge.net/projects/ms-sys/files/latest/download -O ms-sys.tar.gz; tar xpvzf ms-sys.tar.gz; cd $(tar tzf ms-sys.tar.gz|head -1); make install; cd ..)
|
||||
|
||||
echo "spartlnx"
|
||||
which spartlnx.run || $(wget http://damien.guibouret.free.fr/savepart.zip &>/dev/null; unzip -o savepart.zip -d /sbin/)
|
||||
|
||||
echo "python-libfdisk"
|
||||
apt-get -y install python3-psutil python3-dev libfdisk-dev python3-setuptools
|
||||
git clone git://git.48k.eu/python-libfdisk
|
||||
pushd python-libfdisk
|
||||
python3 setup.py install
|
||||
popd
|
||||
apt-get -y remove python3-dev python3-setuptools
|
||||
|
||||
popd
|
||||
export LANGUAGE=$OLDLANGUAGE
|
||||
export LC_ALL=$OLDLC_ALL
|
||||
export LANG=$OLDLANG
|
||||
|
||||
history -c
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Script de instalación de paquetes de software.
|
||||
|
||||
export LANGUAGE=C
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
#LOG_FILE=/tmp/boot-tools-software.txt
|
||||
|
||||
#ADV
|
||||
#Desactivamos upstart
|
||||
dpkg-divert --local --rename --add /sbin/initctl
|
||||
ln -s /bin/true /sbin/initctl
|
||||
#TEST desactivamos upstart
|
||||
#apt-get update; apt-get install --no-install-recommends dbus; dbus-uuidgen > /var/lib/dbus/machine-id; 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 (incluir siempre paquetes de 32 bits)
|
||||
apt-get clean
|
||||
OSARCH=${OSARCH:-$(dpkg --print-architecture)}
|
||||
if [ "$OSARCH" != "i386" ]; then
|
||||
dpkg --add-architecture i386
|
||||
PKGS32="lib32gcc1 lib32stdc++6 lib32z1 libc6-i386"
|
||||
fi
|
||||
apt-get update
|
||||
apt-get upgrade -y
|
||||
|
||||
#Desactivamos el hook del oginitrd.img para evitar problemas, al final de este escripts se activará
|
||||
mv /etc/initramfs-tools/hooks/oghooks /etc/initramfs-tools/
|
||||
|
||||
# Preparamos el mtab necesario para la instalacion correcta de paquetes.
|
||||
echo "/dev/sda1 / ext4 rw,errors=remount-ro 0 0" > /etc/mtab
|
||||
|
||||
# Instalamos el kernel.
|
||||
# Deteccion de la versión y kernel a usar
|
||||
OGCLIENTCFG=${OGCLIENTCFG:-/tmp/ogclient.cfg}
|
||||
[ -f $OGCLIENTCFG ] && source $OGCLIENTCFG
|
||||
OSRELEASE=${OSRELEASE:-$(uname -r)}
|
||||
# Instalar Kernel firmado del repositorio de paquetes.
|
||||
apt-get -y install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} dkms shim-signed
|
||||
apt-get -y install linux-modules-${OSRELEASE} linux-modules-extra-${OSRELEASE} 2>/dev/null
|
||||
|
||||
# Valores para paquetes interactivos.
|
||||
cat << EOT | debconf-set-selections --
|
||||
kexec-tools kexec-tools/load_kexec boolean true
|
||||
openssh-server openssh-server/permit-root-login boolean true
|
||||
refind refind/install_to_esp boolean false
|
||||
EOT
|
||||
apt-get -y install sshfs kexec-tools $PKGS32
|
||||
|
||||
#comenzamos con la instalación de los paquetes a instalar.
|
||||
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 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 [Intro] para continuar"
|
||||
read
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Instalar módulos que algunos paquetes puedan tener pendientes de compilar.
|
||||
echo "Instalando módulos adicionales con DKMS"
|
||||
while read -e mod vers; do
|
||||
echo -n "Intalando módulo $mod v$vers"
|
||||
dkms install -m $mod -v $vers &>/dev/null
|
||||
RETVAL=$?
|
||||
if [ $RETVAL == 0 ]; then
|
||||
echo " : OK - Módulo instalado correctamente (codigo interno de dkms $RETVAL)"
|
||||
else
|
||||
echo " : Error módulo $mod (codigo interno de dkms $RETVAL) "
|
||||
echo "Pulse [Intro] para continuar"
|
||||
read
|
||||
fi
|
||||
done < <(dkms status 2>/dev/null | awk -F, '$3~/added/ {print $1,$2}')
|
||||
|
||||
#Activamos el hook del oginitrd.img
|
||||
mv /etc/initramfs-tools/oghooks /etc/initramfs-tools/hooks/
|
||||
|
||||
# Dejamos el mtab como al principio
|
||||
echo " " > /etc/mtab
|
||||
|
||||
|
||||
#ADV
|
||||
#TEST
|
||||
#apt-get install localepurge
|
||||
#localepurge
|
||||
#rm /var/lib/dbus/machine-id; rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl;
|
||||
#FIN ADV
|
||||
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
apt-get autoremove
|
||||
|
||||
history -c
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/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
|
|
@ -1,25 +0,0 @@
|
|||
#!/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
|
|
@ -1,18 +0,0 @@
|
|||
#!/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
|
Loading…
Reference in New Issue