summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Ionescu <gabriel.ionescu@enea.com>2018-04-20 13:27:49 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2018-04-23 10:09:51 +0200
commitdcfaab1537c257ecb71da35b272829761f669db6 (patch)
tree5a847129e1edc9f8c375c63903944bf957aa9475
parent5d73d7fc77e440e0d2ce12f726cbbad36d34adef (diff)
downloadmeta-el-nfv-access-pyro-nfvaccess.tar.gz
nfv-installer: Integrate NFV installer into all host imagespyro-nfvaccess
Signed-off-by: Gabriel Ionescu <gabriel.ionescu@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r--images/enea-nfv-access-host-common.inc13
-rw-r--r--images/enea-nfv-access-odm.bb124
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 += " \
4 packagegroup-enea-virtualization-host \ 4 packagegroup-enea-virtualization-host \
5 " 5 "
6 6
7# Due to a legacy include from corei7 machine we need to stop building following images 7# Set labels for GRUB and SYSLINUX
8NOHDD = "1" 8LABELS_LIVE="live-boot installer"
9NOISO = "1" 9
10INITRD_IMAGE_LIVE = "" 10# Append default parameters for x86-64 targets
11APPEND_x86-64="console=ttyS0,115200 console=tty0 quiet"
12
13# Set timeout values
14GRUB_TIMEOUT_x86-64="10"
15SYSLINUX_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 @@
1DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM customizations" 1DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM customizations"
2LICENSE="" 2LICENSE=""
3require images/enea-nfv-access-common.inc 3require images/enea-nfv-access-host-common.inc
4 4
5IMAGE_INSTALL += " \ 5IMAGE_INSTALL += " \
6 packagegroup-enea-virtualization-element-odm \ 6 packagegroup-enea-virtualization-element-odm \
7 packagegroup-enea-virtualization-host \
8 element-odm \ 7 element-odm \
9 nfv-init-host \ 8 nfv-init-host \
10 " 9 "
11
12# Customize the syslinux config file
13python build_syslinux_cfg () {
14 import copy
15 import sys
16
17 workdir = d.getVar('WORKDIR')
18 if not workdir:
19 bb.error("WORKDIR not defined, unable to package")
20 return
21
22 cfile = d.getVar('SYSLINUX_CFG')
23 if not cfile:
24 bb.fatal('Unable to read SYSLINUX_CFG')
25
26 try:
27 cfgfile = open(cfile, 'w')
28 except OSError:
29 bb.fatal('Unable to open %s' % cfile)
30
31 cfgfile.write('# Automatically created by OE - Customized for NFV Access\n')
32
33 opts = d.getVar('SYSLINUX_OPTS')
34
35 if opts:
36 for opt in opts.split(';'):
37 cfgfile.write('%s\n' % opt)
38
39 allowoptions = d.getVar('SYSLINUX_ALLOWOPTIONS')
40 if allowoptions:
41 cfgfile.write('ALLOWOPTIONS %s\n' % allowoptions)
42 else:
43 cfgfile.write('ALLOWOPTIONS 1\n')
44
45 syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE')
46 syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY')
47 syslinux_serial = d.getVar('SYSLINUX_SERIAL')
48 if syslinux_serial:
49 cfgfile.write('SERIAL %s\n' % syslinux_serial)
50
51 menu = (d.getVar('AUTO_SYSLINUXMENU') == "1")
52
53 cfgfile.write("DEFAULT Install NFV Access\n")
54
55 cfgfile.write('TIMEOUT 10\n')
56
57 prompt = d.getVar('SYSLINUX_PROMPT')
58 if prompt:
59 cfgfile.write('PROMPT %s\n' % prompt)
60 else:
61 cfgfile.write('PROMPT 1\n')
62
63 if menu:
64 cfgfile.write('ui vesamenu.c32\n')
65 cfgfile.write('menu title Select kernel options and boot kernel\n')
66 cfgfile.write('menu tabmsg Press [Tab] to edit, [Return] to select\n')
67
68 cfgfile.write("LABEL Boot NFV Access\n")
69 cfgfile.write("KERNEL /vmlinuz\n")
70 cfgfile.write("APPEND initrd=/initrd LABEL=boot root=/dev/ram0 rootwait console=ttyS0,115200\n")
71
72 cfgfile.write("LABEL Install NFV Access\n")
73 cfgfile.write("KERNEL /vmlinuz\n")
74 cfgfile.write("APPEND initrd=/initrd LABEL=installer root=/dev/ram0 rootwait console=ttyS0,115200\n")
75
76
77 cfgfile.close()
78}
79
80# Customize the GRUB config file
81python build_efi_cfg() {
82 import sys
83
84 workdir = d.getVar('WORKDIR')
85 if not workdir:
86 bb.error("WORKDIR not defined, unable to package")
87 return
88
89 gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
90
91 cfile = d.getVar('GRUB_CFG')
92 if not cfile:
93 bb.fatal('Unable to read GRUB_CFG')
94
95 try:
96 cfgfile = open(cfile, 'w')
97 except OSError:
98 bb.fatal('Unable to open %s' % cfile)
99
100 cfgfile.write('# Automatically created by OE - customized for NFV Access\n')
101
102 cfgfile.write('default=Boot NFV Access\n')
103
104 timeout = d.getVar('GRUB_TIMEOUT')
105 if timeout:
106 cfgfile.write('timeout=%s\n' % timeout)
107 else:
108 cfgfile.write('timeout=50\n')
109
110 root = d.getVar('GRUB_ROOT')
111 if not root:
112 bb.fatal('GRUB_ROOT not defined')
113
114 if gfxserial == "1":
115 btypes = [ [ " graphics console", "" ],
116 [ " serial console", d.getVar('GRUB_SERIAL') or "" ] ]
117 else:
118 btypes = [ [ "", "" ] ]
119
120 cfgfile.write("menuentry 'Boot NFV Access'{\n")
121 cfgfile.write("linux /vmlinuz %s rootwait LABEL=boot console=ttyS0,115200\n" % root)
122 cfgfile.write("initrd /initrd\n")
123 cfgfile.write("}\n")
124
125 cfgfile.write("menuentry 'Install NFV Access'{\n")
126 cfgfile.write("linux /vmlinuz %s rootwait LABEL=installer console=ttyS0,115200\n" % root)
127 cfgfile.write("initrd /initrd\n")
128 cfgfile.write("}\n")
129
130 cfgfile.close()
131}