diff options
Diffstat (limited to 'classes/override_grub-efi-cfg.inc')
-rw-r--r-- | classes/override_grub-efi-cfg.inc | 94 |
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 ## | ||
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 | } | ||