Compare commits

..

No commits in common. "main" and "add_torrent_client" have entirely different histories.

14 changed files with 625 additions and 904 deletions

View File

@ -5,79 +5,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.14.2] - 2025-09-30
### Changed
- Don't let mksquashfs take all CPU cores
## [3.14.1] - 2025-09-24
### Fixed
- Fix jenkins build with REUSE_PREV_FS=true
## [3.14.0] - 2025-08-14
### Added
- Fix interfaceAdmin code
- Rename parameters
## [3.13.0] - 2025-08-08
### Added
- Have filebeat collect OGAgentUser logs in /home
## [3.12.1] - 2025-08-05
### Added
- Save a log of early init (oginit/ogfuncions)
## [3.12.0] - 2025-07-31
### Changed
- Have /sbin/init run the python init
## [3.11.2] - 2025-07-18
### Changed
- Don't use the "@euro" locales
## [3.11.1] - 2025-07-11
### Fixed
- Fix opensearch pipeline
## [3.11.0] - 2025-07-11
### Added
- Install filebeat
## [3.10.1] - 2025-07-03
### Changed
- Undo the pcp/dstat change--does nothing
## [3.10.0] - 2025-07-03
### Changed
- Explicitly remove pcp and install dstat
## [3.9.2] - 2025-06-26
### Fixed
- Include dbus env var in .xinitrc
## [3.9.1] - 2025-06-18 ## [3.9.1] - 2025-06-18
### Fixed ### Fixed

140
Jenkinsfile vendored
View File

@ -1,145 +1,11 @@
pipeline { pipeline {
agent { label 'built-in' } agent any
options {
timestamps()
// Conserva la concurrencia como en el job original (no añadimos disableConcurrentBuilds)
skipDefaultCheckout(true) // Haremos el checkout con los parámetros manualmente
}
parameters {
string(name: 'OGLIVE_BUILDER_BRANCH', defaultValue: 'main',
description: 'What branch of repository oglive-builder to work in.')
string(name: 'OGCLONE_ENGINE_BRANCH', defaultValue: 'main',
description: 'What branch of repository ogclone-engine to pick files from.')
string(name: 'OGREPOSITORY_BRANCH', defaultValue: 'main',
description: 'What branch of repository ogrepository to pick files from.')
booleanParam(name: 'REUSE_PREV_FS', defaultValue: true,
description: 'Whether to reuse the virtual filesystem from the previous build or to start from scratch.')
}
environment {
CODENAME = 'noble' // Igual que en tu script actual (hardcoded)
}
stages { stages {
stage('Workspace cleanup (pre-build)') { stage('Build') {
when {
expression { return params.REUSE_PREV_FS == false }
}
steps { steps {
// Equivalente al PreBuildCleanup del plugin ws-cleanup echo 'Jenkinsfile for oglive-builder'
cleanWs()
}
}
stage('Checkout oglive-builder') {
steps {
checkout([
$class: 'GitSCM',
userRemoteConfigs: [[
url: 'https://ognproject.evlt.uma.es/gitea/opengnsys/oglive-builder.git',
credentialsId: 'gitea-unizar'
]],
branches: [[ name: "refs/heads/${params.OGLIVE_BUILDER_BRANCH}" ]],
extensions: []
])
}
}
stage('Build ogLive') {
steps {
sh '''#!/bin/bash
set -euo pipefail
export CODENAME="${CODENAME}" ## hardcoded at the moment
echo ========================= Parameters
echo OGLIVE_BUILDER_BRANCH=${OGLIVE_BUILDER_BRANCH}
echo OGCLONE_ENGINE_BRANCH=${OGCLONE_ENGINE_BRANCH}
echo OGREPOSITORY_BRANCH=${OGREPOSITORY_BRANCH}
echo REUSE_PREV_FS=${REUSE_PREV_FS}
echo CODENAME=${CODENAME}
echo ========================= Clone/fetch clone-engine repo
if [[ -d ogclone-engine-repo ]]; then
cd ogclone-engine-repo; git fetch; git checkout "${OGCLONE_ENGINE_BRANCH}"; cd ..
else
git clone -c http.sslVerify=false --branch "${OGCLONE_ENGINE_BRANCH}" \
https://ognproject.evlt.uma.es/gitea/opengnsys/ogclone-engine.git ogclone-engine-repo
fi
HEAD=$(git --git-dir ./ogclone-engine-repo/.git rev-parse HEAD)
echo "ogclone-engine HEAD: $HEAD"
echo ========================= Clone/fetch ogrepository repo
if [[ -d ogrepository-repo ]]; then
cd ogrepository-repo; git fetch; git checkout "${OGREPOSITORY_BRANCH}"; cd ..
else
git clone -c http.sslVerify=false --branch "${OGREPOSITORY_BRANCH}" \
https://ognproject.evlt.uma.es/gitea/opengnsys/ogrepository.git ogrepository-repo
fi
HEAD=$(git --git-dir ./ogrepository-repo/.git rev-parse HEAD)
echo "ogrepository HEAD: $HEAD"
echo ========================= Take stuff out of the ogclone-engine repo
mkdir -p shared
mkdir -p engine
cp -a ./ogclone-engine-repo/ogclient/{bin,etc,lib,scripts} shared/
cp -a ./ogclone-engine-repo/ogclient/lib/engine/bin engine/
git --git-dir ./ogclone-engine-repo/.git log --date format:r%Y%m%d --format=%ad.%h -1 > gitrelease
echo ========================= Take stuff out of the ogrepository repo
mkdir -p ogrepo-ssh-key
cp ./ogrepository-repo/installer/ssh-keys/opengnsys ogrepo-ssh-key/
cp ./ogrepository-repo/installer/ssh-keys/opengnsys.pub ogrepo-ssh-key/
# echo ========================= Fetch deb packages from the artefacts server
# AGENT_DEB=$(env - /bin/ls -t /mnt/srv/artefactos/ogagent/*.deb 2>/dev/null | head -n 1)
# BROWSER_DEB=$(env - /bin/ls -t /mnt/srv/artefactos/ogbrowser/* | head -n 1)
# echo "Found agent package '$AGENT_DEB' and browser package '$BROWSER_DEB'"
# cp -vf $AGENT_DEB $BROWSER_DEB .
echo ========================= Build docker image
docker build --build-arg OPENGNSYS_HEAD="$HEAD" -t opengnsys/mkoglive . ## invalidate cache when $HEAD changes
rm -rf shared engine gitrelease ogrepo-ssh-key
echo ========================= Build ogLive
if [[ "${REUSE_PREV_FS}" == "false" ]]; then
echo "Not reusing old build"
sudo chown user:user "$WORKSPACE/ogclient" || true
rm -rf ogclient
else
echo "Reusing old build. In the following 'ls' output there should be something"
ls -la ogclient/ || true
fi
mkdir -p ogclient ## run this as user; otherwise docker may create it as root
if [[ "zjenkins" != "z$(stat --format %U ogclient)" ]]; then
echo "warning: directory 'ogclient' not owned by user 'jenkins'"
fi
docker run --rm --name mkoglive --privileged=true \
--volume "$PWD/ogclient:/var/lib/tftpboot/ogclient" \
opengnsys/mkoglive --codename "$CODENAME" --loglevel debug
echo Uploading to the artefactos NFS share
[[ -d /mnt/srv ]] || mount /mnt
cp -av ogclient/ogLive-*.iso /mnt/srv/artefactos/oglive/ || true
echo Cleaning up
sudo chown jenkins:jenkins "$WORKSPACE/ogclient" || true
rm -vf ogclient/ogclient.sqfs* ogclient/ogLive-*.iso ogclient/*.iso.sum ogclient/oginitrd.img* ogclient/ogvmlinuz* || true
'''
} }
} }
} }
// Si te interesa conservar el ISO como artefacto de Jenkins, descomenta el 'post' siguiente y
// mueve/duplica el borrado de ficheros para que ocurra después del archiveArtifacts.
// post {
// success {
// archiveArtifacts artifacts: 'ogclient/ogLive-*.iso, ogclient/*.iso.sum', allowEmptyArchive: true
// }
// always {
// wsCleanup()
// }
// }
} }

View File

@ -327,18 +327,8 @@ def mksquashfs (bttargetdir, btrootfsmnt):
now = datetime.datetime.now(datetime.timezone.utc).strftime ('%Y%m%d-%H%M%S%z') now = datetime.datetime.now(datetime.timezone.utc).strftime ('%Y%m%d-%H%M%S%z')
os.rename (f'{bttargetdir}/ogclient.sqfs', f'{bttargetdir}/ogclient.sqfs.{now}') os.rename (f'{bttargetdir}/ogclient.sqfs', f'{bttargetdir}/ogclient.sqfs.{now}')
## for some reason mksqashfs uses all CPU cores available, even within docker ## uses all CPU cores available, even within docker
## so, let's count the number of cores... utils.run (['mksquashfs', btrootfsmnt, f'{bttargetdir}/ogclient.sqfs', '-e', 'var/lib/apt/lists', '-e', 'usr/share/doc'])
fd = open ('/proc/cpuinfo', 'r')
nproc = 0
while True:
line = fd.readline()
if not line: break
if 'processor' in line: nproc += 1
## ...and leave one core unused
nproc = str (nproc-1)
utils.run (['mksquashfs', btrootfsmnt, f'{bttargetdir}/ogclient.sqfs', '-processors', nproc, '-e', 'var/lib/apt/lists', '-e', 'usr/share/doc'])
os.chmod (f'{bttargetdir}/ogclient.sqfs', 0o744) os.chmod (f'{bttargetdir}/ogclient.sqfs', 0o744)
utils.write_md5 (f'{bttargetdir}/ogclient.sqfs') utils.write_md5 (f'{bttargetdir}/ogclient.sqfs')

View File

