diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-23 17:07:28 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-28 12:48:25 +0000 |
commit | 4b1e96facb0a91ae5a1375f08226b15f87b8f5bc (patch) | |
tree | 563ffcd0d9caffc000b02d199203aac241f0cd70 /pxeboot.write | |
parent | 5b6c916b5431878b4f309bfd304ab7478c01bc93 (diff) | |
download | definitions-4b1e96facb0a91ae5a1375f08226b15f87b8f5bc.tar.gz |
pxeboot: Add symlink to pxeboot config file also for local deployments
This functionality was added for remote deployments in a6d7d3a8.
Some bootloaders look for a pxelinux configuration file on the TFTP
server whose name is the normalized MAC address of the NIC prefixed
with '01-'
Change-Id: I6a5dc0cd71f72bf6cea6bbed05ebbeda765af805
Diffstat (limited to 'pxeboot.write')
-rwxr-xr-x | pxeboot.write | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pxeboot.write b/pxeboot.write index 399914f5..c8d8bc4e 100755 --- a/pxeboot.write +++ b/pxeboot.write @@ -431,10 +431,18 @@ class PXEBoot(morphlib.writeexts.WriteExtension): self._write_pxe_config(fh=f, kernel_tftp_url=kernel_tftp_url, rootfs_nfs_url=rootfs_nfs_url, extra_args=os.environ.get('KERNEL_ARGS','')) + + pxe_cfg_link_path = os.path.join (tftproot, + 'pxelinux.cfg', + '01-' + pxe_cfg_filename) + cliapp.runcmd(['ln', '-s', pxe_cfg_filename, pxe_cfg_link_path ], + stdin=None, stdout=open(os.devnull, 'w'), + stderr=None) try: yield finally: os.unlink(pxe_cfg_path) + os.unlink(pxe_cfg_link_path) @contextlib.contextmanager def remote_pxeboot_config(self, tftproot, kernel_tftproot, kernel_subpath, |