2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Revise tftp initialization

For one, if the xCAT /tftpboot is present, roll with that.

For another, use a symlink to /opt instead of copy, to make upgrades
easier.
This commit is contained in:
Jarrod Johnson 2020-07-15 10:59:30 -04:00
parent 81835d66be
commit 77cfa7b45c

View File

@ -50,7 +50,7 @@ def main(args):
def install_tftp_content():
tftplocation = None
candidates = ('/var/lib/tftpboot', '/srv/tftpboot', '/srv/tftp')
candidates = ('/tftpboot', '/var/lib/tftpboot', '/srv/tftpboot', '/srv/tftp')
for cand in candidates:
if os.path.isdir(cand):
tftplocation = cand
@ -63,8 +63,8 @@ def install_tftp_content():
except OSError as e:
if e.errno == 17:
raise
shutil.copy('/opt/confluent/lib/ipxe/ipxe.efi', tftplocation)
shutil.copy('/opt/confluent/lib/ipxe/ipxe.kkpxe', tftplocation)
os.symlink('/opt/confluent/lib/ipxe/ipxe.efi', tftplocation + '/ipxe.efi')
os.symlink('/opt/confluent/lib/ipxe/ipxe.kkpxe', tftplocation + '/ipxe.kkpxe')
def initialize(cmdset):
@ -202,4 +202,4 @@ def osimport(imagefile):
list(c.delete('/deployment/importing/{0}'.format(shortname)))
if __name__ == '__main__':
main(sys.argv)
main(sys.argv)