@ -40,7 +40,7 @@ def boottoolsSoftwareInstall (osarch, osrelease):
subprocess.run (['debconf-set-selections'], input=debconf_settings, text=True) subprocess.run (['debconf-set-selections'], input=debconf_settings, text=True)
utils.run (['dpkg-reconfigure', '--frontend', 'noninteractive', 'console-setup', 'locales']) ## XXX: despues de esto, debconf-get-selections devuelve los valores antiguos, no se por que... utils.run (['dpkg-reconfigure', '--frontend', 'noninteractive', 'console-setup', 'locales']) ## XXX: despues de esto, debconf-get-selections devuelve los valores antiguos, no se por que...
pkgs = [] pkgs = glob.glob ('/tmp/opengnsys/oglive_builder/ogagent_*.deb') + glob.glob ('/tmp/opengnsys/oglive_builder/OGBrowser*.deb')
for section in config.options('Packages'): for section in config.options('Packages'):
pkgs += re.split (r'[ \n]', config['Packages'].get(section).strip()) pkgs += re.split (r'[ \n]', config['Packages'].get(section).strip())

View File

@ -59,4 +59,5 @@ deb http://free.nchc.org.tw/ubuntu OSCODENAME-security main restricted universe
#deb-src http://ppa.launchpad.net/zfs-native/stable/ubuntu OSCODENAME main #deb-src http://ppa.launchpad.net/zfs-native/stable/ubuntu OSCODENAME main
deb [trusted=yes] https://ognproject.evlt.uma.es/debian-opengnsys/nightly/main OSCODENAME main deb [trusted=yes] https://ognproject.evlt.uma.es/debian-opengnsys/opengnsys OSCODENAME main

View File

@ -1,6 +1,6 @@
LC_TYPE=es_ES.UTF-8 LC_TYPE=es_ES.UTF-8@euro
LC_ALL=es_ES.UTF-8 LC_ALL=es_ES.UTF-8@euro
LANG=es_ES.UTF-8 LANG=es_ES.UTF-8@euro
LANGUAGE=es_ES.UTF-8 LANGUAGE=es_ES.UTF-8@euro
XDG_RUNTIME_DIR=/run/user/0 XDG_RUNTIME_DIR=/run/user/0
QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox

View File

