summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-04-29 16:30:41 +0200
committerAdrian Calianu <Adrian.Calianu@enea.com>2021-05-21 17:17:02 +0200
commit5f44786c4370a77b7724df474b017c19914d99e3 (patch)
tree952210cba77a8c51309990d835068edb1d9824c2 /classes
parent5987e0c051babe954238f0bce420d06da5b04b74 (diff)
downloadmeta-el-nfv-access-5f44786c4370a77b7724df474b017c19914d99e3.tar.gz
installer: grub: merge serial/gfx boot entries
- drop our class override that basically reverted the boot menu entry order and used to make serial the first (default) boot entry instead of graphical; - unset GRUB_GFXSERIAL that creates 2 boot entries instead of one; - extend APPEND to contain both tty0 (graphical) and ttyS0 (serial): * ttyS0 is last, so it has priority for selection as /dev/console; Change-Id: I9be029bfea00d9aca61527046fedbe30e7ec58c2 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/override_grub-efi-cfg.inc94
1 files changed, 0 insertions, 94 deletions
diff --git a/classes/override_grub-efi-cfg.inc b/classes/override_grub-efi-cfg.inc
deleted file mode 100644
index 42d89b7..0000000
--- a/classes/override_grub-efi-cfg.inc
+++ /dev/null
@@ -1,94 +0,0 @@
1## ENEA_start ##
2GRUB_GRAPHICS ?= "console=tty0"
3## ENEA_end ##
4
5python build_efi_cfg() {
6 import sys
7
8 workdir = d.getVar('WORKDIR')
9 if not workdir:
10 bb.error("WORKDIR not defined, unable to package")
11 return
12
13 gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
14
15 labels = d.getVar('LABELS')
16 if not labels:
17 bb.debug(1, "LABELS not defined, nothing to do")
18 return
19
20 if labels == []:
21 bb.debug(1, "No labels, nothing to do")
22 return
23
24 cfile = d.getVar('GRUB_CFG')
25 if not cfile:
26 bb.fatal('Unable to read GRUB_CFG')
27
28 try:
29 cfgfile = open(cfile, 'w')
30 except OSError:
31 bb.fatal('Unable to open %s' % cfile)
32
33 cfgfile.write('# Automatically created by OE\n')
34
35 opts = d.getVar('GRUB_OPTS')
36 if opts:
37 for opt in opts.split(';'):
38 cfgfile.write('%s\n' % opt)
39
40 cfgfile.write('default=%s\n' % (labels.split()[0]))
41
42 timeout = d.getVar('GRUB_TIMEOUT')
43 if timeout:
44 cfgfile.write('timeout=%s\n' % timeout)
45 else:
46 cfgfile.write('timeout=50\n')
47
48 root = d.getVar('GRUB_ROOT')
49 if not root:
50 bb.fatal('GRUB_ROOT not defined')
51
52 if gfxserial == "1":
53 ## ENEA_start ##
54 btypes = [ [ " serial console", d.getVar('GRUB_SERIAL') or "" ],
55 [ " graphics console", d.getVar('GRUB_GRAPHICS') or "" ] ]
56 ## ENEA_end ##
57 else:
58 btypes = [ [ "", "" ] ]
59
60 for label in labels.split():
61 localdata = d.createCopy()
62
63 overrides = localdata.getVar('OVERRIDES')
64 if not overrides:
65 bb.fatal('OVERRIDES not defined')
66
67 localdata.setVar('OVERRIDES', 'grub_' + label + ':' + overrides)
68
69 for btype in btypes:
70 cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
71 lb = label
72 if label == "install":
73 lb = "install-efi"
74 kernel = localdata.getVar('KERNEL_IMAGETYPE')
75 cfgfile.write('linux /%s LABEL=%s' % (kernel, lb))
76
77 cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
78
79 append = localdata.getVar('APPEND')
80 initrd = localdata.getVar('INITRD')
81
82 if append:
83 append = replace_rootfs_uuid(d, append)
84 cfgfile.write(' %s' % (append))
85
86 cfgfile.write(' %s' % btype[1])
87 cfgfile.write('\n')
88
89 if initrd:
90 cfgfile.write('initrd /initrd')
91 cfgfile.write('\n}\n')
92
93 cfgfile.close()
94}