Compare commits
44 Commits
10
CHANGELOG
10
CHANGELOG
|
@ -1,5 +1,15 @@
|
|||
# CHANGELOG
|
||||
|
||||
## [0.7.1] - 19/06/2025
|
||||
|
||||
### **Cambios principales**
|
||||
1. Añade scripts de grub y menu.lst para el arranque del Oglive por cache
|
||||
|
||||
## [0.7.0] - 19/06/2025
|
||||
|
||||
### **Cambios principales**
|
||||
1. No hay cambios, pasa el tag 0.5.12 a 0.6.0
|
||||
|
||||
## [0.6.0] - 25/02/2025
|
||||
|
||||
### **Cambios principales**
|
||||
|
|
53
CHANGELOG.md
53
CHANGELOG.md
|
@ -2,6 +2,59 @@
|
|||
|
||||
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.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
|
||||
|
||||
## [0.8.5] - 2024-06-24
|
||||
### Changed
|
||||
- Comprueba si existe una etiqueta para asignar root cuando corresponda en la plantilla de arranque por disco y partición
|
||||
|
||||
## [0.8.4] - 2024-06-20
|
||||
### Changed
|
||||
- Corrige oglivecli para que desmonte los puntos de montaje ante cualquier fallo en el script de instalación de oglive
|
||||
|
||||
## [0.8.3] - 2024-06-20
|
||||
### Changed
|
||||
- Añade el cambio de la 0.8.2
|
||||
|
||||
## [0.8.2] - 2024-06-20
|
||||
### Changed
|
||||
- Corrige un bug en oglivecli que impide cambiar el propietario del oglive
|
||||
|
||||
## [0.8.1] - 2024-06-18
|
||||
### Changed
|
||||
- Añade nuevos modulos al grubx64.efi
|
||||
|
||||
## [0.8.0] - 2024-06-18
|
||||
### Changed
|
||||
- Actualiza a 0.8.0 para incluir los cambios de la versión 0.7.2
|
||||
|
||||
## [0.7.2] - 2024-06-05
|
||||
### Changed
|
||||
- Añade scripts de grub y menu.lst para el arranque por disco y partición
|
||||
- Añade plantilla ogliveadmin con permisos de administracion como parametro del kernel
|
||||
- Añade plantilla de menú para el arranque por disco y partición y caché
|
||||
|
||||
## [0.7.1] - 2024-05-19
|
||||
### Changed
|
||||
- Añade scripts de grub y menu.lst para el arranque del Oglive por cache
|
||||
|
||||
## [0.7.0] - 2024-03-26
|
||||
### Changed
|
||||
- Updated files location
|
||||
|
|
|
@ -48,7 +48,18 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Generate Changelog (Nightly)'){
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
|
||||
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
|
||||
generateDebianChangelog(env.BUILD_DIR, devName, devEmail,'nightly')
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
|
@ -71,6 +82,19 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
stage ('Publish to Debian Repository (Nightly)') {
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
agent { label 'debian-repo' }
|
||||
steps {
|
||||
script {
|
||||
// Construir el patrón de versión esperado en el nombre del paquete
|
||||
def versionPattern = "-${env.BUILD_NUMBER}~nightly"
|
||||
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogboot', 'nightly', versionPattern)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
@ -78,10 +102,3 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
// stage ('Publish to Debian Repository') {
|
||||
// agent { label 'debian-repo' }
|
||||
// steps {
|
||||
// sh "aptly repo add opengnsys-devel /var/tmp/opengnsys/debian-repo/*.deb"
|
||||
// }
|
||||
// }
|
||||
|
||||
|
|
|
@ -1447,6 +1447,7 @@ public function getBootFiles(): JsonResponse
|
|||
* @OA\Property(property="mac", type="string", example="00:50:56:22:11:12"),
|
||||
* @OA\Property(property="template_name", type="string", example="mi_plantilla.ipxe"),
|
||||
* @OA\Property(property="server_ip", type="string", example="192.168.2.1"),
|
||||
* @OA\Property(property="server_pxe_port", type="string", example="8082"),
|
||||
* @OA\Property(property="oglivedir", type="string", example="ogLive")
|
||||
* )
|
||||
* ),
|
||||
|
@ -1484,7 +1485,6 @@ public function createBootFile(Request $request): JsonResponse
|
|||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
|
||||
$data = json_decode($request->getContent(), true);
|
||||
|
||||
$templateName = $data['template_name'] ?? null;
|
||||
$mac = $this->validateAndFormatMac($data['mac'] ?? null);
|
||||
//Si nos pasan el puerto se lo quitamos ya que server_ip siempre tirara por Samba
|
||||
|
@ -1492,6 +1492,14 @@ public function createBootFile(Request $request): JsonResponse
|
|||
if ($serverIp && strpos($serverIp, ':') !== false) {
|
||||
$serverIp = explode(':', $serverIp)[0];
|
||||
}
|
||||
//Declaramos serverPxePort que lo usaremos para la llamada por http
|
||||
$serverPxePort = $data['server_pxe_port'] ?? null;
|
||||
|
||||
$serverIpPort = $serverIp;
|
||||
if (!empty($serverPxePort)) {
|
||||
$serverIpPort .= ':' . $serverPxePort;
|
||||
}
|
||||
|
||||
$ogLiveDir = $data['oglivedir'] ?? 'ogLive';
|
||||
|
||||
// Verificación de los campos obligatorios
|
||||
|
@ -1529,6 +1537,7 @@ public function createBootFile(Request $request): JsonResponse
|
|||
$parameters = [
|
||||
'LANG' => $data['lang'] ?? 'es_ES.UTF-8',
|
||||
'ip' => $data['ip'] ?? '',
|
||||
'server_pxe_port' => $data['server_pxe_port'] ?? '',
|
||||
'router' => $data['router'] ?? '',
|
||||
'netmask' => $data['netmask'] ?? '',
|
||||
'computer_name' => $data['computer_name'] ?? '',
|
||||
|
@ -1581,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 ogactiveadmin=true ogdebug=true ogtmpfs=15 ' .
|
||||
$kernelArgs = 'ro boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogtmpfs=15 ' .
|
||||
'oglivedir=${ISODIR}' . ' ' .
|
||||
'LANG=' . $parameters['LANG'] . ' ' .
|
||||
'ip=' . $parameters['ip'] . ':' . $serverIp . ':' . $parameters['router'] . ':' . $parameters['netmask'] . ':' . $parameters['computer_name'] . ':' . $parameters['netiface'] . ':none ' .
|
||||
|
@ -1600,12 +1609,7 @@ public function createBootFile(Request $request): JsonResponse
|
|||
(is_numeric($parameters['resolution']) && $parameters['resolution'] <= 999 ? 'vga=' . $parameters['resolution'] :
|
||||
(strpos($parameters['resolution'], ':') !== false ? 'video=' . $parameters['resolution'] : ' ' . $parameters['resolution']));
|
||||
|
||||
// Esta será llamada a http para arrancar kernel e imagen de inicialización
|
||||
// Si lo requiriese debe llevar puerto ya que se comunica con nginx
|
||||
$serverIpPort = $this->ogBootIP;
|
||||
if (!empty($this->ogBootPort)) {
|
||||
$serverIpPort .= ':' . $this->ogBootPort;
|
||||
}
|
||||
|
||||
// Extraer solo el nombre del directorio si contiene una ruta completa PROVISIONAL
|
||||
if (strpos($ogLiveDir, '/') !== false) {
|
||||
$ogLiveDir = basename($ogLiveDir);
|
||||
|
@ -1642,6 +1646,65 @@ public function createBootFile(Request $request): JsonResponse
|
|||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
return new JsonResponse(['error' => 'FAILED_TO_CREATE_PXE_FILE', 'message' => 'Error al crear el archivo PXE'], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
$templateCacheDir = $this->tftpbootDir . '/menu.lst';
|
||||
$pxeFileName = '01-' . $mac;
|
||||
$pxeFilePath = $templateCacheDir . '/' . $pxeFileName;
|
||||
|
||||
// Generar archivo si la plantilla es oglives cache o menu
|
||||
if ($templateName === 'ogliveCache' || $templateName === 'menu') {
|
||||
if ($templateName === 'ogliveCache') {
|
||||
$templateCachePath = $templateCacheDir . '/templateCache';
|
||||
} elseif ($templateName === 'menu') {
|
||||
$templateCachePath = $templateCacheDir . '/templateMenu';
|
||||
}
|
||||
$templateCacheContent = file_get_contents($templateCachePath);
|
||||
$grubContent = str_replace(
|
||||
['__INFOHOST__', '__OGLIVE__'],
|
||||
[$kernelArgs, basename($ogLiveDir)],
|
||||
$templateCacheContent
|
||||
);
|
||||
}
|
||||
// Generar archivo si la plantilla es de tipo disco/partición
|
||||
elseif (in_array($templateName, ['firstDisk_firstPartition', 'firstDisk_secondPartition', 'firstDisk_thirdPartition'])) {
|
||||
$templateDiskPath = $templateCacheDir . '/templateDisk';
|
||||
$templateDiskContent = file_get_contents($templateDiskPath);
|
||||
|
||||
// Determinar DISK, PART y DISKPART en función del templateName
|
||||
$map = [
|
||||
'firstDisk_firstPartition' => ['disk' => '01', 'part' => '01', 'diskpart' => '(hd0,gpt1)'],
|
||||
'firstDisk_secondPartition' => ['disk' => '01', 'part' => '02', 'diskpart' => '(hd0,gpt1)'],
|
||||
'firstDisk_thirdPartition' => ['disk' => '01', 'part' => '03', 'diskpart' => '(hd0,gpt1)'],
|
||||
];
|
||||
|
||||
$diskInfo = $map[$templateName];
|
||||
|
||||
// Sustituir variables en plantilla
|
||||
$grubContent = str_replace(
|
||||
['__DISK__', '__PART__', '__DISKPART__'],
|
||||
[$diskInfo['disk'], $diskInfo['part'], $diskInfo['diskpart']],
|
||||
$templateDiskContent
|
||||
);
|
||||
}
|
||||
// En cualquier otro caso, no se hace nada
|
||||
else {
|
||||
return new JsonResponse(['success' => 'NO_TEMPLATE_ACTION', 'message' => 'No se requiere generar archivo PXE'], Response::HTTP_OK);
|
||||
}
|
||||
|
||||
// Escribir el archivo PXE final (común a ambos casos)
|
||||
if (file_put_contents($pxeFilePath, $grubContent) === false) {
|
||||
$httpCode = '500';
|
||||
$this->logger->error(json_encode([
|
||||
'severity' => 'ERROR',
|
||||
'operation' => $operation,
|
||||
'component' => $component,
|
||||
'http_code' => $httpCode,
|
||||
'desc' => 'Failed to create PXE boot file.'
|
||||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
return new JsonResponse(['error' => 'FAILED_TO_CREATE_PXE_FILE', 'message' => 'Error al crear el archivo de arranque PXE'], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
$httpCode = '200';
|
||||
$this->logger->info(json_encode([
|
||||
'severity' => 'INFO',
|
||||
|
|
|
@ -334,6 +334,20 @@ function install() {
|
|||
[ ! -d "$TMPDIR_SQUASHFS" ] && { echo "{\"error\": \"DIR_CREATION_FAILED\", \"message\": \"Failed to create/access directory $TMPDIR_SQUASHFS.\"}"; exit 500; }
|
||||
|
||||
trap "umount $TMPDIR" 1 2 3 6 9 15
|
||||
|
||||
cleanup() {
|
||||
code=$?
|
||||
umount "$OGLIVEFILE" >/dev/null 2>&1
|
||||
umount "$TMPDIR" >/dev/null 2>&1
|
||||
umount "$TMPDIR_SQUASHFS" >/dev/null 2>&1
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "Something went wrong (exit code $code), cleaning up..."
|
||||
rm -r "$OGLIVEDIR" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
mount "$OGLIVEFILE" >/dev/null 2>&1 || { echo "{\"error\": \"MOUNT_FAILED\", \"message\": \"Failed to mount ISO file.\"}"; exit 500; }
|
||||
|
||||
cp -va "$TMPDIR/ogclient/"* "$OGLIVEDIR" >/dev/null 2>&1 || { echo "{\"error\": \"COPY_FAILED\", \"message\": \"Cannot copy files to $OGLIVEDIR.\"}"; exit 500; }
|
||||
|
@ -391,7 +405,7 @@ function install() {
|
|||
}' > "$OGLIVEDIR/oglive_info.json"
|
||||
|
||||
[ ! -f "$OGLIVEDIR/oglive_info.json" ] && { echo "{\"error\": \"JSON_CREATION_FAILED\", \"message\": \"Failed to create oglive_info.json.\"}"; exit 500; }
|
||||
sudo chown -R :opengnsys "$OGLIVEDIR" >/dev/null 2>&1 || { echo "{\"error\": \"CHOWN_FAILED\", \"message\": \"Failed to change ownership for $OGLIVEDIR.\"}"; exit 500; }
|
||||
# chown -R :opengnsys "$OGLIVEDIR" >/dev/null 2>&1 || { echo "{\"error\": \"CHOWN_FAILED\", \"message\": \"Failed to change ownership for $OGLIVEDIR.\"}"; exit 500; }
|
||||
JSON_OUTPUT=$(jq -n \
|
||||
--arg id "$OGLIVEID" \
|
||||
--arg dist "$OGLIVEDIST" \
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
PROG=$(basename $0)
|
||||
OPENGNSYS=${OPENGNSYS:-"/opt/ogboot"}
|
||||
OGCFGFILE=$OPENGNSYS/etc/ogboot_samba.json
|
||||
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys/ogboot"}
|
||||
SAMBAUSER="opengnsys" # Usuario por defecto.
|
||||
TFTPDIR=$OPENGNSYS/tftpboot
|
||||
INITRD=oginitrd.img
|
||||
|
@ -18,7 +17,7 @@ fi
|
|||
case $# in
|
||||
0) # Cambios en todos los clientes ogLive instalados.
|
||||
if which oglivecli &>/dev/null; then
|
||||
LIST=$(oglivecli list | awk '{print $2}')
|
||||
LIST=$(./oglivecli list_installed_oglives | jq -r '.installed_ogLives[].directory' | xargs -n1 basename)
|
||||
else
|
||||
LIST="ogclient"
|
||||
fi ;;
|
||||
|
@ -95,42 +94,6 @@ 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\"."
|
||||
|
@ -146,12 +109,8 @@ EOT
|
|||
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
|
||||
|
|
|
@ -23,7 +23,8 @@ OGCORE_OGLIVE_URL="$RET"
|
|||
# SAMBA_PASS="$RET"
|
||||
|
||||
|
||||
IPXE_REPO="https://github.com/ipxe/ipxe.git"
|
||||
# IPXE_REPO="https://github.com/ipxe/ipxe.git"
|
||||
IPXE_REPO="https://ognproject.evlt.uma.es/gitea/narenas/opengnsys_ipxe.git"
|
||||
|
||||
# Asegurarse de que el usuario exista
|
||||
USER="opengnsys"
|
||||
|
@ -109,8 +110,8 @@ configure_ipxe(){
|
|||
git clone $IPXE_REPO /tmp/ipxe_repo
|
||||
if [ ! -f $OGBOOT_ROOT/tftpboot/undionly.kpxe ]; then
|
||||
cd /tmp/ipxe_repo/src
|
||||
make -s bin/undionly.kpxe EMBED=$OGBOOT_ROOT/tftpboot/ipxe_scripts/dhcp_boot.ipxe
|
||||
make -s bin-x86_64-efi/ipxe.efi EMBED=$OGBOOT_ROOT/tftpboot/ipxe_scripts/dhcp_boot.ipxe
|
||||
make -j4 -s bin/undionly.kpxe EMBED=$OGBOOT_ROOT/tftpboot/ipxe_scripts/dhcp_boot.ipxe
|
||||
make -j4 -s bin-x86_64-efi/ipxe.efi EMBED=$OGBOOT_ROOT/tftpboot/ipxe_scripts/dhcp_boot.ipxe
|
||||
cp bin/undionly.kpxe $OGBOOT_ROOT/tftpboot/
|
||||
cp bin-x86_64-efi/ipxe.efi $OGBOOT_ROOT/tftpboot/
|
||||
|
||||
|
@ -152,7 +153,7 @@ configure_nginx_and_fpm() {
|
|||
|
||||
configure_samba(){
|
||||
echo "Configurando Samba"
|
||||
cp /opt/opengnsys/ogboot/etc/samba/smb-ogboot.conf /etc/samba/
|
||||
cp /opt/opengnsys/ogboot/etc/smb-ogboot.conf.tmpl /etc/samba/smb-ogboot.conf
|
||||
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
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[tftpboot]
|
||||
comment = OpenGnsys init files
|
||||
browseable = no
|
||||
writeable = no
|
||||
path = __OGBOOTDIR__/tftpboot
|
||||
guest ok = no
|
|
@ -1,7 +0,0 @@
|
|||
[ogclient]
|
||||
comment = OpenGnsys Client
|
||||
browseable = no
|
||||
writeable = no
|
||||
locking = no
|
||||
path = __OGBOOTDIR__/client
|
||||
guest ok = no
|
|
@ -0,0 +1,19 @@
|
|||
cat grub.cfg
|
||||
##NO-TOCAR-ESTA-LINEA ogLive
|
||||
set timeout=0
|
||||
set timeout_style=hidden
|
||||
|
||||
echo ">>> GRUB lanzador detectando MAC..."
|
||||
sleep 1
|
||||
|
||||
echo ">>> MAC detectada: ${net_default_mac}"
|
||||
sleep 1
|
||||
|
||||
echo ">>> Intentando cargar menú específico: /menu.lst/01-${net_default_mac}"
|
||||
sleep 1
|
||||
|
||||
configfile /menu.lst/01-${net_default_mac}
|
||||
|
||||
echo ">>> No se pudo cargar /menu.lst/01-${net_default_mac}"
|
||||
sleep 5
|
||||
reboot
|
Binary file not shown.
Binary file not shown.
|
@ -1,84 +0,0 @@
|
|||
#!ipxe
|
||||
|
||||
# Configuración inicial
|
||||
set ISODIR ogLive
|
||||
|
||||
# Detectar si se está ejecutando en modo UEFI o BIOS
|
||||
iseq ${platform} efi && goto uefi_boot || goto bios_boot
|
||||
|
||||
# BIOS Boot Logic
|
||||
:bios_boot
|
||||
echo "Running in BIOS mode..."
|
||||
echo "Starting firstboot and secondboot flow using GRUB4DOS..."
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="
|
||||
timeout 0
|
||||
set ISODIR=${ISODIR};
|
||||
|
||||
# Firstboot
|
||||
find --set-root --ignore-floppies --ignore-cd /ogboot.me checkrange 0x07 parttype > nul;
|
||||
cmp /ogboot.me /ogboot.firstboot || goto secondboot;
|
||||
write /ogboot.firstboot iniciado;
|
||||
pause Firstboot passed. File updated. Press any key to continue...;
|
||||
chainloader +1;
|
||||
boot;
|
||||
|
||||
# Secondboot
|
||||
:secondboot
|
||||
find --set-root --ignore-floppies --ignore-cd /ogboot.me checkrange 0x07 parttype > nul;
|
||||
cmp /ogboot.me /ogboot.secondboot || goto fallback;
|
||||
write /ogboot.secondboot iniciado;
|
||||
pause Secondboot passed. File updated. Press any key to continue...;
|
||||
chainloader +1;
|
||||
boot;
|
||||
|
||||
# Fallback
|
||||
:fallback
|
||||
pause Firstboot and Secondboot failed. Press any key to continue...;
|
||||
quit;
|
||||
|
||||
# OpenGnsys-CACHE
|
||||
echo "Booting OpenGnsys-CACHE"
|
||||
kernel tftp://__SERVERIP__/${ISODIR}/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogupdateinitrd=true ogtmpfs=15 oglivedir=${ISODIR} INFOHOST
|
||||
initrd tftp://__SERVERIP__/${ISODIR}/oginitrd.img
|
||||
boot || echo "Failed to boot OpenGnsys-CACHE"
|
||||
|
||||
# OpenGnsys-NET
|
||||
echo "Booting OpenGnsys-NET"
|
||||
kernel tftp://__SERVERIP__/${ISODIR}/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=${ISODIR} INFOHOST
|
||||
initrd tftp://__SERVERIP__/${ISODIR}/oginitrd.img
|
||||
boot || echo "Failed to boot OpenGnsys-NET"
|
||||
|
||||
# OpenGnsys-NET Default
|
||||
echo "Booting OpenGnsys-NET Default"
|
||||
kernel tftp://__SERVERIP__/ogLive/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=ogLive INFOHOST
|
||||
initrd tftp://__SERVERIP__/ogLive/oginitrd.img
|
||||
boot || echo "Failed to boot OpenGnsys-NET Default"
|
||||
exit
|
||||
|
||||
# UEFI Boot Logic
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode..."
|
||||
set timeout 30
|
||||
|
||||
# Verificar y buscar cargadores en orden de prioridad
|
||||
echo "Searching Grub loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\grub\Boot\grubx64.efi && exit || echo "Grub not found."
|
||||
|
||||
echo "Searching rEFInd loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\refind\shimx64.efi.signed && exit || echo "rEFInd not found."
|
||||
|
||||
echo "Searching Part-01-02 loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Part-01-02\Boot\ogloader.efi && exit || echo "Part-01-02 not found."
|
||||
|
||||
echo "Searching Part-01-03 loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi && exit || echo "Part-01-03 not found."
|
||||
|
||||
echo "Searching Microsoft loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Microsoft\Boot\bootmgfw.efi && exit || echo "Microsoft loader not found."
|
||||
|
||||
echo "Searching Ubuntu loader..."
|
||||
sanboot --no-describe --drive 0 --filename \EFI\ubuntu\grubx64.efi && exit || echo "Ubuntu loader not found."
|
||||
|
||||
# Fallback: Si no hay cargadores encontrados
|
||||
echo "No bootable operating system detected by OpenGnsys. Falling back..."
|
||||
exit
|
|
@ -10,6 +10,6 @@ exit
|
|||
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode - Booting first disk, first partition"
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Part-01-01\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
|
||||
chain http://__SERVERIP__/tftpboot/grubx64.efi
|
||||
exit
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ exit
|
|||
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode - Booting first disk, second partition"
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Part-01-02\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
|
||||
chain http://__SERVERIP__/tftpboot/grubx64.efi
|
||||
exit
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ exit
|
|||
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode - Booting first disk, third partition"
|
||||
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
|
||||
chain http://__SERVERIP__/tftpboot/grubx64.efi
|
||||
exit
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
#!ipxe
|
||||
|
||||
# Detectar si se está ejecutando en modo UEFI o BIOS
|
||||
iseq ${platform} efi && goto uefi_boot || goto bios_boot
|
||||
|
||||
:bios_boot
|
||||
set timeout 3000
|
||||
set esc:hex 1b
|
||||
set bold ${esc:string}[1m
|
||||
set boldoff ${esc:string}[22m
|
||||
set fg_cya ${esc:string}[36m
|
||||
set fg_whi ${esc:string}[37m
|
||||
set ISODIR __OGLIVE__
|
||||
set default 0
|
||||
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
|
||||
item ogcache OpenGnsys CACHE
|
||||
item ognet OpenGnsys NET
|
||||
item ognetdef OpenGnsys NET Default
|
||||
item shell iPXE Shell
|
||||
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...
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title FirstDisk-FirstPartition; root (hd0,0); chainloader (hd0,0)+1; boot" || echo Failed to boot part1
|
||||
exit
|
||||
|
||||
:part2
|
||||
echo Booting FirstHardDisk-SecondPartition...
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title FirstHardDisk-SecondPartition; root (hd0,1); chainloader (hd0,1)+1; boot" || echo Failed to boot part2
|
||||
exit
|
||||
|
||||
:part3
|
||||
echo Booting FirstDisk-ThirdPartition...
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title FirstDisk-ThirdPartition; root (hd0,2); chainloader (hd0,2)+1; boot" || echo Failed to boot part3
|
||||
exit
|
||||
|
||||
:ogcache
|
||||
echo Booting OpenGnsys-CACHE...
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title OpenGnsys-CACHE; find --set-root /boot/__OGLIVE__/ogvmlinuz; kernel /boot/__OGLIVE__/ogvmlinuz ogactiveadmin=true ogdebug=true __INFOHOST__; initrd /boot/__OGLIVE__/oginitrd.img; boot"
|
||||
|
||||
:ognet
|
||||
echo Booting OpenGnsys-NET...
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=false ogdebug=false ${kernelargs} || goto fallback
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
:ognetdef
|
||||
echo Booting OpenGnsys-NET Default...
|
||||
set ISODIR ogLive
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogactiveadmin=false ogdebug=false ${kernelargs}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
||||
:shell
|
||||
echo Launching iPXE shell...
|
||||
shell
|
||||
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode - Booting Menu"
|
||||
chain http://__SERVERIP__/tftpboot/grubx64.efi
|
||||
exit
|
|
@ -7,13 +7,13 @@ set default 0
|
|||
set kernelargs __INFOHOST__
|
||||
# Menú de entrada para seleccionar OgLive
|
||||
:try_iso
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ${kernelargs} || goto fallback
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogdebug=false ${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}
|
||||
kernel http://__SERVERIP__/tftpboot/${ISODIR}/ogvmlinuz ogdebug=false ${kernelargs}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!ipxe
|
||||
set timeout 0
|
||||
set timeout-style hidden
|
||||
|
||||
set ISODIR __OGLIVE__
|
||||
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
|
||||
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}
|
||||
initrd http://__SERVERIP__/tftpboot/${ISODIR}/oginitrd.img
|
||||
boot
|
|
@ -1,17 +1,16 @@
|
|||
#!ipxe
|
||||
|
||||
# Configuración inicial
|
||||
set ISODIR __OGLIVE__
|
||||
set default 0
|
||||
set kernelargs __INFOHOST__
|
||||
:bios_boot_cache
|
||||
echo "Booting ogLive from cache..."
|
||||
# Detectar si se está ejecutando en modo UEFI o BIOS
|
||||
iseq ${platform} efi && goto uefi_boot || goto bios_boot
|
||||
|
||||
chain tftp://__SERVERIP__/tftpboot/grub.exe --config-file="
|
||||
timeout 0
|
||||
set ISODIR=${ISODIR};
|
||||
find --set-root --ignore-floppies --ignore-cd /boot/${ISODIR}/ogvmlinuz;
|
||||
kernel /boot/${ISODIR}/ogvmlinuz ${kernelargs};
|
||||
initrd /boot/${ISODIR}/oginitrd.img;
|
||||
boot;
|
||||
" || echo "Failed to boot ogLive from cache."
|
||||
:bios_boot
|
||||
echo "Running in BIOS mode"
|
||||
# Si el cliente es BIOS, arranca el grub.pxe
|
||||
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 1; title OpenGnsys-CACHE; find --set-root /boot/__OGLIVE__/ogvmlinuz; kernel /boot/__OGLIVE__/ogvmlinuz ogactiveadmin=true ogdebug=true __INFOHOST__; initrd /boot/__OGLIVE__/oginitrd.img; boot"
|
||||
exit
|
||||
|
||||
:uefi_boot
|
||||
echo "Running in UEFI mode"
|
||||
# Si el cliente es UEFI, arranca el grubx64.efi
|
||||
chain http://__SERVERIP__/tftpboot/grubx64.efi
|
||||
exit
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
##NO-TOCAR-ESTA-LINEA ogLive
|
||||
set timeout=0
|
||||
set timeout_style=hidden
|
||||
|
||||
echo ">>> Iniciando GRUB embebido"
|
||||
|
||||
set ISODIR=__OGLIVE__
|
||||
echo ">>> ISODIR definido como: $ISODIR"
|
||||
|
||||
echo ">>> Buscando ogvmlinuz en particiones locales..."
|
||||
search --file --set=root /boot/$ISODIR/ogvmlinuz
|
||||
|
||||
if [ -n "$root" ]; then
|
||||
echo ">>> OgLive encontrado en CACHE en $root"
|
||||
echo ">>> Cargando kernel..."
|
||||
linux /boot/$ISODIR/ogvmlinuz __INFOHOST__
|
||||
echo ">>> Cargando initrd..."
|
||||
initrd /boot/$ISODIR/oginitrd.img
|
||||
echo ">>> Ejecutando boot"
|
||||
boot
|
||||
else
|
||||
echo ">>> ogvmlinuz no encontrado en CACHE."
|
||||
echo ">>> Reintentando en red o abortando..."
|
||||
reboot
|
||||
fi
|
|
@ -0,0 +1,6 @@
|
|||
if ! search --file --set root /Part-__DISK__-__PART__; then
|
||||
search --file --set root /EFI/Part-__DISK__-__PART__/Boot/ogloader.efi
|
||||
fi
|
||||
search --file --set rootEFI /EFI/Part-__DISK__-__PART__/Boot/ogloader.efi
|
||||
chainloader ($rootEFI)/EFI/Part-__DISK__-__PART__/Boot/ogloader.efi
|
||||
boot
|
|
@ -0,0 +1,94 @@
|
|||
set timeout=30
|
||||
|
||||
set detectado='no'
|
||||
# Compruebo si existen distintos cargadores.
|
||||
echo "Searching Grub"
|
||||
set ISODIR=__OGLIVE__
|
||||
search --file --set rootGrub /EFI/grub/Boot/grubx64.efi
|
||||
if [ "$rootGrub" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Grub" {
|
||||
root="$rootGrub"
|
||||
chainloader /EFI/grub/Boot/grubx64.efi
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Searching rEFInd"
|
||||
search --file --set rootRefind /EFI/refind/shimx64.efi.signed
|
||||
if [ "$rootRefind" != "" ]; then
|
||||
menuentry "rEFInd" {
|
||||
root="$rootRefind"
|
||||
chainloader /EFI/refind/shimx64.efi.signed
|
||||
}
|
||||
fi
|
||||
|
||||
if ! search --file --set rootP2 /Part-01-02; then
|
||||
search --file --set rootP2 /EFI/Part-01-02/Boot/ogloader.efi
|
||||
fi
|
||||
search --file --set rootEFI /EFI/Part-01-02/Boot/ogloader.efi
|
||||
|
||||
if [ "$rootP2" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Part-01-02" {
|
||||
root="$rootP2"
|
||||
chainloader ($rootEFI)/EFI/Part-01-02/Boot/ogloader.efi
|
||||
}
|
||||
fi
|
||||
|
||||
if ! search --file --set rootP3 /Part-01-03; then
|
||||
search --file --set rootP3 /EFI/Part-01-03/Boot/ogloader.efi
|
||||
fi
|
||||
|
||||
search --file --set rootEFI /EFI/Part-01-03/Boot/ogloader.efi
|
||||
|
||||
if [ "$rootEFI" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Part-01-03" {
|
||||
root="$rootP3"
|
||||
chainloader ($rootEFI)/EFI/Part-01-03/Boot/ogloader.efi
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Searching Windows"
|
||||
search --file --set rootMS /EFI/Microsoft/Boot/bootmgfw.efi
|
||||
if [ "$rootMS" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Windows" {
|
||||
root="$rootMS"
|
||||
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Searching Ubuntu"
|
||||
search --file --set rootUb /EFI/ubuntu/grubx64.efi
|
||||
if [ "$rootUb" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Ubuntu"{
|
||||
root="$rootUb"
|
||||
chainloader /EFI/ubuntu/grubx64.efi
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
echo "Buscando ogvmlinuz en particiones locales..."
|
||||
search --file --set=rootOgCache /boot/$ISODIR/ogvmlinuz
|
||||
if [ "$rootOgCache" != "" ]; then
|
||||
set detectado='si'
|
||||
menuentry "Oglive Cache"{
|
||||
root="$rootOgCache"
|
||||
linux /boot/$ISODIR/ogvmlinuz __INFOHOST__
|
||||
initrd /boot/$ISODIR/oginitrd.img
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Si no hay ningún sistema operativo muestro mensaje.
|
||||
if [ $detectado == 'no' ]; then
|
||||
menuentry "OpenGnsys no ha detectado ningún sistema operativo" {
|
||||
# para evitar mensajes de error.
|
||||
set root="(hd0,gpt1)"
|
||||
}
|
||||
fi
|
Loading…
Reference in New Issue