refs #2814 include oglive version in the filename

pull/29/head
Natalia Serrano 2025-09-16 15:00:27 +02:00
parent 6c25f76726
commit 051300b053
4 changed files with 24 additions and 12 deletions

View File

@ -5,6 +5,12 @@ 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).
## [4.0.0] - 2025-09-16
### Changed
- Include oglive version in the filename
## [3.14.0] - 2025-08-14
### Added

View File

@ -1 +1 @@
OpenGnsys Client 3.14.0
OpenGnsys Client 4.0.0

View File

@ -70,8 +70,13 @@ def _debootstrap (btrootfsimg, btrootfsmnt, osarch, oscodename, oshttp):
sys.exit (1)
utils.umount (btrootfsmnt)
def _initramfs_version (gitrelease, osrelease, curdir):
utils.run (['sed', '-i', f'1 s/$/ {gitrelease} ({osrelease})/', f'{curdir}/includes/etc/initramfs-tools/scripts/VERSION.txt'])
def _initramfs_version (f, osrelease):
fd = open (f'{curdir}/gitrelease', 'r') ## per the Dockerfile
gitrelease = fd.readline().strip()
fd.close()
today = datetime.datetime.now(datetime.timezone.utc).strftime ('%Y%m%d')
utils.run (['sed', '-i', f'1 s/$/ {gitrelease}_{today} ({osrelease})/', f])
def _copy_og_files (btrootfsimg, btrootfsmnt, osdistrib, oscodename):
_mount_rootfs (btrootfsimg, btrootfsmnt)
@ -112,13 +117,10 @@ def _mkinitrd_squashfs_isofs (bttargetdir, osrelease, btrootfsimg, btrootfsmnt,
def _main (cfgfile, config, type_client):
isolinux_tpl = config['General'].get ('isolinux_template')
btrootfsimglabel = config['General'].get ('rootfs_image_label')
version_file = f'{curdir}/includes/etc/initramfs-tools/scripts/VERSION.txt'
logger.info ('OpenGnsys CLIENT installation begins')
fd = open (f'{curdir}/gitrelease', 'r') ## per the Dockerfile
gitrelease = fd.readline().strip()
fd.close()
osdistrib, oscodename, osrelease, osarch, oshttp = btog.GetOsInfo (type_client)
if osdistrib is None:
logger.error ('GetOsInfo() failed')
@ -135,8 +137,7 @@ def _main (cfgfile, config, type_client):
_debootstrap (btrootfsimg, btrootfsmnt, osarch, oscodename, oshttp)
logger.info ('STAGE 2 - copy files to the rootfs')
today = datetime.datetime.now(datetime.timezone.utc).strftime ('%Y%m%d')
_initramfs_version (gitrelease+'_'+today, osrelease, curdir)
_initramfs_version (version_file, osrelease)
_copy_og_files (btrootfsimg, btrootfsmnt, osdistrib, oscodename)
logger.info ('STAGE 3 - perform tasks within the chroot')
@ -146,7 +147,10 @@ def _main (cfgfile, config, type_client):
logger.info ('STAGE 4 - generate distribution files')
pxepkg = _get_pxepkg()
nameisoclient = '-'.join (['ogLive', oscodename, osrelease, osarch, gitrelease+'_'+today])
fd = open (version_file, 'r')
oglive_version = fd.readline().strip()
fd.close()
nameisoclient = '-'.join (['ogLive', oscodename, osrelease, osarch, oglive_version])
_mkinitrd_squashfs_isofs (bttargetdir, osrelease, btrootfsimg, btrootfsmnt, pxepkg, isolinux_tpl, nameisoclient)
logger.info ('OpenGnsys installation finished')

View File

@ -1,10 +1,12 @@
[IMGogclient]
type=loopback
file=/var/lib/tftpboot/ogclient/ogclient.img
mount-options=-o offset=32256
description=ogclient Ubuntu image
#priority=1
users=root
groups=root
root-groups=root
mount-options=-o offset=32256
root-users=root
setup.copyfiles=