From 051300b0539996d62c1fde68ace8e2eb4bb40a15 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 16 Sep 2025 15:00:27 +0200 Subject: [PATCH] refs #2814 include oglive version in the filename --- CHANGELOG.md | 6 +++++ .../etc/initramfs-tools/scripts/VERSION.txt | 2 +- mkoglive.py | 22 +++++++++++-------- schroot.conf | 6 +++-- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b044db0..1fd54ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/includes/etc/initramfs-tools/scripts/VERSION.txt b/includes/etc/initramfs-tools/scripts/VERSION.txt index 484d442..cde697a 100644 --- a/includes/etc/initramfs-tools/scripts/VERSION.txt +++ b/includes/etc/initramfs-tools/scripts/VERSION.txt @@ -1 +1 @@ -OpenGnsys Client 3.14.0 +OpenGnsys Client 4.0.0 diff --git a/mkoglive.py b/mkoglive.py index 71bd988..cda4cec 100755 --- a/mkoglive.py +++ b/mkoglive.py @@ -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') diff --git a/schroot.conf b/schroot.conf index ec18111..bc0cd3c 100644 --- a/schroot.conf +++ b/schroot.conf @@ -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=