Univention Bugzilla – Attachment 9787 Details for
Bug 48123
Allow update of net installers with repository update
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Update PXE installer with repository-update
0001-Bug-48123-up-Update-PXE-installer-with-repository-up.patch (text/plain), 4.04 KB, created by
Philipp Hahn
on 2019-01-07 08:21:18 CET
(
hide
)
Description:
Update PXE installer with repository-update
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2019-01-07 08:21:18 CET
Size:
4.04 KB
patch
obsolete
>From 74768f65bb5b1fa3bac83fbeac112cc4e4e091a1 Mon Sep 17 00:00:00 2001 >Message-Id: <74768f65bb5b1fa3bac83fbeac112cc4e4e091a1.1546845644.git.hahn@univention.de> >From: Philipp Hahn <hahn@univention.de> >Date: Fri, 4 Jan 2019 15:06:46 +0100 >Subject: [PATCH] Bug #48123 up: Update PXE installer with repository-update > net >Organization: Univention GmbH, Bremen, Germany > >by downloading files from <http://updates.software-univention.de/pxe/> >--- > .../python/univention-repository-update | 60 ++++++++++++++++++++++ > 1 file changed, 60 insertions(+) > >diff --git a/base/univention-updater/python/univention-repository-update b/base/univention-updater/python/univention-repository-update >index 20b70e9e85..3334410be1 100755 >--- a/base/univention-updater/python/univention-repository-update >+++ b/base/univention-updater/python/univention-repository-update >@@ -45,6 +45,10 @@ import univention.updater.repository as urepo > from univention.updater.mirror import UniventionMirror, makedirs > from univention.updater.errors import UpdaterException, VerificationError > from univention.updater.locking import UpdaterLock >+try: >+ from typing import IO # noqa F401 >+except ImportError: >+ pass > > configRegistry = ConfigRegistry() > configRegistry.load() >@@ -192,6 +196,59 @@ def update_net(options): > print >> ver, 'VERSION=%d.%d' % (min_version.major, min_version.minor) > print >> ver, 'PATCHLEVEL=%d' % (min_version.patchlevel,) > >+ if options.pxe: >+ copy_pxe(mirror, options.teefile) >+ >+ >+def copy_pxe(mirror, out): # type: (UniventionMirror, IO) -> None >+ ''' >+ setup network installation (PXE) >+ >+ :param mirror UniventionMirror: an UniventionMirror instance. >+ :param out: File for error output. >+ ''' >+ if mirror.current_version.major < 4: >+ print >> out, 'WARNING: The usage of this DVD for PXE reinstallation is not possible.' >+ print >> out, ' Please use an UCS installation DVD with UCS 4.0-0 or later.' >+ return >+ if mirror.server.baseurl.hostname != 'updates.software-univention.de': >+ print >> out, 'WARNING: Download of PXE files from %s may not work' % (mirror.server.baseurl.public()) >+ >+ version = mirror.get_ucs_version() >+ pxedir = '/var/lib/univention-client-boot' >+ installerdir = os.path.join(pxedir, 'installer', version) >+ makedirs(installerdir) >+ >+ # copy kernel and initrd to /var/lib/univention-client-boot/installer/<major>.<minor>-<patchlevel>/ >+ # and create/refresh symlinks in /var/lib/univention-client-boot/ to these files >+ arch = mirror.architectures[0] >+ for fn in ['linux', 'initrd.gz']: >+ dstfn = os.path.join(installerdir, fn) >+ if os.path.exists(dstfn): >+ continue >+ >+ uri = '/'.join(('pxe', version, arch, 'gtk', 'debian-installer', arch, fn)) >+ try: >+ code, size, content = mirror.server.access(None, filename=uri, get=True) >+ except UpdaterException as ex: >+ print >> out, 'WARNING: Failed download %s: %s' % (uri, ex) >+ continue >+ >+ try: >+ with open(dstfn, 'w') as stream: >+ stream.write(content) >+ except EnvironmentError as ex: >+ print >> out, 'WARNING: Failed to write %s: %s' % (dstfn, ex) >+ continue >+ >+ symlinkfn = os.path.join(pxedir, fn) >+ try: >+ if os.path.islink(symlinkfn): >+ os.remove(symlinkfn) >+ os.symlink(os.path.relpath(dstfn, pxedir), symlinkfn) >+ except EnvironmentError as ex: >+ print >> out, 'WARNING: Failed to update %s: %s' % (symlinkfn, ex) >+ > > def parse_args(): > for mount_point_default in ('/cdrom', '/media/cdrom', '/media/cdrom0'): >@@ -227,6 +284,9 @@ def parse_args(): > '-u', '--updateto', action='store', > dest='update_to', default='', > help='if given the repository is updated to the specified version but not higher') >+ parser.add_option( >+ '--pxe', '-p', action='store_true', >+ help='download PXE network installer files') > > (options, arguments) = parser.parse_args() > >-- >2.11.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48123
: 9787