Compare commits
142 Commits
Author | SHA1 | Date |
---|---|---|
|
5e7b60366f | |
|
a142bb2729 | |
|
aa5efb52a3 | |
|
a64968d57f | |
|
84c7aa8e29 | |
|
2a92557bbc | |
|
b410403ea5 | |
|
5ea6489b41 | |
|
155f4b95b8 | |
|
4ae16782ca | |
|
5321325142 | |
|
4c191aa730 | |
|
e3f5470fce | |
|
13ebbc2939 | |
|
9cc67bbf1f | |
|
78f27b724e | |
|
b78fb6f900 | |
|
0f2cb4aefe | |
|
5541e39b5f | |
|
4f0543fe79 | |
|
a5eacbe203 | |
|
a34c98eb4c | |
|
c55a75f5ce | |
|
1bf1283aff | |
|
d5279eba42 | |
|
87fb51ed2a | |
|
c9c9e98359 | |
|
62ed2e3dde | |
|
7cefe8ff43 | |
|
9fc48067e6 | |
|
13b262d8f7 | |
|
e43e8baea1 | |
|
d619cb005d | |
|
6d5dea6657 | |
|
d5fe20d291 | |
|
c7081b3921 | |
|
6c543660f9 | |
|
594314161e | |
|
7c326e7114 | |
|
944390806b | |
|
461c5faed5 | |
|
a9a2d19653 | |
|
e80ed538b8 | |
|
857ebbd267 | |
|
03f8203598 | |
|
3fd94ecb8f | |
|
d2ef8a98f2 | |
|
8af4627e28 | |
|
b64b6d79b3 | |
|
efc22c1bcd | |
|
36bf1539d6 | |
|
f2c4371e1e | |
|
39b947e598 | |
|
0a26ebd946 | |
|
4061f85704 | |
|
928dedfeeb | |
|
357c94e9ea | |
|
df7d8d96cb | |
|
4df8caa203 | |
|
fa8e94e688 | |
|
65a3b862f7 | |
|
05279ba7c5 | |
|
15a238c206 | |
|
93e349105a | |
|
d733d04b69 | |
|
e83e0e6e16 | |
|
972c2a7c8c | |
|
def329436d | |
|
29cc09105e | |
|
64c5eeae6e | |
|
1050133d59 | |
|
d76390a7b9 | |
|
afe190c47d | |
|
9d1224e0c8 | |
|
02b6708442 | |
|
d7fa82636a | |
|
bc89ddd711 | |
|
4e3740287a | |
|
ab5544203d | |
|
50716302dd | |
|
3796221fb0 | |
|
8a3a2b4084 | |
|
d80695ccb8 | |
|
2064b787c4 | |
|
cf13a6da72 | |
|
867508d5ee | |
|
4a94875d7e | |
|
3d2f06d577 | |
|
6c88096eae | |
|
ed070bc566 | |
|
fd59bdc7fa | |
|
cbb978e514 | |
|
e1b8e5c625 | |
|
03827cdc58 | |
|
9a48940800 | |
|
6958c658e8 | |
|
06885b35d7 | |
|
b9a2c58c96 | |
|
24f5461860 | |
|
0961ec10be | |
|
9514ce6b25 | |
|
eb88929f86 | |
|
6a18e1a0ba | |
|
94ee50eff5 | |
|
41f0efbf5c | |
|
7624964ba1 | |
|
c3e86b7dc0 | |
|
a18e861bea | |
|
842dbf48c2 | |
|
d79c677f16 | |
|
bd056438a1 | |
|
fb665fa4ca | |
|
c76fd8388a | |
|
fac6e142f6 | |
|
e20bd46edb | |
|
f785143b73 | |
|
bf85cb1fed | |
|
e885302256 | |
|
ad3388d36e | |
|
46238456cb | |
|
0179d106e9 | |
|
697c60f812 | |
|
4353c74768 | |
|
2c18e6981f | |
|
c1f123b489 | |
|
1f92f54994 | |
|
bbaa6578e1 | |
|
e1a1be667b | |
|
44511c79a0 | |
|
a1493a827e | |
|
0352e3a2cc | |
|
e76fe57b1b | |
|
793705953f | |
|
782e5c8978 | |
|
0e979c46fa | |
|
6cbe28272f | |
|
565e3d4091 | |
|
5e9fb86f9f | |
|
df16663594 | |
|
48f6a41838 | |
|
288aa9cf09 | |
|
9847cad6a9 |
366
CHANGELOG.md
|
@ -5,6 +5,372 @@ 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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.22.3] - 2025-06-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Don't copy grub.cfg
|
||||
|
||||
## [0.22.2] - 2025-06-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- Don't check rc of updateBootCache.py because we may have no cache partition
|
||||
|
||||
## [0.22.1] - 2025-06-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- Included some changes that should be in the previous version
|
||||
|
||||
## [0.22.0] - 2025-06-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed torrent client from ctorrent to aria2c
|
||||
- Updated ogCreateTorrent function replaced ctorrent with mktorrent
|
||||
|
||||
## [0.21.1] - 2025-06-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed syntax and other errors
|
||||
|
||||
## [0.21.0] - 2025-06-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Prevent Configurar.py from messing with the browser
|
||||
|
||||
## [0.20.3] - 2025-06-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed bugs when partitioning disks
|
||||
|
||||
## [0.20.2] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Do a couple of ogExecAndLog()s also when creating images
|
||||
|
||||
## [0.20.1] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix mark for ogboot on linux
|
||||
|
||||
## [0.20.0] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- In order to have /tmp/command.log updated in realtime, ogExecAndLog now spawns a subprocess rather than calling functions directly
|
||||
|
||||
## [0.19.2] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Write a mark for ogboot on linux only
|
||||
|
||||
## [0.19.1] - 2025-06-23
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed path of EFI boot entry
|
||||
|
||||
## [0.19.0] - 2025-06-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Write a mark for ogboot
|
||||
|
||||
## [0.18.2] - 2025-06-19
|
||||
|
||||
### Fixed
|
||||
|
||||
- Accept None as partition type
|
||||
|
||||
## [0.18.1] - 2025-06-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Look for grub.cfg in two places rather than one
|
||||
|
||||
## [0.18.0] - 2025-06-16
|
||||
|
||||
### Added
|
||||
|
||||
- Added scripts and libs for oggit
|
||||
|
||||
## [0.17.0] - 2025-06-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed useless warning about /dev/loop0
|
||||
- Fix windows EFI booting, and a typo
|
||||
|
||||
## [0.16.0] - 2025-06-12
|
||||
|
||||
### Changed
|
||||
|
||||
- Gave some care to the "Custom" scripts
|
||||
|
||||
## [0.15.3] - 2025-06-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Create missing dir
|
||||
|
||||
## [0.15.2] - 2025-06-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed a condition check
|
||||
|
||||
## [0.15.1] - 2025-06-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Add a missing "import"
|
||||
- Fix retrieving windows version from the registry
|
||||
- Fix bug while building the "Part-01-01" string
|
||||
- Removed obsolete unused "bootOS" scripts (with a capital "S")
|
||||
|
||||
## [0.15.0] - 2025-06-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove opengnsys bash functions from the agent's environment
|
||||
|
||||
## [0.14.2] - 2025-06-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Get rc of bash pipelines in ProtocolLib
|
||||
|
||||
## [0.14.1] - 2025-06-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed rc management in deployImage.py
|
||||
|
||||
## [0.14.0] - 2025-06-07
|
||||
|
||||
### Changed
|
||||
|
||||
- Read $ogusetls and $ogverifytls from the environment and configure stunnel accordingly
|
||||
|
||||
## [0.13.9] - 2025-06-04
|
||||
|
||||
### Fixed
|
||||
|
||||
- Copy grub.cfg so that grub finds the config upon boot
|
||||
|
||||
## [0.13.8] - 2025-06-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Paid attention to return codes between python (True for success) and shell (0 for success)
|
||||
|
||||
## [0.13.7] - 2025-06-02
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed management of the "multicast session" parameter
|
||||
|
||||
## [0.13.6] - 2025-06-02
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed variable name in restoreImage.py
|
||||
|
||||
## [0.13.5] - 2025-05-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Return a true value from the unicast/multicast methods
|
||||
- Fully qualify a method call
|
||||
|
||||
## [0.13.4] - 2025-05-28
|
||||
|
||||
### Changed
|
||||
|
||||
- Show sgdisk output
|
||||
|
||||
## [0.13.3] - 2025-05-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- unlink() only existing files
|
||||
|
||||
## [0.13.2] - 2025-05-28
|
||||
|
||||
### Changed
|
||||
|
||||
- Point urlMenu back to the localhost stunnel
|
||||
|
||||
## [0.13.1] - 2025-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Make dbus envvar available to the agent
|
||||
|
||||
## [0.13.0] - 2025-05-19
|
||||
|
||||
### Added
|
||||
|
||||
- Run dbus
|
||||
|
||||
## [0.12.0] - 2025-05-18
|
||||
|
||||
### Changed
|
||||
|
||||
- no tls for the urlmenu either
|
||||
|
||||
## [0.11.0] - 2025-05-18
|
||||
|
||||
### Added
|
||||
|
||||
- Run stunnel and point the browser to it
|
||||
|
||||
## [0.10.0] - 2025-05-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Run the new browser
|
||||
|
||||
## [0.9.0] - 2025-05-09
|
||||
|
||||
### Added
|
||||
|
||||
- Use zstd when creating and restoring images
|
||||
|
||||
## [0.8.4] - 2025-05-09
|
||||
|
||||
### Added
|
||||
|
||||
- When restoring an image, include the image name in the ogagent configuration file
|
||||
|
||||
## [0.8.3] - 2025-05-08
|
||||
|
||||
### Fixed
|
||||
|
||||
- Have ogNvramAddEntry() handle EFI entries with spaces in them
|
||||
|
||||
## [0.8.2] - 2025-05-07
|
||||
|
||||
### Changed
|
||||
|
||||
- Have Configurar.py ignore the tch parameter, take cache size from the definition of the cache partition
|
||||
|
||||
## [0.8.1] - 2025-05-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Gracefully handle error in ogBoot() when not finding /boot partition in target's fstab
|
||||
|
||||
## [0.8.0] - 2025-04-23
|
||||
|
||||
### Added
|
||||
|
||||
- Have the oglive agent send /stopped on poweroff or restart
|
||||
|
||||
## [0.7.2] - 2025-04-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Have the partitioning functions return a meaningful rc
|
||||
|
||||
## [0.7.1] - 2025-04-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- getConfiguration.py: don't fail if NTFS filesystems are mounted ro
|
||||
|
||||
## [0.7.0] - 2025-04-15
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed references to ogGlobals.OGLOG in python code
|
||||
|
||||
## [0.6.1] - 2025-04-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed capturing of partclone output and management of return value
|
||||
|
||||
## [0.6.0] - 2025-04-15
|
||||
|
||||
### Changed
|
||||
|
||||
- ogGetIpAddress() is no longer required in ogGlobals--move it back into NetLib
|
||||
|
||||
## [0.5.0] - 2025-04-15
|
||||
|
||||
### Changed
|
||||
|
||||
- Log to /var/log/clone-engine.log and clone-engine.json.log
|
||||
|
||||
## [0.4.1] - 2025-04-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- restoreImage.py: return negated rc to the shell
|
||||
|
||||
## [0.4.0] - 2025-04-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Make /opt/opengnsys writable in clients, just like it used to be
|
||||
|
||||
## [0.3.6] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed ogReduceFs
|
||||
|
||||
## [0.3.5] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed syntax
|
||||
|
||||
## [0.3.4] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed usage of ogEcho in FileSystemLib
|
||||
|
||||
## [0.3.3] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Kill coproc'ed browser in all execution branches in Configurar.py
|
||||
|
||||
## [0.3.2] - 2025-04-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Handle invalid number of arguments pass to functions/ogCopyFile
|
||||
|
||||
## [0.3.1] - 2025-04-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed invocation to ogCheckIpAddress in interfaceAdm/CrearImagen.py
|
||||
|
||||
## [0.3.0] - 2025-04-03
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed burg and rsync 3.1
|
||||
|
||||
## [0.2.6] - 2025-03-31
|
||||
|
||||
### Fixed
|
||||
|
||||
- Restore qt4 browser
|
||||
|
||||
## [0.2.5] - 2025-03-31
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -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/ogclient', 'nightly', versionPattern)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[ogclient]
|
||||
comment = OpenGnsys Client
|
||||
browseable = no
|
||||
writeable = no
|
||||
writeable = yes
|
||||
locking = no
|
||||
path = /opt/opengnsys/ogclient
|
||||
guest ok = no
|
||||
|
|
|
@ -21,20 +21,26 @@ echo "${MSG_LAUNCHCLIENT:-.}"
|
|||
if [ -f "/usr/share/OGAgent/opengnsys/linux/OGAgentService.py" -a "$ogstatus" != "offline" ]; then
|
||||
# Ejecutar servicio cliente.
|
||||
cd /usr/share/OGAgent
|
||||
export OGAGENTCFG_OGCORE_IP=$ogcore
|
||||
export OGAGENTCFG_OGCORE_IP=$ogcore
|
||||
export OGAGENTCFG_OGLOG_IP=$oglog
|
||||
export OGAGENTCFG_URLMENU_IP=$ogcore
|
||||
python3 -m opengnsys.linux.OGAgentService fg
|
||||
export OGAGENTCFG_URLMENU_SCHEME=http
|
||||
export OGAGENTCFG_URLMENU_IP=127.0.0.1
|
||||
export OGAGENTCFG_URLMENU_PORT=81
|
||||
(
|
||||
## remove bash functions and some OG vars from the agent's environment
|
||||
unset -f $(declare -F |awk '/og[A-Z]|NT[A-Z]/ { print $3 }')
|
||||
unset $(declare |awk -F= '/^MSG_|^OG_ERR_/ { print $1 }')
|
||||
python3 -m opengnsys.linux.OGAgentService fg
|
||||
)
|
||||
else
|
||||
for FILE in index $OGGROUP $(ogGetIpAddress)
|
||||
do
|
||||
[ -f $OGCAC/menus/$FILE.html ] && OGMENU="$OGCAC/menus/$FILE.html"
|
||||
done
|
||||
echo "exec /usr/bin/OGBrowser $OGMENU" > /home/root/
|
||||
/usr/bin/OGBrowser -qws $OGMENU
|
||||
$OPENGNSYS/bin/launch_browser $OGMENU
|
||||
fi
|
||||
|
||||
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
|
||||
if [ "$ogactiveadmin" == "true" ]; then
|
||||
bash
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -6,7 +6,7 @@ source /opt/opengnsys/etc/preinit/loadenviron.sh
|
|||
|
||||
# Scripts de inicio.
|
||||
for f in fileslinks loadmodules metadevs mountrepo poweroff otherservices; do
|
||||
$OGETC/preinit/$f.sh
|
||||
source $OGETC/preinit/$f.sh
|
||||
done
|
||||
unset f
|
||||
|
||||
|
|
|
@ -13,6 +13,58 @@ ogIsEfiActive && mount -t efivarfs none /sys/firmware/efi/efivars
|
|||
# Lanzar servicios complementarios del cliente.
|
||||
echo "${MSG_OTHERSERVICES:-.}"
|
||||
|
||||
# stunnel start
|
||||
cat >/etc/stunnel/menu.conf <<__EOF__
|
||||
setuid = stunnel4
|
||||
setgid = stunnel4
|
||||
pid = /var/run/stunnel4/menu.pid
|
||||
foreground = yes
|
||||
debug = info
|
||||
|
||||
[menu]
|
||||
client = yes
|
||||
accept = 127.0.0.1:81
|
||||
connect = $ogcore:8443
|
||||
__EOF__
|
||||
if [[ true == "$ogusetls" ]]; then
|
||||
if [[ true == "$ogverifytls" ]]; then
|
||||
## use tls and verify
|
||||
cat >>/etc/stunnel/menu.conf <<__EOF__
|
||||
cert = /opt/opengnsys/etc/ogagent.crt
|
||||
key = /opt/opengnsys/etc/ogagent.key
|
||||
CAfile = /opt/opengnsys/etc/ca.crt
|
||||
requireCert = yes
|
||||
verifyChain = yes
|
||||
__EOF__
|
||||
else
|
||||
## use tls but not verify
|
||||
cat >>/etc/stunnel/menu.conf <<__EOF__
|
||||
cert = /opt/opengnsys/etc/ogagent.crt
|
||||
key = /opt/opengnsys/etc/ogagent.key
|
||||
CAfile = /opt/opengnsys/etc/ca.crt
|
||||
requireCert = no
|
||||
verifyChain = no
|
||||
__EOF__
|
||||
fi
|
||||
else
|
||||
## don't use tls
|
||||
cat >>/etc/stunnel/menu.conf <<__EOF__
|
||||
requireCert = no
|
||||
verifyChain = no
|
||||
__EOF__
|
||||
fi
|
||||
mkdir -p /var/run/stunnel4; chown stunnel4:stunnel4 /var/run/stunnel4
|
||||
stunnel /etc/stunnel/menu.conf &>/var/log/stunnel4/menu.log &
|
||||
# stunnel end
|
||||
|
||||
# Iniciar dbus
|
||||
if [ -e /etc/dbus-1/system.d/ogbrowser.conf ]; then
|
||||
mkdir -p /run/dbus
|
||||
DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --print-address --system --nosyslog)
|
||||
export DBUS_SESSION_BUS_ADDRESS
|
||||
dbus-monitor --system &>/var/log/dbus-monitor.log &
|
||||
fi
|
||||
|
||||
# Iniciar rsyslog, si es necesario.
|
||||
[ -S /dev/log ] || service rsyslog start
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ if 5 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
|
||||
elif 7 == len (sys.argv):
|
||||
parser.add_argument ('src_disk')
|
||||
parser.add_argument ('src_par')
|
||||
|
@ -29,6 +30,31 @@ elif 7 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'disk': args.src_disk, 'par': args.src_par, 'file': args.src_file }
|
||||
dst = { 'disk': args.dst_disk, 'par': args.dst_par, 'file': args.dst_file }
|
||||
|
||||
elif 4 == len (sys.argv):
|
||||
## can be either:
|
||||
## - src_container src_file dst_file
|
||||
## - src_file dst_container dst_file
|
||||
if 'REPO' == sys.argv[1] or 'CACHE' == sys.argv[1]:
|
||||
## we are in "src_container src_file dst_file"
|
||||
parser.add_argument ('src_container')
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_file')
|
||||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'file': args.dst_file }
|
||||
elif 'REPO' == sys.argv[2] or 'CACHE' == sys.argv[2]:
|
||||
## we are in "src_file dst_container dst_file"
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_container')
|
||||
parser.add_argument ('dst_file')
|
||||
args = parser.parse_args()
|
||||
src = { 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
else:
|
||||
ogHelp ('ogCopyFile', 'ogCopyFile [ str_repo | int_ndisk int_npartition ] path_source [ str_repo | int_ndisk int_npartition ] path_target', ['ogCopyFile REPO newfile.txt 1 2 /tmp/newfile.txt'])
|
||||
sys.exit (1)
|
||||
|
||||
elif 6 == len (sys.argv):
|
||||
## can be either:
|
||||
## - src_disk src_par src_file dst_container dst_file
|
||||
|
@ -36,7 +62,7 @@ elif 6 == len (sys.argv):
|
|||
|
||||
try:
|
||||
num = int (sys.argv[1]) ## raises ValueError if sys.argv[1] doesn't look like a number
|
||||
## "src_disk src_par src_file dst_container dst_file"
|
||||
## we are in "src_disk src_par src_file dst_container dst_file"
|
||||
parser.add_argument ('src_disk')
|
||||
parser.add_argument ('src_par')
|
||||
parser.add_argument ('src_file')
|
||||
|
@ -46,7 +72,7 @@ elif 6 == len (sys.argv):
|
|||
src = { 'disk': args.src_disk, 'par': args.src_par, 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
except:
|
||||
## "src_container src_file dst_disk dst_par dst_file"
|
||||
## we are in "src_container src_file dst_disk dst_par dst_file"
|
||||
parser.add_argument ('src_container')
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_disk')
|
||||
|
@ -55,6 +81,9 @@ elif 6 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'disk': args.dst_disk, 'par': args.dst_par, 'file': args.dst_file }
|
||||
else:
|
||||
ogHelp ('ogCopyFile', 'ogCopyFile [ str_repo | int_ndisk int_npartition ] path_source [ str_repo | int_ndisk int_npartition ] path_target', ['ogCopyFile REPO newfile.txt 1 2 /tmp/newfile.txt'])
|
||||
sys.exit (1)
|
||||
|
||||
ret = ogCopyFile (src, dst)
|
||||
if ret is not None:
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
os.system ('pkill -f OGAgent')
|
||||
time.sleep (3)
|
||||
os.system ('poweroff')
|
||||
sys.exit (0)
|
||||
|
|
|
@ -35,10 +35,6 @@ prog = os.path.basename(__name__)
|
|||
# El parámetro $2 es el que aporta toda la información y el $1 se queda obsoleto
|
||||
# Formato de entrada:
|
||||
# dis=Número de disco
|
||||
# *=caracter de separación
|
||||
# che=Vale 0 o 1
|
||||
# *=caracter de separación
|
||||
# $tch=tamaño cache
|
||||
# != caracter de separación
|
||||
#
|
||||
# Y un numero indeterminado de cadenas del tipo siguuenteseparadas por el caracter '$':
|
||||
|
@ -47,13 +43,10 @@ prog = os.path.basename(__name__)
|
|||
#____________________________________________________________________
|
||||
|
||||
# Captura de parámetros (se ignora el 1er parámetro y se eliminan espacios y tabuladores).
|
||||
#param='dis=1*che=0*tch=70000000!par=1*cpt=NTFS*sfi=NTFS*tam=11000000*ope=0%'
|
||||
#param='dis=1!par=1*cpt=NTFS*sfi=NTFS*tam=11000000*ope=0%'
|
||||
#param = ''.join(sys.argv[2:]).replace(' ', '').replace('\t', '')
|
||||
param = sys.argv[2]
|
||||
|
||||
# Activa navegador para ver progreso
|
||||
coproc = subprocess.Popen (['/opt/opengnsys/bin/browser', '-qws', 'http://localhost/cgi-bin/httpd-log.sh'])
|
||||
|
||||
# Leer los dos bloques de parámetros, separados por '!'.
|
||||
tbprm = param.split ('!')
|
||||
pparam = tbprm[0] # General disk parameters
|
||||
|
@ -67,16 +60,15 @@ for item in tbprm:
|
|||
if '=' not in item: continue
|
||||
|
||||
k, v = item.split ('=', 1)
|
||||
if k not in ['dis', 'tch']:
|
||||
if k not in ['dis']:
|
||||
print (f'ignoring unknown disk parameter ({k})')
|
||||
continue
|
||||
|
||||
if 'dis' == k: dis = int (v)
|
||||
elif 'tch' == k: tch = v
|
||||
if 'dis' == k: dis = int (v)
|
||||
|
||||
# Error si no se define el parámetro de disco (dis).
|
||||
if dis is None: sys.exit (ogGlobals.OG_ERR_FORMAT)
|
||||
if tch is None: tch = '0'
|
||||
if dis is None:
|
||||
sys.exit (ogGlobals.OG_ERR_FORMAT)
|
||||
|
||||
# Toma valores de distribución de particiones, separados por "%".
|
||||
tbp = [] # Valores de configuración (parámetros para ogCreatePartitions)
|
||||
|
@ -105,16 +97,19 @@ for item in tbprm:
|
|||
elif 'ope' == k: ope = int (v)
|
||||
|
||||
missing_params = []
|
||||
if par is None: missing_params.append ('par')
|
||||
if cpt is None: missing_params.append ('cpt')
|
||||
if sfi is None: missing_params.append ('sfi')
|
||||
if tam is None: missing_params.append ('tam')
|
||||
if par is None or 'None' == par: missing_params.append ('par')
|
||||
if cpt is None or 'None' == cpt: missing_params.append ('cpt')
|
||||
if sfi is None or 'None' == sfi: missing_params.append ('sfi')
|
||||
if tam is None or 'None' == tam: missing_params.append ('tam')
|
||||
if missing_params:
|
||||
print (f'partition data ({item}) missing required parameters ({' '.join (missing_params)})')
|
||||
sys.exit (1)
|
||||
|
||||
# Componer datos de particionado.
|
||||
if 'CACHE' != cpt: tbp.append (f'{cpt}:{tam}')
|
||||
if 'CACHE' == cpt:
|
||||
tch = tam
|
||||
else:
|
||||
tbp.append (f'{cpt}:{tam}')
|
||||
if ope:
|
||||
# Si se activa operación de formatear, componer datos de formateo.
|
||||
if cpt not in ['EMPTY', 'EXTENDED', 'LINUX-LVM', 'LVM', 'ZPOOL']:
|
||||
|
@ -122,6 +117,9 @@ for item in tbprm:
|
|||
# Obtener la partición mayor.
|
||||
if par > maxp: maxp = par
|
||||
|
||||
if tch is None:
|
||||
tch = '0'
|
||||
|
||||
#____________________________________________________
|
||||
#
|
||||
# Proceso
|
||||
|
@ -140,27 +138,26 @@ cur_ptt = DiskLib.ogGetPartitionTableType (dis)
|
|||
ptt = 'GPT' if InventoryLib.ogIsEfiActive() else 'MSDOS'
|
||||
if not cur_ptt or ptt != cur_ptt:
|
||||
DiskLib.ogDeletePartitionTable (dis)
|
||||
SystemLib.ogExecAndLog ('command', DiskLib.ogUpdatePartitionTable)
|
||||
SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogUpdatePartitionTable'])
|
||||
DiskLib.ogCreatePartitionTable (dis, ptt)
|
||||
|
||||
# Inicia la cache.
|
||||
if 'CACHE' in sparam:
|
||||
SystemLib.ogEcho (['session', 'log'], None, f'[30] {ogGlobals.lang.MSG_HELP_ogCreateCache}')
|
||||
SystemLib.ogEcho (['session', 'log'], None, f' initCache {tch}')
|
||||
rc = SystemLib.ogExecAndLog ('command', CacheLib.initCache, tch)
|
||||
if rc:
|
||||
rc = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGSCRIPTS}/initCache', tch])
|
||||
if not rc:
|
||||
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_CACHE, f'initCache failed')
|
||||
sys.exit (1)
|
||||
|
||||
# Definir particionado.
|
||||
SystemLib.ogEcho (['session', 'log'], None, f'[50] {ogGlobals.lang.MSG_HELP_ogCreatePartitions}')
|
||||
SystemLib.ogEcho (['session', 'log'], None, f' ogCreatePartitions {dis} {' '.join (tbp)}')
|
||||
res = SystemLib.ogExecAndLog ('command', DiskLib.ogCreatePartitions, dis, tbp)
|
||||
res = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreatePartitions', str(dis)] + tbp)
|
||||
if not res:
|
||||
coproc.kill()
|
||||
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_GENERIC, f'ogCreatePartitions {dis} {' '.join (tbp)}')
|
||||
sys.exit (1)
|
||||
SystemLib.ogExecAndLog ('command', DiskLib.ogUpdatePartitionTable)
|
||||
SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogUpdatePartitionTable'])
|
||||
|
||||
# Formatear particiones
|
||||
SystemLib.ogEcho (['session', 'log'], None, f'[70] {ogGlobals.lang.MSG_HELP_ogFormat}')
|
||||
|
@ -170,12 +167,11 @@ for p in range (1, maxp+1):
|
|||
if 'CACHE' == tbf[p]:
|
||||
if CACHESIZE == tch: # Si el tamaño es distinto ya se ha formateado.
|
||||
SystemLib.ogEcho (['session', 'log'], None, ' ogFormatCache')
|
||||
retval = SystemLib.ogExecAndLog ('command', CacheLib.ogFormatCache)
|
||||
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatCache'])
|
||||
else:
|
||||
SystemLib.ogEcho (['session', 'log'], None, f' ogFormatFs {dis} {p} {tbf[p]}')
|
||||
retval = SystemLib.ogExecAndLog ('command', FileSystemLib.ogFormatFs, dis, str(p), tbf[p])
|
||||
if retval:
|
||||
coproc.kill()
|
||||
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatFs', str(dis), str(p), tbf[p]])
|
||||
if not retval:
|
||||
SystemLib.ogRaiseError (['session', 'log'], ogGlobals.OG_ERR_GENERIC, f'ogFormatFs {dis} {p} {tbf[p]}')
|
||||
sys.exit (1)
|
||||
# Registro de fin de ejecución
|
||||
|
@ -186,5 +182,4 @@ SystemLib.ogEcho (['session', 'log'], None, f'{ogGlobals.lang.MSG_INTERFACE_END}
|
|||
# Retorno
|
||||
#___________________________________________________________________
|
||||
|
||||
coproc.kill()
|
||||
sys.exit (0)
|
||||
|
|
|
@ -66,7 +66,7 @@ repo = arg_repo
|
|||
if not repo: repo = 'REPO'
|
||||
if repo == ogGetIpAddress(): repo = 'CACHE'
|
||||
# Si es una ip y es distinta a la del recurso samba cambiamos de REPO.
|
||||
if 'REPO' == repo or StringLib.ogCheckIpAddress (repo):
|
||||
if 'REPO' == repo or ogCheckIpAddress (repo):
|
||||
# Si falla el cambio -> salimos con error repositorio no valido
|
||||
if not ogChangeRepo (repo):
|
||||
ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, repo)
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
sys.path.insert(0, "/opt/oglive/rootfs/opt/opengnsys/lib/python3/")
|
||||
sys.path.insert(0, "/opt/opengnsys/interfaceAdm/git/")
|
||||
sys.path.insert(0, "/opt/opengnsys/ogrepository/oggit/lib/")
|
||||
|
||||
import NetLib
|
||||
import ogGlobals
|
||||
import SystemLib
|
||||
|
||||
|
||||
from gitlib import OpengnsysGitLibrary, NTFSImplementation
|
||||
|
||||
|
||||
def create_image(disk_num, partition_num, repo, image_name):
|
||||
|
||||
ntfs_impl = NTFSImplementation.NTFS3G
|
||||
og_git = OpengnsysGitLibrary(ntfs_implementation = ntfs_impl)
|
||||
device = og_git._runBashFunction("ogDiskToDev", [str(disk_num), str(partition_num)])
|
||||
og_git.initRepo(device, image_name)
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 6:
|
||||
sys.exit(SystemLib.ogRaiseError(OG_ERR_FORMAT, "Incorrect number of arguments"))
|
||||
|
||||
disk_num, partition_num, image_name, repo, tag = sys.argv[1:6]
|
||||
|
||||
retval = create_image(disk_num, partition_num, repo, image_name)
|
||||
|
||||
sys.exit(retval)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
os.system ('pkill -f OGAgent')
|
||||
time.sleep (3)
|
||||
os.system ('reboot')
|
||||
sys.exit (0)
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
sys.path.insert(0, "/opt/oglive/rootfs/opt/opengnsys/lib/python3/")
|
||||
sys.path.insert(0, "/opt/opengnsys/interfaceAdm/git/")
|
||||
sys.path.insert(0, "/opt/opengnsys/ogrepository/oggit/lib/")
|
||||
|
||||
import NetLib
|
||||
import ogGlobals
|
||||
import SystemLib
|
||||
from gitlib import OpengnsysGitLibrary, NTFSImplementation
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 4:
|
||||
print("Usage: python RestaurarImagenGit.py <disk> <partition> <repo> <boot_device>")
|
||||
sys.exit(1)
|
||||
|
||||
disk = sys.argv[1]
|
||||
partition = sys.argv[2]
|
||||
repo = sys.argv[3]
|
||||
boot_device = sys.argv[4]
|
||||
|
||||
ntfs_impl = NTFSImplementation.NTFS3G
|
||||
og_git = OpengnsysGitLibrary(ntfs_implementation = ntfs_impl)
|
||||
|
||||
device = og_git._runBashFunction("ogDiskToDev", [str(disk), str(partition)])
|
||||
|
||||
og_git.cloneRepo(repo, device, boot_device)
|
||||
|
||||
|
|
@ -74,4 +74,5 @@ else:
|
|||
|
||||
# Borramos marcas de arranque de Windows
|
||||
for f in glob.glob ('/mnt/*/ogboot.*') + glob.glob ('/mnt/*/*/ogboot.*'):
|
||||
os.unlink (f)
|
||||
try: os.unlink (f)
|
||||
except: pass
|
||||
|
|
Before Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 73 KiB |
|
@ -1,79 +0,0 @@
|
|||
include "theme"
|
||||
|
||||
screen {
|
||||
background = "$$/background.png"
|
||||
|
||||
panel {
|
||||
halign = center
|
||||
attach_vcenter = 0
|
||||
height = 19
|
||||
# Flip so the cursor defaults to the main menu
|
||||
direction = bottom_to_top
|
||||
|
||||
### Main Menu ###
|
||||
panel {
|
||||
height = 15
|
||||
max_width = 120
|
||||
margin_top = 1
|
||||
class = container-body
|
||||
# No need for a min width and centering panel because extended width > min width
|
||||
|
||||
direction = left_to_right
|
||||
anchor = 1
|
||||
id = __menu__
|
||||
}
|
||||
|
||||
panel {
|
||||
height = 4
|
||||
width = 100%
|
||||
class = container-title
|
||||
|
||||
direction = left_to_right
|
||||
|
||||
image {
|
||||
image = "$$/images/txt-select.png"
|
||||
attach_top = 0
|
||||
attach_left = 0
|
||||
}
|
||||
|
||||
### Tools Menu ###
|
||||
image {
|
||||
attach_right = 2
|
||||
image = "$$/images/button-tools.png:$$/images/button-tools-hover.png"
|
||||
command = "menu_popup tools_menu"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
### Progress Bar ###
|
||||
panel {
|
||||
halign = center
|
||||
attach_vcenter = 20
|
||||
width = 80
|
||||
class = progressbar-background
|
||||
id = __timeout__
|
||||
|
||||
progressbar { }
|
||||
}
|
||||
}
|
||||
|
||||
template_menuitem {
|
||||
panel {
|
||||
width = 40
|
||||
height = 12
|
||||
|
||||
parameters = "class=image.class:title=panel.text.text"
|
||||
|
||||
image {
|
||||
attach_vcenter = 0
|
||||
attach_hcenter = 0
|
||||
}
|
||||
|
||||
panel {
|
||||
attach_vcenter = 0
|
||||
attach_hcenter = 0
|
||||
class = text-line
|
||||
text { font = "Helvetica Regular 22" }
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 1.5 KiB |
|
@ -1,21 +0,0 @@
|
|||
+class
|
||||
{
|
||||
-opengnsys { image = "$$/normal_opengnsys.png:$$/hover_opengnsys.png" }
|
||||
-windows10 { image = "$$/normal_windows10.png:$$/hover_windows10.png" }
|
||||
-windows7 { image = "$$/normal_windows7.png:$$/hover_windows7.png" }
|
||||
-windows { image = "$$/normal_windows.png:$$/hover_windows.png" }
|
||||
-elementary { image = "$$/normal_elementary.png:$$/hover_elementary.png" }
|
||||
-elementaryos { image = "$$/normal_elementary.png:$$/hover_elementary.png" }
|
||||
-recovery { image = "$$/normal_recovery.png:$$/hover_recovery.png" }
|
||||
-shutdown { image = "$$/normal_shutdown.png:$$/hover_shutdown.png" }
|
||||
-restart { image = "$$/normal_restart.png:$$/hover_restart.png" }
|
||||
-linux { image = "$$/normal_linux.png:$$/hover_linux.png" }
|
||||
-ubuntu { image = "$$/normal_ubuntu.png:$$/hover_ubuntu.png" }
|
||||
-debian { image = "$$/normal_debian.png:$$/hover_debian.png" }
|
||||
-suse { image = "$$/normal_opensuse.png:$$/hover_opensuse.png" }
|
||||
-freebsd { image = "$$/normal_freebsd.png:$$/hover_freebsd.png" }
|
||||
-macosx { image = "$$/normal_osx.png:$$/hover_osx.png" }
|
||||
-haiku { image = "$$/normal_haiku.png:$$/hover_haiku.png" }
|
||||
-image { image = "$$/normal_os.png:$$/hover_os.png" }
|
||||
-os { image = "$$/normal_os.png:$$/hover_os.png" }
|
||||
}
|
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 725 B |
Before Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 346 B |
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 905 B |