@ -1,29 +0,0 @@
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/opengnsys.json.log
- /home/*/opengnsys.json.log
setup.template.settings:
index.number_of_shards: 1
output.elasticsearch:
hosts: ["__OGLOG_IP__:__OGLOG_PORT__"]
pipeline: "filebeat_opengnsys_pipeline"
username: "filebeat_writer"
password: "__OPENSEARCH_PASSWORD__"
protocol: "https"
ssl.enabled: true
ssl.verification_mode: none
#ssl.certificate: "/opt/opengnsys/etc/filebeat.crt.pem"
#ssl.key: "/opt/opengnsys/etc/filebeat.key.pem"
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
- add_docker_metadata: ~
- add_kubernetes_metadata: ~
seccomp.enabled: false

View File

@ -1 +1 @@
OpenGnsys Client 3.14.2 OpenGnsys Client 3.9.1

View File

@ -19,7 +19,6 @@
#*/ ## #*/ ##
ogGetNetworkDevice () ogGetNetworkDevice ()
{ {
echo "ogGetNetworkDevice()" >>/tmp/oginit.log
# Mantener retrocompatibilidad con interfaces antiguas tipo eth. # Mantener retrocompatibilidad con interfaces antiguas tipo eth.
case "$1" in case "$1" in
eth0) ind=1 ;; eth0) ind=1 ;;
@ -27,17 +26,13 @@ case "$1" in
eth2) ind=3 ;; eth2) ind=3 ;;
*) ind="$1" ;; *) ind="$1" ;;
esac esac
echo "ind ($ind)" >>/tmp/oginit.log
# Buscar el dispositivo del índice. # Buscar el dispositivo del índice.
dev="" dev=""
for f in /sys/class/net/*/uevent; do for f in /sys/class/net/*/uevent; do
echo "source $f" >>/tmp/oginit.log
source $f source $f
let aux=$IFINDEX-1 let aux=$IFINDEX-1
echo "aux ($aux)" >>/tmp/oginit.log
[ "$ind" = "$INTERFACE" -o "$ind" = $aux ] && dev="$INTERFACE" [ "$ind" = "$INTERFACE" -o "$ind" = $aux ] && dev="$INTERFACE"
done done
echo "dev ($dev)" >>/tmp/oginit.log
[ -n "$dev" ] && echo "$dev" [ -n "$dev" ] && echo "$dev"
} }
@ -55,20 +50,18 @@ echo "dev ($dev)" >>/tmp/oginit.log
#*/ ## #*/ ##
ogExportKernelParameters () ogExportKernelParameters ()
{ {
echo "ogExportKernelParameters()" >>/tmp/oginit.log
GLOBAL="cat /proc/cmdline" GLOBAL="cat /proc/cmdline"
for i in `${GLOBAL}`; do for i in `${GLOBAL}`
echo $i | grep "=" > /dev/null && export $i && echo "export $i" >>/tmp/oginit.log do
echo $i | grep "=" > /dev/null && export $i
done done
# Sustituir índice de interfaz de red por su dispositivo. # Sustituir índice de interfaz de red por su dispositivo.
DEVIND=$(echo "$ip" | cut -f6 -d:) DEVIND=$(echo "$ip" | cut -f6 -d:)
echo "DEVIND ($DEVIND)" >>/tmp/oginit.log
if [ -n "$DEVIND" ]; then if [ -n "$DEVIND" ]; then
PRE=$(echo "$ip" | cut -f1-5 -d:) PRE=$(echo "$ip" | cut -f1-5 -d:)
POST=$(echo "$ip" | cut -f7- -d:) POST=$(echo "$ip" | cut -f7- -d:)
DEVICE=$(ogGetNetworkDevice $DEVIND) DEVICE=$(ogGetNetworkDevice $DEVIND)
echo "DEVICE ($DEVICE)" >>/tmp/oginit.log [ -n "$DEVICE" ] && export ip="$PRE:$DEVICE:${POST:-none}"
[ -n "$DEVICE" ] && export ip="$PRE:$DEVICE:${POST:-none}" && echo "export ip=$PRE:$DEVICE:${POST:-none}" >>/tmp/oginit.log
fi fi
return 0 return 0
} }
@ -87,7 +80,6 @@ ogExportKernelParameters ()
#*/ ## #*/ ##
ogChangeVideoResolution () ogChangeVideoResolution ()
{ {
echo "ogChangeVideoResolution()" >>/tmp/oginit.log
# Variables locales. # Variables locales.
local DRIVER MODE local DRIVER MODE
# Mostrar resolución y driver por defecto si solo hay una opción disponible. # Mostrar resolución y driver por defecto si solo hay una opción disponible.
@ -127,7 +119,6 @@ fi
#*/ ## #*/ ##
ogExportVarEnvironment () ogExportVarEnvironment ()
{ {
echo "ogExportVarEnvironment()" >>/tmp/oginit.log
export CFGINITRD="/tmp/initrd.cfg" export CFGINITRD="/tmp/initrd.cfg"
OGPROTOCOL="${ogprotocol:-smb}" OGPROTOCOL="${ogprotocol:-smb}"
[ "$ogunit" != "" ] && OGUNIT="/$ogunit" [ "$ogunit" != "" ] && OGUNIT="/$ogunit"
@ -135,8 +126,6 @@ ogExportVarEnvironment ()
export OPTIONS=" -o user=opengnsys,pass=og" export OPTIONS=" -o user=opengnsys,pass=og"
DEFOGLIVE="ogclient" DEFOGLIVE="ogclient"
export OGLIVEDIR="${oglivedir:-$DEFOGLIVE}" && echo "OGLIVEDIR=$OGLIVEDIR" >> $CFGINITRD export OGLIVEDIR="${oglivedir:-$DEFOGLIVE}" && echo "OGLIVEDIR=$OGLIVEDIR" >> $CFGINITRD
echo "CFGINITRD ($CFGINITRD) OGPROTOCOL ($OGPROTOCOL) OGUNIT ($OGUNIT) OGLIVEDIR ($OGLIVEDIR)" >>/tmp/oginit.log
export CFGINITRD="/tmp/initrd.cfg"
case "$OGPROTOCOL" in case "$OGPROTOCOL" in
nfs|NFS) nfs|NFS)
export SRCOGLIVE="/var/lib/tftpboot" && echo "SRCOGLIVE=$SRCOGLIVE" >> $CFGINITRD export SRCOGLIVE="/var/lib/tftpboot" && echo "SRCOGLIVE=$SRCOGLIVE" >> $CFGINITRD
@ -158,20 +147,22 @@ ogExportVarEnvironment ()
export SRCOGIMAGES="images" && echo "SRCOGIMAGES=$SRCOGIMAGES" >> $CFGINITRD export SRCOGIMAGES="images" && echo "SRCOGIMAGES=$SRCOGIMAGES" >> $CFGINITRD
;; ;;
esac esac
echo "SRCOGLIVE ($SRCOGLIVE) SRCOGSHARE ($SRCOGSHARE) SRCOGLOG ($SRCOGLOG) SRCOGIMAGES ($SRCOGIMAGES)" >>/tmp/oginit.log #punto de acceso al boot-tools live
export DSTOGLIVE="/opt/oglive/tftpboot" #punto de acceso al boot-tools live export DSTOGLIVE="/opt/oglive/tftpboot"
export OGLIVERAMFS="/opt/oglive/ramfs" && echo "OGLIVERAMFS=$OGLIVERAMFS" >> $CFGINITRD #punto de montaje para unionfs #punto de montaje para unionfs
export OGLIVEROOTFS="/opt/oglive/rootfs" && echo "OGLIVEROOTFS=$OGLIVEROOTFS" >> $CFGINITRD #punto de montaje donde se accede al 2nd FS mediante loop export OGLIVERAMFS="/opt/oglive/ramfs" && echo "OGLIVERAMFS=$OGLIVERAMFS" >> $CFGINITRD
export OGLIVEUNIONFS="/opt/oglive/unionfs" && echo "OGLIVEUNIONFS=$OGLIVEUNIONFS" >> $CFGINITRD #punto de union entre LOCALROOTIMG y LOCALROOTRAM #punto de montaje donde se accede al 2nd FS mediante loop
export OGLIVELABEL="ogClient" #etiquta para los dispositivos offline export OGLIVEROOTFS="/opt/oglive/rootfs" && echo "OGLIVEROOTFS=$OGLIVEROOTFS" >> $CFGINITRD
echo "DSTOGLIVE ($DSTOGLIVE) OGLIVERAMFS ($OGLIVERAMFS) OGLIVEROOTFS ($OGLIVEROOTFS) OGLIVEUNIONFS ($OGLIVEUNIONFS)" >>/tmp/oginit.log #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 "puntos de montajes para los demas accesos"
#echo "acceso al client, engine, scritps, interfaz" #echo "acceso al client, engine, scritps, interfaz"
export DSTOGSHARE="/opt/opengnsys" && echo "DSTOGSHARE=$DSTOGSHARE" >> $CFGINITRD export DSTOGSHARE="/opt/opengnsys" && echo "DSTOGSHARE=$DSTOGSHARE" >> $CFGINITRD
export DSTOGLOG="/opt/opengnsys/log" && echo "DSTOGLOG=$DSTOGLOG" >> $CFGINITRD export DSTOGLOG="/opt/opengnsys/log" && echo "DSTOGLOG=$DSTOGLOG" >> $CFGINITRD
export DSTOGIMAGES="/opt/opengnsys/images" && echo "DSTOGIMAGES=$DSTOGIMAGES" >> $CFGINITRD export DSTOGIMAGES="/opt/opengnsys/images" && echo "DSTOGIMAGES=$DSTOGIMAGES" >> $CFGINITRD
echo "DSTOGSHARE ($DSTOGSHARE) DSTOGLOG ($DSTOGLOG) DSTOGIMAGES ($DSTOGIMAGES)" >>/tmp/oginit.log
##INFORMACION DE OTRAS VARIABLES OBTENDIAS EN OTRAS FUNCIONES ogConfigureNetwork. ##INFORMACION DE OTRAS VARIABLES OBTENDIAS EN OTRAS FUNCIONES ogConfigureNetwork.
#DEVICE #DEVICE
@ -203,7 +194,6 @@ ogExportVarEnvironment ()
#*/ ## #*/ ##
ogConfigureRamfs () ogConfigureRamfs ()
{ {
echo "ogConfigureRamfs()" >>/tmp/oginit.log
mkdir -p $DSTOGLIVE mkdir -p $DSTOGLIVE
mkdir -p $OGLIVERAMFS mkdir -p $OGLIVERAMFS
mkdir -p $OGLIVEROOTFS mkdir -p $OGLIVEROOTFS
@ -225,9 +215,9 @@ ogConfigureRamfs ()
#*/ ## #*/ ##
ogLoadNetModule () ogLoadNetModule ()
{ {
echo "ogLoadNetModule()" >>/tmp/oginit.log if [ -n "$ognetmodule" ]
if [ -n "$ognetmodule" ]; then then
echo "Cargando modulo de red $ognetmodule" |tee -a /tmp/oginit.log echo "Cargando modulo de red $ognetmodule"
modprobe ${ognetmodule} modprobe ${ognetmodule}
fi fi
} }
@ -245,8 +235,6 @@ ogLoadNetModule ()
#*/ ## #*/ ##
ogPostConfigureFS() ogPostConfigureFS()
{ {
echo "ogPostConfigureFS()" >>/tmp/oginit.log
echo "IPV4ADDR ($IPV4ADDR) HOSTNAME ($HOSTNAME)" >>/tmp/oginit.log
# configuramos el /etc/hostname. # configuramos el /etc/hostname.
echo $HOSTNAME > /etc/hostname echo $HOSTNAME > /etc/hostname
@ -261,12 +249,10 @@ ogPostConfigureFS()
#configuramos el dns anterior ubuntu 12.04 (parámetro del Kernel "ogdns=IP_DNS") #configuramos el dns anterior ubuntu 12.04 (parámetro del Kernel "ogdns=IP_DNS")
if [ -n "$ogdns" ]; then if [ -n "$ogdns" ]; then
mkdir -p /run/resolvconf mkdir -p /run/resolvconf
echo "writing 'nameserver $ogdns' to /run/resolvconf/resolv.conf" >>/tmp/oginit.log
echo "nameserver $ogdns" > /run/resolvconf/resolv.conf echo "nameserver $ogdns" > /run/resolvconf/resolv.conf
fi fi
#configuramos el uso del servicio http proxy (parámetro del Kernel "ogproxy=URL_Proxy") #configuramos el uso del servicio http proxy (parámetro del Kernel "ogproxy=URL_Proxy")
echo "ogproxy ($ogproxy)" >>/tmp/oginit.log
if [ -n "${ogproxy}" ]; then if [ -n "${ogproxy}" ]; then
export http_proxy="$ogproxy" export http_proxy="$ogproxy"
export https_proxy="$ogproxy" export https_proxy="$ogproxy"
@ -277,7 +263,6 @@ ogPostConfigureFS()
# configuramos el /etc/networks # configuramos el /etc/networks
#read -e NETIP NETDEFAULT <<<$(route -n | grep eth0 | awk -F" " '{print $1}') #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" ") NETIP=$(route -n | grep eth0 | awk -F" " '{print $1}') && NETIP=$(echo $NETIP | cut -f1 -d" ")
echo "NETIP ($NETIP)" >>/tmp/oginit.log
echo "default 0.0.0.0" > /etc/networks echo "default 0.0.0.0" > /etc/networks
echo "loopback 127.0.0.0" >> /etc/networks echo "loopback 127.0.0.0" >> /etc/networks
echo "link-local 169.254.0.0" >> /etc/networks echo "link-local 169.254.0.0" >> /etc/networks
@ -289,7 +274,6 @@ ogPostConfigureFS()
#enlace si iniciamos desde ogprotocolo=local { cdrom, usb, cache } . #enlace si iniciamos desde ogprotocolo=local { cdrom, usb, cache } .
# monta el raiz del dispositivo local en /opt/og2fs/tftpboot - acceso al fichero .sqfs # monta el raiz del dispositivo local en /opt/og2fs/tftpboot - acceso al fichero .sqfs
# y monta el sistema root sqfs en /opt/og2fs/2ndfs # y monta el sistema root sqfs en /opt/og2fs/2ndfs
echo "LOCALMEDIA ($LOCALMEDIA) ogprotocol ($ogprotocol) ogstatus ($ogstatus)" >>/tmp/oginit.log
#[ "$LOCALMEDIA" == "CACHE" ] && ln -s $DSTOGLIVE /opt/opengnsys/cache #[ "$LOCALMEDIA" == "CACHE" ] && ln -s $DSTOGLIVE /opt/opengnsys/cache
#[ "$ogprotocol" == "local" ] && ln -s ${OGLIVEROOTFS}/opt/opengnsys/* /opt/opengnsys/ #[ "$ogprotocol" == "local" ] && ln -s ${OGLIVEROOTFS}/opt/opengnsys/* /opt/opengnsys/
if [ "$ogprotocol" == "local" ]; then if [ "$ogprotocol" == "local" ]; then
@ -298,21 +282,16 @@ ogPostConfigureFS()
# Montamos CACHE # Montamos CACHE
# Si existe particion identificada como CACHE se monta. # Si existe particion identificada como CACHE se monta.
DEVICECACHE=$(blkid -L "CACHE") DEVICECACHE=$(blkid -L "CACHE")
echo "DEVICECACHE ($DEVICECACHE)" >>/tmp/oginit.log
if [ "$DEVICECACHE" != "" ]; then if [ "$DEVICECACHE" != "" ]; then
# Se monta diferente segun el dispositivo de cache igual o no al de ogclient. # Se monta diferente segun el dispositivo de cache igual o no al de ogclient.
DEVICEOGLIVE=$(df |grep $DSTOGLIVE|awk '{print $1}') DEVICEOGLIVE=$(df |grep $DSTOGLIVE|awk '{print $1}')
echo "DEVICEOGLIVE ($DEVICEOGLIVE)" >>/tmp/oginit.log
if [[ "$DEVICECACHE" == "*$DEVICEOGLIVE*" ]];then if [[ "$DEVICECACHE" == "*$DEVICEOGLIVE*" ]];then
echo "running 'mount --bind $DSTOGLIVE /opt/opengnsys/cache'" >>/tmp/oginit.log
mount --bind $DSTOGLIVE /opt/opengnsys/cache mount --bind $DSTOGLIVE /opt/opengnsys/cache
else else
echo "running 'mount $DEVICECACHE /opt/opengnsys/cache'" >>/tmp/oginit.log
mount $DEVICECACHE /opt/opengnsys/cache mount $DEVICECACHE /opt/opengnsys/cache
fi fi
if [ "$ogstatus" == "offline" ]; then if [ "$ogstatus" == "offline" ]; then
[ -d /opt/opengnsys/cache/log ] || mkdir /opt/opengnsys/cache/log [ -d /opt/opengnsys/cache/log ] || mkdir /opt/opengnsys/cache/log
echo "running 'mount --bind /opt/opengnsys/cache/log /opt/opengnsys/log'" >>/tmp/oginit.log
mount --bind /opt/opengnsys/cache/log /opt/opengnsys/log mount --bind /opt/opengnsys/cache/log /opt/opengnsys/log
fi fi
fi fi
@ -321,14 +300,9 @@ ogPostConfigureFS()
# Si estatus distinto de online buscamos un dispositivo con etiqueta repo # Si estatus distinto de online buscamos un dispositivo con etiqueta repo
# y si no existe montamos la cache como repo (si existe). # y si no existe montamos la cache como repo (si existe).
TYPE=$(blkid | grep REPO | awk -F"TYPE=" '{print $2}' | tr -d \") TYPE=$(blkid | grep REPO | awk -F"TYPE=" '{print $2}' | tr -d \")
echo "TYPE ($TYPE)" >>/tmp/oginit.log
if [ "$TYPE" == "" ]; then if [ "$TYPE" == "" ]; then
if [ -d "/opt/opengnsys/cache$DSTOGIMAGES" ]; then [ -d "/opt/opengnsys/cache$DSTOGIMAGES" ] && mount --bind /opt/opengnsys/cache$DSTOGIMAGES $DSTOGIMAGES
echo "running 'mount --bind /opt/opengnsys/cache$DSTOGIMAGES $DSTOGIMAGES'" >>/tmp/oginit.log
mount --bind /opt/opengnsys/cache$DSTOGIMAGES $DSTOGIMAGES
fi
else else
echo "running 'mount -t $TYPE LABEL=REPO $DSTOGIMAGES'" >>/tmp/oginit.log
mount -t $TYPE LABEL=REPO $DSTOGIMAGES &>/dev/null mount -t $TYPE LABEL=REPO $DSTOGIMAGES &>/dev/null
fi fi
fi fi
@ -349,6 +323,7 @@ ogPostConfigureFS()
mkdir -p /dev/shm mkdir -p /dev/shm
mount tmpfs -t tmpfs /dev/shm mount tmpfs -t tmpfs /dev/shm
chmod 1777 /dev/shm chmod 1777 /dev/shm
} }
@ -370,8 +345,6 @@ ogPostConfigureFS()
#*/ ## #*/ ##
ogGetROOTSERVER () ogGetROOTSERVER ()
{ {
echo "ogGetROOTSERVER()" >>/tmp/oginit.log
echo "NFSROOT ($NFSROOT)" >>/tmp/oginit.log
# get nfs root from dhcp # get nfs root from dhcp
if [ "x${NFSROOT}" = "xauto" ]; then if [ "x${NFSROOT}" = "xauto" ]; then
# check if server ip is part of dhcp root-path # check if server ip is part of dhcp root-path
@ -392,17 +365,14 @@ ogGetROOTSERVER ()
NFSROOT=${ROOTSERVER}:${NFSROOT} NFSROOT=${ROOTSERVER}:${NFSROOT}
fi fi
fi fi
echo "NFSROOT now ($NFSROOT)" >>/tmp/oginit.log
export ROOTSERVER export ROOTSERVER
echo "ROOTSERVER=$ROOTSERVER" >> $CFGINITRD echo "ROOTSERVER=$ROOTSERVER" >> $CFGINITRD
echo "ROOTSERVER ($ROOTSERVER)" >>/tmp/oginit.log
#si oglive no oglive=R #si oglive no oglive=R
export OGSERVERIMAGES="${ogrepo:-$ROOTSERVER}" && echo "OGSERVERIMAGES=$OGSERVERIMAGES" >> $CFGINITRD export OGSERVERIMAGES="${ogrepo:-$ROOTSERVER}" && echo "OGSERVERIMAGES=$OGSERVERIMAGES" >> $CFGINITRD
export OGSERVERSHARE="${ogshare:-$ROOTSERVER}" && echo "OGSERVERSHARE=$OGSERVERSHARE" >> $CFGINITRD export OGSERVERSHARE="${ogshare:-$ROOTSERVER}" && echo "OGSERVERSHARE=$OGSERVERSHARE" >> $CFGINITRD
export OGSERVERLOG="${oglog:-$ROOTSERVER}" && echo "OGSERVERLOG=$OGSERVERLOG" >> $CFGINITRD export OGSERVERLOG="${oglog:-$ROOTSERVER}" && echo "OGSERVERLOG=$OGSERVERLOG" >> $CFGINITRD
export OGSERVERLIVE="${oglive:-$OGSERVERIMAGES}" && echo "OGSERVERLIVE=$OGSERVERLIVE" >> $CFGINITRD export OGSERVERLIVE="${oglive:-$OGSERVERIMAGES}" && echo "OGSERVERLIVE=$OGSERVERLIVE" >> $CFGINITRD
echo "OGSERVERIMAGES ($OGSERVERIMAGES) OGSERVERSHARE ($OGSERVERSHARE) OGSERVERLOG ($OGSERVERLOG) OGSERVERLIVE ($OGSERVERLIVE)" >>/tmp/oginit.log
return 0 return 0
} }
@ -427,50 +397,50 @@ ogGetROOTSERVER ()
ogUpdateInitrd () ogUpdateInitrd ()
{ {
echo "ogUpdateInitrd()" >>/tmp/oginit.log
local OGLIVEDIR local OGLIVEDIR
OGLIVEDIR=${oglivedir:-"ogclient"} OGLIVEDIR=${oglivedir:-"ogclient"}
echo "OGLIVEDIR ($OGLIVEDIR)" >>/tmp/oginit.log
cd /tmp cd /tmp
mkdir /tmp/cache mkdir /tmp/cache
TYPE=$(blkid -po export $(blkid -L CACHE) 2>/dev/null | awk -F= '$1=="TYPE" { print $2}') TYPE=$(blkid -po export $(blkid -L CACHE) 2>/dev/null | awk -F= '$1=="TYPE" { print $2}')
echo "TYPE ($TYPE)" >>/tmp/oginit.log
# Salir si no se detecta caché. # Salir si no se detecta caché.
[ -z "$TYPE" ] && return [ -z "$TYPE" ] && return
echo "running 'mount -t $TYPE LABEL=CACHE /tmp/cache'" >>/tmp/oginit.log
mount -t $TYPE LABEL=CACHE /tmp/cache || return mount -t $TYPE LABEL=CACHE /tmp/cache || return
echo "running 'mkdir -p /tmp/cache/boot/$OGLIVEDIR'" >>/tmp/oginit.log
mkdir -p /tmp/cache/boot/$OGLIVEDIR mkdir -p /tmp/cache/boot/$OGLIVEDIR
# comparamos los del server # comparamos los del server
busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER
busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER
SERVERVMLINUZ=`cat ogvmlinuz.sum` SERVERVMLINUZ=`cat ogvmlinuz.sum`
SERVERINITRD=`cat oginitrd.img.sum` SERVERINITRD=`cat oginitrd.img.sum`
#comparamos los de la cache #comparamos los de la cache
CACHEVMLINUZ=`cat /tmp/cache/boot/$OGLIVEDIR/ogvmlinuz.sum` CACHEVMLINUZ=`cat /tmp/cache/boot/$OGLIVEDIR/ogvmlinuz.sum`
CACHEINITRD=`cat /tmp/cache/boot/$OGLIVEDIR/oginitrd.img.sum` CACHEINITRD=`cat /tmp/cache/boot/$OGLIVEDIR/oginitrd.img.sum`
echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD" |tee -a /tmp/oginit.log echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD"
echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD" |tee -a /tmp/oginit.log echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD"
cd /tmp/cache/boot/$OGLIVEDIR || mkdir -p /tmp/cache/boot/$OGLIVEDIR cd /tmp/cache/boot/$OGLIVEDIR || mkdir -p /tmp/cache/boot/$OGLIVEDIR
if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]; then if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]
echo "ogvmlinuz updating" |tee -a /tmp/oginit.log then
echo "ogvmlinuz updating"
busybox tftp -g -r $OGLIVEDIR/ogvmlinuz $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/ogvmlinuz $ROOTSERVER
busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER
DOREBOOT=true DOREBOOT=true
fi fi
if [ "$CACHEINITRD" != "$SERVERINITRD" ]; then if [ "$CACHEINITRD" != "$SERVERINITRD" ]
echo "oginitrd updating" |tee -a /tmp/oginit.log then
echo "oginitrd updating"
busybox tftp -g -r $OGLIVEDIR/oginitrd.img $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/oginitrd.img $ROOTSERVER
busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER
DOREBOOT=true DOREBOOT=true
fi fi
cd /; umount /tmp/cache cd /; umount /tmp/cache
[ "$DOREBOOT" == "true" ] && reboot -f [ "$DOREBOOT" == "true" ] && reboot -f
} }
@ -492,33 +462,25 @@ ogUpdateInitrd ()
ogConnect () ogConnect ()
{ {
echo "ogConnect()" >>/tmp/oginit.log
SERVER=$1 SERVER=$1
PROTOCOL=$2 PROTOCOL=$2
SRC=$3 SRC=$3
DST=$4 DST=$4
READONLY=$5 READONLY=$5
echo "SERVER ($SERVER) PROTOCOL ($PROTOCOL) SRC ($SRC) DST ($DST) READONLY ($READONLY)" >>/tmp/oginit.log
OPTIONS_LOG_SAFE=$(echo "$OPTIONS" |sed -e 's/pass=.*/pass=***/')
case "$PROTOCOL" in case "$PROTOCOL" in
nfs) nfs)
echo "running 'nfsmount ${SERVER}:${SRC} ${DST} -o nolock${READONLY} || mount.nfs ${SERVER}:${SRC} ${DST} -o nolock${READONLY}'" >>/tmp/oginit.log
nfsmount ${SERVER}:${SRC} ${DST} -o nolock${READONLY} 2> /dev/null || mount.nfs ${SERVER}:${SRC} ${DST} -o nolock${READONLY} nfsmount ${SERVER}:${SRC} ${DST} -o nolock${READONLY} 2> /dev/null || mount.nfs ${SERVER}:${SRC} ${DST} -o nolock${READONLY}
;; ;;
smb) smb)
echo "running 'mount.cifs //${SERVER}/${SRC} ${DST} ${OPTIONS_LOG_SAFE}${READONLY}'" >>/tmp/oginit.log
mount.cifs //${SERVER}/${SRC} ${DST} ${OPTIONS}${READONLY} mount.cifs //${SERVER}/${SRC} ${DST} ${OPTIONS}${READONLY}
;; ;;
local) local)
# Comprobamos que estatus sea online y que la variable del server no esta vacia. # Comprobamos que estatus sea online y que la variable del server no esta vacia.
echo "ogstatus ($ogstatus) SERVER ($SERVER) SRC ($SRC)" >>/tmp/oginit.log
if [ "$ogstatus" != "offline" -a "$SERVER" != "" -a "$SRC" != "" ]; then if [ "$ogstatus" != "offline" -a "$SERVER" != "" -a "$SRC" != "" ]; then
# Comprobamos que existe un servicio de samba. # Comprobamos que existe un servicio de samba.
echo "running 'smbclient -L $SERVER -N'" >>/tmp/oginit.log
smbclient -L $SERVER -N &>/dev/null smbclient -L $SERVER -N &>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "running 'mount.cifs //${SERVER}/og${SRC} ${DST} ${OPTIONS_LOG_SAFE}${READONLY}'" >>/tmp/oginit.log
mount.cifs //${SERVER}/og${SRC} ${DST} ${OPTIONS}${READONLY} mount.cifs //${SERVER}/og${SRC} ${DST} ${OPTIONS}${READONLY}
fi fi
# TODO: buscar condicion para NFS # TODO: buscar condicion para NFS
@ -543,27 +505,21 @@ ogConnect ()
#@date 2011/05/24 #@date 2011/05/24
ogConnectOgLive () ogConnectOgLive ()
{ {
echo "ogConnectOgLive()" >>/tmp/oginit.log
echo "SRCOGLIVE ($SRCOGLIVE)" >>/tmp/oginit.log
# Si ogprotocol=local, la funcion ogExportVar => SRCOGLIVE=local # Si ogprotocol=local, la funcion ogExportVar => SRCOGLIVE=local
if [ "$SRCOGLIVE" == "local" ]; then if [ "$SRCOGLIVE" == "local" ]
echo "Montar imagen del sistema root desde dispositivo local" |tee -a /tmp/oginit.log then
for i in $(blkid /dev/s* | grep $OGLIVELABEL | awk -F: '{print $2}' | tr -d \"); do echo "Montar imagen del sistema root desde dispositivo local"
echo "export $i" >>/tmp/oginit.log for i in $(blkid /dev/s* | grep $OGLIVELABEL | awk -F: '{print $2}' | tr -d \"); do export $i; done
export $i
done
# si local usb| cd con partcion es identificada como label $OGLIVELABEL # si local usb| cd con partcion es identificada como label $OGLIVELABEL
echo "running 'mount -t $TYPE LABEL=$OGLIVELABEL $DSTOGLIVE'" >>/tmp/oginit.log
mount -t $TYPE LABEL=$OGLIVELABEL $DSTOGLIVE mount -t $TYPE LABEL=$OGLIVELABEL $DSTOGLIVE
if [ $? != 0 ]; then if [ $? != 0 ]
then
# Si local es particion CACHE es identificada como CACHE # Si local es particion CACHE es identificada como CACHE
echo "mount failed, running 'mount LABEL=CACHE $DSTOGLIVE'" >>/tmp/oginit.log
mount LABEL=CACHE $DSTOGLIVE mount LABEL=CACHE $DSTOGLIVE
#export LOCALMEDIA=CACHE #export LOCALMEDIA=CACHE
fi fi
else else
# Si ogprotocol es remoto. TODO en smb rw y en nfs ro?? # Si ogprotocol es remoto. TODO en smb rw y en nfs ro??
echo "running 'ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE'" >>/tmp/oginit.log
ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE
fi fi
# Si el montaje ha sido correcto, tanto en local como en remoto. Procedemos con la union # Si el montaje ha sido correcto, tanto en local como en remoto. Procedemos con la union
@ -582,38 +538,33 @@ ogConnectOgLive ()
#@date 2011/05/24 #@date 2011/05/24
ogMergeLive() ogMergeLive()
{ {
echo "ogMergeLive()" >>/tmp/oginit.log
#Si existe en el punto de acceso del del oglive el fichero ogclient.sqfs #Si existe en el punto de acceso del del oglive el fichero ogclient.sqfs
if [ ! -d $DSTOGLIVE/$OGLIVEDIR ]; then if [ ! -d $DSTOGLIVE/$OGLIVEDIR ]; then
echo "Usando ogLive por defecto." echo "Usando ogLive por defecto."
export OGLIVEDIR=$DEFOGLIVE export OGLIVEDIR=$DEFOGLIVE
fi fi
echo "OGLIVEDIR ($OGLIVEDIR) og2nd ($og2nd)" >>/tmp/oginit.log if [ -f $DSTOGLIVE/$OGLIVEDIR/ogclient.sqfs ]
if [ -f $DSTOGLIVE/$OGLIVEDIR/ogclient.sqfs ]; then then
cat /proc/mounts > /tmp/mtab.preunion cat /proc/mounts > /tmp/mtab.preunion
if [ "$og2nd" == "img" ]; then if [ "$og2nd" == "img" ]
then
#Montamos el ROOTFS tipo img, para desarrolladores #Montamos el ROOTFS tipo img, para desarrolladores
#TODO: comprobar que se tiene acceso de escritura #TODO: comprobar que se tiene acceso de escritura
echo "running 'losetup /dev/loop0 $DSTOGLIVE/$OGLIVEDIR/ogclient.img -o 32256'" >>/tmp/oginit.log
losetup /dev/loop0 $DSTOGLIVE/$OGLIVEDIR/ogclient.img -o 32256 losetup /dev/loop0 $DSTOGLIVE/$OGLIVEDIR/ogclient.img -o 32256
echo "running 'mount /dev/loop0 $OGLIVEROOTFS'" >>/tmp/oginit.log
mount /dev/loop0 $OGLIVEROOTFS mount /dev/loop0 $OGLIVEROOTFS
else else
## Montamos el ROOTFS tipo squashfs ## Montamos el ROOTFS tipo squashfs
echo "running 'mount $DSTOGLIVE/$OGLIVEDIR/ogclient.sqfs $OGLIVEROOTFS -t squashfs -o loop'" >>/tmp/oginit.log
mount $DSTOGLIVE/$OGLIVEDIR/ogclient.sqfs $OGLIVEROOTFS -t squashfs -o loop mount $DSTOGLIVE/$OGLIVEDIR/ogclient.sqfs $OGLIVEROOTFS -t squashfs -o loop
fi fi
# Realizamos la union entre el ogliveram(initrd) y el ogliverootfs(ogclient.sqfs) # Realizamos la union entre el ogliveram(initrd) y el ogliverootfs(ogclient.sqfs)
# Nota: el orden es muy importante para evitar errores de montaje. # Nota: el orden es muy importante para evitar errores de montaje.
[ -d $OGLIVEROOTFS/lib32 ] && LIBS=lib32 [ -d $OGLIVEROOTFS/lib32 ] && LIBS=lib32
echo "LIBS ($LIBS)" >>/tmp/oginit.log
for i in bin sbin lib $LIBS etc var usr root boot; do for i in bin sbin lib $LIBS etc var usr root boot; do
echo "ogUnionLiveDir $i" >>/tmp/oginit.log
ogUnionLiveDir $i ogUnionLiveDir $i
done done
[ -L /etc/mtab ] || cat /tmp/mtab.preunion > /etc/mtab [ -L /etc/mtab ] || cat /tmp/mtab.preunion > /etc/mtab
else else
echo "Fichero imagen del cliente no encontrado" |tee -a /tmp/oginit.log echo "Fichero imagen del cliente no encontrado"
return 1 return 1
fi fi
} }
@ -631,12 +582,10 @@ fi
#@date 2011/05/24 #@date 2011/05/24
ogUnionLiveDir() ogUnionLiveDir()
{ {
echo "ogUnionLiveDir()" >>/tmp/oginit.log
TMPDIR=/$1 #dir TMPDIR=/$1 #dir
FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid" FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid"
UNION_OPT="-o cow -o noinitgroups" UNION_OPT="-o cow -o noinitgroups"
UBIN="unionfs-fuse" UBIN="unionfs-fuse"
echo "TMPDIR ($TMPDIR) FUSE_OPT ($FUSE_OPT) UNION_OPT ($UNION_OPT) UBIN ($UBIN)" >>/tmp/oginit.log
mkdir -p $OGLIVERAMFS$TMPDIR mkdir -p $OGLIVERAMFS$TMPDIR
U1STDIR="${OGLIVERAMFS}${TMPDIR}=RW" U1STDIR="${OGLIVERAMFS}${TMPDIR}=RW"
@ -644,9 +593,7 @@ ogUnionLiveDir()
UNIONDIR=${OGLIVEUNIONFS}${TMPDIR} UNIONDIR=${OGLIVEUNIONFS}${TMPDIR}
ulimit -n 4096 ulimit -n 4096
mkdir -p $UNIONDIR $TMPDIR mkdir -p $UNIONDIR $TMPDIR
echo "running '$UBIN $FUSE_OPT $UNION_OPT ${U1STDIR}:${U2NDDIR} $UNIONDIR'" >>/tmp/oginit.log
$UBIN $FUSE_OPT $UNION_OPT ${U1STDIR}:${U2NDDIR} $UNIONDIR $UBIN $FUSE_OPT $UNION_OPT ${U1STDIR}:${U2NDDIR} $UNIONDIR
echo "running 'mount --bind $UNIONDIR $TMPDIR'" >>/tmp/oginit.log
mount --bind $UNIONDIR $TMPDIR mount --bind $UNIONDIR $TMPDIR
} }
@ -667,7 +614,6 @@ ogUnionLiveDir()
#*/ ## #*/ ##
ogConfigureLoopback() ogConfigureLoopback()
{ {
echo "ogConfigureLoopback()" >>/tmp/oginit.log
# for the portmapper we need localhost # for the portmapper we need localhost
ifconfig lo 127.0.0.1 ifconfig lo 127.0.0.1
#/etc/init.d/portmap start #/etc/init.d/portmap start
@ -685,10 +631,10 @@ ogConfigureLoopback()
#*/ ## #*/ ##
ogConfigureNetworking() ogConfigureNetworking()
{ {
echo "ogConfigureNetworking()" >>/tmp/oginit.log #echo "ogConfigureNetworking: Buscando interfaz a configurar DEVICE"
echo "ogConfigureNetworking: Buscando interfaz a configurar DEVICE" >>/tmp/oginit.log if [ -n "${BOOTIF}" ]
if [ -n "${BOOTIF}" ]; then then
echo " variable BOOTIF exportada con pxelinux.0 con valor ($BOOTIF)" >>/tmp/oginit.log #echo " variable BOOTIF exportada con pxelinux.0 con valor $BOOTIF"
IP=$IPOPTS IP=$IPOPTS
temp_mac=${BOOTIF#*-} temp_mac=${BOOTIF#*-}
# convert to typical mac address format by replacing "-" with ":" # convert to typical mac address format by replacing "-" with ":"
@ -702,22 +648,20 @@ if [ -n "${BOOTIF}" ]; then
fi fi
done done
unset IFS unset IFS
echo "IP ($IP) bootif_mac ($bootif_mac)" >>/tmp/oginit.log # look for devices with matching mac address, and set DEVICE to
# look for devices with matching mac address, and set DEVICE to appropriate value if match is found. # appropriate value if match is found.
for device in /sys/class/net/* ; do for device in /sys/class/net/* ; do
if [ -f "$device/address" ]; then if [ -f "$device/address" ]; then
current_mac=$(cat "$device/address") current_mac=$(cat "$device/address")
if [ "$bootif_mac" = "$current_mac" ]; then if [ "$bootif_mac" = "$current_mac" ]; then
DEVICE=${device##*/} DEVICE=${device##*/}
echo "current_mac ($current_mac) of device ($device) equals bootif_mac ($bootif_mac), setting DEVICE to ($DEVICE)" >>/tmp/oginit.log
break break
fi fi
fi fi
done done
else else
echo "variable BOOTIF no exportada, intentamos detectar que interfaz se ha iniciado" >>/tmp/oginit.log #echo "variable BOOTIF no exportada, intentamos detectar que interfaz se ha iniciado"
IP=$ip IP=$ip
echo "IP ($IP)" >>/tmp/oginit.log
#TODO Detectar que interfaz se ha iniciado #TODO Detectar que interfaz se ha iniciado
case "$IP" in case "$IP" in
none|off) none|off)
@ -734,34 +678,29 @@ else
DEVICE=`echo $IP | cut -f6 -d:` DEVICE=`echo $IP | cut -f6 -d:`
;; ;;
esac esac
echo "DEVICE ($DEVICE)" >>/tmp/oginit.log
fi fi
DEVICE=$(ogGetNetworkDevice $DEVICE) DEVICE=$(ogGetNetworkDevice $DEVICE)
echo "DEVICE now ($DEVICE)" >>/tmp/oginit.log
if [ -z "${DEVICE}" ]; then if [ -z "${DEVICE}" ]; then
echo "variable DEVICE con valor $DEVICE no encontrada, llamamos de nuevo a ogconfigure_networking" |tee -a /tmp/oginit.log echo "variable DEVICE con valor $DEVICE no encontrada, llamamos de nuevo a ogconfigure_networking"
ogConfigureNetworking ogConfigureNetworking
fi fi
[ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ] && echo "/run/net-$DEVICE.conf exists" >>/tmp/oginit.log && return 0 [ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ] && return 0
#if [ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ]; then #if [ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ]; then
# echo "variable DEVICE con valor $DEVICE y fichero /run/net-$DEVICE encontrados" |tee -a /tmp/oginit.log # echo "variable DEVICE con valor $DEVICE y fichero /run/net-$DEVICE encontrados"
# return 0 # return 0
#else #else
# echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /run/net-$DEVICE" |tee -a /tmp/oginit.log # echo "variable DEVICE con valor $DEVICE encontrada, procedemos a configurala y a crear el fichero /run/net-$DEVICE"
#fi #fi
# Activamos la interfaz antes de configurar. # Activamos la interfaz antes de configurar.
echo "running 'ip address flush $DEVICE'" >>/tmp/oginit.log
ip address flush $DEVICE ip address flush $DEVICE
echo "running 'ip link set dev $DEVICE up'" >>/tmp/oginit.log
ip link set dev $DEVICE up ip link set dev $DEVICE up
# Si no se detecta señal portadora volver a configurar. # Si no se detecta señal portadora volver a configurar.
sleep 1 sleep 1
CARRIER=$(cat /sys/class/net/${DEVICE}/carrier) CARRIER=$(cat /sys/class/net/${DEVICE}/carrier)
echo "CARRIER ($CARRIER)" >>/tmp/oginit.log if [ "$CARRIER" != "1" ]
if [ "$CARRIER" != "1" ]; then then
ogConfigureNetworking ogConfigureNetworking
fi fi
@ -769,29 +708,27 @@ fi
# Documentation/filesystems/nfsroot.txt # Documentation/filesystems/nfsroot.txt
# Documentation/frv/booting.txt # Documentation/frv/booting.txt
for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do
echo "ROUNDTTT ($ROUNDTTT)" >>/tmp/oginit.log
# The NIC is to be configured if this file does not exist. # 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. # Ip-Config tries to create this file and when it succeds
# creating the file, ipconfig is not run again.
if [ -e /run/net-"${DEVICE}".conf ]; then if [ -e /run/net-"${DEVICE}".conf ]; then
echo "/run/net-$DEVICE.conf exists" >>/tmp/oginit.log
break; break;
fi fi
echo "IP ($IP)" >>/tmp/oginit.log
case "$IP" in case "$IP" in
none|off) none|off)
return 0 return 0
;; ;;
""|on|any) ""|on|any)
# Bring up device # Bring up device
echo "Setting $DEVICE with option:on|any and Variable IP= $IP: ipconfig -t ${ROUNDTTT} ${DEVICE} " |tee -a /tmp/oginit.log echo "Setting $DEVICE with option:on|any and Variable IP= $IP: ipconfig -t ${ROUNDTTT} ${DEVICE} "
ipconfig -t ${ROUNDTTT} ${DEVICE} ipconfig -t ${ROUNDTTT} ${DEVICE}
;; ;;
dhcp|bootp|rarp|both) dhcp|bootp|rarp|both)
echo "Setting $DEVICE with option:dhcp|bootp|rarp|both and Variable IP= $IP: ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} " |tee -a /tmp/oginit.log 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} ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE}
;; ;;
*) *)
echo "Setting $DEVICE with option * and Variable IP= $IP: ipconfig -t ${ROUNDTTT} -d $IP " |tee -a /tmp/oginit.log echo "Setting $DEVICE with option * and Variable IP= $IP: ipconfig -t ${ROUNDTTT} -d $IP "
ipconfig -t ${ROUNDTTT} -d $IP ipconfig -t ${ROUNDTTT} -d $IP
# grab device entry from ip option # grab device entry from ip option
NEW_DEVICE=${IP#*:*:*:*:*:*} NEW_DEVICE=${IP#*:*:*:*:*:*}
@ -801,7 +738,6 @@ for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do
# wrong parse, possibly only a partial string # wrong parse, possibly only a partial string
NEW_DEVICE= NEW_DEVICE=
fi fi
echo "NEW_DEVICE ($NEW_DEVICE)" >>/tmp/oginit.log
if [ -n "${NEW_DEVICE}" ]; then if [ -n "${NEW_DEVICE}" ]; then
DEVICE="${NEW_DEVICE}" DEVICE="${NEW_DEVICE}"
fi fi
@ -810,23 +746,19 @@ for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do
done done
# source ipconfig output # source ipconfig output
echo "DEVICE ($DEVICE)" >>/tmp/oginit.log
if [ -n "${DEVICE}" ]; then if [ -n "${DEVICE}" ]; then
export DEVICE export DEVICE
export DEVICECFG="/run/net-${DEVICE}.conf" export DEVICECFG="/run/net-${DEVICE}.conf"
# En algunos casos, el fichero de configuración está en /tmp. # En algunos casos, el fichero de configuración está en /tmp.
[ ! -f $DEVICECFG -a -f ${DEVICECFG/run/tmp} ] && mv ${DEVICECFG/run/tmp} $DEVICECFG [ ! -f $DEVICECFG -a -f ${DEVICECFG/run/tmp} ] && mv ${DEVICECFG/run/tmp} $DEVICECFG
echo "source'ing DEVICECFG ($DEVICECFG)" >>/tmp/oginit.log
source $DEVICECFG source $DEVICECFG
echo "DEVICE=$DEVICE" >> $CFGINITRD echo "DEVICE=$DEVICE" >> $CFGINITRD
echo "DEVICECFG=$DEVICECFG" >> $CFGINITRD echo "DEVICECFG=$DEVICECFG" >> $CFGINITRD
echo "exportando variable DEVICE con valor = ($DEVICE) y DEVICECFG con valor ($DEVICECFG)" echo "exportando variable DEVICE con valor = $DEVICE y DEVICECFG con valor $DEVICECFG"
# Compatibilidad con versiones anteriores. # Compatibilidad con versiones anteriores.
ln -fs $DEVICECFG /tmp ln -fs $DEVICECFG /tmp
else else
# source any interface as not exaclty specified # source any interface as not exaclty specified
NET_STAR=/run/net-*.conf
echo "source'ing ($NET_STAR)" >>/tmp/oginit.log
source /run/net-*.conf source /run/net-*.conf
fi fi
} }
@ -845,7 +777,6 @@ fi
#*/ ## #*/ ##
ogYesNo() ogYesNo()
{ {
echo "ogYesNo()" >>/tmp/oginit.log
local ans local ans
local ok=0 local ok=0
local timeout=0 local timeout=0

View File

@ -32,12 +32,10 @@
#@date 2013/02/18 #@date 2013/02/18
#*/ #*/
og_ask() {
echo "$1" >>/tmp/oginit.log
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "$1: y/N "; [ $? == 0 ] && sh || echo " "
}
mountroot () { # Parameter: Where to mount the filesystem
mountroot ()
{
[ -f /scripts/VERSION.txt ] && OGVERSION=$(cat /scripts/VERSION.txt) [ -f /scripts/VERSION.txt ] && OGVERSION=$(cat /scripts/VERSION.txt)
OGVERSION=${OGVERSION:-"OpenGnsys Client"} OGVERSION=${OGVERSION:-"OpenGnsys Client"}
echo; echo; echo "$OGVERSION"; echo; echo echo; echo; echo "$OGVERSION"; echo; echo
@ -46,38 +44,42 @@ mountroot () {
#run_scripts /scripts/og-top #run_scripts /scripts/og-top
#[ "$quiet" != "y" ] && log_end_msg #[ "$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/functions
. /scripts/ogfunctions . /scripts/ogfunctions
# If the root device hasn't shown up yet, give it a little while
# to deal with removable devices
sleep 2 sleep 2
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before get OG variables: y/N "
og_ask "Stop before get OG variables" [ $? == 0 ] && sh || echo " "
set -a set -a
log_success_msg "Checking kernel parameters" log_success_msg "Checking kernel parameters"
ogExportKernelParameters ogExportKernelParameters
[ -n "$video" ] && ogChangeVideoResolution # Cambiar resolución de vídeo para kernels que usan el parámetro "video". # Cambiar resolución de vídeo para kernels que usan el parámetro "video".
[ -n "$video" ] && ogChangeVideoResolution
log_success_msg "Checking OpenGnsys Environmnet" log_success_msg "Checking OpenGnsys Environmnet"
ogExportVarEnvironment ogExportVarEnvironment
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure ramfs structure for OG: y/N "
og_ask "Stop before configure ramfs structure for OG" [ $? == 0 ] && sh || echo " "
ogConfigureRamfs ogConfigureRamfs
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure netmoule specified in kernel parameters: y/N "
og_ask "Stop before configure netmoule specified in kernel parameters" [ $? == 0 ] && sh || echo " "
ogLoadNetModule ogLoadNetModule
#[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount" #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
#run_scripts /scripts/og-premount #run_scripts /scripts/og-premount
#[ "$quiet" != "y" ] && log_end_msg #[ "$quiet" != "y" ] && log_end_msg
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure networking: y/N "
og_ask "Stop before configure networking" [ $? == 0 ] && sh || echo " "
if [ -n "$oglive" ]; then if [ -n "$oglive" ]
while !(ping -c 1 $oglive &> /dev/null); do then
while !(ping -c 1 $oglive &> /dev/null)
do
ogConfigureNetworking ogConfigureNetworking
done done
fi fi
@ -86,50 +88,59 @@ mountroot () {
log_success_msg "config loopback" log_success_msg "config loopback"
og_ask "Stop before detect rootserver" [ "$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 " ogGetROOTSERVER && log_success_msg "Get Info from pxe server and ckeck distribuited OG services "
if [ "$ogupdateinitrd" == "true" ]; then if [ "$ogdebug" == "true" -a "$ogupdateinitrd" == "true" ]; then
og_ask "Stop before check updating initrd" ogYesNo --timeout 5 --default no "Stop before check updating initrd: y/N "
[ $? == 0 ] && sh || echo " "
fi fi
# Actualizar Initrd si se solicita o si no se corresponde con su kernel.
if [ "$ogupdateinitrd" == "true" -o ! -d /lib/modules/$(uname -r) ]; then if [ "$ogupdateinitrd" == "true" -o ! -d /lib/modules/$(uname -r) ]; then
ogUpdateInitrd # Actualizar Initrd si se solicita o si no se corresponde con su kernel. ogUpdateInitrd
fi fi
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N "
og_ask "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE" [ $? == 0 ] && sh || echo " "
ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh
# si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE # 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 "
og_ask "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE " [ $? == 0 ] && sh || echo " "
ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE
if [ $? -ne 0 -a "$SRCOGSHARE" != "$DEFOGSHARE" ]; then if [ $? -ne 0 -a "$SRCOGSHARE" != "$DEFOGSHARE" ]; then
ogConnect $OGSERVERSHARE $OGPROTOCOL $DEFOGSHARE $DSTOGSHARE && SRCOGSHARE=$DEFOGSHARE ogConnect $OGSERVERSHARE $OGPROTOCOL $DEFOGSHARE $DSTOGSHARE && SRCOGSHARE=$DEFOGSHARE
fi fi
unset DEFOGSHARE unset DEFOGSHARE
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N "
og_ask "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG " [ $? == 0 ] && sh || echo " "
ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N "
og_ask "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES " [ $? == 0 ] && sh || echo " "
ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES ,ro
og_ask "Stop before doing the postconfiguration" [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N "
[ $? == 0 ] && sh || echo " "
ogPostConfigureFS ogPostConfigureFS
setupcon -k setupcon -k
[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before calling oginit with /etc/inittab: y/N "
[ $? == 0 ] && sh || echo " "
og_ask "Stop before calling oginit with /etc/inittab" if [ "$oginit" ]
if [ "$oginit" ]; then then
echo "exec oginit ($oginit)" >>/tmp/oginit.log
exec $oginit exec $oginit
else else
echo "exec regular init" >>/tmp/oginit.log
exec init exec init
fi fi
} }

View File

@ -1,5 +1,13 @@
# This is run first except when booting in single-user mode # This is run first except when booting in single-user mode
tty1::respawn:/opt/opengnsys/etc/preinit.py #
#::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 tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3 tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4 tty4::respawn:/sbin/getty 38400 tty4

View File

@ -1,14 +1,28 @@
#!/bin/bash #!/bin/bash
# Compatibilidad con los argumentos usados con el browser original: browser -qws http://google.com # Compatibilidad con los argumentos usados con el browser original:
# browser -qws http://google.com
#
while getopts ":qwsDWX" opt ; do while getopts ":qwsDWX" opt ; do
case $opt in case $opt in
q) echo "Ignoring option: -q" ;; q)
w) echo "Ignoring option: -w" ;; echo "Ignoring option: -q"
s) echo "Ignoring option: -s" ;; ;;
D) BROWSER_DEBUG=1 ;; w)
W) DISABLE_WAYLAND=1 ;; echo "Ignoring option: -w"
X) DISABLE_X11=1 ;; ;;
s)
echo "Ignoring option: -s"
;;
D)
BROWSER_DEBUG=1
;;
W)
DISABLE_WAYLAND=1
;;
X)
DISABLE_X11=1
;;
esac esac
done done
@ -28,54 +42,45 @@ if [ -n "BROWSER_DEBUG" ] ; then
echo "" echo ""
fi fi
[ -x "/usr/bin/kitty" ] && wl_terminal=/usr/bin/kitty [ -x "/usr/bin/kitty" ] && wl_terminal=/usr/bin/kitty
[ -x "/usr/bin/foot" ] && wl_terminal=/usr/bin/foot [ -x "/usr/bin/foot" ] && wl_terminal=/usr/bin/foot
#[ -x "/usr/bin/xterm" ] && x11_terminal=/usr/bin/kitty
#[ -x "/usr/bin/i3-sensible-terminal" ] && x11_terminal=/usr/bin/i3-sensible-terminal
# --- El navegador y flags (QtWebEngine/Chromium) --- [ -x "/usr/bin/xterm" ] && x11_terminal=/usr/bin/kitty
# Seguridad: desactiva CORS [ -x "/usr/bin/i3-sensible-terminal" ] && x11_terminal=/usr/bin/i3-sensible-terminal
# The admin page is hosted remotely but executes things on localhost
QTWEBENGINE_CHROMIUM_FLAGS="--disable-web-security" QTWEBENGINE_CHROMIUM_FLAGS="--disable-web-security"
# Estabilidad en entornos sin GPU/GL y con /dev/shm limitado:
QTWEBENGINE_CHROMIUM_FLAGS+=" --disable-gpu --use-gl=disabled --disable-gpu-compositing" [ "$UID" -eq "0" ] && QTWEBENGINE_CHROMIUM_FLAGS="${QTWEBENGINE_CHROMIUM_FLAGS} --no-sandbox"
QTWEBENGINE_CHROMIUM_FLAGS+=" --disable-features=VaapiVideoDecoder,AcceleratedVideoDecode,CanvasOopRasterization,UseSkiaRenderer"
QTWEBENGINE_CHROMIUM_FLAGS+=" --disable-dev-shm-usage"
# Root: Chromium exige --no-sandbox
if [ "$EUID" -eq 0 ]; then
QTWEBENGINE_CHROMIUM_FLAGS+=" --no-sandbox"
fi
export QTWEBENGINE_CHROMIUM_FLAGS export QTWEBENGINE_CHROMIUM_FLAGS
# Entorno Qt (software puro; X11 por xcb) rm -rf "/run/sway.started" "/run/x11.started"
export QT_QPA_PLATFORM=xcb
export QSG_RHI_BACKEND=software
export QT_QUICK_BACKEND=software
export LIBGL_ALWAYS_SOFTWARE=1
export QT_XCB_GL_INTEGRATION=none
## sway
mkdir -p $HOME/.config/sway mkdir -p $HOME/.config/sway
echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\"" > $HOME/.config/sway/config echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\" || /usr/bin/browser -qws \"$browser_args\"" > $HOME/.config/sway/config
if [ -n "BROWSER_DEBUG" ] ; then if [ -n "BROWSER_DEBUG" ] ; then
echo "bindsym Mod4+Return exec $wl_terminal" >> $HOME/.config/sway/config echo "bindsym Mod4+Return exec $wl_terminal" >> $HOME/.config/sway/config
echo "bindsym Control+Alt+Backspace exit" >> $HOME/.config/sway/config echo "bindsym Control+Alt+Backspace exit" >> $HOME/.config/sway/config
fi fi
echo "exec touch /run/sway.started" >> $HOME/.config/sway/config echo "exec touch /run/sway.started" >> $HOME/.config/sway/config
## i3
mkdir -p $HOME/.config/i3 mkdir -p $HOME/.config/i3
echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\"" > $HOME/.config/i3/config echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\" || /usr/bin/browser -qws \"$browser_args\"" > $HOME/.config/i3/config
if [ -n "BROWSER_DEBUG" ] ; then if [ -n "BROWSER_DEBUG" ] ; then
echo "bindsym Mod4+Return exec i3-sensible-terminal" >> $HOME/.config/i3/config echo "bindsym Mod4+Return exec i3-sensible-terminal" >> $HOME/.config/i3/config
echo "bindsym Control+Mod1+BackSpace exit" >> $HOME/.config/i3/config echo "bindsym Control+Mod1+BackSpace exit" >> $HOME/.config/i3/config
fi fi
echo "exec touch /run/x11.started" >> $HOME/.config/i3/config echo "exec touch /run/x11.started" >> $HOME/.config/i3/config
## xinitrc echo "exec /usr/bin/i3" > $HOME/.xinitrc
if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then eval $(cat /proc/$(pidof OGAgent)/environ |sed -e 's/\x00/\x0a/g' |grep DBUS_SESSION_BUS_ADDRESS); fi
echo "export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" > $HOME/.xinitrc
echo "exec /usr/bin/i3" >> $HOME/.xinitrc
echo "exec /usr/bin/xterm" >> $HOME/.xinitrc echo "exec /usr/bin/xterm" >> $HOME/.xinitrc
@ -83,9 +88,6 @@ echo "exec /usr/bin/xterm" >> $HOME/.xinit
/usr/bin/udevadm trigger /usr/bin/udevadm trigger
## go
rm -rf "/run/sway.started" "/run/x11.started"
if [ -x "/usr/bin/sway" -a -z "$DISABLE_WAYLAND" ] ; then if [ -x "/usr/bin/sway" -a -z "$DISABLE_WAYLAND" ] ; then
echo "*** Trying to launch Sway ***" echo "*** Trying to launch Sway ***"
/usr/bin/sway /usr/bin/sway
@ -110,3 +112,5 @@ if [ ! -f "/run/sway.started" -a ! -f "/run/x11.started" ] ; then
else else
echo "All done." echo "All done."
fi fi

