windows netboot - installfiles_dir & setup.exe

Antworten
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

windows netboot - installfiles_dir & setup.exe

Beitrag von larsg »

Hallo,

ich habe ein verständnisproblem mit der property installfiles_dir.

ich versuche gerade, die windows-netboot-produkte von uib zu erweitern, so das mit einem Paket verschiedene installationsquellen genutzt werden können.

im netboot-produkt win10-x64 liegen 3 zusätzliche installfiles verzeichnisse, das original installfiles verzeichnis bleibt leer:

Code: Alles auswählen

root@opsi-config:/var/lib/opsi/depot/win10-x64# ls -d installfiles*
installfiles  installfiles_1809  installfiles_ltsb2016  installfiles_ltsc2019

Code: Alles auswählen

root@opsi-config:/var/lib/opsi/depot/win10-x64# ls installfiles_1809/
setup.exe  sources  support
in der property installfiles_dir sind die werte installfiles_1809, installfiles_ltsb2016 & installfiles_ltsc2019 auswählbar.
das bootimage erkennt den ausgewählten wert auch, meldet jedoch sofort das die setup.exe nicht im original installfiles verzeichnis gefunden wurde:

Code: Alles auswählen

(949)     [5] [Mai 28 16:54:27] Using installfiles_dir: installfiles_1809 (setup.py|225)
(950)     [5] [Mai 28 16:54:27] winpe_debug_cmd_exe = False (setup.py|249)
(951)     [5] [Mai 28 16:54:27] Determine if we have to localize the administrator (setup.py|302)
(952)     [2] [Mai 28 16:54:28] Traceback: (Logger.py|798)
(953)     [2] [Mai 28 16:54:28]   File "/usr/local/bin/master.py", line 1447, in <module>
(954)         execfile(actionScript)
(955)      (Logger.py|798)
(956)     [2] [Mai 28 16:54:28]   File "/tmp/setup.py", line 306, in <module>
(957)         raise Exception(u"Expected setup.exe not found in %s/installfiles/" % (depotsource))
(958)      (Logger.py|798)
(959)     [2] [Mai 28 16:54:28]      ==>>> Expected setup.exe not found in /mnt/opsi/win10-x64/installfiles/ (master.py|1499)
wenn ich nur eine der setup.exe dateien in das das original installfiles verzeichnis kopiere, dann funktioniert es.
warum wird die datei an der stelle vorrausgesetzt, bzw. warum kann die setup.exe nicht aus dem jeweils angegebenen installfiles verzeichnis geladen werden?


versionsstand:

Code: Alles auswählen

root@opsi-config:/# dpkg -l | grep opsi
ii  opsi-configed                         4.0.7.6.34-2                        all          OPSI config editor
ii  opsi-linux-bootimage                  20190227-1                          all          opsi bootimage for netboot tasks.
ii  opsi-linux-support                    4.1.1-3                             all          Configure system to be able to deploy Linux with opsi.
ii  opsi-server                           4.1.1.7-1                           all          opsi server configuration package
ii  opsi-tftpd-hpa                        5.2.8-49                            amd64        HPA's tftp server
ii  opsi-utils                            4.1.1.32-1                          all          utilites for working with opsi.
ii  opsi-vm-config                        4.1.2                               all          Configuration of opsi VM.
ii  opsi-windows-support                  4.1.1-8                             all          Install utilities useful for deploying Windows with opsi.
ii  opsiconfd                             4.1.1.18-4                          all          opsi configuration service
ii  opsipxeconfd                          4.1.1.14-1                          all          opsi pxe configuration daemon
ii  python-opsi                           4.1.1.65-1                          all          opsi python library

Code: Alles auswählen

root@opsi-config:/# opsi-package-manager -l | grep win10-x64
   win10-x64                          4.1.0.0-15                Windows 10 x64
uncle_scrooge
Beiträge: 650
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: windows netboot - installfiles_dir & setup.exe

Beitrag von uncle_scrooge »

Riecht nach bug. Möglicherweise reingekommen, als die Geschichte mit dem 'lokalisierten Administrator' hochkam.
An der Stelle ist der Pfad hart verdrahtet. Kannst Du Dir in der setup.py selber ansehen.
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

Re: windows netboot - installfiles_dir & setup.exe

Beitrag von larsg »

