summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2014-06-17 14:56:37 +1000
committerGerrit Code Review <gerrit@beaker-project.org>2014-06-24 02:13:24 +0000
commit42f3dd36ee7c7f0a4cf5fc832ba303d4b1477ace (patch)
tree8f508548acc8c2cec7631c12613cf58a385d3c20
parenta0c25563466e452e3e04c8febd862f9424b3e0c0 (diff)
change aarch64 TFTP locations from pxelinux/ to aarch64/
This commit also removes the symlink creation/removal business, which is not needed. Instead we can just write a default config to grub.cfg which immediately exits. This achieves the same effect and more closely corresponds to how we handle PXELINUX. Bug: 1078965 Change-Id: Id7bd78c0a59f3ce8d60965f682bee3f502e4883f
-rw-r--r--LabController/src/bkr/labcontroller/netboot.py17
-rw-r--r--LabController/src/bkr/labcontroller/test_netboot.py9
-rw-r--r--documentation/admin-guide/tftp.rst17
3 files changed, 21 insertions, 22 deletions
diff --git a/LabController/src/bkr/labcontroller/netboot.py b/LabController/src/bkr/labcontroller/netboot.py
index b3ef6ae..e28aa87 100644
--- a/LabController/src/bkr/labcontroller/netboot.py
+++ b/LabController/src/bkr/labcontroller/netboot.py
@@ -154,15 +154,9 @@ def configure_aarch64(fqdn, kernel_options):
"""
Creates PXE bootloader files for aarch64 Linux
- <get_tftp_root()>/pxelinux/grub.cfg-<pxe_basename(fqdn)>
-
- Also ensures <fqdn>.efi is symlinked to bootaa64.efi
-
- Specify filename "pxelinux/<fqdn>.efi"; in your dhcpd.conf file
- We remove this when the install is done. This allows efi
- to fall through to the next boot entry.
+ <get_tftp_root()>/aarch64/grub.cfg-<pxe_basename(fqdn)>
"""
- pxe_base = os.path.join(get_tftp_root(), 'pxelinux')
+ pxe_base = os.path.join(get_tftp_root(), 'aarch64')
makedirs_ignore(pxe_base, mode=0755)
devicetree, kernel_options = extract_arg('devicetree=', kernel_options)
if devicetree:
@@ -178,18 +172,17 @@ def configure_aarch64(fqdn, kernel_options):
logger.debug('Writing aarch64 config for %s as %s', fqdn, basename)
with atomically_replaced_file(os.path.join(pxe_base, basename)) as f:
f.write(config)
- atomic_symlink('bootaa64.efi', os.path.join(pxe_base, "%s.efi" % fqdn))
+ # We also ensure a default config exists that exits
+ write_ignore(os.path.join(pxe_base, 'grub.cfg'), 'exit\n')
def clear_aarch64(fqdn):
"""
Removes PXE bootloader file created by configure_aarch64
"""
- pxe_base = os.path.join(get_tftp_root(), 'pxelinux')
+ pxe_base = os.path.join(get_tftp_root(), 'aarch64')
basename = "grub.cfg-%s" % pxe_basename(fqdn)
logger.debug('Removing aarch64 config for %s as %s', fqdn, basename)
- unlink_ignore(os.path.join(pxe_base, "%s.efi" % fqdn))
unlink_ignore(os.path.join(pxe_base, basename))
- # XXX Should we save a default config, the way we do for non-aarch64 PXE?
### Bootloader config: PXE Linux for ARM
diff --git a/LabController/src/bkr/labcontroller/test_netboot.py b/LabController/src/bkr/labcontroller/test_netboot.py
index 14d4c1f..279bc75 100644
--- a/LabController/src/bkr/labcontroller/test_netboot.py
+++ b/LabController/src/bkr/labcontroller/test_netboot.py
@@ -421,25 +421,24 @@ class Aarch64Test(NetBootTestCase):
def test_configure_then_clear(self):
netboot.configure_aarch64(TEST_FQDN,
'console=ttyS0,115200 ks=http://lol/')
- grub_config_path = os.path.join(self.tftp_root, 'pxelinux', 'grub.cfg-7F0000FF')
+ grub_config_path = os.path.join(self.tftp_root, 'aarch64', 'grub.cfg-7F0000FF')
+ grub_default_path = os.path.join(self.tftp_root, 'aarch64', 'grub.cfg')
self.assertEquals(open(grub_config_path).read(), """\
linux ../images/fqdn.example.invalid/kernel console=ttyS0,115200 ks=http://lol/
initrd ../images/fqdn.example.invalid/initrd
boot
""")
- grub_symlink_path = os.path.join(self.tftp_root, 'pxelinux', 'fqdn.example.invalid.efi')
- self.assertEquals(os.readlink(grub_symlink_path), 'bootaa64.efi')
+ self.assertEquals(open(grub_default_path).read(), 'exit\n')
netboot.clear_aarch64(TEST_FQDN)
self.assertFalse(os.path.exists(grub_config_path))
- self.assertFalse(os.path.exists(grub_symlink_path))
# https://bugzilla.redhat.com/show_bug.cgi?id=1100008
def test_alternate_devicetree(self):
netboot.configure_aarch64(TEST_FQDN,
'devicetree=custom.dtb ks=http://lol/')
- grub_config_path = os.path.join(self.tftp_root, 'pxelinux', 'grub.cfg-7F0000FF')
+ grub_config_path = os.path.join(self.tftp_root, 'aarch64', 'grub.cfg-7F0000FF')
self.assertEquals(open(grub_config_path).read(), """\
linux ../images/fqdn.example.invalid/kernel ks=http://lol/
initrd ../images/fqdn.example.invalid/initrd
diff --git a/documentation/admin-guide/tftp.rst b/documentation/admin-guide/tftp.rst
index 20c7230..15ed0e0 100644
--- a/documentation/admin-guide/tftp.rst
+++ b/documentation/admin-guide/tftp.rst
@@ -48,7 +48,7 @@ boot loader images (see :ref:`adding-systems`).
:file:`elilo-ia64.efi`
Location of the ELILO_ image, used for IA64 systems.
-:file:`pxelinux/bootaa64.efi`
+:file:`aarch64/bootaa64.efi`
Location of the boot loader image for 64-bit ARM systems.
.. _Syslinux: http://www.syslinux.org/
@@ -92,10 +92,7 @@ removes them once the installation is complete.
Configuration for 32-bit ARM systems. The filename follows the PXELINUX
naming convention.
-:file:`pxelinux/{fqdn}.efi`
- Symbolic link to :file:`bootaa64.efi`.
-
-:file:`pxelinux/grub.cfg-{0A010203}`
+:file:`aarch64/grub.cfg-{0A010203}`
Configuration for 64-bit ARM systems.
:file:`s390x/s_{fqdn}`; :file:`s390x/s_{fqdn}_parm`; :file:`s390x/s_{fqdn}_conf`
@@ -121,6 +118,16 @@ Other files in the TFTP root directory
If this file does not exist, Beaker populates it with a simple default
configuration that immediately boots the local disk.
+:file:`aarch64/grub.cfg`
+ Default configuration used by 64-bit ARM systems when no system-specific
+ configuration exists.
+
+ The Beaker administrator can customize this configuration, however it
+ should exit after a timeout using the ``exit`` command.
+
+ If this file does not exist, Beaker populates it with a simple default
+ configuration that immediately exits.
+
:file:`pxelinux.cfg/beaker_menu`
Menu configuration generated by :program:`beaker-pxemenu` for the
``menu.c32`` program (part of Syslinux). See :ref:`pxe-menu` for details.