Compare commits
No commits in common. "main" and "update-template-disk" have entirely different histories.
main
...
update-tem
19
CHANGELOG.md
19
CHANGELOG.md
|
@ -3,25 +3,6 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.8.10] - 2024-07-05
|
||||
### Changed
|
||||
- Añade oglive BIOS para el arranque de Windows al arrancarlo desde el ogbrowser
|
||||
- Elimina arranque MBR del menú de arranque
|
||||
|
||||
## [0.8.9] - 2024-06-30
|
||||
### Changed
|
||||
- Borra directorio samba de etc y modifica postint para que copie el fichero de configuración de la plantilla de samba
|
||||
|
||||
## [0.8.8] - 2024-06-27
|
||||
### Changed
|
||||
- Actualiza grub.exe para que soporte sistemas de particiones ext
|
||||
- Actualiza las plantillas de arranque de menu para bios para que use el nuevo grub.exe
|
||||
- Elimina la plantilla de bootmark obsoleta
|
||||
|
||||
## [0.8.7] - 2024-06-25
|
||||
### Changed
|
||||
- Elimina el parámetro de kernel ogdebug del controlador y se le añade a las plantillas de arranque de oglive
|
||||
|
||||
## [0.8.6] - 2024-06-24
|
||||
### Changed
|
||||
- Modifica la plantilla de arranque por disco y partición para no tener hardcodeado la partición EFI
|
||||
|
|
|
@ -1590,7 +1590,7 @@ public function createBootFile(Request $request): JsonResponse
|
|||
}
|
||||
|
||||
// Construcción de los argumentos del kernel
|
||||
$kernelArgs = 'ro boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogtmpfs=15 ' .
|
||||
$kernelArgs = 'ro boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogdebug=true ogtmpfs=15 ' .
|
||||
'oglivedir=${ISODIR}' . ' ' .
|
||||
'LANG=' . $parameters['LANG'] . ' ' .
|
||||
'ip=' . $parameters['ip'] . ':' . $serverIp . ':' . $parameters['router'] . ':' . $parameters['netmask'] . ':' . $parameters['computer_name'] . ':' . $parameters['netiface'] . ':none ' .
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
PROG=$(basename $0)
|
||||
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys/ogboot"}
|
||||
OPENGNSYS=${OPENGNSYS:-"/opt/ogboot"}
|
||||
OGCFGFILE=$OPENGNSYS/etc/ogboot_samba.json
|
||||
SAMBAUSER="opengnsys" # Usuario por defecto.
|
||||
TFTPDIR=$OPENGNSYS/tftpboot
|
||||
INITRD=oginitrd.img
|
||||
|
@ -17,7 +18,7 @@ fi
|
|||
case $# in
|
||||
0) # Cambios en todos los clientes ogLive instalados.
|
||||
if which oglivecli &>/dev/null; then
|
||||
LIST=$(./oglivecli list_installed_oglives | jq -r '.installed_ogLives[].directory' | xargs -n1 basename)
|
||||
LIST=$(oglivecli list | awk '{print $2}')
|
||||
else
|
||||
LIST="ogclient"
|
||||
fi ;;
|
||||
|
@ -94,6 +95,42 @@ for OGLIVE in $LIST; do
|
|||
sudo sed -i "s/OPTIONS=\(.*\)user=\w*\(.*\)pass=\w*\(.*\)/OPTIONS=\1user=$SAMBAUSER\2pass=$SAMBAPASS\3/" scripts/ogfunctions
|
||||
# TEMPORAL: solución ticket 554, actualizar cliente en caché (ogLive r3257).
|
||||
sudo sed -i "s/busybox reboot/reboot/" scripts/ogfunctions
|
||||
# FIN CÓDIGO TEMPORAL.
|
||||
# Ticket 565, preparar acceso Rsync cliente.
|
||||
echo "$SAMBAPASS" | sudo tee scripts/passrsync > /dev/null
|
||||
echo "Guardar tokens de seguridad"
|
||||
cat <<EOT | sudo tee scripts/client.cfg > /dev/null
|
||||
CLIENTID=$(jq -r .client.id $OGCFGFILE)
|
||||
CLIENTSECRET=$(jq -r .client.secret $OGCFGFILE)
|
||||
EOT
|
||||
sudo chown ogboot:ogboot scripts/passrsync scripts/client.cfg
|
||||
# pwd
|
||||
# sudo find . -print > /tmp/filelist.txt
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: No se pudo encontrar los archivos."
|
||||
# exit 5
|
||||
# fi
|
||||
|
||||
# cpio -H newc -oa < /tmp/filelist.txt > /tmp/initrd.cpio
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: No se pudo crear el archivo CPIO."
|
||||
# exit 5
|
||||
# fi
|
||||
# $COMPRESS_CMD < /tmp/initrd.cpio > /tmp/initrd.cpio.gz
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: No se pudo comprimir el archivo CPIO."
|
||||
# exit 5
|
||||
# fi
|
||||
# echo "Copiando el contenido del archivo /tmp/initrd.cpio.gz al archivo /opt/opengnsys/tftpboot/ogLive-5.11.0-r20210413/oginitrd.img."
|
||||
# echo $CLIENTINITRD
|
||||
# dd if=/tmp/initrd.cpio.gz of=/opt/opengnsys/tftpboot/ogLive-5.11.0-r20210413/oginitrd.img
|
||||
# echo "dd ejecutado correctamente"
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: No se pudo escribir el archivo comprimido en el destino."
|
||||
# exit 5
|
||||
# fi
|
||||
# echo "borrando rm /tmp/initrd.cpio /tmp/initrd.cpio.gz"
|
||||
# sudo rm /tmp/initrd.cpio /tmp/initrd.cpio.gz
|
||||
find . | cpio -H newc -oa | gzip -9c > "$CLIENTINITRD"
|
||||
else
|
||||
echo "$PROG: Aviso: no se ha modificado la clave del cliente \"$OGLIVE\"."
|
||||
|
@ -109,8 +146,12 @@ for OGLIVE in $LIST; do
|
|||
done
|
||||
|
||||
if [[ $CHANGES != 0 ]]; then
|
||||
# Ticket 565, preparar acceso Rsync servidor.
|
||||
echo "$SAMBAUSER:$SAMBAPASS" | sudo tee /etc/rsyncd.secrets > /dev/null
|
||||
echo "chown debugging"
|
||||
sudo chown root:root /etc/rsyncd.secrets
|
||||
sudo chmod 600 /etc/rsyncd.secrets
|
||||
# Cambiar clave Samba.
|
||||
echo "Cambiando clave samba en el servidor"
|
||||
echo -ne "$SAMBAPASS\n$SAMBAPASS\n" | sudo smbpasswd -a -s $SAMBAUSER
|
||||
echo "setsmbpass finish"
|
||||
else
|
||||
|
|
|
@ -153,7 +153,7 @@ configure_nginx_and_fpm() {
|
|||
|
||||
configure_samba(){
|
||||
echo "Configurando Samba"
|
||||
cp /opt/opengnsys/ogboot/etc/smb-ogboot.conf.tmpl /etc/samba/smb-ogboot.conf
|
||||
cp /opt/opengnsys/ogboot/etc/samba/smb-ogboot.conf /etc/samba/
|
||||
sed -i "s|__OGBOOTDIR__|$OGBOOT_ROOT|g" /etc/samba/smb-ogboot.conf
|
||||
INCLUDE_LINE="include = /etc/samba/smb-ogboot.conf"
|
||||
if ! grep -q "$INCLUDE_LINE" /etc/samba/smb.conf; then
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[tftpboot]
|
||||
comment = OpenGnsys init files
|
||||
browseable = no
|
||||
writeable = no
|
||||
path = __OGBOOTDIR__/tftpboot
|
||||
guest ok = no
|
|
@ -0,0 +1,7 @@
|
|||
[ogclient]
|
||||
comment = OpenGnsys Client
|
||||
browseable = no
|
||||
writeable = no
|
||||
locking = no
|
||||
path = __OGBOOTDIR__/client
|
||||
guest ok = no
|
|
@ -17,6 +17,7 @@ set kernelargs __INFOHOST__
|
|||
:main_menu
|
||||
clear menu
|
||||
menu ${bold}${fg_cya}OpenGnsys iPXE Disk Boot Menu${boldoff}
|
||||
item mbr Boot MBR (entire disk)
|
||||
item part1 FirstDisk-FirstPartition
|
||||
item part2 FirstHardDisk-SecondPartition
|
||||
item part3 FirstDisk-ThirdPartition
|
||||
|
@ -24,7 +25,12 @@ item ogcache OpenGnsys CACHE
|
|||
item ognet OpenGnsys NET
|
||||
item ognetdef OpenGnsys NET Default
|
||||
item shell iPXE Shell
|
||||
choose --timeout ${timeout} --default ogcache target && goto ${target}
|
||||
choose --timeout ${timeout} --default mbr target && goto ${target}
|
||||
|
||||
:mbr
|
||||
echo Booting MBR...
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title MBR; chainloader (hd0)+1; rootnoverify (hd0); boot" || echo Failed to boot MBR
|
||||
exit
|
||||
|
||||
:part1
|
||||
echo Booting FirstDisk-FirstPartition...
|
||||
|
|
|
@ -7,13 +7,13 @@ set default 0
|
|||
set kernelargs __INFOHOST__
|
||||
# Menú de entrada para seleccionar OgLive
|
||||
:try_iso
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogdebug=false ${kernelargs} || goto fallback
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ${kernelargs} || goto fallback
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
:fallback
|
||||
echo "OgLive default"
|
||||
set ISODIR ogLive
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogdebug=false ${kernelargs}
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ${kernelargs}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
|
|
@ -7,13 +7,13 @@ set default 0
|
|||
set kernelargs __INFOHOST__
|
||||
# Menú de entrada para seleccionar OgLive
|
||||
:try_iso
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=true ogdebug=true ${kernelargs} || goto fallback
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=true ${kernelargs} || goto fallback
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
:fallback
|
||||
echo "OgLive default"
|
||||
set ISODIR ogLive
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=true ogdebug=true ${kernelargs}
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=true ${kernelargs}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
#!ipxe
|
||||
|
||||
#Template: ogliveBios
|
||||
|
||||
# Detectar si se está ejecutando en modo UEFI o BIOS
|
||||
iseq ${platform} efi && goto uefi_boot || goto bios_boot
|
||||
|
||||
:uefi_boot
|
||||
set timeout 0
|
||||
set timeout-style hidden
|
||||
|
||||
set ISODIR __OGLIVE__
|
||||
set default 0
|
||||
set kernelargs ogactiveadmin=true ogdebug=true __INFOHOST__
|
||||
# Menú de entrada para seleccionar OgLive
|
||||
:try_iso
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ${kernelargs} || goto fallback
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
:fallback
|
||||
echo "OgLive default"
|
||||
set ISODIR ogLive
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ${kernelargs}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
|
||||
:bios_boot
|
||||
set PIPE |
|
||||
set SERVERIP __SERVERIP__
|
||||
set ISODIR __OGLIVE__
|
||||
set kernelargs ogactiveadmin=true ogdebug=true __INFOHOST__
|
||||
|
||||
set CFG_PREFIX default saved; timeout 1; hiddenmenu; fallback 1 2 3 4; set ISODIR=${ISODIR};
|
||||
set CFG_FIRSTBOOT title firsboot; find --set-root --ignore-floppies --ignore-cd /ogboot.me checkrange 0x07 parttype > nul; cmp /ogboot.me /ogboot.firstboot ${PIPE}${PIPE} ls FALLBACK; write /ogboot.firstboot iniciado; chainloader +1; boot;
|
||||
set CFG_SECONDBOOT title secondboot; find --set-root --ignore-floppies --ignore-cd /ogboot.me checkrange 0x07 parttype > nul; cmp /ogboot.me /ogboot.secondboot; write /ogboot.secondboot iniciado; chainloader +1; boot;
|
||||
set CFG_OGCACHE title OpenGnsys-CACHE; find --set-root --ignore-floppies --ignore-cd /boot/%ISODIR%/ogvmlinuz; kernel /boot/%ISODIR%/ogvmlinuz ogactiveadmin=false ogdebug=false ogupdateinitrd=true ${kernelargs}; initrd /boot/%ISODIR%/oginitrd.img; boot;
|
||||
#set CFG_OGNET title OpenGnsys-NET; kernel (pd)/%ISODIR%/ogvmlinuz ${kernelargs}; initrd (pd)/%ISODIR%/oginitrd.img; boot;
|
||||
#set CFG_OGNET_DEFAULT title OpenGnsys-NET default; kernel (pd)/ogLive/ogvmlinuz ${kernelargs}; initrd (pd)/ogLive/oginitrd.img; boot;
|
||||
|
||||
set default 0
|
||||
# Menú de entrada para seleccionar OgLive
|
||||
:try_iso
|
||||
chain http://${SERVERIP}/tftpboot/grub.exe --config-file="${CFG_PREFIX} ${CFG_FIRSTBOOT} ${CFG_SECONDBOOT} ${CFG_OGCACHE}"
|
||||
boot
|
||||
|
||||
:fallback
|
||||
echo "OgLive default"
|
||||
set ISODIR ogLive
|
||||
kernel http://${SERVERIP}/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=true ogdebug=true ${kernelargs}
|
||||
initrd http://${SERVERIP}/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
Loading…
Reference in New Issue