View File

@ -70,6 +70,11 @@ isolinux_template =
basic = basic =
dialog man-db fbset gdebi-core bash-static busybox-static locales lshw gawk git python3-openssl python3 php-cli dmidecode rpm sqlite3 os-prober moreutils jq dialog man-db fbset gdebi-core bash-static busybox-static locales lshw gawk git python3-openssl python3 php-cli dmidecode rpm sqlite3 os-prober moreutils jq
#console-data # ogLive anterior a Ubuntu 20.04
#subversion # ogLive anterior a Ubuntu 18.04
#php5-cli # ogLive anterior a Ubuntu 16.04
#realpath # ogLive hasta Ubuntu 16.04
#zypper # PROBAR
cloning = fsarchiver pv cloning = fsarchiver pv
#pxe-kexec # ubuntu noble: Unable to locate package #pxe-kexec # ubuntu noble: Unable to locate package
@ -77,6 +82,7 @@ cloning = fsarchiver pv
compile = compile =
build-essential libattr1 libattr1-dev uuid-dev attr make m4 gettext libmhash-dev build-essential libattr1 libattr1-dev uuid-dev attr make m4 gettext libmhash-dev
#libattr* # Satura el tamaño del archivo en Ubuntu 15.04
compressor = lzma zip unzip gzip lzop pigz pbzip2 lbzip2 rzip p7zip-full compressor = lzma zip unzip gzip lzop pigz pbzip2 lbzip2 rzip p7zip-full
@ -90,20 +96,33 @@ filesystem_local =
android-tools-adb # ogLive a partir de Ubuntu 16.04 android-tools-adb # ogLive a partir de Ubuntu 16.04
android-tools-fastboot # ogLive a partir de Ubuntu 16.04 android-tools-fastboot # ogLive a partir de Ubuntu 16.04
f2fs-tools f2fs-tools
#drbl-ntfsprogs # Eliminado
#ntfs-config # ogLive anterior a Ubuntu 20.04
#btrfs-tools # ogLive anterior a Ubuntu 20.04
#ufsutils # ogLive anterior a Ubuntu 14.04
#zfsutils # ogLive anterior a Ubuntu 16.04
#android-tools-fsutils # ogLive entre Ubuntu 16.04 y Ubuntu 20.04
filesystem_remote = filesystem_remote =
sshfs cifs-utils smbclient open-iscsi openssh-server sshfs cifs-utils smbclient open-iscsi openssh-server
#nfs-common # Provoca error de instalación en Ubuntu 15.04
#bittornado # ogLive anterior a Ubuntu 20.04
monitoring = htop ncdu bwbar bmon iftop ifstat dstat hdparm sdparm blktool testdisk kitty-terminfo monitoring = htop ncdu bwbar bmon iftop ifstat dstat hdparm sdparm blktool testdisk kitty-terminfo
networking = netpipes curl wget tftp-hpa dnsutils networking = netpipes curl wget tftp-hpa dnsutils
#trickle # ubuntu noble: has no installation candidate #trickle # ubuntu noble: has no installation candidate
lighttpd ethtool ssmping tcpdump nmap arping ntpdate udpcast aria2 mktorrent #iptraf lighttpd ethtool ssmping tcpdump nmap arping ntpdate ctorrent udpcast aria2 #iptraf
testing = testing =
screen schroot xmlstarlet screen schroot xmlstarlet
efibootmgr efitools refind grub-efi-amd64-bin grub-efi-ia32-bin grub-pc-bin ## UEFI efibootmgr efitools refind grub-efi-amd64-bin grub-efi-ia32-bin grub-pc-bin ## UEFI
#libxss1 python-prctl python-six python-requests ## OGAgent
##############
fusioninventory-agent nvme-cli disktype laptop-detect fusioninventory-agent nvme-cli disktype laptop-detect
#discover casper lupin-casper xinit obconf xserver-xorg x11-xserver-utils xterm network-manager-gnome plymouth-x11 plymouth-label plymouth-theme-ubuntu-logo pcmanfm chromium-browser gtk-theme-switch gtk2-engines murrine-themes
####################################3
#gnome-icon-theme gnome-brave-icon-theme dmz-cursor-theme python-wnck python-xlib python-pyinotify python-alsaaudio python-vte maximus gpicview leafpad lxappearance lxmenu-data lxrandr lxterminal nitrogen ttf-ubuntu-font-family time synaptic libglib-perl libgtk2-perl libxml-simple-perl smartmontools gnome-disk-utility policykit-1-gnome policykit-desktop-privileges baobab lshw-gtk usb-creator-gtk wodim curlftpfs libnotify-bin cryptsetup system-config-lvm
xwindows = xwindows =
v86d # VESA Kernel 3.7+ v86d # VESA Kernel 3.7+
@ -112,8 +131,8 @@ xwindows =
#roxterm gparted #+80M #roxterm gparted #+80M
#openbox midori #xvesa en compilacion #openbox midori #xvesa en compilacion
ogagent = stunnel4 filebeat ogagent ogagent = stunnel4
ogbrowser = sway libinput-tools hwdata ogbrowser ogbrowser = sway libinput-tools hwdata ogbrowser
oggit = python3 python3-git python3-pyxattr python3-libarchive-c python3-pylibacl python3-pip python3-hivex opengnsys-libarchive-c python3-termcolor bsdextrautils opengnsys-pyblkid ntfs-3g-system-compression python3-tqdm oggit = python3 python3-git python3-pyxattr python3-libarchive-c python3-pylibacl python3-pip python3-hivex opengnsys-libarchive-c python3-termcolor bsdextrautils opengnsys-pyblkid opengnsys-gitlib ntfs-3g-system-compression python3-tqdm

View File

@ -1,17 +1,10 @@
[IMGogclient] [IMGogclient]
type=loopback type=loopback
file=/var/lib/tftpboot/ogclient/ogclient.img file=/var/lib/tftpboot/ogclient/ogclient.img
mount-options=-o offset=32256
description=ogclient Ubuntu image description=ogclient Ubuntu image
#priority=1
users=root users=root
groups=root groups=root
root-groups=root root-groups=root
mount-options=-o offset=32256
root-users=root root-users=root
## man 5 schroot.conf
## "In addition to the configuration keys listed above, it is possible to add custom keys. These keys will be used to add additional environment variables to the setup script environment when setup scripts are run"
## We need this because in chroot-tasks.py setup_resolvconf2() we create a symlink /etc/resolv.conf -> /run/resolvconf/resolv.conf
## On the second run of the jenkins job, with REUSE_PREV_FS = true, schroot tries to copy /etc/resolv.conf but it now points to a non-existent file, making schroot fail
## With this line, we tell schroot not to copy any files to the chroot
setup.copyfiles=