diff options
| author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2021-04-29 16:30:41 +0200 |
|---|---|---|
| committer | Adrian Calianu <Adrian.Calianu@enea.com> | 2021-05-21 17:17:02 +0200 |
| commit | 5f44786c4370a77b7724df474b017c19914d99e3 (patch) | |
| tree | 952210cba77a8c51309990d835068edb1d9824c2 | |
| parent | 5987e0c051babe954238f0bce420d06da5b04b74 (diff) | |
| download | meta-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>
| -rw-r--r-- | classes/override_grub-efi-cfg.inc | 94 | ||||
| -rw-r--r-- | images/enea-nfv-access-host-common.inc | 4 |
2 files changed, 1 insertions, 97 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 ## | ||
| 2 | GRUB_GRAPHICS ?= "console=tty0" | ||
| 3 | ## ENEA_end ## | ||
| 4 | |||
| 5 | python 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 | } | ||
diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc index c91e1e7..c096600 100644 --- a/images/enea-nfv-access-host-common.inc +++ b/images/enea-nfv-access-host-common.inc | |||
| @@ -2,7 +2,6 @@ IMAGE_FSTYPES += "hddimg" | |||
| 2 | 2 | ||
| 3 | REQUIRE_FILES = " \ | 3 | REQUIRE_FILES = " \ |
| 4 | images/enea-nfv-access-common.inc \ | 4 | images/enea-nfv-access-common.inc \ |
| 5 | classes/override_grub-efi-cfg.inc \ | ||
| 6 | " | 5 | " |
| 7 | REQUIRE_FILES_append_df-efi-secure-boot = " \ | 6 | REQUIRE_FILES_append_df-efi-secure-boot = " \ |
| 8 | classes/override_live-vm-common.inc \ | 7 | classes/override_live-vm-common.inc \ |
| @@ -19,9 +18,8 @@ IMAGE_INSTALL += " \ | |||
| 19 | # Set labels for GRUB and SYSLINUX | 18 | # Set labels for GRUB and SYSLINUX |
| 20 | LABELS_LIVE = "installer live-boot" | 19 | LABELS_LIVE = "installer live-boot" |
| 21 | 20 | ||
| 22 | GRUB_GFXSERIAL_x86-64 = "1" | ||
| 23 | # Append default parameters for x86-64 targets | 21 | # Append default parameters for x86-64 targets |
| 24 | APPEND_x86-64 = "quiet" | 22 | APPEND_x86-64 = "quiet console=tty0 console=ttyS0,115200" |
| 25 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" | 23 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" |
| 26 | 24 | ||
| 27 | # Skip menu and boot installer immediately | 25 | # Skip menu and boot installer immediately |