uncle_scrooge hat geschrieben:Riecht nach bug. Möglicherweise reingekommen, als die Geschichte mit dem 'lokalisierten Administrator' hochkam.
An der Stelle ist der Pfad hart verdrahtet. Kannst Du Dir in der setup.py selber ansehen.
Stimmt, danke für den Hinweis. Hatte erst gedacht das wäre aus irgendeinem Grund "by design", aber das hat nun nicht den Anschein.
Wenn dies tatsächlich ein Bug ist, könnte vielleicht jemand das Thema in den Bug-Bereich verschieben? Danke :)


Der Vollständigkeit halber:

Code: Alles auswählen

logger.notice(u"Determine if we have to localize the administrator")
adminName = u'Administrator'
# we need to check the internal version of the setup.exe
if not os.path.exists("%s/installfiles/setup.exe" % (depotsource)):
        raise Exception(u"Expected setup.exe not found in %s/installfiles/" % (depotsource))
# we can do this with the peres command (if available)
exitcode = os.system("which peres")
winverlist =[]
winver = '6'
if (0 == int(exitcode)):
        logger.notice(u"peres found - we use peres -v to get setup.exe fileversion")
        winverlist = execute("peres -v %s/installfiles/setup.exe" % (depotsource))
else:
        logger.notice(u"no peres found - we use getwinfileversion to get setup.exe fileversion")
        # get the correct architecture
        try:
                #result = execute("%s" % which(uname -p))
                result = execute("uname -p")
                if result:
                        if result[0].strip() == "x86_64":
                                arch = "64"
                        else:
                                arch = "32"
        except Exception as e:
                arch = "32"
                logger.error(u"Exception in uname -p")

        bootimgtarget = "/tmp"
        pathToCopy = os.path.join(source, "linutils", "%sbit" % arch,"getwinfileversion")
        depot.copy(pathToCopy, bootimgtarget)
        execute("chmod ugo+x %s/getwinfileversion" % (bootimgtarget))
        winverlist = execute("%s/getwinfileversion %s/installfiles/setup.exe" % (bootimgtarget,depotsource))
muss ersetzt werden durch

Code: Alles auswählen

logger.notice(u"Determine if we have to localize the administrator")
adminName = u'Administrator'
# we need to check the internal version of the setup.exe
if not os.path.exists("%s/%s/setup.exe" % (depotsource,installfiles_dir)):
        raise Exception(u"Expected setup.exe not found in %s/%s/" % (depotsource,installfiles_dir))
# we can do this with the peres command (if available)
exitcode = os.system("which peres")
winverlist =[]
winver = '6'
if (0 == int(exitcode)):
        logger.notice(u"peres found - we use peres -v to get setup.exe fileversion")
        winverlist = execute("peres -v %s/%s/setup.exe" % (depotsource,installfiles_dir))
else:
        logger.notice(u"no peres found - we use getwinfileversion to get setup.exe fileversion")
        # get the correct architecture
        try:
                #result = execute("%s" % which(uname -p))
                result = execute("uname -p")
                if result:
                        if result[0].strip() == "x86_64":
                                arch = "64"
                        else:
                                arch = "32"
        except Exception as e:
                arch = "32"
                logger.error(u"Exception in uname -p")

        bootimgtarget = "/tmp"
        pathToCopy = os.path.join(source, "linutils", "%sbit" % arch,"getwinfileversion")
        depot.copy(pathToCopy, bootimgtarget)
        execute("chmod ugo+x %s/getwinfileversion" % (bootimgtarget))
        winverlist = execute("%s/getwinfileversion %s/%s/setup.exe" % (bootimgtarget,depotsource,installfiles_dir))
bzw. "%s/installfiles" muss ersetzt werden durch "%s/%s" und jeweils die variable "installfiles_dir" als Parameter zur Substitution hinzugefügt werden.
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1515
Registriert: 10 Jun 2015, 12:19

Re: windows netboot - installfiles_dir & setup.exe

Beitrag von m.radtke »

Gude

im experimental bereich findet ihr eine Version 4.1.0.1-1, die neben anderer Sachen noch den Fix für das Problem beinhaltet.

Grüße
Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

Re: windows netboot - installfiles_dir & setup.exe

Beitrag von larsg »

wow, das ging fix :shock: danke! :D
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1515
Registriert: 10 Jun 2015, 12:19

Re: windows netboot - installfiles_dir & setup.exe

Beitrag von m.radtke »

Hi

Ich war an der setup.py sowieso zugange und habe das gleich mit dem neuen Feature mit reingenommen.

Gruß und schönes Wochenende

Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
Antworten