From dcfaab1537c257ecb71da35b272829761f669db6 Mon Sep 17 00:00:00 2001 From: Gabriel Ionescu Date: Fri, 20 Apr 2018 13:27:49 +0200 Subject: nfv-installer: Integrate NFV installer into all host images Signed-off-by: Gabriel Ionescu Signed-off-by: Adrian Dudau --- images/enea-nfv-access-host-common.inc | 13 ++-- images/enea-nfv-access-odm.bb | 124 +-------------------------------- 2 files changed, 10 insertions(+), 127 deletions(-) diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc index c907b88..10bf5dc 100644 --- a/images/enea-nfv-access-host-common.inc +++ b/images/enea-nfv-access-host-common.inc @@ -4,7 +4,12 @@ IMAGE_INSTALL += " \ packagegroup-enea-virtualization-host \ " -# Due to a legacy include from corei7 machine we need to stop building following images -NOHDD = "1" -NOISO = "1" -INITRD_IMAGE_LIVE = "" +# Set labels for GRUB and SYSLINUX +LABELS_LIVE="live-boot installer" + +# Append default parameters for x86-64 targets +APPEND_x86-64="console=ttyS0,115200 console=tty0 quiet" + +# Set timeout values +GRUB_TIMEOUT_x86-64="10" +SYSLINUX_TIMEOUT_x86-64="10" diff --git a/images/enea-nfv-access-odm.bb b/images/enea-nfv-access-odm.bb index 2144b68..9c65236 100644 --- a/images/enea-nfv-access-odm.bb +++ b/images/enea-nfv-access-odm.bb @@ -1,131 +1,9 @@ DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM customizations" LICENSE="" -require images/enea-nfv-access-common.inc +require images/enea-nfv-access-host-common.inc IMAGE_INSTALL += " \ packagegroup-enea-virtualization-element-odm \ - packagegroup-enea-virtualization-host \ element-odm \ nfv-init-host \ " - -# Customize the syslinux config file -python build_syslinux_cfg () { - import copy - import sys - - workdir = d.getVar('WORKDIR') - if not workdir: - bb.error("WORKDIR not defined, unable to package") - return - - cfile = d.getVar('SYSLINUX_CFG') - if not cfile: - bb.fatal('Unable to read SYSLINUX_CFG') - - try: - cfgfile = open(cfile, 'w') - except OSError: - bb.fatal('Unable to open %s' % cfile) - - cfgfile.write('# Automatically created by OE - Customized for NFV Access\n') - - opts = d.getVar('SYSLINUX_OPTS') - - if opts: - for opt in opts.split(';'): - cfgfile.write('%s\n' % opt) - - allowoptions = d.getVar('SYSLINUX_ALLOWOPTIONS') - if allowoptions: - cfgfile.write('ALLOWOPTIONS %s\n' % allowoptions) - else: - cfgfile.write('ALLOWOPTIONS 1\n') - - syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE') - syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY') - syslinux_serial = d.getVar('SYSLINUX_SERIAL') - if syslinux_serial: - cfgfile.write('SERIAL %s\n' % syslinux_serial) - - menu = (d.getVar('AUTO_SYSLINUXMENU') == "1") - - cfgfile.write("DEFAULT Install NFV Access\n") - - cfgfile.write('TIMEOUT 10\n') - - prompt = d.getVar('SYSLINUX_PROMPT') - if prompt: - cfgfile.write('PROMPT %s\n' % prompt) - else: - cfgfile.write('PROMPT 1\n') - - if menu: - cfgfile.write('ui vesamenu.c32\n') - cfgfile.write('menu title Select kernel options and boot kernel\n') - cfgfile.write('menu tabmsg Press [Tab] to edit, [Return] to select\n') - - cfgfile.write("LABEL Boot NFV Access\n") - cfgfile.write("KERNEL /vmlinuz\n") - cfgfile.write("APPEND initrd=/initrd LABEL=boot root=/dev/ram0 rootwait console=ttyS0,115200\n") - - cfgfile.write("LABEL Install NFV Access\n") - cfgfile.write("KERNEL /vmlinuz\n") - cfgfile.write("APPEND initrd=/initrd LABEL=installer root=/dev/ram0 rootwait console=ttyS0,115200\n") - - - cfgfile.close() -} - -# Customize the GRUB config file -python build_efi_cfg() { - import sys - - workdir = d.getVar('WORKDIR') - if not workdir: - bb.error("WORKDIR not defined, unable to package") - return - - gfxserial = d.getVar('GRUB_GFXSERIAL') or "" - - cfile = d.getVar('GRUB_CFG') - if not cfile: - bb.fatal('Unable to read GRUB_CFG') - - try: - cfgfile = open(cfile, 'w') - except OSError: - bb.fatal('Unable to open %s' % cfile) - - cfgfile.write('# Automatically created by OE - customized for NFV Access\n') - - cfgfile.write('default=Boot NFV Access\n') - - timeout = d.getVar('GRUB_TIMEOUT') - if timeout: - cfgfile.write('timeout=%s\n' % timeout) - else: - cfgfile.write('timeout=50\n') - - root = d.getVar('GRUB_ROOT') - if not root: - bb.fatal('GRUB_ROOT not defined') - - if gfxserial == "1": - btypes = [ [ " graphics console", "" ], - [ " serial console", d.getVar('GRUB_SERIAL') or "" ] ] - else: - btypes = [ [ "", "" ] ] - - cfgfile.write("menuentry 'Boot NFV Access'{\n") - cfgfile.write("linux /vmlinuz %s rootwait LABEL=boot console=ttyS0,115200\n" % root) - cfgfile.write("initrd /initrd\n") - cfgfile.write("}\n") - - cfgfile.write("menuentry 'Install NFV Access'{\n") - cfgfile.write("linux /vmlinuz %s rootwait LABEL=installer console=ttyS0,115200\n" % root) - cfgfile.write("initrd /initrd\n") - cfgfile.write("}\n") - - cfgfile.close() -} -- cgit v1.2.3-54-g00ecf