]> git.proxmox.com Git - grub2.git/blob - ChangeLog
Declare fast forward from 2.02+dfsg1-20
[grub2.git] / ChangeLog
1 2019-07-04 Daniel Kiper <daniel.kiper@oracle.com>
2
3 Release 2.04
4
5 2019-06-24 Thomas Schmitt <scdbackup@gmx.net>
6
7 docs: Document workaround for grub-mkrescue with older MacBooks
8 Add a description of the workaround for firmware of older MacBooks
9 which stalls with a grub-mkrescue ISO image for x86_64-efi target
10 on an USB stick.
11
12 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
13
14 2019-06-24 Eric Snowberg <eric.snowberg@oracle.com>
15
16 docs: Bootstrap changes required for older distros
17 Some older distros do not contain gettext 0.18. Document the workaround
18 to use the bootstrap utility on these systems.
19
20 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
21
22 2019-06-07 Leif Lindholm <leif.lindholm@linaro.org>
23
24 ia64: build fix in cache.h
25 Add IA64 to the architectures excluding a declaration for
26 grub_arch_sync_dma_caches().
27
28 IA64 does not include any of the source files that require the function,
29 but was overlooked for d8901e3ba115 ("cache: Fix compilation for ppc,
30 sparc and arm64").
31
32 Add it to the list of excluding architectures in order to not get
33 missing symbol errors when running grub-mkimage.
34
35 Reported-by: Alexander Graf <agraf@csgraf.de>
36 Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
37 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
38
39 2019-06-07 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
40
41 hostfs: #undef open and close.
42 Unlike in case of disks in this case it's just a single place, so it's easier
43 to just #undef
44
45 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
46
47 2019-06-03 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
48
49 f2fs: Disable gcc9 -Waddress-of-packed-member
50 Disable the -Wadress-of-packaed-member diagnostic for the grub_f2fs_label
51 function since the result is found to be false postive.
52
53 A pointer to the 'volume_name' member of 'struct grub_f2fs_superblock' is
54 guaranteed to be aligned as the offset of 'volume_name' within the struct
55 is dividable by the natural alignment on both 32- and 64-bit targets.
56
57 grub-core/fs/f2fs.c: In function ‘grub_f2fs_label’:
58 grub-core/fs/f2fs.c:1253:60: error: taking address of packed member of ‘struct grub_f2fs_superblock’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
59 1253 | *label = (char *) grub_f2fs_utf16_to_utf8 (data->sblock.volume_name);
60 | ~~~~~~~~~~~~^~~~~~~~~~~~
61 cc1: all warnings being treated as errors
62
63 Reported-by: Neil MacLeod <neil@nmacleod.com>
64 Tested-by: Neil MacLeod <neil@nmacleod.com>
65 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
66
67 2019-05-20 Vincent Legoll <vincent.legoll@gmail.com>
68
69 grub-mkrescue: Fix error message about the wrong command having failed: mformat instead of mcopy
70 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
71
72 2019-05-20 Mathieu Trudel-Lapierre <mathieu.tl@gmail.com>
73
74 video: skip 'text' gfxpayload if not supported, to fallback to default
75 On UEFI, 'text' gfxpayload is not supported, but we still reach parse_modespec()
76 with it, which will obviously fail. Fortunately, whatever gfxpayload is set,
77 we still still have the 'auto' default to fall back to. Allow getting to this
78 fallback by not trying to parse 'text' as a modespec.
79
80 This is because 'text' correctly doesn't parse as a modespec, and ought to have
81 been ignored before we got to that point, just like it is immediately picked if
82 we're running on a system where 'text' is a supported video mode.
83
84 Bug: https://savannah.gnu.org/bugs/index.php?56217
85
86 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
87
88 2019-05-20 Ovidiu Panait <ovidiu.panait@windriver.com>
89
90 grub-mkconfig: Use -c instead of --printf for stat
91 "--printf" only works with the stat variant provided by coreutils.
92
93 With busybox, stat will fail with the following error:
94 stat: unrecognized option '--printf=%T'
95
96 Usage: stat [OPTIONS] FILE...
97
98 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
99
100 2019-05-20 Michael Chang <mchang@suse.com>
101
102 f2fs: Fix gcc9 error -Werror=maybe-uninitialized
103 The function grub_get_node_path() could return uninitialized offset with
104 level == 0 if the block is greater than direct_index + 2 * direct_blks +
105 2 * indirect_blks + dindirect_blks. The uninitialized offset is then used
106 by function grub_f2fs_get_block() because level == 0 is valid and
107 meaningful return to be processed.
108
109 The fix is to set level = -1 as return value by grub_get_node_path() to
110 signify an error that the input block cannot be handled. Any caller
111 should therefore check level is negative or not before processing the
112 output.
113
114 Reported-by: Neil MacLeod <neil@nmacleod.com>
115 Tested-by: Neil MacLeod <neil@nmacleod.com>
116 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
117
118 2019-05-06 Alexander Graf <agraf@csgraf.de>
119
120 arm: Align section alignment with manual relocation offset code
121 The arm relocation code has a manual special case for EFI binaries to
122 add the natural alignment to its own relocation awareness.
123
124 Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
125 boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
126 the change in that branch that we forgot as well.
127
128 This fixes running 32bit arm grub efi binaries for me again.
129
130 Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
131 Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
132 Reported-by: Steve McIntyre <steve@einval.com>
133 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
134 Tested-by: Julien ROBIN <julien.robin28@free.fr>
135 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
136 Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
137 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
138
139 2019-05-06 Alexander Graf <agraf@csgraf.de>
140
141 arm: Move trampolines into code section
142 When creating T32->A32 transition jumps, the relocation code in grub
143 will generate trampolines. These trampolines live in the .data section
144 of our PE binary which means they are not marked as executable.
145
146 This misbehavior was unmasked by commit a51f953f4ee87 ("mkimage: Align
147 efi sections on 4k boundary") which made the X/NX boundary more obvious
148 because everything became page aligned.
149
150 To put things into proper order, let's move the arm trampolines into the
151 .text section instead. That way everyone knows they are executable.
152
153 Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
154 Reported-by: Julien ROBIN <julien.robin28@free.fr>
155 Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
156 Tested-by: Julien ROBIN <julien.robin28@free.fr>
157 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
158 Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
159 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
160
161 2019-04-23 Michael Chang <mchang@suse.com>
162
163 efi: Fix gcc9 error -Waddress-of-packed-member
164 The address of fp->path_name could be unaligned since seeking into the
165 device path buffer for a given node could end in byte boundary.
166
167 The fix is allocating aligned buffer by grub_malloc for holding the
168 UTF16 string copied from fp->path_name, and after using that buffer as
169 argument for grub_utf16_to_utf8 to convert it to UTF8 string.
170
171 [ 255s] ../../grub-core/kern/efi/efi.c: In function 'grub_efi_get_filename':
172 [ 255s] ../../grub-core/kern/efi/efi.c:410:60: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
173 [ 255s] 410 | p = (char *) grub_utf16_to_utf8 ((unsigned char *) p, fp->path_name, len);
174 [ 255s] | ~~^~~~~~~~~~~
175 [ 255s] ../../grub-core/kern/efi/efi.c: In function 'grub_efi_print_device_path':
176 [ 255s] ../../grub-core/kern/efi/efi.c:900:33: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
177 [ 255s] 900 | *grub_utf16_to_utf8 (buf, fp->path_name,
178 [ 255s] | ~~^~~~~~~~~~~
179
180 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
181
182 2019-04-23 Michael Chang <mchang@suse.com>
183
184 chainloader: Fix gcc9 error -Waddress-of-packed-member
185 The address of fp->path_name could be unaligned since seeking into the
186 device path buffer for a given node could end in byte boundary.
187
188 The fix is using aligned buffer allocated by grub_malloc for receiving
189 the converted UTF16 string by grub_utf8_to_utf16 and also the processing
190 after. The resulting string then gets copied to fp->path_name.
191
192 [ 243s] ../../grub-core/loader/efi/chainloader.c: In function 'copy_file_path':
193 [ 243s] ../../grub-core/loader/efi/chainloader.c:136:32: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
194 [ 243s] 136 | size = grub_utf8_to_utf16 (fp->path_name, len * GRUB_MAX_UTF16_PER_UTF8,
195 [ 243s] | ~~^~~~~~~~~~~
196 [ 243s] ../../grub-core/loader/efi/chainloader.c:138:12: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
197 [ 243s] 138 | for (p = fp->path_name; p < fp->path_name + size; p++)
198 [ 243s] | ^~
199
200 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
201
202 2019-04-23 Michael Chang <mchang@suse.com>
203
204 usbtest: Disable gcc9 -Waddress-of-packed-member
205 Disable the -Wadress-of-packaed-member diagnostic for the
206 grub_usb_get_string function since the result is false postive. The
207 descstrp->str is found to be aligned in the buffer allocated for 'struct
208 grub_usb_desc_str'.
209
210 [ 229s] ../../grub-core/commands/usbtest.c: In function 'grub_usb_get_string':
211 [ 229s] ../../grub-core/commands/usbtest.c:104:58: error: taking address of packed member of 'struct grub_usb_desc_str' may result in an unaligned pointer value [-Werror=address-of-packed-member]
212 [ 229s] 104 | *grub_utf16_to_utf8 ((grub_uint8_t *) *string, descstrp->str,
213 [ 229s] | ~~~~~~~~^~~~~
214
215 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
216
217 2019-04-23 Michael Chang <mchang@suse.com>
218
219 acpi: Fix gcc9 error -Waddress-of-packed-member
220 Simply adds the missing packed attribute to 'struct grub_acpi_madt'.
221
222 [ 233s] ../../grub-core/commands/lsacpi.c: In function 'disp_acpi_xsdt_table':
223 [ 233s] ../../grub-core/commands/lsacpi.c:201:27: error: converting a packed 'struct grub_acpi_table_header' pointer (alignment 1) to a 'struct grub_acpi_madt' pointer (alignment 4) may result in an unaligned pointer value [-Werror=address-of-packed-member]
224 [ 233s] 201 | disp_madt_table ((struct grub_acpi_madt *) t);
225 [ 233s] | ^~~~~~~~~~~~~~
226 [ 233s] In file included from ../../grub-core/commands/lsacpi.c:23:
227 [ 233s] ../../include/grub/acpi.h:50:8: note: defined here
228 [ 233s] 50 | struct grub_acpi_table_header
229 [ 233s] | ^~~~~~~~~~~~~~~~~~~~~~
230 [ 233s] ../../include/grub/acpi.h:90:8: note: defined here
231 [ 233s] 90 | struct grub_acpi_madt
232 [ 233s] | ^~~~~~~~~~~~~~
233 [ 233s] ../../grub-core/commands/lsacpi.c: In function 'disp_acpi_rsdt_table':
234 [ 233s] ../../grub-core/commands/lsacpi.c:225:27: error: converting a packed 'struct grub_acpi_table_header' pointer (alignment 1) to a 'struct grub_acpi_madt' pointer (alignment 4) may result in an unaligned pointer value [-Werror=address-of-packed-member]
235 [ 233s] 225 | disp_madt_table ((struct grub_acpi_madt *) t);
236 [ 233s] | ^~~~~~~~~~~~~~
237 [ 233s] In file included from ../../grub-core/commands/lsacpi.c:23:
238 [ 233s] ../../include/grub/acpi.h:50:8: note: defined here
239 [ 233s] 50 | struct grub_acpi_table_header
240 [ 233s] | ^~~~~~~~~~~~~~~~~~~~~~
241 [ 233s] ../../include/grub/acpi.h:90:8: note: defined here
242 [ 233s] 90 | struct grub_acpi_madt
243 [ 233s] | ^~~~~~~~~~~~~~
244
245 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
246
247 2019-04-23 Michael Chang <mchang@suse.com>
248
249 hfsplus: Fix gcc9 error with -Waddress-of-packed-member
250 The catkey->name could be unaligned since the address of 'void* record'
251 is calculated as offset in bytes to a malloc buffer.
252
253 The fix is using aligned buffer allocated by grub_malloc for holding
254 the UTF16 string copied from catkey->name. And use that buffer as
255 argument for grub_utf16_to_utf8 to convert to UTF8 strings.
256
257 In addition, using a new copy of buffer rather than catkey->name itself
258 for processing the endianess conversion, we can also get rid of the hunk
259 restoring byte order of catkey->name to what it was previously.
260
261 [ 59s] ../grub-core/fs/hfsplus.c: In function 'list_nodes':
262 [ 59s] ../grub-core/fs/hfsplus.c:738:57: error: taking address of packed member of 'struct grub_hfsplus_catkey' may result in an unaligned pointer value [-Werror=address-of-packed-member]
263 [ 59s] 738 | *grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name,
264 [ 59s] | ~~~~~~^~~~~~
265 [ 59s] ../grub-core/fs/hfsplus.c: In function 'grub_hfsplus_label':
266 [ 59s] ../grub-core/fs/hfsplus.c:1019:57: error: taking address of packed member of 'struct grub_hfsplus_catkey' may result in an unaligned pointer value [-Werror=address-of-packed-member]
267 [ 59s] 1019 | *grub_utf16_to_utf8 ((grub_uint8_t *) (*label), catkey->name,
268 [ 59s] | ~~~~~~^~~~~~
269
270 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
271
272 2019-04-23 Michael Chang <mchang@suse.com>
273
274 hfs: Fix gcc9 error -Waddress-of-packed-member
275 Simply adds the missing packed attribute to 'struct grub_hfs_extent'.
276
277 [ 83s] ../grub-core/fs/hfs.c: In function 'grub_hfs_iterate_records':
278 [ 83s] ../grub-core/fs/hfs.c:699:9: error: taking address of packed member of 'struct grub_hfs_sblock' may result in an unaligned pointer value [-Werror=address-of-packed-member]
279 [ 83s] 699 | ? (&data->sblock.catalog_recs)
280 [ 83s] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~
281 [ 83s] ../grub-core/fs/hfs.c:700:9: error: taking address of packed member of 'struct grub_hfs_sblock' may result in an unaligned pointer value [-Werror=address-of-packed-member]
282 [ 83s] 700 | : (&data->sblock.extent_recs));
283 [ 83s] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~
284
285 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
286
287 2019-04-23 Michael Chang <mchang@suse.com>
288
289 jfs: Disable gcc9 -Waddress-of-packed-member
290 Disable the -Wadress-of-packaed-member diagnostic for the
291 grub_jfs_getent function since the result is found to be false postive.
292
293 The leaf is read into memory as continous chunks in size of 32 bytes and
294 the pointer to its base is aligned, which also guarentee its member
295 leaf->namepart is aligned.
296
297 [ 60s] ../grub-core/fs/jfs.c: In function 'grub_jfs_getent':
298 [ 60s] ../grub-core/fs/jfs.c:557:44: error: taking address of packed member of 'struct grub_jfs_leaf_dirent' may result in an unaligned pointer value [-Werror=address-of-packed-member]
299 [ 60s] 557 | le_to_cpu16_copy (filename + strpos, leaf->namepart, len < diro->data->namecomponentlen ? len
300 [ 60s] | ~~~~^~~~~~~~~~
301 [ 60s] ../grub-core/fs/jfs.c:570:48: error: taking address of packed member of 'struct grub_jfs_leaf_next_dirent' may result in an unaligned pointer value [-Werror=address-of-packed-member]
302 [ 60s] 570 | le_to_cpu16_copy (filename + strpos, next_leaf->namepart, len < 15 ? len : 15);
303 [ 60s] | ~~~~~~~~~^~~~~~~~~~
304 [ 60s] cc1: all warnings being treated as errors
305
306 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
307
308 2019-04-23 Michael Chang <mchang@suse.com>
309
310 cpio: Disable gcc9 -Waddress-of-packed-member
311 Disable the -Wadress-of-packaed-member diagnostic for the
312 grub_cpio_find_file function since the result is found to be false
313 postive. Any pointers to member of the 'struct head hd' is aligned even
314 if the structure is packed without paddings.
315
316 [ 59s] In file included from ../grub-core/fs/cpio.c:51:
317 [ 59s] ../grub-core/fs/cpio_common.c: In function 'grub_cpio_find_file':
318 [ 59s] ../grub-core/fs/cpio_common.c:58:31: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
319 [ 59s] 58 | data->size = read_number (hd.filesize, ARRAY_SIZE (hd.filesize));
320 [ 59s] | ~~^~~~~~~~~
321 [ 59s] ../grub-core/fs/cpio_common.c:60:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
322 [ 59s] 60 | *mtime = read_number (hd.mtime, ARRAY_SIZE (hd.mtime));
323 [ 59s] | ~~^~~~~~
324 [ 59s] ../grub-core/fs/cpio_common.c:61:28: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
325 [ 59s] 61 | modeval = read_number (hd.mode, ARRAY_SIZE (hd.mode));
326 [ 59s] | ~~^~~~~
327 [ 59s] ../grub-core/fs/cpio_common.c:62:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
328 [ 59s] 62 | namesize = read_number (hd.namesize, ARRAY_SIZE (hd.namesize));
329 [ 59s] | ~~^~~~~~~~~
330 [ 59s] In file included from ../grub-core/fs/cpio_be.c:51:
331 [ 59s] ../grub-core/fs/cpio_common.c: In function 'grub_cpio_find_file':
332 [ 59s] ../grub-core/fs/cpio_common.c:58:31: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
333 [ 59s] 58 | data->size = read_number (hd.filesize, ARRAY_SIZE (hd.filesize));
334 [ 59s] | ~~^~~~~~~~~
335 [ 59s] ../grub-core/fs/cpio_common.c:60:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
336 [ 59s] 60 | *mtime = read_number (hd.mtime, ARRAY_SIZE (hd.mtime));
337 [ 59s] | ~~^~~~~~
338 [ 59s] ../grub-core/fs/cpio_common.c:61:28: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
339 [ 59s] 61 | modeval = read_number (hd.mode, ARRAY_SIZE (hd.mode));
340 [ 59s] | ~~^~~~~
341 [ 59s] ../grub-core/fs/cpio_common.c:62:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
342 [ 59s] 62 | namesize = read_number (hd.namesize, ARRAY_SIZE (hd.namesize));
343 [ 59s] | ~~^~~~~~~~~
344
345 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
346
347 2019-04-23 Heinrich Schuchardt <xypron.glpk@gmx.de>
348
349 efi: Avoid NULL dereference if FilePath is NULL
350 The UEFI specification allows LoadImage() to be called with a memory
351 location only and without a device path. In this case FilePath will not be
352 set in the EFI_LOADED_IMAGE_PROTOCOL.
353
354 So in function grub_efi_get_filename() the device path argument may be
355 NULL. As we cannot determine the device path in this case just return NULL
356 from the function.
357
358 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
359 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
360
361 2019-04-23 Daniel Kiper <daniel.kiper@oracle.com>
362
363 x86/msr: Fix build with older GCC versions
364 Some older GCC versions produce following error when x86 MSR modules are build:
365
366 In file included from commands/i386/rdmsr.c:29:0:
367 ../include/grub/i386/rdmsr.h:27:29: error: no previous prototype for ‘grub_msr_read’ [-Werror=missing-prototypes]
368 extern inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id)
369 ^
370 cc1: all warnings being treated as errors
371
372 This happens due to lack of support for a such usage of extern keyword
373 in older GCCs. Additionally, this usage is not consistent with the rest
374 of codebase. So, replace it with static keyword.
375
376 Additionally, fix incorrect coding style.
377
378 Reported-by: Eric Snowberg <eric.snowberg@oracle.com>
379 Reported-by: adrian15 <adrian15sgd@gmail.com>
380 Reviewed-by: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
381 Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com>
382 Tested-by: adrian15 <adrian15sgd@gmail.com>
383
384 2019-04-09 Vladimir Serbinenko <phcoder@gmail.com>
385
386 Release 2.04~rc1
387
388 2019-04-09 Vladimir Serbinenko <phcoder@gmail.com>
389
390 Change fs functions to add fs_ prefix
391 This avoid conflict with gnulib
392
393 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
394
395 2019-04-08 Vladimir Serbinenko <phcoder@google.com>
396
397 A workaround for clang problem assembling startup_raw.S
398 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
399
400 2019-04-04 Eric Snowberg <eric.snowberg@oracle.com>
401
402 ieee1275: NULL pointer dereference in grub_ieee1275_encode_devname()
403 Function grub_strndup() may return NULL, this is called from
404 function grub_ieee1275_get_devname() which is then called from
405 function grub_ieee1275_encode_devname() to set device. The device
406 variable could then be used with a NULL pointer.
407
408 Reviewed-by: Colin Watson <cjwatson@ubuntu.com>
409 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
410
411 2019-04-02 Daniel Kiper <daniel.kiper@oracle.com>
412
413 docs/grub-dev: Change comments rules
414 Current comments forms are annoying, so, some of them are disallowed
415 starting from now. New rules are more flexible and mostly aligned
416 with, e.g., Linux kernel comments rules.
417
418 Reviewed-by: Vladimir Serbinenko <phcoder@google.com>
419
420 2019-04-02 Andrew Jeddeloh <andrew.jeddeloh@coreos.com>
421
422 loader/i386/linux: Calculate the setup_header length
423 Previously the setup_header length was just assumed to be the size of the
424 linux_kernel_params struct. The linux x86 32-bit boot protocol says that the
425 end of the linux_i386_kernel_header is at 0x202 + the byte value at 0x201 in
426 the linux_i386_kernel_header. So, calculate the size of the header using the
427 end of the linux_i386_kernel_header, rather than assume it is the size of the
428 linux_kernel_params struct.
429
430 Additionally, add some required members to the linux_kernel_params
431 struct and align the content of linux_i386_kernel_header struct with
432 it. New members naming was taken directly from Linux kernel source.
433
434 linux_kernel_params and linux_i386_kernel_header structs require more
435 cleanup. However, this is not urgent, so, let's do this after release.
436 Just in case...
437
438 Reviewed-by: Vladimir Serbinenko <phcoder@google.com>
439 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
440
441 2019-04-02 Eric Snowberg <eric.snowberg@oracle.com>
442
443 efidisk: NULL pointer dereference in grub_efidisk_get_device_name()
444 Function grub_efi_find_last_device_path() may return NULL when called
445 from grub_efidisk_get_device_name().
446
447 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
448
449 2019-04-02 Eric Snowberg <eric.snowberg@oracle.com>
450
451 efidisk: NULL pointer dereference in is_child()
452 Function grub_efi_find_last_device() path may return NULL when called
453 from is_child().
454
455 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
456
457 2019-04-02 Eric Snowberg <eric.snowberg@oracle.com>
458
459 efidisk: Write to NULL pointer ldp
460 Function grub_efi_find_last_device_path() may return constant NULL when
461 called from find_parent_device().
462
463 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
464
465 2019-04-02 Vladimir Serbinenko <phcoder@google.com>
466
467 clang: Pair -Qn with -Qunused-arguments.
468 When assembling module wirh clang -Qn ends up on command line but later ignored
469 To avoid it breaking the compile, add -Qunused-arguments.
470
471 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
472
473 2019-03-28 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
474
475 ieee1275: Fix path reference in comment of sparc64 boot loader code
476 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
477
478 2019-03-28 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
479
480 ieee1275: Include a.out header in assembly of sparc64 boot loader
481 Recent versions of binutils dropped support for the a.out and COFF
482 formats on sparc64 targets. Since the boot loader on sparc64 is
483 supposed to be an a.out binary and the a.out header entries are
484 rather simple to calculate in our case, we just write the header
485 ourselves instead of relying on external tools to do that.
486
487 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
488
489 2019-03-26 Vladimir Serbinenko <phcoder@gmail.com>
490
491 Propagate GNU_PRINTF from gnulib vfprintf
492 gnulib now replaces vfprintf and hence its format becomes GNU_PRINTF format
493
494 This also fixes matching definitions to always use GNU format
495
496 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
497
498 2019-03-26 Vladimir Serbinenko <phcoder@gmail.com>
499
500 efi/tpm.c: Add missing casts
501 Without those casts we get a warning about implicit conversion of pointer
502 to integer.
503
504 2019-03-26 Vladimir Serbinenko <phcoder@gmail.com>
505
506 POTFILES: Don't include gnulib in grub.pot
507 They're translated as a separate project, so we
508 don't want to submit them again.
509
510 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
511
512 2019-03-26 Vladimir Serbinenko <phcoder@google.com>
513
514 configure.ac: Use nostdlib when checking for nostdinc
515 With clang nostdinc behaviour is influenced by nostdlib. Since we
516 always add nostdlib, add it in test as well
517
518 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
519
520 2019-03-25 Vladimir Serbinenko <phcoder@gmail.com>
521
522 efi/tpm.h: Fix hash_log_extend_event definition.
523 I didn't check the spec but pointer to address doesn't make much sense
524 and doesn't match the code.
525
526 Rename grub_disk members
527 Otherwise it horribly clashes with gnulib when it's
528 replacing open/write/read/close
529
530 grub-mkimagexx: Fix RISCV error message
531 Outputting a raw pointer doesn't match the format and is
532 also useless. Output offset instead.
533
534 kern/emu/misc.c: Don't include config-util.h when running as GRUB_BUILD
535
536 Support R_PPC_PLTREL24
537 It's emitted by clang 7. It's the same as R_PPC_REL24.
538
539 2019-03-20 Daniel Kiper <daniel.kiper@oracle.com>
540
541 sparc: Enable __clzsi2() and __clzdi2()
542 This patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers
543 for clz) but for SPARC target.
544
545 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
546
547 2019-03-20 Daniel Kiper <daniel.kiper@oracle.com>
548
549 mips: Enable __clzsi2()
550 This patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers
551 for clz) but for MIPS target.
552
553 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
554
555 2019-03-20 Daniel Kiper <daniel.kiper@oracle.com>
556
557 verifiers: MIPS fallout cleanup
558 MIPS fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility
559 to verify kernel and modules command lines).
560
561 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
562
563 2019-03-20 Daniel Kiper <daniel.kiper@oracle.com>
564
565 verifiers: PowerPC fallout cleanup
566 PowerPC fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility
567 to verify kernel and modules command lines) and ca0a4f689 (verifiers: File
568 type for fine-grained signature-verification controlling).
569
570 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
571
572 2019-03-20 Daniel Kiper <daniel.kiper@oracle.com>
573
574 verifiers: IA-64 fallout cleanup
575 IA-64 fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility
576 to verify kernel and modules command lines).
577
578 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
579
580 2019-03-20 Colin Watson <cjwatson@ubuntu.com>
581
582 posix_wrap: Flesh out posix_wrap/limits.h a little more
583 In addition to what was already there, Gnulib's <intprops.h> needs SCHAR_MIN,
584 SCHAR_MAX, SHRT_MIN, INT_MIN, LONG_MIN, and LONG_MAX. Fixes build on CentOS 7.
585
586 Reported-by: "Chen, Farrah" <farrah.chen@intel.com>
587 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
588
589 2019-03-19 Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
590
591 xen: Look for Xen notes in section headers too
592 Mirror behaviour of ELF loader in libxc: first look for Xen notes in
593 PT_NOTE segment, then in SHT_NOTE section and only then fallback to
594 a section with __xen_guest name. This fixes loading PV kernels that
595 Xen note have outside of PT_NOTE. While this may be result of a buggy
596 linker script, loading such kernel directly works fine, so make it work
597 with GRUB too. Specifically, this applies to binaries built from Unikraft.
598
599 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
600
601 2019-03-19 Colin Watson <cjwatson@ubuntu.com>
602
603 getroot: Save/restore CWD more reliably on Unix
604 Various GRUB utilities fail if the current directory doesn't exist,
605 because grub_find_device() chdirs to a different directory and then
606 fails when trying to chdir back. Gnulib's save-cwd module uses fchdir()
607 instead when it can, avoiding this category of problem.
608
609 Fixes Debian bug #918700.
610
611 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
612
613 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
614
615 net/dhcp: Add explicit net_dhcp command
616 Mostly for cosmetic reasons, we add a "net_dhcp" command, which is (at the
617 moment) identical to the existing "net_bootp" command. Both actually trigger
618 a DHCP handshake now, and both should be able to deal with pure BOOTP servers.
619 We could think about dropping the DHCP options from the initial DISCOVER packet
620 when the user issues the net_bootp command, but it's unclear whether this is
621 really useful, as both protocols should be able to coexist.
622
623 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
624
625 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
626
627 net/dhcp: Actually send out DHCPv4 DISCOVER and REQUEST messages
628 Even though we were parsing some DHCP options sent by the server, so far
629 we are only using the BOOTP 2-way handshake, even when talking to a DHCP
630 server.
631
632 Change this by actually sending out DHCP DISCOVER packets instead of the
633 generic (mostly empty) BOOTP BOOTREQUEST packets.
634
635 A pure BOOTP server would ignore the extra DHCP options in the DISCOVER
636 packet and would just reply with a BOOTREPLY packet, which we also
637 handle in the code.
638
639 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
640
641 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
642
643 net/dhcp: Allow receiving DHCP OFFER and ACK packets
644 In respone to a BOOTREQUEST packet a BOOTP server would answer with a BOOTREPLY
645 packet, which ends the conversation for good. DHCP uses a 4-way handshake,
646 where the initial server respone is an OFFER, which has to be answered with
647 REQUEST by the client again, only to be completed by an ACKNOWLEDGE packet
648 from the server.
649
650 Teach the grub_net_process_dhcp() function to deal with OFFER packets,
651 and treat ACK packets the same es BOOTREPLY packets.
652
653 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
654
655 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
656
657 net/dhcp: Use DHCP options for name and bootfile
658 The BOOTP RFC describes the boot file name and the server name as being part
659 of the integral BOOTP data structure, with some limits on the size of them.
660 DHCP extends this by allowing them to be separate DHCP options, which is more
661 flexible.
662
663 Teach the code dealing with those fields to check for those DHCP options first
664 and use this information, if provided. We fall back to using the BOOTP
665 information if those options are not used.
666
667 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
668
669 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
670
671 net/dhcp: Introduce per-interface timeout
672 Currently we have a global timeout for all network cards in the BOOTP/DHCP
673 discovery process.
674
675 Make this timeout a per-interface one, so better accommodate the upcoming
676 4-way DHCP handshake and to also cover the lease time limit a DHCP offer
677 will come with.
678
679 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
680
681 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
682
683 net/dhcp: Make grub_net_process_dhcp() take an interface
684 Change the interface of the function dealing with incoming BOOTP packets
685 to take an interface instead of a card, to allow more fine per-interface
686 state (timeout, handshake state) later on.
687
688 Use the opportunity to clean up the code a bit.
689
690 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
691
692 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
693
694 net/dhcp: Refactor DHCP packet transmission into separate function
695 In contrast to BOOTP, DHCP uses a 4-way handshake, so requires to send
696 packets more often.
697
698 Refactor the generation and sending of the BOOTREQUEST packet into
699 a separate function, so that future code can more easily reuse this.
700
701 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
702
703 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
704
705 net/dhcp: Allow overloading legacy bootfile and name field
706 DHCP specifies a special dummy option OVERLOAD, to allow DHCP options to
707 spill over into the (legacy) BOOTFILE and SNAME fields.
708
709 Parse and handle this option properly.
710
711 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
712
713 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
714
715 net/dhcp: Replace parse_dhcp_vendor() with find_dhcp_option()
716 For proper DHCP support we will need to parse DHCP options from a packet
717 more often and at various places.
718
719 Refactor the option parsing into a new function, which will scan a packet to
720 find *a particular* option field. Use that new function in places where we
721 were dealing with DHCP options before.
722
723 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
724
725 2019-03-12 Andrei Borzenkov <arvidjaar@gmail.com>
726
727 net/dhcp: Remove dead code
728 The comment is right, the "giaddr" fields holds the IP address of the BOOTP
729 relay, not a general purpose router address. Just remove the commented code,
730 archeologists can find it in the git history.
731
732 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
733
734 2019-03-12 Jesús Diéguez Fernández <jesusdf@gmail.com>
735
736 msr: Add new MSR modules (rdmsr/wrmsr)
737 In order to be able to read from and write to model-specific registers,
738 two new modules are added. They are i386 specific, as the cpuid module.
739
740 rdmsr module registers the command rdmsr that allows reading from a MSR.
741 wrmsr module registers the command wrmsr that allows writing to a MSR.
742
743 wrmsr module is disabled if UEFI secure boot is enabled.
744
745 Please note that on SMP systems, interacting with a MSR that has a scope
746 per hardware thread, implies that the value only applies to the
747 particular cpu/core/thread that ran the command.
748
749 Also, if you specify a reserved or unimplemented MSR address, it will
750 cause a general protection exception (which is not currently being
751 handled) and the system will reboot.
752
753 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
754
755 2019-03-12 Jesús Diéguez Fernández <jesusdf@gmail.com>
756
757 asm: Replace "__asm__ __volatile__" with "asm volatile"
758 In order to maintain the coding style consistency, it was requested to
759 replace the methods that use "__asm__ __volatile__" with "asm volatile".
760
761 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
762
763 2019-03-12 Eric Snowberg <eric.snowberg@oracle.com>
764
765 sparc64: Add bios boot partition support
766 Add BIOS Boot Partition support for sparc64 platforms. This will work a
767 little different than x86. With GPT, both the OBP "load" and "boot" commands
768 are partition aware and neither command can see the partition table. Therefore
769 the entire boot-loader is stored within the BIOS Boot Partition and nothing
770 is stored within the bootstrap code area of MBR.
771
772 To use it, the end user will issue the boot command with the path pointing to
773 the BIOS Boot Partition.
774
775 For example with the disk below:
776
777 Model: Unknown (unknown)
778 Disk /dev/nvme1n1: 1600GB
779 Sector size (logical/physical): 512B/512B
780 Partition Table: gpt
781
782 Number Start End Size File system Name Flags
783 1 1049kB 1075MB 1074MB ext3
784 2 1075MB 1076MB 1049kB bios_grub
785 3 1076MB 1600GB 1599GB lvm
786
787 To boot grub2 from OBP, you would use:
788
789 boot /pci@302/pci@1/pci@0/pci@13/nvme@0/disk@1:b
790
791 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
792
793 2019-03-12 Eric Snowberg <eric.snowberg@oracle.com>
794
795 ieee1275: obdisk driver
796 Add a new disk driver called obdisk for IEEE1275 platforms. Currently
797 the only platform using this disk driver is SPARC, however other IEEE1275
798 platforms could start using it if they so choose. While the functionality
799 within the current IEEE1275 ofdisk driver may be suitable for PPC and x86, it
800 presented too many problems on SPARC hardware.
801
802 Within the old ofdisk, there is not a way to determine the true canonical
803 name for the disk. Within Open Boot, the same disk can have multiple names
804 but all reference the same disk. For example the same disk can be referenced
805 by its SAS WWN, using this form:
806
807 /pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@w5000cca02f037d6d,0
808
809 It can also be referenced by its PHY identifier using this form:
810
811 /pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@p0
812
813 It can also be referenced by its Target identifier using this form:
814
815 /pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@0
816
817 Also, when the LUN=0, it is legal to omit the ,0 from the device name. So with
818 the disk above, before taking into account the device aliases, there are 6 ways
819 to reference the same disk.
820
821 Then it is possible to have 0 .. n device aliases all representing the same disk.
822 Within this new driver the true canonical name is determined using the the
823 IEEE1275 encode-unit and decode-unit commands when address_cells == 4. This
824 will determine the true single canonical name for the device so multiple ihandles
825 are not opened for the same device. This is what frequently happens with the old
826 ofdisk driver. With some devices when they are opened multiple times it causes
827 the entire system to hang.
828
829 Another problem solved with this driver is devices that do not have a device
830 alias can be booted and used within GRUB. Within the old ofdisk, this was not
831 possible, unless it was the original boot device. All devices behind a SAS
832 or SCSI parent can be found. Within the old ofdisk, finding these disks
833 relied on there being an alias defined. The alias requirement is not
834 necessary with this new driver. It can also find devices behind a parent
835 after they have been hot-plugged. This is something that is not possible
836 with the old ofdisk driver.
837
838 The old ofdisk driver also incorrectly assumes that the device pointing to by a
839 device alias is in its true canonical form. This assumption is never made with
840 this new driver.
841
842 Another issue solved with this driver is that it properly caches the ihandle
843 for all open devices. The old ofdisk tries to do this by caching the last
844 opened ihandle. However this does not work properly because the layer above
845 does not use a consistent device name for the same disk when calling into the
846 driver. This is because the upper layer uses the bootpath value returned within
847 /chosen, other times it uses the device alias, and other times it uses the
848 value within grub.cfg. It does not have a way to figure out that these devices
849 are the same disk. This is not a problem with this new driver.
850
851 Due to the way GRUB repeatedly opens and closes the same disk. Caching the
852 ihandle is important on SPARC. Without caching, some SAS devices can take
853 15 - 20 minutes to get to the GRUB menu. This ihandle caching is not possible
854 without correctly having the canonical disk name.
855
856 When available, this driver also tries to use the deblocker #blocks and
857 a way of determining the disk size.
858
859 Finally and probably most importantly, this new driver is also capable of
860 seeing all partitions on a GPT disk. With the old driver, the GPT
861 partition table can not be read and only the first partition on the disk
862 can be seen.
863
864 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
865
866 2019-03-12 Paul Menzel <pmenzel@molgen.mpg.de>
867
868 Makefile: Allow to set file systems modules for default_payload.elf
869 By default all file system modules are added to the GRUB coreboot
870 payload `default_payload.elf`. This makes the image quite big,
871 especially as often not all modules are needed.
872
873 Introduce the variable `FS_PAYLOAD_MODULES`, which can be used to
874 explicitly set file systems modules to be added.
875
876 $ make default_payload.elf
877 test -f default_payload.elf && rm default_payload.elf || true
878 pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o default_payload.elf --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu affs afs bfs btrfs cbfs cpio cpio_be exfat ext2 f2fs fat hfs hfsplus iso9660 jfs minix minix2 minix2_be minix3 minix3_be minix_be newc nilfs2 ntfs odc procfs reiserfs romfs sfs squash4 tar udf ufs1 ufs1_be ufs2 xfs zfs password_pbkdf2 ' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=./coreboot.cfg
879 $ ls -l default_payload.elf
880 -rw-rw---- 1 joey joey 1199568 Mar 6 13:58 default_payload.elf
881
882 $ make default_payload.elf FS_PAYLOAD_MODULES="" # ext2 already in `--modules`
883 test -f default_payload.elf && rm default_payload.elf || true
884 pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o default_payload.elf --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu password_pbkdf2 ' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=./coreboot.cfg
885 $ ls -l default_payload.elf
886 -rw-rw---- 1 joey joey 832976 Mar 7 12:13 default_payload.elf
887
888 So, the resulting payload size is around 370 kB smaller. (Adding it to
889 the CBFS, it will be compressed, so the effective size difference will
890 be smaller.)
891
892 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
893
894 2019-03-07 Vladimir Serbinenko <phcoder@gmail.com>
895
896 windows/platform.c: Fix compilation errors
897
898 2019-03-05 Colin Watson <cjwatson@ubuntu.com>
899
900 gnulib: Upgrade Gnulib and switch to bootstrap tool
901 Upgrade Gnulib files to 20190105.
902
903 It's much easier to maintain GRUB's use of portability support files
904 from Gnulib when the process is automatic and driven by a single
905 configuration file, rather than by maintainers occasionally running
906 gnulib-tool and committing the result. Removing these
907 automatically-copied files from revision control also removes the
908 temptation to hack the output in ways that are difficult for future
909 maintainers to follow. Gnulib includes a "bootstrap" program which is
910 designed for this.
911
912 The canonical way to bootstrap GRUB from revision control is now
913 "./bootstrap", but "./autogen.sh" is still useful if you just want to
914 generate the GRUB-specific parts of the build system.
915
916 GRUB now requires Autoconf >= 2.63 and Automake >= 1.11, in line with
917 Gnulib.
918
919 Gnulib source code is now placed in grub-core/lib/gnulib/ (which should
920 not be edited directly), and GRUB's patches are in
921 grub-core/lib/gnulib-patches/. I've added a few notes to the developer
922 manual on how to maintain this.
923
924 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
925
926 2019-03-05 Colin Watson <cjwatson@ubuntu.com>
927
928 syslinux: Fix syslinux_test in out-of-tree builds
929 syslinux_parse simplifies some filenames by removing things like ".."
930 segments, but the tests assumed that @abs_top_srcdir@ would be
931 untouched, which is not true in the case of out-of-tree builds where
932 @abs_top_srcdir@ may contain ".." segments.
933
934 Performing the substitution requires some awkwardness in Makefile.am due
935 to details of how config.status works.
936
937 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
938
939 2019-03-05 Colin Watson <cjwatson@ubuntu.com>
940
941 util: Detect more I/O errors
942 Many of GRUB's utilities don't check anywhere near all the possible
943 write errors. For example, if grub-install runs out of space when
944 copying a file, it won't notice. There were missing checks for the
945 return values of write, fflush, fsync, and close (or the equivalents on
946 other OSes), all of which must be checked.
947
948 I tried to be consistent with the existing logging practices of the
949 various hostdisk implementations, but they weren't entirely consistent
950 to start with so I used my judgement. The result at least looks
951 reasonable on GNU/Linux when I provoke a write error:
952
953 Installing for x86_64-efi platform.
954 grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/debian/grubx64.efi': No space left on device.
955
956 There are more missing checks in other utilities, but this should fix
957 the most critical ones.
958
959 Fixes Debian bug #922741.
960
961 Reviewed-by: Steve McIntyre <93sam@debian.org>
962 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
963
964 2019-03-05 James Clarke <jrtc27@jrtc27.com>
965
966 osdep/freebsd: Fix partition calculation for EBR entries
967 For EBR partitions, "start" is the relative starting sector of the EBR
968 header itself, whereas "offset" is the relative starting byte of the
969 partition's contents, excluding the EBR header and any padding. Thus we
970 must use "offset", and divide by the sector size to convert to sectors.
971
972 Fixes Debian bug #923253.
973
974 Reviewed-by: Colin Watson <cjwatson@ubuntu.com>
975 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
976
977 2019-02-26 Steve McIntyre <93sam@debian.org>
978
979 grub-install: Check for arm-efi as a default target
980 Much like on x86, we can work out if the system is running on top of EFI
981 firmware. If so, return "arm-efi". If not, fall back to "arm-uboot" as
982 previously.
983
984 Split out the code to (maybe) load the efivar module and check for
985 /sys/firmware/efi into a common helper routine is_efi_system().
986
987 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
988 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
989
990 2019-02-26 Daniel Kiper <daniel.kiper@oracle.com>
991
992 Revert "grub-install: Check for arm-efi as a default target"
993 This reverts commit 082fd84d525f8d6602f892160b77c0a948308a78.
994
995 Incorrect version of the patch was pushed into the git repo.
996
997 Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
998
999 2019-02-25 Alexander Graf <agraf@suse.de>
1000
1001 travis: Add Travis CI config file
1002 There is a really convenient service for open source project from Travis
1003 CI: They allow for free CI testing using their infrastructure.
1004
1005 GRUB has had issues with broken builds for various targets for a long time
1006 already. The main reason is a lack of CI to just do smoke tests on whether
1007 all targets still at least compile.
1008
1009 This patch adds a Travis config file which builds (almost) all currently
1010 available targets.
1011
1012 On top of that, this Travis config also runs a small execution test on the
1013 x86_64-efi target.
1014
1015 All of this config file can easily be extended further on. It probably
1016 makes sense to do something similar to the u-boot test infrastructure
1017 that communicates with the payload properly. Going forward, we also will
1018 want to do more QEMU runtime checks for other targets.
1019
1020 Currently, with this config alone, I already see about half of the available
1021 targets as broken. So it's definitely desperately needed :).
1022
1023 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1024
1025 2019-02-25 Steve McIntyre <93sam@debian.org>
1026
1027 grub-install: Check for arm-efi as a default target
1028 Much like on x86, we can work out if the system is running on top
1029 of EFI firmware. If so, return "arm-efi". If not, fall back to
1030 "arm-uboot" as previously.
1031
1032 Heavily inspired by the existing code for x86.
1033
1034 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
1035 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1036
1037 2019-02-25 Leif Lindholm <leif.lindholm@linaro.org>
1038
1039 arm64/efi: Fix grub_efi_get_ram_base()
1040 grub_efi_get_ram_base() looks for the lowest available RAM address by
1041 traversing the memory map, comparing lowest address found so far.
1042 Due to a brain glitch, that "so far" was initialized to GRUB_UINT_MAX -
1043 completely preventing boot on systems without RAM below 4GB.
1044
1045 Change the initial value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally
1046 intended.
1047
1048 Reported-by: Steve McIntyre <93sam@debian.org>
1049 Tested-by: Steve McIntyre <93sam@debian.org>
1050 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1051
1052 2019-02-25 Paul Menzel <pmenzel@molgen.mpg.de>
1053
1054 normal/menu: Do not treat error values as key presses
1055 Some terminals, like `grub-core/term/at_keyboard.c`, return `-1` in case
1056 they are not ready yet.
1057
1058 if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
1059 return -1;
1060
1061 Currently, that is treated as a key press, and the menu time-out is
1062 cancelled/cleared. This is unwanted, as the boot is stopped and the user
1063 manually has to select a menu entry. Therefore, adapt the condition to
1064 require the key value also to be greater than 0.
1065
1066 `GRUB_TERM_NO_KEY` is defined as 0, so the condition could be collapsed
1067 to greater or equal than (≥) 0, but the compiler will probably do that
1068 for us anyway, so keep the cases separate for clarity.
1069
1070 This is tested with coreboot, the GRUB default payload, and the
1071 configuration file `grub.cfg` below.
1072
1073 For GRUB:
1074
1075 $ ./autogen.sh
1076 $ ./configure --with-platform=coreboot
1077 $ make -j`nproc`
1078 $ make default_payload.elf
1079
1080 For coreboot:
1081
1082 $ more grub.cfg
1083 serial --unit 0 --speed 115200
1084 set timeout=5
1085
1086 menuentry 'halt' {
1087 halt
1088 }
1089 $ build/cbfstool build/coreboot.rom add-payload \
1090 -f /dev/shm/grub/default_payload.elf -n fallback/payload -c lzma
1091 $ build/cbfstool build/coreboot.rom add -f grub.cfg -n etc/grub.cfg -t raw
1092 $ qemu-system-x86_64 --version
1093 QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-2+b1)
1094 Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers
1095 $ qemu-system-x86_64 -M pc -bios build/coreboot.rom -serial stdio -nic none
1096
1097 Currently, the time-out is cancelled/cleared. With the commit, it is not.
1098 With a small GRUB payload, this the problem is also reproducible on the
1099 ASRock E350M1.
1100
1101 Link: http://lists.gnu.org/archive/html/grub-devel/2019-01/msg00037.html
1102
1103 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1104
1105 2019-02-25 Alexander Graf <agraf@suse.de>
1106
1107 fdt: Treat device tree file type like ACPI
1108 We now have signature check logic in grub which allows us to treat
1109 files differently depending on their file type.
1110
1111 Treat a loaded device tree like an overlayed ACPI table.
1112 Both describe hardware, so I suppose their threat level is the same.
1113
1114 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1115 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1116
1117 2019-02-25 Alexander Graf <agraf@suse.de>
1118
1119 RISC-V: Add to build system
1120 This patch adds support for RISC-V to the grub build system. With this
1121 patch, I can successfully build grub on RISC-V as a UEFI application.
1122
1123 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1124 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1125 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1126 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1127
1128 2019-02-25 Alexander Graf <agraf@suse.de>
1129
1130 RISC-V: Add libgcc helpers for clz
1131 Gcc may decide it wants to call helper functions to execute clz. Provide
1132 them in our own copy of libgcc.
1133
1134 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1135
1136 2019-02-25 Alexander Graf <agraf@suse.de>
1137
1138 RISC-V: Add auxiliary files
1139 To support a new architecture we need to provide a few helper functions
1140 for memory, cache, timer, etc support.
1141
1142 This patch adds the remainders of those. Some bits are still disabled,
1143 as I couldn't guarantee that we're always running on models / in modes
1144 where the respective hardware is available.
1145
1146 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1147 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1148
1149 2019-02-25 Alexander Graf <agraf@suse.de>
1150
1151 RISC-V: Add awareness for RISC-V reloations
1152 This patch adds awareness of RISC-V relocations throughout the grub tools
1153 as well as dynamic linkage and elf->PE relocation conversion support.
1154
1155 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1156 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1157
1158 2019-02-25 Alexander Graf <agraf@suse.de>
1159
1160 RISC-V: Add Linux load logic
1161 We currently only support to run grub on RISC-V as UEFI payload. Ideally,
1162 we also only want to support running Linux underneath as UEFI payload.
1163
1164 Prepare that with some Linux boot stub code. Once the arm64 target is
1165 generalized, we can hook into that one and gain boot functionality.
1166
1167 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1168 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1169
1170 2019-02-25 Alexander Graf <agraf@suse.de>
1171
1172 RISC-V: Add early startup code
1173 On entry, we need to save the system table pointer as well as our image
1174 handle. Add an early startup file that saves them and then brings us
1175 into our main function.
1176
1177 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1178 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1179 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1180 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1181
1182 2019-02-25 Alexander Graf <agraf@suse.de>
1183
1184 RISC-V: Add setjmp implementation
1185 This patch adds a 32/64 capable setjmp implementation for RISC-V.
1186
1187 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1188 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1189 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1190 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1191
1192 2019-02-25 Alexander Graf <agraf@suse.de>
1193
1194 elf.h: Add RISC-V definitions
1195 The RISC-V ABI document outlines ELF header structure and relocation
1196 information. Pull the respective magic numbers into our elf header
1197 so we can make use of them.
1198
1199 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1200 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1201 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1202 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1203
1204 2019-02-25 Alexander Graf <agraf@suse.de>
1205
1206 PE: Add RISC-V definitions
1207 The PE format defines magic numbers as well as relocation identifiers for
1208 RISC-V. Add them to our include file, so we can make use of them.
1209
1210 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
1211 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1212 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1213 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1214 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1215
1216 2019-02-25 Alexander Graf <agraf@suse.de>
1217
1218 efi: Rename armxx to arch
1219 Some architectures want to boot Linux as plain UEFI binary. Today that
1220 really only encompasses ARM and AArch64, but going forward more
1221 architectures may adopt that model.
1222
1223 So rename our internal API accordingly.
1224
1225 Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
1226 Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
1227 Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
1228 Tested-by: Bin Meng <bmeng.cn@gmail.com>
1229 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1230
1231 2019-02-06 Alexander Graf <agraf@suse.de>
1232
1233 mkimage: Clarify file alignment in efi case
1234 There are a few spots in the PE generation code for EFI binaries that uses
1235 the section alignment rather than file alignment, even though the alignment
1236 is really only file bound.
1237
1238 Replace those cases with the file alignment constant instead.
1239
1240 Reported-by: Daniel Kiper <dkiper@net-space.pl>
1241 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1242 Tested-by: Julien ROBIN <julien.robin28@free.fr>
1243
1244 2019-02-06 Alexander Graf <agraf@suse.de>
1245
1246 mkimage: Align efi sections on 4k boundary
1247 There is UEFI firmware popping up in the wild now that implements stricter
1248 permission checks using NX and write protect page table entry bits.
1249
1250 This means that firmware now may fail to load binaries if its individual
1251 sections are not page aligned, as otherwise it can not ensure permission
1252 boundaries.
1253
1254 So let's bump all efi section alignments up to 4k (EFI page size). That way
1255 we will stay compatible going forward.
1256
1257 Unfortunately our internals can't deal very well with a mismatch of alignment
1258 between the virtual and file offsets, so we have to also pad our target
1259 binary a bit.
1260
1261 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1262 Tested-by: Julien ROBIN <julien.robin28@free.fr>
1263
1264 2019-02-06 Alexander Graf <agraf@suse.de>
1265
1266 mkimage: Use EFI32_HEADER_SIZE define in arm-efi case
1267 The efi-arm case was defining its own header size calculation, even though it's
1268 100% identical to the common EFI32_HEADER_SIZE definition.
1269
1270 So let's clean it up to use the common define.
1271
1272 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1273 Tested-by: Julien ROBIN <julien.robin28@free.fr>
1274
1275 2019-02-06 Guillaume GARDET <guillaume.gardet@arm.com>
1276
1277 arm: Move initrd upper to leave more space for kernel
1278 This patch allows to have bigger kernels. If the kernel grows, then it will
1279 overwrite the initrd when it is extracted.
1280
1281 Acked-by: Alexander Graf <agraf@suse.de>
1282 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1283
1284 2019-01-23 Leif Lindholm <leif.lindholm@linaro.org>
1285
1286 linux, efi, arm*, fdt: Break FDT extra allocation space out into a #define
1287 A certain amount of dynamic space is required for the handover from
1288 GRUB/Linux-EFI-stub. This entails things like initrd addresses,
1289 address-cells entries and associated strings.
1290
1291 But move this into a proper centralised #define rather than live-code
1292 it in the loader.
1293
1294 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1295
1296 2019-01-22 Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
1297
1298 uboot: Add the missing disk write operation support
1299 uboot_disk_write() is currently lacking the write support
1300 to storage devices because, historically, those devices did not
1301 implement block_write() in U-Boot.
1302
1303 The solution has been tested using a patched U-Boot loading
1304 and booting GRUB in a QEMU vexpress-a9 environment.
1305 The disk write operations were triggered with GRUB's save_env
1306 command.
1307
1308 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1309
1310 2019-01-21 Max Tottenham <mtottenh@akamai.com>
1311
1312 tpm: Fix bug in GRUB2 TPM module
1313 The value of tpm_handle changes between successive calls to grub_tpm_handle_find(),
1314 as instead of simply copying the stored pointer we end up taking the address of
1315 said pointer when using the cached value of grub_tpm_handle.
1316
1317 This causes grub_efi_open_protocol() to return a nullptr in grub_tpm2_execute()
1318 and grub_tpm2_log_event(). Said nullptr goes unchecked and
1319 efi_call_5(tpm->hash_log_extend_event,...) ends up jumping to 0x0, Qemu crashes
1320 once video ROM is reached at 0xb0000.
1321
1322 This patch seems to do the trick of fixing that bug, but we should also ensure
1323 that all calls to grub_efi_open_protocol() are checked so that we don't start
1324 executing low memory.
1325
1326 Reviewed-by: Matthew Garrett <mjg59@google.com>
1327 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1328
1329 2019-01-14 Colin Watson <cjwatson@ubuntu.com>
1330
1331 pgp: Fix emu build and tests after pgp module renaming
1332 Commit b07feb8746c3bb845e3f0d33d37c0bded704d14d (verifiers: Rename
1333 verify module to pgp module) renamed the "verify" module to "pgp", but
1334 the GRUB_MOD_INIT and GRUB_MOD_FINI macros were left as "verify", which
1335 broke the emu target build; and file_filter_test still referred to the
1336 now non-existent "verify" module. Fix both of these.
1337
1338 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1339
1340 2019-01-14 Peter Große <pegro@friiks.de>
1341
1342 grub-mkconfig/20_linux_xen: Support multiple early initrd images
1343 Add support for multiple, shared, early initrd images. These early
1344 images will be loaded in the order declared, and all will be loaded
1345 before the initrd image.
1346
1347 While many classes of data can be provided by early images, the
1348 immediate use case would be for distributions to provide CPU
1349 microcode to mitigate the Meltdown and Spectre vulnerabilities.
1350
1351 Xen has also support to load microcode updates provided as additional
1352 modules by the bootloader.
1353
1354 There are two environment variables provided for declaring the early
1355 images.
1356
1357 * GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare
1358 images that are provided by the distribution or installed packages.
1359 If undeclared, this will default to a set of common microcode image
1360 names.
1361
1362 * GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User
1363 images will be loaded after the stock images.
1364
1365 These separate configurations allow the distribution and user to
1366 declare different image sets without clobbering each other.
1367
1368 This also makes a minor update to ensure that UUID partition labels
1369 stay disabled when no initrd image is found, even if early images are
1370 present.
1371
1372 This is basically a copy of a698240d "grub-mkconfig/10_linux: Support
1373 multiple early initrd images" by Matthew S. Turnbull.
1374
1375 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1376
1377 2019-01-14 Heinrich Schuchardt <xypron.glpk@gmx.de>
1378
1379 grub-core/loader/efi/fdt.c: Do not copy random memory
1380 We should not try to copy any memory area which is outside of the original
1381 fdt. If this extra memory is controlled by a hypervisor this might end
1382 with a crash.
1383
1384 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
1385 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1386
1387 2018-12-12 Matthew Garrett <matthewgarrett@google.com>
1388
1389 verifiers: Add TPM documentation
1390 Describe the behaviour of GRUB when the TPM module is in use.
1391
1392 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1393
1394 2018-12-12 Matthew Garrett <mjg59@google.com>
1395
1396 verifiers: Core TPM support
1397 Add support for performing basic TPM measurements. Right now this only
1398 supports extending PCRs statically and only on UEFI. In future we might
1399 want to have some sort of mechanism for choosing which events get logged
1400 to which PCRs, but this seems like a good default policy and we can wait
1401 to see whether anyone has a use case before adding more complexity.
1402
1403 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1404
1405 2018-12-12 Matthew Garrett <mjg59@google.com>
1406
1407 verifiers: Verify commands executed by grub
1408 Pass all commands executed by GRUB to the verifiers layer. Most verifiers will
1409 ignore this, but some (such as the TPM verifier) want to be able to measure and
1410 log each command executed in order to ensure that the boot state is as expected.
1411
1412 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1413
1414 2018-12-12 Juergen Gross <jgross@suse.com>
1415
1416 xen_pvh: Add support to configure
1417 Support platform i386/xen_pvh in configure.
1418
1419 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1420 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1421
1422 2018-12-12 Juergen Gross <jgross@suse.com>
1423
1424 xen_pvh: Support grub-install for xen_pvh
1425 Add xen_pvh support to grub-install.
1426
1427 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1428 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1429
1430 2018-12-12 Juergen Gross <jgross@suse.com>
1431
1432 xen_pvh: Support building a standalone image
1433 Support mkimage for xen_pvh.
1434
1435 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1436 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1437
1438 2018-12-12 Juergen Gross <jgross@suse.com>
1439
1440 xen: Use elfnote defines instead of plain numbers
1441 In order to avoid using plain integers for the ELF notes use the
1442 available Xen include instead.
1443
1444 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1445 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1446
1447 2018-12-12 Hans van Kranenburg <hans@knorrie.org>
1448
1449 grub-module-verifier: Ignore all_video for xen_pvh
1450 This solves the build failing with "Error: no symbol table and no
1451 .moddeps section"
1452
1453 Also see:
1454 - 6371e9c10433578bb236a8284ddb9ce9e201eb59
1455 - https://savannah.gnu.org/bugs/?49012
1456
1457 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1458 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1459
1460 2018-12-12 Juergen Gross <jgross@suse.com>
1461
1462 xen_pvh: Add build runes for grub-core
1463 Add the modifications to the build system needed to build a xen_pvh
1464 grub.
1465
1466 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1467 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1468
1469 2018-12-12 Juergen Gross <jgross@suse.com>
1470
1471 xen: Init memory regions for PVH
1472 Add all usable memory regions to grub memory management and add the
1473 needed mmap iterate code, which will be used by grub core (e.g.
1474 grub-core/lib/relocator.c or grub-core/mmap/mmap.c).
1475
1476 As we are running in 32-bit mode don't add memory above 4GB.
1477
1478 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1479 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1480
1481 2018-12-12 Juergen Gross <jgross@suse.com>
1482
1483 xen: Setup Xen specific data for PVH
1484 Initialize the needed Xen specific data. This is:
1485
1486 - the Xen start of day page containing the console and Xenstore ring
1487 page PFN and event channel
1488 - the grant table
1489 - the shared info page
1490
1491 Write back the possibly modified memory map to the hypervisor in case
1492 the guest is reading it from there again.
1493
1494 Set the RSDP address for the guest from the start_info page passed
1495 as boot parameter.
1496
1497 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1498 Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
1499 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1500
1501 2018-12-12 Juergen Gross <jgross@suse.com>
1502
1503 xen: Get memory map from hypervisor for PVH
1504 Retrieve the memory map from the hypervisor and normalize it to contain
1505 no overlapping entries and to be sorted by address.
1506
1507 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1508 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1509
1510 2018-12-12 Juergen Gross <jgross@suse.com>
1511
1512 xen: Setup hypercall page for PVH
1513 Add the needed code to setup the hypercall page for calling into the
1514 Xen hypervisor.
1515
1516 Import the XEN_HVM_DEBUGCONS_IOPORT define from Xen unstable into
1517 include/xen/arch-x86/xen.h
1518
1519 Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
1520 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1521 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1522
1523 2018-12-12 Juergen Gross <jgross@suse.com>
1524
1525 xen: Add PVH boot entry code
1526 Add the code for the Xen PVH mode boot entry.
1527
1528 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1529 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1530
1531 2018-12-12 Juergen Gross <jgross@suse.com>
1532
1533 xen: Add basic hooks for PVH in current code
1534 Add the hooks to current code needed for Xen PVH. They will be filled
1535 with code later when the related functionality is being added.
1536
1537 loader/i386/linux.c needs to include machine/kernel.h now as it needs
1538 to get GRUB_KERNEL_USE_RSDP_ADDR from there. This in turn requires to
1539 add an empty kernel.h header for some i386 platforms (efi, coreboot,
1540 ieee1275, xen) and for x86_64 efi.
1541
1542 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1543 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1544
1545 2018-12-12 Juergen Gross <jgross@suse.com>
1546
1547 xen: Add PVH specific defines to offset.h
1548 include/grub/offsets.h needs some defines for Xen PVH mode.
1549
1550 Add them. While at it line up the values in the surrounding lines to
1551 start at the same column.
1552
1553 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1554 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1555
1556 2018-12-12 Juergen Gross <jgross@suse.com>
1557
1558 xen: Modify grub_xen_ptr2mfn() for Xen PVH
1559 grub_xen_ptr2mfn() returns the machine frame number for a given pointer
1560 value. For Xen-PVH guests this is just the PFN. Add the PVH specific
1561 variant.
1562
1563 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1564 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1565
1566 2018-12-12 Juergen Gross <jgross@suse.com>
1567
1568 xen: Rearrange xen/init.c to prepare it for Xen PVH mode
1569 Rearrange grub-core/kern/xen/init.c to prepare adding PVH mode support
1570 to it. This includes putting some code under #ifdef GRUB_MACHINE_XEN
1571 as it will not be used when running as PVH.
1572
1573 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1574 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1575
1576 2018-12-12 Juergen Gross <jgross@suse.com>
1577
1578 xen: Add some dummy headers for PVH mode
1579 With Xen PVH mode adding a new machine type the machine related headers
1580 need to be present for the build to succeed. Most of the headers just
1581 need to include the related common i386 headers. Add those to the tree.
1582
1583 Note that xen_pvh/int.h needs to include pc/int_types.h instead of
1584 pc/int.h in order to avoid the definition of grub_bios_interrupt().
1585
1586 xen_pvh/memory.h needs to include coreboot/memory.h (like some other
1587 <machine>/memory.h do as well) as this contains just the needed stubs.
1588
1589 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1590 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1591
1592 2018-12-12 Juergen Gross <jgross@suse.com>
1593
1594 xen: Prepare common code for Xen PVH support
1595 Some common code needs to be special cased for Xen PVH mode. This hits
1596 mostly Xen PV mode specific areas.
1597
1598 Split include/grub/i386/pc/int_types.h off from
1599 include/grub/i386/pc/int.h to support including this file later from
1600 xen_pvh code without the grub_bios_interrupt definition.
1601
1602 Move definition of struct grub_e820_mmap_entry from
1603 grub-core/mmap/i386/pc/mmap.c to include/grub/i386/memory.h in order
1604 to make it usable from xen_pvh code.
1605
1606 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1607 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1608
1609 2018-12-12 Juergen Gross <jgross@suse.com>
1610
1611 xen: Carve out grant tab initialization into dedicated function
1612 Initialize the grant tab in a dedicated function. This will enable
1613 using it for PVH guests, too.
1614
1615 Call the new function from grub_machine_init() as this will later
1616 be common between Xen PV and Xen PVH mode.
1617
1618 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1619 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1620
1621 2018-12-12 Juergen Gross <jgross@suse.com>
1622
1623 loader/linux: Support passing RSDP address via boot params
1624 Xen PVH guests will have the RSDP at an arbitrary address. Support that
1625 by passing the RSDP address via the boot parameters to Linux.
1626
1627 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1628 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1629
1630 2018-12-12 Juergen Gross <jgross@suse.com>
1631
1632 xen: Add some Xen headers
1633 In order to support grub2 in Xen PVH environment some additional Xen
1634 headers are needed as grub2 will be started in PVH mode requiring to
1635 use several HVM hypercalls and structures.
1636
1637 Add the needed headers from Xen 4.10 being the first Xen version with
1638 full (not only experimental) PVH guest support.
1639
1640 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1641 Tested-by: Hans van Kranenburg <hans@knorrie.org>
1642
1643 2018-12-07 Daniel Kiper <daniel.kiper@oracle.com>
1644
1645 verifiers: ARM Xen fallout cleanup
1646 ARM Xen fallout cleanup after commit ca0a4f689 (verifiers: File type for
1647 fine-grained signature-verification controlling).
1648
1649 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1650
1651 2018-12-07 Daniel Kiper <daniel.kiper@oracle.com>
1652
1653 verifiers: Xen fallout cleanup
1654 Xen fallout cleanup after commit ca0a4f689 (verifiers: File type for
1655 fine-grained signature-verification controlling).
1656
1657 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1658
1659 2018-11-28 Eric Snowberg <eric.snowberg@oracle.com>
1660
1661 ofnet: Fix build regression in grub_ieee1275_parse_bootpath()
1662 The grub_ieee1275_parse_bootpath() function (commit a661a32, ofnet: Initialize
1663 structs in bootpath parser) introduces a build regression on SPARC:
1664
1665 cc1: warnings being treated as errors
1666 net/drivers/ieee1275/ofnet.c: In function 'grub_ieee1275_parse_bootpath':
1667 net/drivers/ieee1275/ofnet.c:156: error: missing initializer
1668 net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'client_addr.type')
1669 net/drivers/ieee1275/ofnet.c:156: error: missing initializer
1670 net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'gateway_addr.type')
1671 net/drivers/ieee1275/ofnet.c:156: error: missing initializer
1672 net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'subnet_mask.type')
1673 net/drivers/ieee1275/ofnet.c:157: error: missing initializer
1674 net/drivers/ieee1275/ofnet.c:157: error: (near initialization for 'hw_addr.type')
1675 make[3]: *** [net/drivers/ieee1275/ofnet_module-ofnet.o] Error 1
1676
1677 Initialize the entire structure.
1678
1679 More info can be found here:
1680 http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00034.html
1681
1682 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1683
1684 2018-11-26 Nick Terrell <terrelln@fb.com>
1685
1686 btrfs: Add zstd support to grub btrfs
1687 - Adds zstd support to the btrfs module.
1688 - Adds a test case for btrfs zstd support.
1689 - Changes top_srcdir to srcdir in the btrfs module's lzo include
1690 following comments from Daniel Kiper about the zstd include.
1691
1692 Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zstd
1693 compression. A test case was also added to the test suite that fails before
1694 the patch, and passes after.
1695
1696 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1697
1698 2018-11-26 Nick Terrell <terrelln@fb.com>
1699
1700 zstd: Import upstream zstd-1.3.6
1701 - Import zstd-1.3.6 from upstream
1702 - Add zstd's module.c file
1703 - Add the zstd module to Makefile.core.def
1704
1705 Import zstd-1.3.6 from upstream [1]. Only the files need for decompression
1706 are imported. I used the latest zstd release, which includes patches [2] to
1707 build cleanly in GRUB.
1708
1709 I included the script used to import zstd-1.3.6 below at the bottom of the
1710 commit message.
1711
1712 Upstream zstd commit hash: 4fa456d7f12f8b27bd3b2f5dfd4f46898cb31c24
1713 Upstream zstd commit name: Merge pull request #1354 from facebook/dev
1714
1715 Zstd requires some posix headers, which it gets from posix_wrap.
1716 This can be checked by inspecting the .Po files generated by automake,
1717 which contain the header dependencies. After building run the command
1718 `cat grub-core/lib/zstd/.deps-core/*.Po` to see the dependencies [3].
1719 The only OS dependencies are:
1720
1721 - stddef.h, which is already a dependency in posix_wrap, and used for size_t
1722 by lzo and xz.
1723 - stdarg.h, which comes from the grub/misc.h header, and we don't use in zstd.
1724
1725 All the types like uint64_t are typedefed to grub_uint64_t under the hood.
1726 The only exception is size_t, which comes from stddef.h. This is already the
1727 case for lzo and xz. I don't think there are any cross-compilation concerns,
1728 because cross-compilers provide their own system headers (and it would already
1729 be broken).
1730
1731 [1] https://github.com/facebook/zstd/releases/tag/v1.3.6
1732 [2] https://github.com/facebook/zstd/pull/1344
1733 [3] https://gist.github.com/terrelln/7a16b92f5a1b3aecf980f944b4a966c4
1734
1735 ```
1736
1737 curl -L -O https://github.com/facebook/zstd/releases/download/v1.3.6/zstd-1.3.6.tar.gz
1738 curl -L -O https://github.com/facebook/zstd/releases/download/v1.3.6/zstd-1.3.6.tar.gz.sha256
1739 sha256sum --check zstd-1.3.6.tar.gz.sha256
1740 tar xzf zstd-1.3.6.tar.gz
1741
1742 SRC_LIB="zstd-1.3.6/lib"
1743 DST_LIB="grub-core/lib/zstd"
1744 rm -rf $DST_LIB
1745 mkdir -p $DST_LIB
1746 cp $SRC_LIB/zstd.h $DST_LIB/
1747 cp $SRC_LIB/common/*.[hc] $DST_LIB/
1748 cp $SRC_LIB/decompress/*.[hc] $DST_LIB/
1749 rm $DST_LIB/{pool.[hc],threading.[hc]}
1750 rm -rf zstd-1.3.6*
1751 echo SUCCESS!
1752 ```
1753
1754 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1755
1756 2018-11-21 Michael Chang <mchang@suse.com>
1757
1758 verifiers: fix double close on pgp's sig file descriptor
1759 An error emerged as when I was testing the verifiers branch, so instead
1760 of putting it in pgp prefix, the verifiers is used to reflect what the
1761 patch is based on.
1762
1763 While running verify_detached, grub aborts with error.
1764
1765 verify_detached /@/.snapshots/1/snapshot/boot/grub/grub.cfg
1766 /@/.snapshots/1/snapshot/boot/grub/grub.cfg.sig
1767
1768 alloc magic is broken at 0x7beea660: 0
1769 Aborted. Press any key to exit.
1770
1771 The error is caused by sig file descriptor been closed twice, first time
1772 in grub_verify_signature() to which it is passed as parameter. Second in
1773 grub_cmd_verify_signature() or in whichever opens the sig file
1774 descriptor. The second close is not consider as bug to me either, as in
1775 common rule of what opens a file has to close it to avoid file
1776 descriptor leakage.
1777
1778 After all the design of grub_verify_signature() makes it difficult to keep
1779 a good trace on opened file descriptor from it's caller. Let's refine
1780 the application interface to accept file path rather than descriptor, in
1781 this way the caller doesn't have to care about closing the descriptor by
1782 delegating it to grub_verify_signature() with full tracing to opened
1783 file descriptor by itself.
1784
1785 Also making it clear that sig descriptor is not referenced in error
1786 returning path of grub_verify_signature_init(), so it can be closed
1787 directly by it's caller. This also makes delegating it to
1788 grub_pubkey_close() infeasible to help in relieving file descriptor
1789 leakage as it has to depend on uncertainty of ctxt fields in error
1790 returning path.
1791
1792 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1793
1794 2018-11-21 Lee Jones <lee.jones@linaro.org>
1795
1796 generic/blocklist: Fix implicit declaration of function grub_file_filter_disable_compression()
1797 grub_file_filter_disable_compression() no longer exists.
1798
1799 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1800
1801 2018-11-21 Lee Jones <lee.jones@linaro.org>
1802
1803 arm64/xen: Fix too few arguments to function grub_create_loader_cmdline()
1804 Without this fix, building xen_boot.c omits:
1805
1806 loader/arm64/xen_boot.c: In function ‘xen_boot_binary_load’:
1807 loader/arm64/xen_boot.c:370:7: error: too few arguments to function ‘grub_create_loader_cmdline’
1808 grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline,
1809 ^~~~~~~~~~~~~~~~~~~~~~~~~~
1810 In file included from loader/arm64/xen_boot.c:36:0:
1811 ../include/grub/lib/cmdline.h:29:12: note: declared here
1812 grub_err_t grub_create_loader_cmdline (int argc, char *argv[], char *buf,
1813
1814 Reviewed-by: Julien Grall <julien.grall@arm.com>
1815 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1816
1817 2018-11-16 Leif Lindholm <leif.lindholm@linaro.org>
1818
1819 arm-uboot, ia64, sparc64: Fix up grub_file_open() calls
1820 The verifiers framework changed the grub_file_open() interface, breaking all
1821 non-x86 linux loaders. Add file types to the grub_file_open() calls to make
1822 them build again.
1823
1824 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1825
1826 2018-11-16 Leif Lindholm <leif.lindholm@linaro.org>
1827
1828 arm64/efi: Fix breakage caused by verifiers
1829 - add variable "err" (used but not defined),
1830 - add GRUB_FILE_TYPE_LINUX_KERNEL to grub_file_open() call.
1831
1832 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1833
1834 2018-11-16 Leif Lindholm <leif.lindholm@linaro.org>
1835
1836 grub-core/loader/efi/fdt.c: Fixup grub_file_open() call
1837 The verifiers framework changed the API of grub_file_open(), but did not
1838 fix up all users. Add the file type GRUB_FILE_TYPE_DEVICE_TREE_IMAGE
1839 to the "devicetree" command handler call.
1840
1841 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1842
1843 2018-11-16 Leif Lindholm <leif.lindholm@linaro.org>
1844
1845 include/grub/file.h: Add device tree file type
1846 The API change of grub_file_open() for adding verifiers did not include
1847 a type for device tree blobs. Add GRUB_FILE_TYPE_DEVICE_TREE_IMAGE to
1848 the grub_file_type enum.
1849
1850 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1851
1852 2018-11-16 Leif Lindholm <leif.lindholm@linaro.org>
1853
1854 include/grub/verify.h: Add include guard
1855 verify.h was added without include guards. This means compiling anything
1856 including both include/grub/verify.h and include/grub/lib/cmdline.h fails
1857 (at least grub-core/loader/arm64/linux.c.
1858
1859 Add the necessary include guard.
1860
1861 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1862
1863 2018-11-16 Matthew Daley <mattd@bugfuzz.com>
1864
1865 mkimage: Pad DTBs to target-specific pointer size
1866 Device tree (DTB) lengths are being padded to a multiple of 4 bytes
1867 rather than the target-specific pointer size. This causes objects
1868 following OBJ_TYPE_DTB objects to be incorrectly parsed during GRUB
1869 execution on arm64.
1870
1871 Fix by using ALIGN_ADDR(), not ALIGN_UP().
1872
1873 Signed-by-off: Matthew Daley <mattd@bugfuzz.com>
1874 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1875
1876 2018-11-09 Colin Watson <cjwatson@ubuntu.com>
1877
1878 Cope with / being on a ZFS root dataset
1879 If / is on the root dataset in a ZFS pool, then ${bootfs} will be set to
1880 "/" (whereas if it is on a non-root dataset, there will be no trailing
1881 slash). Passing "root=ZFS=${rpool}/" will fail to boot, but
1882 "root=ZFS=${rpool}" works fine, so strip the trailing slash.
1883
1884 Fixes: https://savannah.gnu.org/bugs/?52746
1885
1886 Tested-by: Fejes József <jozsef.fejes@gmail.com>
1887 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1888
1889 2018-11-09 Paul Menzel <pmenzel@molgen.mpg.de>
1890
1891 unix/platform: Initialize variable to fix grub-install on UEFI system
1892 On a UEFI system, were no boot entry *grub* is present, currently,
1893 `grub-install` fails with an error.
1894
1895 $ efibootmgr
1896 BootCurrent: 0000
1897 Timeout: 0 seconds
1898 BootOrder: 0001,0006,0003,0004,0005
1899 Boot0001 Diskette Drive
1900 Boot0003* USB Storage Device
1901 Boot0004* CD/DVD/CD-RW Drive
1902 Boot0005 Onboard NIC
1903 Boot0006* WDC WD2500AAKX-75U6AA0
1904 $ sudo grub-install /dev/sda
1905 Installing for x86_64-efi platform.
1906 grub-install: error: efibootmgr failed to register the boot entry: Unknown error 22020.
1907
1908 The error code is always different, and the error message (incorrectly)
1909 points to efibootmgr.
1910
1911 But, the error is in GRUB’s function
1912 `grub_install_remove_efi_entries_by_distributor()`, where the variable
1913 `rc` for the return value, is uninitialized and never set, when no boot
1914 entry for the distributor is found.
1915
1916 The content of that uninitialized variable is then returned as the error
1917 code of efibootmgr.
1918
1919 Set the variable to 0, so that success is returned, when no entry needs
1920 to be deleted.
1921
1922 Tested on Dell OptiPlex 7010 with firmware A28.
1923
1924 $ sudo ./grub-install /dev/sda
1925 Installing for x86_64-efi platform.
1926 Installation finished. No error reported.
1927
1928 [1]: https://github.com/rhboot/efibootmgr/issues/100
1929
1930 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1931
1932 2018-11-09 Daniel Kiper <daniel.kiper@oracle.com>
1933
1934 efi: Add EFI shim lock verifier
1935 This module provides shim lock verification for various kernels
1936 if UEFI secure boot is enabled on a machine.
1937
1938 It is recommended to put this module into GRUB2 standalone image
1939 (avoid putting iorw and memrw modules into it; they are disallowed
1940 if UEFI secure boot is enabled). However, it is also possible to use
1941 it as a normal module. Though such configurations are more fragile
1942 and less secure due to various limitations.
1943
1944 If the module is loaded and UEFI secure boot is enabled then:
1945 - module itself cannot be unloaded (persistent module),
1946 - the iorw and memrw modules cannot be loaded,
1947 - if the iorw and memrw modules are loaded then
1948 machine boot is disabled,
1949 - GRUB2 defers modules and ACPI tables verification to
1950 other verifiers.
1951
1952 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1953
1954 2018-11-09 Daniel Kiper <daniel.kiper@oracle.com>
1955
1956 dl: Add support for persistent modules
1957 This type of modules cannot be unloaded. This is useful if a given
1958 functionality, e.g. UEFI secure boot shim signature verification, should
1959 not be disabled if it was enabled at some point in time. Somebody may
1960 say that we can use standalone GRUB2 here. That is true. However, the
1961 code is not so big nor complicated hence it make sense to support
1962 modularized configs too.
1963
1964 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1965
1966 2018-11-09 Vladimir Serbinenko <phcoder@gmail.com>
1967
1968 verifiers: Add the documentation
1969 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1970
1971 2018-11-09 Daniel Kiper <daniel.kiper@oracle.com>
1972
1973 verifiers: Rename verify module to pgp module
1974 Just for clarity. No functional change.
1975
1976 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1977
1978 2018-11-09 Daniel Kiper <daniel.kiper@oracle.com>
1979
1980 verifiers: Add possibility to defer verification to other verifiers
1981 This way if a verifier requires verification of a given file it can defer task
1982 to another verifier (another authority) if it is not able to do it itself. E.g.
1983 shim_lock verifier, posted as a subsequent patch, is able to verify only PE
1984 files. This means that it is not able to verify any of GRUB2 modules which have
1985 to be trusted on UEFI systems with secure boot enabled. So, it can defer
1986 verification to other verifier, e.g. PGP one.
1987
1988 I silently assume that other verifiers are trusted and will do good job for us.
1989 Or at least they will not do any harm.
1990
1991 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1992
1993 2018-11-09 Vladimir Serbinenko <phcoder@gmail.com>
1994
1995 verifiers: Add possibility to verify kernel and modules command lines
1996 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
1997
1998 2018-11-09 Vladimir Serbinenko <phcoder@gmail.com>
1999
2000 verifiers: Framework core
2001 Verifiers framework provides core file verification functionality which
2002 can be used by various security mechanisms, e.g., UEFI secure boot, TPM,
2003 PGP signature verification, etc.
2004
2005 The patch contains PGP code changes and probably they should be extracted
2006 to separate patch for the sake of clarity.
2007
2008 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
2009
2010 2018-11-09 Vladimir Serbinenko <phcoder@gmail.com>
2011
2012 verifiers: File type for fine-grained signature-verification controlling
2013 Let's provide file type info to the I/O layer. This way verifiers
2014 framework and its users will be able to differentiate files and verify
2015 only required ones.
2016
2017 This is preparatory patch.
2018
2019 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
2020
2021 2018-11-09 Daniel Kiper <daniel.kiper@oracle.com>
2022
2023 bufio: Use grub_size_t instead of plain int for size
2024 Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
2025
2026 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2027
2028 btrfs: Add RAID 6 recovery for a btrfs filesystem
2029 Add the RAID 6 recovery, in order to use a RAID 6 filesystem even if some
2030 disks (up to two) are missing. This code use the md RAID 6 code already
2031 present in grub.
2032
2033 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2034
2035 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2036
2037 btrfs: Make more generic the code for RAID 6 rebuilding
2038 The original code which handles the recovery of a RAID 6 disks array
2039 assumes that all reads are multiple of 1 << GRUB_DISK_SECTOR_BITS and it
2040 assumes that all the I/O is done via the struct grub_diskfilter_segment.
2041 This is not true for the btrfs code. In order to reuse the native
2042 grub_raid6_recover() code, it is modified to not call
2043 grub_diskfilter_read_node() directly, but to call an handler passed
2044 as an argument.
2045
2046 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2047
2048 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2049
2050 btrfs: Add support for recovery for a RAID 5 btrfs profiles
2051 Add support for recovery for a RAID 5 btrfs profile. In addition
2052 it is added some code as preparatory work for RAID 6 recovery code.
2053
2054 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2055
2056 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2057
2058 btrfs: Refactor the code that read from disk
2059 Move the code in charge to read the data from disk into a separate
2060 function. This helps to separate the error handling logic (which
2061 depends on the different raid profiles) from the read from disk
2062 logic. Refactoring this code increases the general readability too.
2063
2064 This is a preparatory patch, to help the adding of the RAID 5/6 recovery code.
2065
2066 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2067
2068 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2069
2070 btrfs: Move logging code in grub_btrfs_read_logical()
2071 A portion of the logging code is moved outside of internal for(;;). The part
2072 that is left inside is the one which depends on the internal for(;;) index.
2073
2074 This is a preparatory patch. The next one will refactor the code inside
2075 the for(;;) into an another function.
2076
2077 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2078
2079 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2080
2081 btrfs: Avoid a rescan for a device which was already not found
2082 Currently read from missing device triggers rescan. However, it is never
2083 recorded that the device is missing. So, each read of a missing device
2084 triggers rescan again and again. This behavior causes a lot of unneeded
2085 rescans leading to huge slowdowns.
2086
2087 This patch fixes above mentioned issue. Information about missing devices
2088 is stored in the data->devices_attached[] array as NULL value in dev
2089 member. Rescan is triggered only if no information is found for a given
2090 device. This means that only first time read triggers rescan.
2091
2092 The patch drops premature return. This way data->devices_attached[] is
2093 filled even when a given device is missing.
2094
2095 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2096
2097 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2098
2099 btrfs: Move the error logging from find_device() to its caller
2100 The caller knows better if this error is fatal or not, i.e. another disk is
2101 available or not.
2102
2103 This is a preparatory patch.
2104
2105 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2106
2107 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2108
2109 btrfs: Add helper to check the btrfs header
2110 This helper is used in a few places to help the debugging. As
2111 conservative approach the error is only logged.
2112 This does not impact the error handling.
2113
2114 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2115
2116 2018-10-31 Goffredo Baroncelli <kreijack@inwind.it>
2117
2118 btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile
2119 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2120
2121 2018-09-27 Michael Chang <mchang@suse.com>
2122
2123 msdos: Fix overflow in converting partition start and length into 512B blocks
2124 When booting from NVME SSD with 4k sector size, it fails with the message.
2125
2126 error: attempt to read or write outside of partition.
2127
2128 This patch fixes the problem by fixing overflow in converting partition start
2129 and length into 512B blocks.
2130
2131 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2132
2133 2018-09-27 Mihai Moldovan <ionic@ionic.de>
2134
2135 osdep/linux: Convert partition start to disk sector length
2136 When reading data off a disk, sector values are based on the disk sector
2137 length.
2138
2139 Within grub_util_fd_open_device(), the start of the partition was taken
2140 directly from grub's partition information structure, which uses the
2141 internal sector length (currently 512b), but never transformed to the
2142 disk's sector length.
2143
2144 Subsequent calculations were all wrong for devices that have a diverging
2145 sector length and the functions eventually skipped to the wrong stream
2146 location, reading invalid data.
2147
2148 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2149
2150 2018-09-27 Adam Williamson <awilliam@redhat.com>
2151
2152 python: Use AM_PATH_PYTHON to determine interpreter for gentpl.py
2153 gentpl.py is python2/3-agnostic, but there's no way to cause it
2154 to be run with any interpreter other than 'python', it's just
2155 hard-coded into Makefile.common that way. Adjust that to use
2156 AM_PATH_PYTHON (provided by automake) to find an interpreter
2157 and run gentpl.py with that instead. This makes grub buildable
2158 when `python` does not exist (but rather `python3` or `python2`
2159 or `python2.7`, etc.) Minimum version is set to 2.6 as this is
2160 the first version with `__future__.print_function` available.
2161
2162 Note, AM_PATH_PYTHON respects the PYTHON environment variable
2163 and will treat its value as the *only* candidate for a valid
2164 interpreter if it is set - when PYTHON is set, AM_PATH_PYTHON
2165 will not try to find any alternative interpreter, it will only
2166 check whether the interpreter set as the value of PYTHON meets
2167 the requirements and use it if so or fail if not. This means
2168 that when using grub's `autogen.sh`, as it too uses the value
2169 of the PYTHON environment variable (and if it is not set, just
2170 sets it to 'python') you cannot rely on AM_PATH_PYTHON
2171 interpreter discovery. If your desired Python interpreter is
2172 not just 'python', you must set the PYTHON environment variable,
2173 e.g. 'PYTHON=/usr/local/bin/python3 ./autogen.sh'. The specified
2174 interpreter will then be used both by autogen.sh itself and by
2175 the autotools-driven build scripts.
2176
2177 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2178
2179 2018-09-27 Colin Watson <cjwatson@ubuntu.com>
2180
2181 build: Use pkg-config to find FreeType
2182 pkg-config is apparently preferred over freetype-config these days (see
2183 the BUGS section of freetype-config(1)). pkg-config support was added
2184 to FreeType in version 2.1.5, which was released in 2003, so it should
2185 comfortably be available everywhere by now.
2186
2187 We no longer need to explicitly substitute FREETYPE_CFLAGS and
2188 FREETYPE_LIBS, since PKG_CHECK_MODULES does that automatically.
2189
2190 Fixes Debian bug #887721.
2191
2192 Reported-by: Hugh McMaster <hugh.mcmaster@outlook.com>
2193 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2194
2195 2018-09-27 Colin Watson <cjwatson@ubuntu.com>
2196
2197 build: Capitalise *freetype_* variables
2198 Using FREETYPE_CFLAGS and FREETYPE_LIBS is more in line with the naming
2199 scheme used by pkg-config macros.
2200
2201 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2202
2203 2018-09-13 Julian Andres Klode <julian.klode@canonical.com>
2204
2205 ofnet: Initialize structs in bootpath parser
2206 Code later on checks if variables inside the struct are
2207 0 to see if they have been set, like if there were addresses
2208 in the bootpath.
2209
2210 The variables were not initialized however, so the check
2211 might succeed with uninitialized data, and a new interface
2212 with random addresses and the same name is added. This causes
2213 $net_default_mac to point to the random one, so, for example,
2214 using that variable to load per-mac config files fails.
2215
2216 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785859
2217
2218 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2219
2220 2018-09-13 dann frazier <dann.frazier@canonical.com>
2221
2222 grub-reboot: Warn when "for the next boot only" promise cannot be kept
2223 The "for the next boot only" property of grub-reboot is dependent upon
2224 GRUB being able to clear the next_entry variable in the environment
2225 block. However, GRUB cannot write to devices using the diskfilter
2226 and lvm abstractions.
2227
2228 Ref: https://lists.gnu.org/archive/html/grub-devel/2009-12/msg00276.html
2229 Ref: https://bugs.launchpad.net/bugs/788298
2230
2231 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2232
2233 2018-09-13 Cao jin <caoj.fnst@cn.fujitsu.com>
2234
2235 relocator16: Comments update
2236 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2237
2238 2018-09-13 Paul Menzel <pmenzel@molgen.mpg.de>
2239
2240 ahci: Increase time-out from 10 s to 32 s
2241 This is a cryptographically signed message in MIME format.
2242
2243 Date: Thu, 9 Aug 2018 07:27:35 +0200
2244
2245 Currently, the GRUB payload for coreboot does not detect the Western
2246 Digital hard disk WDC WD20EARS-60M AB51 connected to the ASRock E350M1,
2247 as that takes over ten seconds to spin up.
2248
2249 ```
2250 disk/ahci.c:533: port 0, err: 0
2251 disk/ahci.c:539: port 0, err: 0
2252 disk/ahci.c:543: port 0, err: 0
2253 disk/ahci.c:549: port 0, offset: 120, tfd:80, CMD: 6016
2254 disk/ahci.c:552: port 0, err: 0
2255 disk/ahci.c:563: port 0, offset: 120, tfd:80, CMD: 6016
2256 disk/ahci.c:566: port: 0, err: 0
2257 disk/ahci.c:593: port 0 is busy
2258 disk/ahci.c:621: cleaning up failed devs
2259 ```
2260
2261 GRUB detects the drive, when either unloading the module *ahci*, and
2262 then loading it again, or when doing a warm reset.
2263
2264 As the ten second time-out is too short, increase it to 32 seconds,
2265 used by SeaBIOS. which detects the drive successfully.
2266
2267 The AHCI driver in libpayload uses 30 seconds, and that time-out was
2268 added in commit 354066e1 (libpayload: ahci: Increase timeout for
2269 signature reading) with the description below.
2270
2271 > We can't read the drives signature before it's ready, i.e. spun up.
2272 > So set the timeout to the standard 30s. Also put a notice on the
2273 > console, so the user knows why the signature reading failed.
2274
2275 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2276
2277 2018-09-13 Cao jin <caoj.fnst@cn.fujitsu.com>
2278
2279 linux16: Code cleanup
2280 1. move relocator related code more close to each other
2281 2. use variable "len" since it has correct assignment, and keep coding
2282 style with upper code
2283
2284 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2285
2286 2018-09-13 Colin Watson <cjwatson@ubuntu.com>
2287
2288 tests: Fix qemu options for UHCI test
2289 qemu 2.12 removed the -usbdevice option. Use a more modern spelling
2290 instead, in line with other USB-related tests.
2291
2292 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2293
2294 2018-09-13 Colin Watson <cjwatson@ubuntu.com>
2295
2296 tests: Disable sercon in SeaBIOS
2297 SeaBIOS 1.11.0 added support for VGA emulation over a serial port, which
2298 interferes with grub-shell. Turn it off.
2299
2300 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2301
2302 2018-09-12 Peter Jones <pjones@redhat.com>
2303
2304 grub-module-verifier: Report the filename or modname in errors
2305 Make it so that when grub-module-verifier complains of an issue, it tells you
2306 which module the issue was with.
2307
2308 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2309
2310 2018-09-12 Peter Jones <pjones@redhat.com>
2311
2312 configure: Fix an 8 year old typo
2313 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2314
2315 2018-09-12 Leif Lindholm <leif.lindholm@linaro.org>
2316
2317 loader/multiboot_mbi2: Use central copy of grub_efi_find_mmap_size()
2318 Delete local copy of function to determine required buffer size for the
2319 UEFI memory map, use helper in kern/efi/mm.c.
2320
2321 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2322
2323 2018-09-12 Leif Lindholm <leif.lindholm@linaro.org>
2324
2325 loader/ia64/linux: Use central copy of grub_efi_find_mmap_size()
2326 Delete local copy of function to determine required buffer size for the
2327 UEFI memory map, use helper in kern/efi/mm.c.
2328
2329 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2330
2331 2018-09-12 Leif Lindholm <leif.lindholm@linaro.org>
2332
2333 loader/i386/linux: Use central copy of grub_efi_find_mmap_size()
2334 Delete local copy of function to determine required buffer size for the
2335 UEFI memory map, use helper in kern/efi/mm.c.
2336
2337 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2338
2339 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2340
2341 i386: Don't include lib/i386/reset.c in EFI builds
2342 Commit 0ba90a7f0178 ("efi: Move grub_reboot() into kernel") broke
2343 the build on i386-efi - genmoddep.awk bails out with message
2344 grub_reboot in reboot is duplicated in kernel
2345 This is because both lib/i386/reset.c and kern/efi/efi.c now provide
2346 this function.
2347
2348 Rather than explicitly list each i386 platform variant in
2349 Makefile.core.def, include the contents of lib/i386/reset.c only when
2350 GRUB_MACHINE_EFI is not set.
2351
2352 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2353
2354 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2355
2356 efi: Restrict arm/arm64 linux loader initrd placement
2357 The 32-bit arm Linux kernel is built as a zImage, which self-decompresses
2358 down to near start of RAM. In order for an initrd/initramfs to be
2359 accessible, it needs to be placed within the first ~768MB of RAM.
2360 The initrd loader built into the kernel EFI stub restricts this down to
2361 512MB for simplicity - so enable the same restriction in grub.
2362
2363 For arm64, the requirement is within a 1GB aligned 32GB window also
2364 covering the (runtime) kernel image. Since the EFI stub loader itself
2365 will attempt to relocate to near start of RAM, force initrd to be loaded
2366 completely within the first 32GB of RAM.
2367
2368 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2369
2370 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2371
2372 arm: Delete unused efi support from loader/arm
2373 The 32-bit arm efi port now shares the 64-bit linux loader, so delete
2374 the now unused bits from the 32-bit linux loader.
2375
2376 This in turn leaves the grub-core/kern/arm/efi/misc.c unused, so
2377 delete that too.
2378
2379 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2380
2381 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2382
2383 arm/efi: Switch to arm64 linux loader
2384 The arm64 and arm linux kernel EFI-stub support presents pretty much
2385 identical interfaces, so the same linux loader source can be used for
2386 both architectures.
2387
2388 Switch 32-bit ARM UEFI platforms over to the existing EFI-stub aware
2389 loader initially developed for arm64.
2390
2391 This *WILL* stop non-efistub Linux kernels from booting on arm-efi.
2392
2393 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2394
2395 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2396
2397 arm64/linux/loader: Rename functions and macros and move to common headers
2398 In preparation for using the linux loader for 32-bit and 64-bit platforms,
2399 rename grub_arm64*/GRUB_ARM64* to grub_armxx*/GRUB_ARMXX*.
2400
2401 Move prototypes for now-common functions to efi/efi.h.
2402
2403 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2404
2405 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2406
2407 efi: Add grub_efi_get_ram_base() function for arm64
2408 Since ARM platforms do not have a common memory map, add a helper
2409 function that finds the lowest address region with the EFI_MEMORY_WB
2410 attribute set in the UEFI memory map.
2411
2412 Required for the arm64 efi linux loader to restrict the initrd
2413 location to where it will be accessible by the kernel at runtime.
2414
2415 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2416
2417 2018-07-25 Leif Lindholm <leif.lindholm@linaro.org>
2418
2419 efi: Add central copy of grub_efi_find_mmap_size
2420 There are several implementations of this function in the tree.
2421 Add a central version in grub-core/efi/mm.c.
2422
2423 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2424
2425 2018-07-25 Arindam Nath <arindam.nath@amd.com>
2426
2427 i386/linux: Add support for ext_lfb_base
2428 The EFI Graphics Output Protocol can return a 64-bit
2429 linear frame buffer address in some firmware/BIOS
2430 implementations. We currently only store the lower
2431 32-bits in the lfb_base. This will eventually be
2432 passed to Linux kernel and the efifb driver will
2433 incorrectly interpret the framebuffer address as
2434 32-bit address.
2435
2436 The Linux kernel has already added support to handle
2437 64-bit linear framebuffer address in the efifb driver
2438 since quite some time now.
2439
2440 This patch adds the support for 64-bit linear frame
2441 buffer address in GRUB to address the above mentioned
2442 scenario.
2443
2444 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2445
2446 2018-07-11 Leif Lindholm <leif.lindholm@linaro.org>
2447
2448 commands/file: Use definitions from arm64/linux.h
2449 Clean up code for matching IS_ARM64 slightly by making use of struct
2450 linux_arm64_kernel_header and GRUB_LINUX_ARM64_MAGIC_SIGNATURE.
2451
2452 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2453
2454 2018-07-11 Leif Lindholm <leif.lindholm@linaro.org>
2455
2456 commands/file: Use definitions from arm/linux.h
2457 Clean up code for matching IS_ARM slightly by making use of struct
2458 linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE.
2459
2460 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2461
2462 2018-07-11 Hans de Goede <hdegoede@redhat.com>
2463
2464 efi/console: Fix the "enter" key not working on x86 tablets
2465 Most 8" or 7" x86 Windows 10 tablets come with volume up/down buttons and
2466 a power-button. In their UEFI these are almost always mapped to arrow
2467 up/down and enter.
2468
2469 Pressing the volume buttons (sometimes by accident) will stop the
2470 menu countdown, but the power-button / "enter" key was not being recognized
2471 as enter, so the user would be stuck at the grub menu.
2472
2473 The problem is that these tablets send scan_code 13 or 0x0d for the
2474 power-button, which officialy maps to the F3 key. They also set
2475 unicode_char to 0x0d.
2476
2477 This commit recognizes the special case of both scan_code and unicode_char
2478 being set to 0x0d and treats this as an enter key press.
2479
2480 This fixes things getting stuck at the grub-menu and allows the user
2481 to choice a grub-menu entry using the buttons on the tablet.
2482
2483 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2484
2485 2018-07-11 Cao jin <caoj.fnst@cn.fujitsu.com>
2486
2487 grub-setup: Debug message cleanup
2488 Variable "root" is initialized after root device probing and is null in
2489 current place, so, drop it.
2490
2491 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2492
2493 2018-07-02 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
2494
2495 multiboot_elfxx.c: Fix compilation by fixing undeclared variable
2496 Without that fix we have:
2497 In file included from ../../include/grub/command.h:25:0,
2498 from ../../grub-core/loader/multiboot.c:30:
2499 ../../grub-core/loader/multiboot_elfxx.c: In function 'grub_multiboot_load_elf64':
2500 ../../grub-core/loader/multiboot_elfxx.c:130:28: error: 'relocatable' undeclared (first use in this function)
2501 "load_base_addr=0x%x\n", relocatable,
2502
2503 This happens due to mistake in the commit 14ec665
2504 (mbi: Use per segment a separate relocator chunk).
2505
2506 So, let's fix it.
2507
2508 2018-06-23 Leif Lindholm <leif.lindholm@linaro.org>
2509
2510 efi/fdt: Set address/size cells to 2 for empty tree
2511 When booting an arm* system on UEFI with an empty device tree (currently
2512 only when hardware description comes from ACPI), we don't currently set
2513 default to 1 cell (32 bits).
2514
2515 Set both of these properties, to 2 cells (64 bits), to resolve issues
2516 with kexec on some platforms.
2517
2518 This change corresponds with linux kernel commit ae8a442dfdc4
2519 ("efi/libstub/arm*: Set default address and size cells values for an empty dtb")
2520 and ensures booting through grub does not behave differently from booting
2521 the stub loader directly.
2522
2523 See also https://patchwork.kernel.org/patch/9561201/
2524
2525 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2526
2527 2018-06-23 Leif Lindholm <leif.lindholm@linaro.org>
2528
2529 fdt: Move prop_entry_size to fdt.h
2530 To be able to resuse the prop_entry_size macro, move it to
2531 <grub/fdt.h> and rename it grub_fdt_prop_entry_size.
2532
2533 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2534
2535 2018-06-23 Will Thompson <wjt@endlessm.com>
2536
2537 grub-fs-tester: Fix losetup race
2538 If something else on the system is using loopback devices, then the
2539 device that's free at the call to `losetup -f` may not be free in the
2540 following call to try to use it. Instead, find and use the first free
2541 loopback device in a single call to losetup.
2542
2543 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2544
2545 2018-06-23 Alexander Boettcher <alexander.boettcher@genode-labs.com>
2546
2547 mbi: Use per segment a separate relocator chunk
2548 Instead of setting up a all comprising relocator chunk for all segments,
2549 use per segment a separate relocator chunk.
2550
2551 Currently, if the ELF is non-relocatable, a single relocator chunk will
2552 comprise memory (between the segments) which gets overridden by the relst()
2553 invocation of the movers code in grub_relocator16/32/64_boot().
2554
2555 The overridden memory may contain reserved ranges like VGA memory or ACPI
2556 tables, which may lead to crashes or at least to strange boot behaviour.
2557
2558 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2559
2560 2018-06-05 Daniel Kiper <daniel.kiper@oracle.com>
2561
2562 templates: Add missing "]"
2563 Commit 51be337 (templates: Update grub script template files)
2564 lacked one "]", so, add it.
2565
2566 Reported-by: Philip <philm@manjaro.org>
2567
2568 2018-05-29 Daniel Kiper <daniel.kiper@oracle.com>
2569
2570 xfs: Accept filesystem with sparse inodes
2571 The sparse inode metadata format became a mkfs.xfs default in
2572 xfsprogs-4.16.0, and such filesystems are now rejected by grub as
2573 containing an incompatible feature.
2574
2575 In essence, this feature allows xfs to allocate inodes into fragmented
2576 freespace. (Without this feature, if xfs could not allocate contiguous
2577 space for 64 new inodes, inode creation would fail.)
2578
2579 In practice, the disk format change is restricted to the inode btree,
2580 which as far as I can tell is not used by grub. If all you're doing
2581 today is parsing a directory, reading an inode number, and converting
2582 that inode number to a disk location, then ignoring this feature
2583 should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED
2584
2585 I did some brief testing of this patch by hacking up the regression
2586 tests to completely fragment freespace on the test xfs filesystem, and
2587 then write a large-ish number of inodes to consume any existing
2588 contiguous 64-inode chunk. This way any files the grub tests add and
2589 traverse would be in such a fragmented inode allocation. Tests passed,
2590 but I'm not sure how to cleanly integrate that into the test harness.
2591
2592 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2593 Tested-by: Chris Murphy <lists@colorremedies.com>
2594
2595 2018-05-29 Oleg Solovyov <mcpain@altlinux.org>
2596
2597 grub-probe: Don't skip /dev/mapper/dm-* devices
2598 This patch ensures that grub-probe will find the root device placed in
2599 /dev/mapper/dm-[0-9]+-.* e.g. device named /dev/mapper/dm-0-luks will be
2600 found and grub.cfg will be updated properly, enabling the system to boot.
2601
2602 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2603
2604 2018-05-08 Michael Chang <mchang@suse.com>
2605
2606 bufio: Round up block size to power of 2
2607 Rounding up the bufio->block_size to meet power of 2 to facilitate next_buf
2608 calculation in grub_bufio_read().
2609
2610 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2611
2612 2018-04-23 Nicholas Vinson <nvinson234@gmail.com>
2613
2614 templates: Update grub script template files
2615 Update grub-mkconfig.in and 10_linux.in to support grub-probe's new
2616 partuuid target. Update grub.texi documentation. The following table
2617 shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and
2618 initramfs detection interact:
2619
2620 Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root
2621 detected Set Set ID Method
2622
2623 false false false part UUID
2624 false false true part UUID
2625 false true false dev name
2626 false true true dev name
2627 true false false fs UUID
2628 true false true part UUID
2629 true true false fs UUID
2630 true true true dev name
2631
2632 Note: GRUB_DISABLE_LINUX_PARTUUID and GRUB_DISABLE_LINUX_UUID equate to
2633 'false' when unset or set to any value other than 'true'.
2634 GRUB_DISABLE_LINUX_PARTUUID defaults to 'true'.
2635
2636 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2637
2638 2018-04-23 Nicholas Vinson <nvinson234@gmail.com>
2639
2640 grub-probe: Add PARTUUID detection support
2641 Add PARTUUID detection support grub-probe for MBR and GPT partition schemes.
2642
2643 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2644
2645 2018-04-23 Nicholas Vinson <nvinson234@gmail.com>
2646
2647 disk: Update grub_gpt_partentry
2648 Rename grub_gpt_part_type to grub_gpt_part_guid and update grub_gpt_partentry
2649 to use this type for both the partition type GUID string and the partition GUID
2650 string entries. This change ensures that the two GUID fields are handled more
2651 consistently and helps to simplify the changes needed to add Linux partition
2652 GUID support.
2653
2654 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2655
2656 2018-04-23 Nicholas Vinson <nvinson234@gmail.com>
2657
2658 grub-probe: Centralize GUID prints
2659 Define print_gpt_guid(), so there is a central function for printing
2660 GUID strings. This change is a precursor for later patches which rely
2661 on this logic.
2662
2663 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2664
2665 2018-04-23 Olaf Hering <olaf@aepfle.de>
2666
2667 grub-install: Locale depends on nls
2668 With --disable-nls no locales exist.
2669
2670 Avoid runtime error by moving code that copies locales into its own
2671 function. Return early in case nls was disabled. That way the compiler
2672 will throw away unreachable code, no need to put preprocessor
2673 conditionals everywhere to avoid warnings about unused code.
2674
2675 Fix memleak by freeing srcf and dstf.
2676 Convert tabs to spaces in moved code.
2677
2678 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2679
2680 2018-04-23 Cao jin <caoj.fnst@cn.fujitsu.com>
2681
2682 diskboot: Trivial correction on stale comments
2683 diskboot.img now is loaded at 0x8000 and is jumped to with 0:0x8000.
2684
2685 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2686
2687 2018-04-10 Jaegeuk Kim <jaegeuk@kernel.org>
2688
2689 fs: Add F2FS support
2690 "F2FS (Flash-Friendly File System) is flash-friendly file system which was merged
2691 into Linux kernel v3.8 in 2013.
2692
2693 The motive for F2FS was to build a file system that from the start, takes into
2694 account the characteristics of NAND flash memory-based storage devices (such as
2695 solid-state disks, eMMC, and SD cards).
2696
2697 F2FS was designed on a basis of a log-structured file system approach, which
2698 remedies some known issues of the older log structured file systems, such as
2699 the snowball effect of wandering trees and high cleaning overhead. In addition,
2700 since a NAND-based storage device shows different characteristics according to
2701 its internal geometry or flash memory management scheme (such as the Flash
2702 Translation Layer or FTL), it supports various parameters not only for
2703 configuring on-disk layout, but also for selecting allocation and cleaning
2704 algorithm.", quote by https://en.wikipedia.org/wiki/F2FS.
2705
2706 The source codes for F2FS are available from:
2707
2708 http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git
2709 http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
2710
2711 This patch has been integrated in OpenMandriva Lx 3.
2712 https://www.openmandriva.org/
2713
2714 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2715
2716 2018-04-04 Michael Chang <mchang@suse.com>
2717
2718 Fix packed-not-aligned error on GCC 8
2719 When building with GCC 8, there are several errors regarding packed-not-aligned.
2720
2721 ./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
2722
2723 This patch fixes the build error by cleaning up the ambiguity of placing
2724 aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
2725 grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
2726 has to be packed, to ensure the structure is bit-to-bit mapped to the format
2727 laid on disk. I think we could blame to copy and paste error here for the
2728 mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
2729 the name suggests. :)
2730
2731 Tested-by: Michael Chang <mchang@suse.com>
2732 Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
2733 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2734
2735 2018-04-04 mike.travis@hpe.com <mike.travis@hpe.com>
2736
2737 efi/uga: Fix PCIe LER when GRUB2 accesses non-enabled MMIO data from VGA
2738 A GPU inserted into a PCIe I/O slot disappears during system startup.
2739 The problem centers around GRUB and a specific VGA init function in
2740 efi_uga.c. This causes an LER (Link Error Recorvery) because the MMIO
2741 memory has not been enabled before attempting access.
2742
2743 The fix is to add the same coding used in other VGA drivers, specifically
2744 to add a check to insure that it is indeed a VGA controller. And then
2745 enable the MMIO address space with the specific bits.
2746
2747 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2748
2749 2018-03-26 Eric Snowberg <eric.snowberg@oracle.com>
2750
2751 ieee1275: NULL pointer dereference in grub_machine_get_bootlocation()
2752 Read from NULL pointer canon in function grub_machine_get_bootlocation().
2753 Function grub_ieee1275_canonicalise_devname() may return NULL.
2754
2755 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2756
2757 2018-03-14 Eric Snowberg <eric.snowberg@oracle.com>
2758
2759 ieee1275: split up grub_machine_get_bootlocation
2760 Split up some of the functionality in grub_machine_get_bootlocation into
2761 grub_ieee1275_get_boot_dev. This will allow for code reuse in a follow on
2762 patch.
2763
2764 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2765
2766 2018-03-14 C. Masloch <pushbx@38.de>
2767
2768 chainloader: patch in BPB's sectors_per_track and num_heads
2769 These fields must reflect the ROM-BIOS's geometry for CHS-based
2770 loaders to correctly load their next stage. Most loaders do not
2771 query the ROM-BIOS (Int13.08), relying on the BPB fields to hold
2772 the correct values already.
2773
2774 Tested with lDebug booted in qemu via grub2's
2775 FreeDOS direct loading support, refer to
2776 https://bitbucket.org/ecm/ldosboot + https://bitbucket.org/ecm/ldebug
2777 (For this test, lDebug's iniload.asm must be assembled with
2778 -D_QUERY_GEOMETRY=0 to leave the BPB values provided by grub.)
2779
2780 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2781
2782 2018-03-14 Matthew S. Turnbull <sparky@bluefang-logic.com>
2783
2784 grub-mkconfig/10_linux: Support multiple early initrd images
2785 Add support for multiple, shared, early initrd images. These early
2786 images will be loaded in the order declared, and all will be loaded
2787 before the initrd image.
2788
2789 While many classes of data can be provided by early images, the
2790 immediate use case would be for distributions to provide CPU
2791 microcode to mitigate the Meltdown and Spectre vulnerabilities.
2792
2793 There are two environment variables provided for declaring the early
2794 images.
2795
2796 * GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare
2797 images that are provided by the distribution or installed packages.
2798 If undeclared, this will default to a set of common microcode image
2799 names.
2800
2801 * GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User
2802 images will be loaded after the stock images.
2803
2804 These separate configurations allow the distribution and user to
2805 declare different image sets without clobbering each other.
2806
2807 This also makes a minor update to ensure that UUID partition labels
2808 stay disabled when no initrd image is found, even if early images are
2809 present.
2810
2811 This is a continuation of a previous patch published by Christian
2812 Hesse in 2016:
2813 http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00025.html
2814
2815 Down stream Gentoo bug:
2816 https://bugs.gentoo.org/645088
2817
2818 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2819
2820 2018-03-07 Eric Snowberg <eric.snowberg@oracle.com>
2821
2822 mkimage: fix build regression in grub_mkimage_load_image
2823 The grub_mkimage_load_image function (commit 7542af6, mkimage: refactor a bunch
2824 of section data into a struct.) introduces a build regression on SPARC:
2825
2826 cc1: warnings being treated as errors
2827 In file included from util/grub-mkimage32.c:23:
2828 util/grub-mkimagexx.c: In function 'grub_mkimage_load_image32':
2829 util/grub-mkimagexx.c:1968: error: missing initializer
2830 util/grub-mkimagexx.c:1968: error: (near initialization for 'smd.sections')
2831 make[2]: *** [util/grub_mkimage-grub-mkimage32.o] Error 1
2832
2833 Initialize the entire section_metadata structure.
2834
2835 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2836
2837 2018-03-05 dann frazier <dann.frazier@canonical.com>
2838
2839 Revert "Keep the native terminal active when enabling gfxterm"
2840 This can cause an issue where GRUB is trying to display both a text and
2841 graphical menu on the display at the same time, resulting in a flickering
2842 effect when e.g. scrolling quickly through a menu (LP: #1752767).
2843
2844 Revert for now while we look for a better solution for the original issue.
2845
2846 This reverts commit 52ef7b23f528ce844716661d586497a177e80d5b.
2847
2848 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2849
2850 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2851
2852 sparc64: #blocks64 disk node method
2853 Return the 64bit number of blocks of storage associated with the device or
2854 instance. Where a "block" is a unit of storage consisting of the number of
2855 bytes returned by the package's "block-size" method. If the size cannot be
2856 determined, or if the number of blocks exceeds the range return -1.
2857
2858 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2859
2860 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2861
2862 sparc64: #blocks disk node method
2863 Return the number of blocks of storage associated with the device or
2864 instance. Where a "block" is a unit of storage consisting of the number
2865 of bytes returned by the package's "block-size" method. If the size cannot
2866 be determined, the #blocks method returns the maximum unsigned integer
2867 (which, because of Open Firmware's assumption of two's complement arithmetic,
2868 is equivalent to the signed number -1). If the number of blocks exceeds
2869 the range of an unsigned number, return 0 to alert the caller to try
2870 the #blocks64 command.
2871
2872 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2873
2874 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2875
2876 ieee1275: block-size deblocker support method
2877 IEEE Std 1275-1994 Standard for Boot (Initialization Configuration)
2878 Firmware: Core Requirements and Practices
2879
2880 3.8.3 deblocker support package
2881
2882 Any package that uses the "deblocker" support package must define
2883 the following method, which the deblocker uses as a low-level
2884 interface to the device
2885
2886 block-size ( -- block-len ) Return "granularity" for accesses to this
2887 device.
2888
2889 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2890
2891 2018-03-05 Daniel Kiper <daniel.kiper@oracle.com>
2892
2893 ieee1275: no-data-command bus specific method
2894 IEEE 1275-1994 Standard for Boot (Initialization Configuration)
2895 Firmware: Core Requirements and Practices
2896
2897 E.3.2.2 Bus-specific methods for bus nodes
2898
2899 A package implementing the scsi-2 device type shall implement the
2900 following bus-specific method:
2901
2902 no-data-command ( cmd-addr -- error? )
2903 Executes a simple SCSI command, automatically retrying under
2904 certain conditions. cmd-addr is the address of a 6-byte command buffer
2905 containing an SCSI command that does not have a data transfer phase.
2906 Executes the command, retrying indefinitely with the same retry criteria
2907 as retry-command.
2908
2909 error? is nonzero if an error occurred, zero otherwise.
2910 NOTE no-data-command is a convenience function. It provides
2911 no capabilities that are not present in retry-command, but for
2912 those commands that meet its restrictions, it is easier to use.
2913
2914 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2915
2916 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2917
2918 ieee1275: set-address bus specific method
2919 IEEE 1275-1994 Standard for Boot (Initialization Configuration)
2920 Firmware: Core Requirements and Practices
2921 E.3.2.2 Bus-specific methods for bus nodes
2922
2923 A package implementing the scsi-2 device type shall implement the
2924 following bus-specific method:
2925
2926 set-address ( unit# target# -- )
2927 Sets the SCSI target number (0x0..0xf) and unit number (0..7) to which
2928 subsequent commands apply.
2929
2930 This function is for devices with #address-cells == 2
2931
2932 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2933
2934 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2935
2936 ieee1275: encode-unit command for 4 addr cell devs
2937 Convert physical address to text unit-string.
2938
2939 Convert phys.lo ... phys-high, the numerical representation, to unit-string,
2940 the text string representation of a physical address within the address
2941 space defined by this device node. The number of cells in the list
2942 phys.lo ... phys.hi is determined by the value of the #address-cells property
2943 of this node.
2944
2945 This function is for devices with #address-cells == 4
2946
2947 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2948
2949 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2950
2951 ieee1275: decode-unit command for 4 addr cell devs
2952 decode-unit ( addr len -- phys.lo ... phys.hi )
2953
2954 Convert text unit-string to physical address.
2955
2956 Convert unit-string, the text string representation, to phys.lo ... phys.hi,
2957 the numerical representation of a physical address within the address space
2958 defined by this device node. The number of cells in the list
2959 phys.lo ... phys.hi is determined by the value of the #address-cells
2960 property of this node.
2961
2962 This function is for devices with #address-cells == 4
2963
2964 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2965
2966 2018-03-05 Eric Snowberg <eric.snowberg@oracle.com>
2967
2968 sparc64: Limit nvme of_path_of_nvme to just SPARC
2969 Limit NVMe of_path_of_nvme to just SPARC hardware for now. It has been
2970 found that non-Open Firmware hardware platforms can some how access
2971 this function.
2972
2973 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2974
2975 2018-03-05 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2976
2977 ieee1275: Fix crash in of_path_of_nvme when of_path is empty
2978 The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme
2979 support within ofpath) introduced a functional regression:
2980
2981 On systems which are not based on Open Firmware but have at
2982 least one NVME device, find_obppath will return NULL and thus
2983 trying to append the disk name to of_path will result in a
2984 crash.
2985
2986 The proper behavior of of_path_of_nvme is, however, to just
2987 return NULL in such cases, like other users of find_obppath,
2988 such as of_path_of_scsi.
2989
2990 Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com>
2991 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2992
2993 2018-03-05 Peter Jones <pjones@redhat.com>
2994
2995 .mod files: Strip annobin annotations and .eh_frame, and their relocations
2996 This way debuginfo built from the .module will still include this
2997 information, but the final result won't have the data we don't actually
2998 need in the modules, either on-disk, loaded at runtime, or in prebuilt
2999 images.
3000
3001 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3002
3003 2018-03-05 Peter Jones <pjones@redhat.com>
3004
3005 mkimage: avoid copying relocations for sections that won't be copied.
3006 Some versions of gcc include a plugin called "annobin", and in some
3007 build systems this is enabled by default. This plugin creates special
3008 ELF note sections to track which ABI-breaking features are used by a
3009 binary, as well as a series of relocations to annotate where.
3010
3011 If grub is compiled with this feature, then when grub-mkimage translates
3012 the binary to another file format which does not strongly associate
3013 relocation data with sections (i.e. when platform is *-efi), these
3014 relocations appear to be against the .text section rather than the
3015 original note section. When the binary is loaded by the PE runtime
3016 loader, hilarity ensues.
3017
3018 This issue is not necessarily limited to the annobin, but could arise
3019 any time there are relocations in sections that are not represented in
3020 grub-mkimage's output.
3021
3022 This patch seeks to avoid this issue by only including relocations that
3023 refer to sections which will be included in the final binary.
3024
3025 As an aside, this should also obviate the need to avoid -funwind-tables,
3026 -fasynchronous-unwind-tables, and any sections similar to .eh_frame in
3027 the future. I've tested it on x86-64-efi with the following gcc command
3028 line options (as recorded by -grecord-gcc-flags), but I still need to
3029 test the result on some other platforms that have been problematic in
3030 the past (especially ARM Aarch64) before I feel comfortable making
3031 changes to the configure.ac bits:
3032
3033 GNU C11 7.2.1 20180116 (Red Hat 7.2.1-7) -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -msoft-float -mno-stack-arg-probe -mcmodel=large -mno-red-zone -m64 -mtune=generic -march=x86-64 -g3 -Os -freg-struct-return -fno-stack-protector -ffreestanding -funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing -fstack-clash-protection -fno-ident -fplugin=annobin
3034
3035 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3036
3037 2018-03-05 Peter Jones <pjones@redhat.com>
3038
3039 mkimage: refactor a bunch of section data into a struct.
3040 This basically moves a bunch of the section information we pass around a
3041 lot into a struct, and passes a pointer to a single one of those
3042 instead.
3043
3044 This shouldn't change the binary file output or the "grub-mkimage -v"
3045 output in any way.
3046
3047 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3048
3049 2018-03-05 Peter Jones <pjones@redhat.com>
3050
3051 mkimage: make locate_sections() set up vaddresses as well.
3052 This puts both kinds of address initialization at the same place, and also lets
3053 us iterate through the section list one time fewer.
3054
3055 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3056
3057 2018-03-05 Peter Jones <pjones@redhat.com>
3058
3059 mkimage: rename a couple of things to be less confusing later.
3060 This renames some things:
3061
3062 - the "strtab" and "strtab_section" in relocate_symbols are changed to "symtab"
3063 instead, so as to be less confusing when "strtab" is moved to a struct in a
3064 later patch.
3065
3066 - The places where we pass section_vaddresses to functions are changed to also
3067 be called section_vaddresses"inside those functions, so I get less confused
3068 when I put addresses and vaddresses in a struct in a later patch.
3069
3070 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3071
3072 2018-03-05 Peter Jones <pjones@redhat.com>
3073
3074 mkimage: make it easier to run syntax checkers on grub-mkimagexx.c
3075 This makes it so you can treat grub-mkimagexx.c as a file you can build
3076 directly, so syntax checkers like vim's "syntastic" plugin, which uses
3077 "gcc -x c -fsyntax-only" to build it, will work.
3078
3079 One still has to do whatever setup is required to make it pick the right
3080 include dirs, which -W options we use, etc., but this makes it so you
3081 can do the checking on the file you're editing, rather than on a
3082 different file.
3083
3084 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3085
3086 2018-03-05 Peter Jones <pjones@redhat.com>
3087
3088 aout.h: Fix missing include.
3089 grub_aout_load() has a grub_file_t parameter, and depending on what order
3090 includes land in, it's sometimes not defined. This patch explicitly adds
3091 file.h to aout.h so that it will always be defined.
3092
3093 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3094
3095 2018-02-26 Joakim Bech <joakim.bech@linaro.org>
3096
3097 ieee1275: fix build regression in of_path_of_nvme
3098 The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme
3099 support within ofpath) introduced a build regression:
3100 grub-core/osdep/linux/ofpath.c:365:21: error: comparison between pointer
3101 and zero character constant [-Werror=pointer-compare]
3102 if ((digit_string != '\0') && (*part_end == 'p'))
3103
3104 Update digit_string to compare against the char instead of the pointer.
3105
3106 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3107
3108 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3109
3110 arm: make linux.h safe to include for non-native builds
3111 <grub/machine/loader.h> (for machine arm/efi) and
3112 <grub/machine/kernel.h> (for machine arm/coreboot) will not always
3113 resolve (and will likely not be valid to) if pulled in when building
3114 non-native commands, such as host tools or the "file" command.
3115 So explicitly include them with their expanded pathnames.
3116
3117 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3118
3119 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3120
3121 arm: switch linux loader to linux_arm_kernel_header struct
3122 Use kernel header struct and magic definition to align (and coexist) with
3123 i386/arm64 ports.
3124
3125 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3126
3127 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3128
3129 arm64: align linux kernel magic macro naming with i386
3130 Change GRUB_ARM64_LINUX_MAGIC to GRUB_LINUX_ARM64_MAGIC_SIGNATURE.
3131
3132 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3133
3134 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3135
3136 arm64: align linux kernel header struct naming with i386
3137 Rename struct grub_arm64_linux_kernel_header -> linux_arm64_kernel_header.
3138
3139 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3140
3141 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3142
3143 i386: make struct linux_kernel_header architecture specific
3144 struct linux_kernel_header -> struct linux_i386_kernel_header
3145
3146 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3147
3148 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3149
3150 make GRUB_LINUX_MAGIC_SIGNATURE architecture-specific
3151 Rename GRUB_LINUX_MAGIC_SIGNATURE GRUB_LINUX_I386_MAGIC_SIGNATURE,
3152 to be usable in code that supports more than one image type.
3153
3154 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3155
3156 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3157
3158 Make arch-specific linux.h include guards architecture unique
3159 Replace uses of GRUB_LINUX_MACHINE_HEADER and GRUB_LINUX_CPU_HEADER
3160 with GRUB_<arch>_LINUX_HEADER include guards to prevent issues when
3161 including more than one of them.
3162
3163 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3164
3165 2018-02-23 Leif Lindholm <leif.lindholm@linaro.org>
3166
3167 arm64/efi: move EFI_PAGE definitions to efi/memory.h
3168 The EFI page definitions and macros are generic and should not be confined
3169 to arm64 headers - so move to efi/memory.h.
3170 Also add EFI_PAGE_SIZE macro.
3171
3172 Update loader sources to reflect new header location.
3173
3174 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3175
3176 2018-02-23 Colin Watson <cjwatson@ubuntu.com>
3177
3178 libgcrypt: Import replacement CRC operations
3179 The CRC implementation imported from libgcrypt 1.5.3 is arguably
3180 non-free, due to being encumbered by the restrictive Internet Society
3181 licence on RFCs (see e.g. https://wiki.debian.org/NonFreeIETFDocuments).
3182 Fortunately, libgcrypt has since replaced it with a version that is both
3183 reportedly better-optimised and doesn't suffer from this encumbrance.
3184
3185 The ideal solution would be to update to a new version of libgcrypt, and
3186 I spent some time trying to do that. However, util/import_gcry.py
3187 requires complex modifications to cope with the new version, and I
3188 stalled part-way through; furthermore, GRUB's libgcrypt tree already
3189 contains some backports of upstream changes. Rather than allowing the
3190 perfect to be the enemy of the good, I think it's best to backport this
3191 single change to at least sort out the licensing situation. Doing so
3192 won't make things any harder for a future wholesale upgrade.
3193
3194 This commit is mostly a straightforward backport of
3195 https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commitdiff;h=06e122baa3321483a47bbf82fd2a4540becfa0c9,
3196 but I also imported bufhelp.h from libgcrypt 1.7.0 (newer versions
3197 required further changes elsewhere).
3198
3199 I've tested that "hashsum -h crc32" still produces correct output for a
3200 variety of files on both i386-pc and x86_64-emu targets.
3201
3202 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3203
3204 2018-02-23 Eric Snowberg <eric.snowberg@oracle.com>
3205
3206 ieee1275: add nvme support within ofpath
3207 Add NVMe support within ofpath.
3208
3209 The Open Firmware text representation for a NVMe device contains the
3210 Namespace ID. An invalid namespace ID is one whose value is zero or whose
3211 value is greater than the value reported by the Number of Namespaces (NN)
3212 field in the Identify Controller data structure. At the moment only a
3213 single Namespace is supported, therefore the value is currently hard coded
3214 to one.
3215
3216 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3217
3218 2018-02-23 Daniel Kiper <daniel.kiper@oracle.com>
3219
3220 chainloader: Fix wrong break condition (must be AND not, OR)
3221 The definition of bpb's num_total_sectors_16 and num_total_sectors_32
3222 is that either the 16-bit field is non-zero and is used (in which case
3223 eg mkfs.fat sets the 32-bit field to zero), or it is zero and the
3224 32-bit field is used. Therefore, a BPB is invalid only if *both*
3225 fields are zero; having one field as zero and the other as non-zero is
3226 the case to be expected. (Indeed, according to Microsoft's specification
3227 one of the fields *must* be zero, and the other non-zero.)
3228
3229 This affects all users of grub_chainloader_patch_bpb which are in
3230 chainloader.c, freedos.c, and ntldr.c
3231
3232 Some descriptions of the semantics of these two fields:
3233
3234 https://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html
3235
3236 The old 2-byte fields "total number of sectors" and "number of
3237 sectors per FAT" are now zero; this information is now found in
3238 the new 4-byte fields.
3239
3240 (Here given in the FAT32 EBPB section but the total sectors 16/32 bit
3241 fields semantic is true of FAT12 and FAT16 too.)
3242
3243 https://wiki.osdev.org/FAT#BPB_.28BIOS_Parameter_Block.29
3244
3245 19 | 2 | The total sectors in the logical volume. If this value is 0,
3246 it means there are more than 65535 sectors in the volume, and the actual
3247 count is stored in "Large Sectors (bytes 32-35).
3248
3249 32 | 4 | Large amount of sector on media. This field is set if there
3250 are more than 65535 sectors in the volume.
3251
3252 (Doesn't specify what the "large" field is set to when unused, but as
3253 mentioned mkfs.fat sets it to zero then.)
3254
3255 https://technet.microsoft.com/en-us/library/cc976796.aspx
3256
3257 0x13 | WORD | 0x0000 |
3258 Small Sectors . The number of sectors on the volume represented in 16
3259 bits (< 65,536). For volumes larger than 65,536 sectors, this field
3260 has a value of zero and the Large Sectors field is used instead.
3261
3262 0x20 | DWORD | 0x01F03E00 |
3263 Large Sectors . If the value of the Small Sectors field is zero, this
3264 field contains the total number of sectors in the FAT16 volume. If the
3265 value of the Small Sectors field is not zero, the value of this field
3266 is zero.
3267
3268 https://staff.washington.edu/dittrich/misc/fatgen103.pdf page 10
3269
3270 BPB_TotSec16 | 19 | 2 |
3271 This field is the old 16-bit total count of sectors on the volume.
3272 This count includes the count of all sectors in all four regions of the
3273 volume. This field can be 0; if it is 0, then BPB_TotSec32 must be
3274 non-zero. For FAT32 volumes, this field must be 0. For FAT12 and
3275 FAT16 volumes, this field contains the sector count, and
3276 BPB_TotSec32 is 0 if the total sector count “fits” (is less than
3277 0x10000).
3278
3279 BPB_TotSec32 | 32 | 4 |
3280 This field is the new 32-bit total count of sectors on the volume.
3281 This count includes the count of all sectors in all four regions of the
3282 volume. This field can be 0; if it is 0, then BPB_TotSec16 must be
3283 non-zero. For FAT32 volumes, this field must be non-zero. For
3284 FAT12/FAT16 volumes, this field contains the sector count if
3285 BPB_TotSec16 is 0 (count is greater than or equal to 0x10000).
3286
3287 (This specifies that an unused BPB_TotSec32 field is set to zero.)
3288
3289 By the way fix offsets in include/grub/fat.h.
3290
3291 Tested with lDebug booted in qemu via grub2's
3292 FreeDOS direct loading support, refer to
3293 https://bitbucket.org/ecm/ldosboot + https://bitbucket.org/ecm/ldebug
3294
3295 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3296
3297 2018-02-23 H.J. Lu <hjl.tools@gmail.com>
3298
3299 x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
3300 Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:
3301
3302 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a
3303
3304 x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
3305 32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as
3306 R_X86_64_PC32.
3307
3308 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3309
3310 2018-02-14 Steve McIntyre <steve@einval.com>
3311
3312 Make grub-install check for errors from efibootmgr
3313 Code is currently ignoring errors from efibootmgr, giving users
3314 clearly bogus output like:
3315
3316 Setting up grub-efi-amd64 (2.02~beta3-4) ...
3317 Installing for x86_64-efi platform.
3318 Could not delete variable: No space left on device
3319 Could not prepare Boot variable: No space left on device
3320 Installation finished. No error reported.
3321
3322 and then potentially unbootable systems. If efibootmgr fails, grub-install
3323 should know that and report it!
3324
3325 We've been using similar patch in Debian now for some time, with no ill effects.
3326
3327 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3328
3329 2018-02-14 Eric Snowberg <eric.snowberg@oracle.com>
3330
3331 sparc64: fix OF path names for sun4v systems
3332 Fix the Open Firmware (OF) path property for sun4v SPARC systems.
3333 These platforms do not have a /sas/ within their path. Over time
3334 different OF addressing schemes have been supported. There
3335 is no generic addressing scheme that works across every HBA.
3336
3337 It looks that this functionality will not work if you try to cross-install
3338 SPARC GRUB2 binary using e.g. x86 grub-install. By default it should work.
3339 However, we will also have other issues here, like lack of access to OF
3340 firmware/paths, which make such configs unusable anyway. So, let's leave
3341 this patch as is for time being. If somebody cares then he/she should fix
3342 the issue(s) at some point.
3343
3344 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3345
3346 2018-02-14 Eric Snowberg <eric.snowberg@oracle.com>
3347
3348 sparc64: Add blocklist GPT support for SPARC
3349 Add block-list GPT support for SPARC. The OBP "load" and "boot" methods
3350 are partition aware and neither command can see the partition table. Also
3351 neither command can address the entire physical disk. When the install
3352 happens, grub generates the block-list entries based on the beginning of the
3353 physical disk, not the beginning of the partition. This patch fixes the
3354 block-list entries so they match what OBP expects during boot for a GPT disk.
3355
3356 T5 and above now supports GPT as well as VTOC.
3357
3358 This patch has been tested on T5-2 and newer SPARC systems.
3359
3360 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3361
3362 2018-01-29 Stefan Fritsch <fritsch@genua.de>
3363
3364 ahci: Improve error handling
3365 Check the error bits in the interrupt status register. According to the
3366 AHCI 1.2 spec, "Interrupt sources that are disabled (‘0’) are still
3367 reflected in the status registers.", so this should work even though
3368 grub uses polling
3369
3370 This fixes the following problem on a Fujitsu E744 laptop:
3371
3372 Sometimes there is a very long delay (up to several minutes) when
3373 booting from hard disk. It seems accessing the DVD drive (which has no
3374 disk inserted) sometimes fails with some errors, which leads to each
3375 access being stalled until the 20s timeout triggers. This seems to
3376 happen when grub is trying to read filesystem/partition data.
3377
3378 The problem is that the command_issue bit that is checked in the loop is
3379 only reset if the "HBA receives a FIS which clears the BSY, DRQ, and ERR
3380 bits for the command", but the ERR bit is never cleared. Therefore
3381 command_issue is never reset and grub waits for the timeout.
3382
3383 The relevant bit in our case is the Task File Error Status (TFES), which
3384 is equivalent to the ERR bit 0 in tfd. But this patch also checks
3385 the other error bits except for the "Interface non-fatal error status"
3386 bit.
3387
3388 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3389
3390 2018-01-29 dann frazier <dann.frazier@canonical.com>
3391
3392 Keep the native terminal active when enabling gfxterm
3393 grub-mkconfig will set GRUB_TERMINAL_OUTPUT to "gfxterm" unless the user
3394 has overridden it. On EFI systems, this will stop output from going to the
3395 default "console" terminal. When the EFI fw console is configured to output to
3396 both serial and video, this will cause GRUB to only display on video - while
3397 continuing to accept input from both video and serial.
3398
3399 Instead of switching from "console" to "gfxterm", let's output to both.
3400
3401 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3402
3403 2017-12-06 Julien Grall <julien.grall@linaro.org>
3404
3405 arm64/xen: Add missing #address-cells and #size-cells properties
3406 The properties #address-cells and #size-cells are used to know the
3407 number of cells for ranges provided by "regs". If they don't exist, the
3408 value are resp. 2 and 1.
3409
3410 Currently, when multiboot nodes are created it is assumed that #address-cells
3411 and #size-cells are exactly 2. However, they are never set by GRUB and
3412 will result to later failure when the device-tree is generated by GRUB
3413 or contain different values.
3414
3415 To prevent this failure, create the both properties in the chosen nodes.
3416
3417 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3418
3419 2017-12-06 Jordan Glover <Golden_Miller83@protonmail.ch>
3420
3421 grub-mkconfig: Fix detecting .sig files as system images
3422 grub-mkconfig detects detached RSA signatures for kernel images used for
3423 signature checking as valid images and adds them to grub.cfg as separate
3424 menu entries. This patch adds .sig extension to common blacklist.
3425
3426 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3427
3428 2017-12-06 Eric Snowberg <eric.snowberg@oracle.com>
3429
3430 ieee1275: Fix segfault in grub-ofpathname
3431 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3432
3433 2017-11-28 Eric Snowberg <eric.snowberg@oracle.com>
3434
3435 grub-install: Fix memory leak
3436 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3437
3438 2017-11-24 Eric Snowberg <eric.snowberg@oracle.com>
3439
3440 ls: prevent double open
3441 Prevent a double open. This can cause problems with some ieee1275
3442 devices, causing the system to hang. The double open can occur
3443 as follows:
3444
3445 grub_ls_list_files (char *dirname, int longlist, int all, int human)
3446 dev = grub_device_open (device_name);
3447 dev remains open while:
3448 grub_normal_print_device_info (device_name);
3449 dev = grub_device_open (name);
3450
3451 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3452
3453 2017-10-06 David E. Box <david.e.box@linux.intel.com>
3454
3455 tsc: Change default tsc calibration method to pmtimer on EFI systems
3456 On efi systems, make pmtimer based tsc calibration the default over the
3457 pit. This prevents Grub from hanging on Intel SoC systems that power gate
3458 the pit.
3459
3460 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3461
3462 2017-09-07 Alexander Graf <agraf@suse.de>
3463
3464 efi: Free malloc regions on exit
3465 When we exit grub, we don't free all the memory that we allocated earlier
3466 for our heap region. This can cause problems with setups where you try
3467 to descend the boot order using "exit" entries, such as PXE -> HD boot
3468 scenarios.
3469
3470 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3471
3472 2017-09-07 Alexander Graf <agraf@suse.de>
3473
3474 efi: Move grub_reboot() into kernel
3475 The reboot function calls machine_fini() and then reboots the system.
3476 Currently it lives in lib/ which means it gets compiled into the
3477 reboot module which lives on the heap.
3478
3479 In a following patch, I want to free the heap on machine_fini()
3480 though, so we would free the memory that the code is running in. That
3481 obviously breaks with smarter UEFI implementations.
3482
3483 So this patch moves it into the core. That way we ensure that all
3484 code running after machine_fini() in the UEFI case is running from
3485 memory that got allocated (and gets deallocated) by the UEFI core.
3486
3487 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3488
3489 2017-09-07 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3490
3491 Use grub-file to figure out whether multiboot2 should be used for Xen.gz
3492 The multiboot2 is much more preferable than multiboot. Especiall
3493 if booting under EFI where multiboot does not have the functionality
3494 to pass ImageHandler.
3495
3496 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3497
3498 2017-09-07 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3499
3500 Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
3501 Commit d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe introduced
3502 the support for this, but it does not work under x86 (as it stops
3503 20_linux_xen from running).
3504
3505 The 20_linux_xen is run under a shell and any exits from within it:
3506
3507 (For example on x86):
3508 + /usr/bin/grub2-file --is-arm64-efi /boot/xen-4.9.0.gz
3509 [root@tst063 grub]# echo $?
3510 1
3511
3512 will result in 20_linux_xen exiting without continuing
3513 and also causing grub2-mkconfig to stop processing.
3514
3515 As in:
3516
3517 [root@tst063 grub]# ./grub-mkconfig | tail
3518 Generating grub configuration file ...
3519 Found linux image: /boot/vmlinuz-4.13.0-0.rc5.git1.1.fc27.x86_64
3520 Found initrd image: /boot/initramfs-4.13.0-0.rc5.git1.1.fc27.x86_64.img
3521 Found linux image: /boot/vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2
3522 Found initrd image: /boot/initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img
3523 echo 'Loading Linux 0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 ...'
3524 linux /vmlinuz-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2 root=/dev/mapper/fedora_tst063-root ro single
3525 echo 'Loading initial ramdisk ...'
3526 initrd /initramfs-0-rescue-ec082ee24aea41b9b16aca52a6d10cc2.img
3527 }
3528 }
3529
3530 ### END /usr/local/etc/grub.d/10_linux ###
3531
3532 ### BEGIN /usr/local/etc/grub.d/20_linux_xen ###
3533
3534 root@tst063 grub]#
3535
3536 And no more.
3537
3538 This patch wraps the invocation of grub-file to be a in subshell
3539 and to process the return value in a conditional. That fixes
3540 the issue.
3541
3542 RH-BZ 1486002: grub2-mkconfig does not work if xen.gz is installed.
3543
3544 CC: Fu Wei <fu.wei@linaro.org>
3545 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3546
3547 2017-09-07 Vladimir Serbinenko <phcoder@gmail.com>
3548
3549 Fix compilation for x86_64-efi.
3550
3551 2017-09-05 Vladimir Serbinenko <phcoder@gmail.com>
3552
3553 Add a file missing in multiboot2 commit.
3554
3555 2017-08-30 Vladimir Serbinenko <phcoder@google.com>
3556
3557 gzio: fix unaligned access
3558
3559 grub-fs-tester: Fix bashism
3560
3561 2017-08-30 Vladimir Serbinenko <phcoder@gmail.com>
3562
3563 Regenerate checksum.h with newer unifont.
3564 Old link is broken. New unifont is
3565 http://ftp.de.debian.org/debian/pool/main/u/unifont/xfonts-unifont_9.0.06-2_all.deb
3566
3567 printf_unit_test: Disable Wformat-truncation on GCC >= 7
3568 We intentionally pass NULL as argument to format, hence disable the warning.
3569
3570 qemu, coreboot, multiboot: Change linking address to 0x9000.
3571 It's common for distros to use a defective ld which links at 0x9000. Instead
3572 of fighting it, just move link target to 0x9000.
3573
3574 2017-08-30 Stefan Fritsch <sf@sfritsch.de>
3575
3576 Implement checksum verification for gunzip
3577 This implements the crc32 check for the gzip format. Support for zlib's
3578 adler checksum is not included, yet.
3579
3580 2017-08-30 Vladimir Serbinenko <phcoder@gmail.com>
3581
3582 xfs: Don't attempt to iterate over empty directory.
3583 Reported by: Tuomas Tynkkynen
3584
3585 2017-08-30 Patrick Steinhardt <ps@pks.im>
3586
3587 unix exec: avoid atexit handlers when child exits
3588 The `grub_util_exec_redirect_all` helper function can be used to
3589 spawn an executable and redirect its output to some files. After calling
3590 `fork()`, the parent will wait for the child to terminate with
3591 `waitpid()` while the child prepares its file descriptors, environment
3592 and finally calls `execvp()`. If something in the children's setup
3593 fails, it will stop by calling `exit(127)`.
3594
3595 Calling `exit()` will cause any function registered via `atexit()` to be
3596 executed, which is usually the wrong thing to do in a child. And
3597 actually, one can easily observe faulty behaviour on musl-based systems
3598 without modprobe(8) installed: executing `grub-install --help` will call
3599 `grub_util_exec_redirect_all` with "modprobe", which obviously fails if
3600 modprobe(8) is not installed. Due to the child now exiting and invoking
3601 the `atexit()` handlers, it will clean up some data structures of the
3602 parent and cause it to be deadlocked in the `waitpid()` syscall.
3603
3604 The issue can easily be fixed by calling `_exit(127)` instead, which is
3605 especially designed to be called when the atexit-handlers should not be
3606 executed.
3607
3608 2017-08-30 Vladimir Serbinenko <phcoder@gmail.com>
3609
3610 arc: Do not create spurious variable grub_arc_memory_type_t.
3611
3612 2017-08-14 Xuan Guo <nbdd0121>
3613
3614 Set have_exec to y on cygwin so we have grub_mkrescue.
3615
3616 2017-08-14 Vladimir Serbinenko <phcoder@gmail.com>
3617
3618 enforcing fixup
3619
3620 multiboot fixup
3621
3622 linux fixup
3623
3624 yylex: Explicilty cast fprintf to void.
3625 It's needed to avoid warning on recent GCC.
3626
3627 genmoddep: Check that no modules provide the same symbol.
3628 The semantics of 2 modules providing the same symbol are undefined. So
3629 ensure that it doesn't happen.
3630
3631 Fix symbols appearing in several modules in linux*.
3632 If same symbol is provided by 2 modules its semantics are undefined.
3633 Avoid this by depending rather than double-including files.
3634
3635 2017-08-14 Vladimir Serbinenko <phcoder@gmail.com>
3636
3637 multiboot: disentangle multiboot and multiboot2.
3638 Previously we had multiboot and multiboot2 declaring the same symbols.
3639 This can potentially lead to aliasing and strange behaviours when e.g.
3640 module instead of module2 is used with multiboot2.
3641
3642 Bug: #51137
3643
3644 2017-08-14 Vladimir Serbinenko <phcoder@gmail.com>
3645
3646 hdparm: Depend on hexdump rather than having a second copy of hexdump.
3647
3648 grub.texi: Fix typo
3649 Reported by: Ori Avtalion <saltyhorse>
3650
3651 2017-08-07 Pete Batard <pete@akeo.ie>
3652
3653 io: add a GRUB_GZ prefix to gzio specific defines
3654 * This is done to avoid a conflict with a PACKED define in the EDK2
3655
3656 core: use GRUB_TERM_ definitions when handling term characters
3657 * Also use hex value for GRUB_TERM_ESC as '\e' is not in the C standard and is not understood by some compilers
3658
3659 2017-08-07 Leif Lindholm <leif.lindholm@linaro.org>
3660
3661 efi: change heap allocation type to GRUB_EFI_LOADER_CODE
3662 With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may
3663 not return regions with execute ability. Since modules are loaded onto
3664 the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in
3665 order to permit execution on systems with this feature enabled.
3666
3667 Closes: 50420
3668
3669 2017-08-07 Leif Lindholm <leif.lindholm@linaro.org>
3670
3671 arm64 linux loader: improve type portability
3672 In preparation for turning this into a common loader for 32-bit and 64-bit
3673 platforms, ensure the code will compile cleanly for either.
3674
3675 2017-08-07 Leif Lindholm <leif.lindholm@linaro.org>
3676
3677 efi: Add GRUB_PE32_MAGIC definition
3678 Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete
3679 the existing one in arm64/linux.h.
3680
3681 Update arm64 Linux loader to use this new definition.
3682
3683 2017-08-07 Leif Lindholm <leif.lindholm@linaro.org>
3684
3685 efi: move fdt helper library
3686 There is nothing ARM64 (or even ARM) specific about the efi fdt helper
3687 library, which is used for locating or overriding a firmware-provided
3688 devicetree in a UEFI system - so move it to loader/efi for reuse.
3689
3690 Move the fdtload.h include file to grub/efi and update path to
3691 efi/fdtload.h in source code referring to it.
3692
3693 2017-08-07 Vladimir Serbinenko <phcoder@gmail.com>
3694
3695 Remove grub_efi_allocate_pages.
3696 grub_efi_allocate_pages Essentially does 2 unrelated things:
3697 * Allocate at fixed address.
3698 * Allocate at any address.
3699
3700 To switch between 2 different functions it uses address == 0 as magic
3701 value which is wrong as 0 is a perfectly valid fixed adress to allocate at.
3702
3703 2017-08-07 Leif Lindholm <leif.lindholm@linaro.org>
3704
3705 efi: refactor grub_efi_allocate_pages
3706 Expose a new function, grub_efi_allocate_pages_real(), making it possible
3707 to specify allocation type and memory type as supported by the UEFI
3708 AllocatePages boot service.
3709
3710 Make grub_efi_allocate_pages() a consumer of the new function,
3711 maintaining its old functionality.
3712
3713 Also delete some left-around #if 1/#else blocks in the affected
3714 functions.
3715
3716 2017-08-07 Vladimir Serbinenko <phcoder@gmail.com>
3717
3718 Fail if xorriso failed.
3719 If xorriso failed most likely we didn't generate a meaningful image.
3720
3721 mkrescue: Check xorriso presence before doing anything else.
3722 mkrescue can't do anything useful without xorriso, so abort early if it's
3723 not available.
3724
3725 2017-08-07 Pali Rohár <pali.rohar@gmail.com>
3726
3727 * grub-core/fs/udf.c: Add support for UUID
3728 Use same algorithm as in libblkid from util-linux v2.30.
3729
3730 1. Take first 16 bytes from UTF-8 encoded string of VolumeSetIdentifier
3731 2. If all bytes are hexadecimal digits, convert to lowercase and use as UUID
3732 3. If first 8 bytes are not all hexadecimal digits, convert those 8 bytes
3733 to their hexadecimal representation, resulting in 16 bytes for UUID
3734 4. Otherwise, compose UUID from two parts:
3735 1. part: converted first 8 bytes (which are hexadecimal digits) to lowercase
3736 2. part: encoded following 4 bytes to their hexadecimal representation (16 bytes)
3737
3738 So UUID would always have 16 hexadecimal digits in lowercase variant.
3739
3740 According to UDF specification, first 16 Unicode characters of
3741 VolumeSetIdentifier should be unique value and first 8 should be
3742 hexadecimal characters.
3743
3744 In most cases all 16 characters are hexadecimal, but e.g. MS Windows
3745 format.exe set only first 8 as hexadecimal and remaining as fixed
3746 (non-unique) which violates specification.
3747
3748 2017-08-07 Pali Rohár <pali.rohar@gmail.com>
3749
3750 udf: Fix reading label, lvd.ident is dstring
3751 UDF dstring has stored length in the last byte of buffer. Therefore last
3752 byte is not part of recorded characters. And empty string in dstring is
3753 encoded as empty buffer, including first byte (compression id).
3754
3755 2017-08-07 Pete Batard <pete@akeo.ie>
3756
3757 zfs: remove size_t typedef and use grub_size_t instead
3758 * Prevents some toolchains from issuing a warning on size_t redef.
3759
3760 2017-08-03 Rob Clark <rclark@redhat.com>
3761
3762 Fix a segfault in lsefi
3763 when protocols_per_handle returns error, we can't use the pointers we
3764 passed to it, and that includes trusting num_protocols.
3765
3766 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3767
3768 2017-07-10 Vladimir Serbinenko <phcoder@gmail.com>
3769
3770 fdt: silence clang warning.
3771
3772 2017-07-09 Vladimir Serbinenko <phcoder@gmail.com>
3773
3774 arm-efi: Fix compilation
3775
3776 2017-07-09 AppChecker <appchecker>
3777
3778 crypto: Fix use after free.
3779 Reported by: AppChecker
3780 Transformed to patch by: Satish Govindarajan
3781
3782 2017-07-09 Vladimir Serbinenko <phcoder@gmail.com>
3783
3784 ehci: Fix compilation on i386
3785
3786 2017-07-09 phcoder <phcoder@sid.debian.laptop.phnet>
3787
3788 cache: Fix compilation for ppc, sparc and arm64
3789
3790 ehci: Fix compilation for amd64
3791
3792 2017-06-29 Eric Biggers <ebiggers@google.com>
3793
3794 Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature.
3795 On such a filesystem, inodes may have EXT4_ENCRYPT_FLAG set.
3796 For a regular file, this means its contents are encrypted; for a
3797 directory, this means the filenames in its directory entries are
3798 encrypted; and for a symlink, this means its target is encrypted. Since
3799 GRUB cannot decrypt encrypted contents or filenames, just issue an error
3800 if it would need to do so. This is sufficient to allow unencrypted boot
3801 files to co-exist with encrypted files elsewhere on the filesystem.
3802
3803 (Note that encrypted regular files and symlinks will not normally be
3804 encountered outside an encrypted directory; however, it's possible via
3805 hard links, so they still need to be handled.)
3806
3807 Tested by booting from an ext4 /boot partition on which I had run
3808 'tune2fs -O encrypt'. I also verified that the expected error messages
3809 are printed when trying to access encrypted directories, files, and
3810 symlinks from the GRUB command line. Also ran 'sudo ./grub-fs-tester
3811 ext4_encrypt'; note that this requires e2fsprogs v1.43+ and Linux v4.1+.
3812
3813 2017-05-29 Eric Snowberg <eric.snowberg@oracle.com>
3814
3815 sparc64: Don't use devspec to determine the OBP path
3816 Don't use devspec to determine the OBP path on SPARC hardware. Within all
3817 versions of Linux on SPARC, the devspec returns one of three values:
3818 "none", "vnet-port", or "vdisk". Unlike on PPC, none of these values
3819 are useful in determining the OBP path.
3820
3821 Before this patch grub-ofpathname always returned the wrong value
3822 for a virtual disk. For example:
3823
3824 % grub-ofpathname /dev/vdiskc2
3825 vdisk/disk@2:b
3826
3827 After this patch it now returns the correct value:
3828
3829 % grub-ofpathname /dev/vdiskc2
3830 /virtual-devices@100/channel-devices@200/disk@2:b
3831
3832 Orabug: 24459765
3833
3834 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3835
3836 2017-05-18 Fu Wei <fu.wei@linaro.org>
3837
3838 arm64: Update the introduction of Xen boot commands in docs/grub.texi
3839 delete: xen_linux, xen_initrd, xen_xsm
3840 add: xen_module
3841
3842 This update bases on
3843 commit 0edd750e50698854068358ea53528100a9192902
3844 Author: Vladimir Serbinenko <phcoder@gmail.com>
3845 Date: Fri Jan 22 10:18:47 2016 +0100
3846
3847 xen_boot: Remove obsolete module type distinctions.
3848
3849 Also bases on the module loading mechanism of Xen code:
3850 488c2a8 docs/arm64: clarify the documention for loading XSM support
3851 67831c4 docs/arm64: update the documentation for loading XSM support
3852 ca32012 xen/arm64: check XSM Magic from the second unknown module.
3853
3854 Reviewed-by: Julien Grall <julien.grall@arm.com>
3855 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3856
3857 2017-05-18 Fu Wei <fu.wei@linaro.org>
3858
3859 util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
3860 This patch adds the support of xen_boot command for aarch64:
3861 xen_hypervisor
3862 xen_module
3863 These two commands are only for aarch64, since it has its own protocol and
3864 commands to boot xen hypervisor and Dom0, but not multiboot.
3865
3866 For other architectures, they are still using multiboot and module
3867 commands.
3868
3869 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3870
3871 2017-05-18 Fu Wei <fu.wei@linaro.org>
3872
3873 arm64: Add "--nounzip" option support in xen_module command
3874 This patch adds "--nounzip" option support in order to
3875 be compatible with the module command of multiboot on other architecture,
3876 by this way we can simplify grub-mkconfig support code.
3877
3878 This patch also allow us to use zip compressed module(like Linux kernel
3879 for Dom0).
3880
3881 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3882
3883 2017-05-18 Julien Grall <julien.grall@linaro.org>
3884
3885 arm64/xen_boot: Fix Xen boot using GRUB2 on AARCH64
3886 Xen is currently crashing because of malformed compatible property for
3887 the boot module. This is because the property string is not
3888 null-terminated as requested by the ePAR spec.
3889
3890 Tested-by: Fu Wei <fu.wei@linaro.org>
3891 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3892
3893 2017-05-18 Eric Snowberg <eric.snowberg@oracle.com>
3894
3895 sparc64: Close cdboot ihandle
3896 The ihandle is left open with a cd-core image. This will cause a delay
3897 booting grub from a virtual cdrom in a LDOM. It will also cause problems
3898 as Linux boots, since it expects the ihandle to be closed during init.
3899
3900 Orabug: 25911275
3901
3902 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
3903
3904 2017-05-09 Vladimir Serbinenko <phcoder@gmail.com>
3905
3906 at_keyboard: Fix falco chromebook case.
3907 EC is slow, so we need few delays for it to toggle the bits correctly.
3908
3909 Command to enable clock and keyboard were not sent.
3910
3911 2017-05-09 Julius Werner <jwerner@chromium.org>
3912
3913 coreboot: Changed cbmemc to support updated console format from coreboot.
3914
3915 2017-05-09 Vladimir Serbinenko <phcoder@gmail.com>
3916
3917 Missing parts of previous commit
3918
3919 arm_coreboot: Add Chromebook keyboard driver.
3920
3921 rk3288_spi: Add SPI driver
3922
3923 fdtbus: Add ability to send/receive messages on parent busses.
3924
3925 Fix bug on FDT nodes with compatible property
3926
3927 2017-05-08 Vladimir Serbinenko <phcoder@gmail.com>
3928
3929 arm_coreboot: Support EHCI.
3930
3931 ehci: Split core code from PCI part.
3932 On ARM often EHCI is present without PCI and just declared in device
3933 tree. So splitcore from PCI part.
3934
3935 arm_coreboot: Support DMA.
3936 This is needed to support USB and some other busses.
3937
3938 arm_coreboot: Support loading linux images.
3939
3940 arm_coreboot: Support grub-mkstandalone.
3941
3942 arm_coreboot: Support keyboard for vexpress.
3943
3944 at_keyboard: Split protocol from controller code.
3945 On vexpress controller is different but protocol is the same, so reuse the
3946 code.
3947
3948 arm-coreboot: Export FDT routines.
3949 We need to use them from modules as well.
3950
3951 arm-coreboot: Support for vexpress timer.
3952
3953 Add support for device-tree-based drivers.
3954
3955 arm-coreboot: Start new port.
3956
3957 Rename uboot/datetime to dummy/datetime.
3958 It's just a stub and is not UBoot-specific.
3959
3960 Rename uboot/halt.c to dummy/halt.c.
3961 It's not U-Boot specific and it's a stub.
3962
3963 coreboot: Split parts that are platform-independent.
3964 We currently assume that coreboot is always i386, it's no longer the case,
3965 so split i386-coreboot parts from generic coreboot code.
3966
3967 Refactor arm-uboot code to make it genereic.
3968 arm-coreboot startup code can be very similar to arm-uboot but current code has
3969 U-Boot specific references. So split U-Boot part from generic part.
3970
3971 mkimage: Pass layout to mkimage_generate_elfXX rather than some fields.
3972 This allows easier extension of this function without having too long of
3973 arguments list.
3974
3975 2017-05-03 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
3976
3977 Add Virtual LAN support.
3978 This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows
3979 multiple VLANs in a bridged network to share the same physical network link
3980 but maintain isolation:
3981
3982 http://en.wikipedia.org/wiki/IEEE_802.1Q
3983
3984 * grub-core/net/ethernet.c: Add check, get, and set vlan tag id.
3985 * grub-core/net/drivers/ieee1275/ofnet.c: Get vlan tag id from bootargs.
3986 * grub-core/net/arp.c: Add check.
3987 * grub-core/net/ip.c: Likewise.
3988 * include/grub/net/arp.h: Add vlantag attribute.
3989 * include/grub/net/ip.h: Likewise.
3990
3991 2017-05-03 Vladimir Serbinenko <phcoder@gmail.com>
3992
3993 strtoull: Fix behaviour on chars between '9' and 'a'.
3994 Reported by: Aaron Miller <aaronmiller@fb.com>
3995
3996 Add strtoull test.
3997
3998 Fix shebang for termux.
3999 Termux doesn't have a /bin/sh. So we needto use $SHELL.
4000 Keep /bin/sh as much as possible.
4001
4002 Add termux path to dict.
4003
4004 po: Use @SHELL@ rather than /bin/sh.
4005 /bin/sh might not exist.
4006
4007 Use $(SHELL) rather than /bin/sh.
4008 /bin/sh doesn't exist under termux.
4009
4010 Support lseek64.
4011 Android doesn't have 64-bit off_t, so use off64_t instead.
4012
4013 Don't retrieve fstime when it's not useful.
4014
4015 support busybox date.
4016 Busybox date doesn't understand weekdays in -d input,
4017 so strip them beforehand.
4018
4019 fs-tester: make sh-compatible
4020
4021 Remove bashisms from tests.
4022 Those tests don't actually need bash. Just use common shebang.
4023
4024 Bump version to 2.03
4025
4026 2017-04-25 Vladimir Serbinenko <phcoder@gmail.com>
4027
4028 Increase version to 2.02.
4029
4030 2017-04-12 Vladimir Serbinenko <phcoder@gmail.com>
4031
4032 Fix remaining cases of gcc 7 fallthrough warning.
4033 They are all intended, so just add the relevant comment.
4034
4035 2017-04-04 Andrei Borzenkov <arvidjaar@gmail.com>
4036
4037 Add gnulib-fix-gcc7-fallthrough.diff
4038 As long as the code is not upstream, add it as explicit patch for the
4039 case of gnulib refresh.
4040
4041 2017-04-04 Andrei Borzenkov <arvidjaar@gmail.com>
4042
4043 i386, x86_64, ppc: fix switch fallthrough cases with GCC7
4044 In util/getroot and efidisk slightly modify exitsing comment to mostly
4045 retain it but still make GCC7 compliant with respect to fall through
4046 annotation.
4047
4048 In grub-core/lib/xzembed/xz_dec_lzma2.c it adds same comments as
4049 upstream.
4050
4051 In grub-core/tests/setjmp_tets.c declare functions as "noreturn" to
4052 suppress GCC7 warning.
4053
4054 In grub-core/gnulib/regexec.c use new __attribute__, because existing
4055 annotation is not recognized by GCC7 parser (which requires that comment
4056 immediately precedes case statement).
4057
4058 Otherwise add FALLTHROUGH comment.
4059
4060 Closes: 50598
4061
4062 2017-04-04 Andrei Borzenkov <arvidjaar@gmail.com>
4063
4064 btrfs: avoid "used uninitialized" error with GCC7
4065 sblock was local and so considered new variable on every loop
4066 iteration.
4067
4068 Closes: 50597
4069
4070 2017-04-02 Andrei Borzenkov <arvidjaar@gmail.com>
4071
4072 acpi: add missing efi_call wrapper to acpi command
4073 Fixed loading of ACPI tables on EFI (side effect was apparent memory
4074 corruption ranging from unpredictable behavior to system reset).
4075
4076 Reported by Nando Eva <nando4eva@ymail.com>
4077
4078 2017-03-15 Vladimir Serbinenko <phcoder@gmail.com>
4079
4080 Increment version to GRUB 2.02~rc2.
4081
4082 Use core2duo for bootcheck test on 64-bit EFI.
4083 Obviously pentium2 can't run efi64.
4084
4085 2017-03-14 Andrei Borzenkov <arvidjaar@gmail.com>
4086
4087 efi: skip iPXE block device.
4088 iPXE adds Simple File System Protocol to loaded image handle, as side
4089 effect it also adds Block IO protocol (according to comments, to work
4090 around some bugs in EDK2). GRUB assumes that every device with Block IO
4091 is disk and skips network initialization entirely. But iPXE Block IO
4092 implementation is just a stub which always fails for every operation
4093 so cannot be used. Attempt to detect and skip such devices.
4094
4095 We are using media ID which iPXE sets to "iPXE" and block IO size in
4096 hope that no real device would announce 1B block ...
4097
4098 Closes: 50518
4099
4100 2017-03-05 phcoder <phcoder@gmail.com>
4101
4102 xen: Fix wrong register in relocator.
4103 This fixes chainloading of some GRUB variants.
4104
4105 2017-02-27 Vladimir Serbinenko <phcoder@gmail.com>
4106
4107 video_fb: Fix blue collor if using unoptimized blitter.
4108 when unmapping the color what matters is the mode of source, not target.
4109
4110 legacy_initrd: Strip any additional arguments to initrd.
4111
4112 2017-02-26 Andrei Borzenkov <arvidjaar@gmail.com>
4113
4114 grub-fs-tester: improve squash4 tests
4115 1. Make sure files are not multiple of block size. This will ensure tail packing
4116 for squash4 and may also trigger more codes paths in other filesystems.
4117
4118 2. Call mksquashfs with -always-use-fragments to force tail packing.
4119
4120 2017-02-25 Andrei Borzenkov <arvidjaar@gmail.com>
4121
4122 efi: strip off final NULL from File Path in grub_efi_get_filename
4123 UEFI 2.6 9.3.6.4 File Path Media Device Path says that Path Name is
4124 "A NULL-terminated Path string including directory and file names".
4125
4126 Strip final NULL from Path Name in each File Path node when constructing
4127 full path. To be on safe side, strip all of them.
4128
4129 Fixes failure chainloading grub from grub, when loaded grub truncates
4130 image path and does not find its grub.cfg.
4131
4132 https://bugzilla.opensuse.org/show_bug.cgi?id=1026344
4133
4134 This was triggered by commit ce95549cc54b5d6f494608a7c390dba3aab4fba7;
4135 before it we built Path Name without trailing NULL, and apparently all
4136 other bootloaders use single File Path node, thus not exposing this bug.
4137
4138 2017-02-24 Andrei Borzenkov <arvidjaar@gmail.com>
4139
4140 squash4: fix handling of fragments and sparse files
4141 1. Do not assume block list and fragment are mutually exclusive. Squash
4142 can pack file tail as fragment (unless -no-fragments is specified); so
4143 check read offset and read either from block list or from fragments as
4144 appropriate.
4145
4146 2. Support sparse files with zero blocks.
4147
4148 3. Fix fragment read - frag.offset is absolute fragment position,
4149 not offset relative to ino.chunk.
4150
4151 Reported and tested by Carlo Caione <carlo@endlessm.com>
4152
4153 2017-02-22 Vladimir Serbinenko <phcoder@gmail.com>
4154
4155 Whitelist sparc64-ieee1275 as having no video modules.
4156 ieee1275_fb is not built on sparc64 due to virtual address issues.
4157
4158 2017-02-12 Andrei Borzenkov <arvidjaar@gmail.com>
4159
4160 script: fix double free in lexer
4161 yylex_destroy() already frees scanner.
4162
4163 Found by: Coverity scan.
4164 CID: 176636
4165
4166 2017-02-07 Vladimir Serbinenko <phcoder@gmail.com>
4167
4168 xen: Fix parsing of XZ kernel.
4169 In case of xz, the uncompressed size is appended to xz data which confuses
4170 our xz decompressor. Trim it.
4171
4172 2017-02-07 Vladimir Serbinenko <phcoder@gmail.com>
4173
4174 xen: Fix handling of GRUB chainloading.
4175 In case of GRUB we put remapper after domain pages and not at 0x0.
4176 In this case we use max_addr to put remapper. Unfortunately we increment
4177 max_addr as well in this case resulting in virt mapping mapping page
4178 at old max_addr and trying to boot using new max_addr.
4179
4180 Closes 46014.
4181
4182 2017-02-04 Vladimir Serbinenko <phcoder@gmail.com>
4183
4184 linguas: Don't skip ko.po.
4185 Translation project doesn't require copyright disclaimers. They're independant
4186 from us. They're responsible for their copyright story.
4187
4188 2017-02-03 Vladimir Serbinenko <phcoder@gmail.com>
4189
4190 Fix truncated checksum.h.
4191
4192 Regenerate checksums.h
4193 Screenshots contain version, so we need new checksums.
4194
4195 Release 2.02-rc1.
4196
4197 Fix mingw compilation.
4198
4199 2017-02-03 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4200
4201 documentation: Clarify documentation for special environment variable "default".
4202 The current documentation for the special environment variable
4203 "default" is confusing and unclear. This patch attempts to clean it
4204 up.
4205
4206 In particular, the current documentation refers to the "number or
4207 title", but then in the example it gives, the menu entries and
4208 submenus all have numbers *in* their title; furthermore, there is no
4209 example given about how to choose the number, or any indication about
4210 whether counting is zero-indexed or 1-indexed.
4211
4212 Having a cleaner example and presenting all variants (numeric, title,
4213 and id) should make it clearer to the user.
4214
4215 2017-02-03 Vladimir Serbinenko <phcoder@gmail.com>
4216
4217 Avoid causing kernel oops in nilfs2 test.
4218 1024-byte and 2048-byte blocks don't really work with some kernels, skip
4219 them as we don't want any oops'es.
4220
4221 btrfs: Shorten label by one character.
4222 mkfs.btrfs imposes a slightly lower limit than would be possible in btrfs.
4223
4224 2017-02-02 Vladimir Serbinenko <phcoder@gmail.com>
4225
4226 grub-fs-tester: Fix mkudffs invocation.
4227 With current invocation order of arguments is wrong and path is hardcoded.
4228
4229 grub-fs-tester: Fix fat test.
4230 mkfs.vfat ignores -S when invoked on a disk, including loopback device,
4231 so do an mkfs on underlying image.
4232
4233 2017-02-02 Daniel Kiper <daniel.kiper@oracle.com>
4234
4235 i386/relocator: Align stack in grub_relocator64_efi relocator
4236 Unified Extensible Firmware Interface Specification, Version 2.6,
4237 section 2.3.4, x64 Platforms, boot services, says among others:
4238 The stack must be 16-byte aligned. So, do it. Otherwise OS may
4239 boot only by chance as it happens right now.
4240
4241 2017-02-02 Vladimir Serbinenko <phcoder@gmail.com>
4242
4243 i386-ieee1275: Add missing bootcheck target.
4244
4245 bootcheck-linux-i386: Use -cpu pentium2.
4246 Most modern kernels are compiled for i686, so use -cpu pentium2
4247 to avoid spurious failures.
4248
4249 Use -fPIC with arm64 with clang.
4250 Currently it doesn't work either way but with -fPIC it should work once
4251 clang bug is fixed.
4252
4253 INSTALL: Fix mention of thumb-clang.
4254
4255 Fix thumb compilation with clang.
4256 According to EABI only STT_FUNC has convention of lowest bit indicating
4257 execution mode. R_THM_{JUMP,CALL}* relocations are assumed to be pointing
4258 to thumb mode unless they use STT_FUNC.
4259
4260 2017-02-01 Vladimir Serbinenko <phcoder@gmail.com>
4261
4262 Add missing strtoull_test.c
4263 It was forgotten in my local directory.
4264
4265 arm64: Add support for GOT and PCREL32 relocations.
4266
4267 mkimage: Fix memory leak.
4268
4269 arm/arm64: Fix improper use of start address.
4270 It was used instead of loading address of current section or of entire buffer.
4271
4272 ia64: Fix iterator for relocation entries.
4273 Don't assume relocation entry size and use sh_entsize properly.
4274
4275 arm: Fix trampoline generation.
4276 We used the wrong pointer in this case. It worked only by accident.
4277
4278 Fix bootcheck-related files compilation.
4279 We need -static as otherwise linker will set interpreter field and ld.so
4280 is not available on our initrd's.
4281 Strip all sections we don't need on binary tests.
4282
4283 2017-01-31 Vladimir Serbinenko <phcoder@gmail.com>
4284
4285 Regenerate checksum.h.
4286 Screenshots checked.
4287 Using unifont from http://ftp.us.debian.org/debian/pool/main/u/unifont/xfonts-unifont_7.0.06-1_all.deb.
4288
4289 grub-mkfont: Remove leftover debug statement.
4290
4291 charset: Trim away RLM and LRM.
4292 They are not visible but would otherwise end up as [LRM] or [RLM] squares
4293 with some fonts.
4294
4295 gfxterm: Fix clearing of cursor.
4296 If ascent is bigger than height - 2, then we draw over character box but then
4297 to clear cursor we only draw over character box. So trim ascent if necessarry.
4298
4299 ia64: Add support for R_IA64_GPREL64I.
4300 Recent GCC generates those relocations, so we need to support them.
4301
4302 2017-01-30 Vladimir Serbinenko <phcoder@gmail.com>
4303
4304 grub-module-verifier: Add mips to all_video whitelist.
4305 On MIPS video is compiled-in. So all_video is empty. Whitelist it.
4306
4307 Fix -nopie/-nopie check.
4308 We don't use lgcc_s but missing lgcc_s or another library cause test to fail.
4309 So use -nostdlib.
4310 We need to use -Werror to avoid warning-generated case to be accepted.
4311 Clang uses -nopie rather than -no-pie. Check both and use whichever one works.
4312 Additionally android clang passes -pie to the linker even though it doesn't
4313 define __PIE__. So if compilation without no-pie logic fails add -nopie/-no-pie
4314 even if __PIE__ is not defined.
4315
4316 grub-module-verifier: Ignore all_video emptiness on xen.
4317 It's intentional that it's empty when no video modules
4318 are available.
4319
4320 2017-01-28 Vladimir Serbinenko <phcoder@gmail.com>
4321
4322 Support arm clang 3.8 amd later.
4323 clang 3.8 and later doesn't support -mllvm -use-arm-movt=0
4324 whereas older clang doesn't know -mno-movt. So use
4325 -mno-movt whenever possible and fallback to mllvm variant.
4326
4327 2017-01-27 Carlo Caione <carlo@endlessm.com>
4328
4329 exfat: Support files over 4GiB
4330 file size in grub_fat_data was 32-bit on exfat.
4331
4332 2017-01-27 Vladimir Serbinenko <phcoder@gmail.com>
4333
4334 Ensure that grub_reboot doesn't return on emu.
4335 Use grub_fatal if longjmp fails.
4336
4337 grub_reboot is marked as noreturn so return would cause
4338 a crash.
4339
4340 2017-01-27 Vladimir Serbinenko <phcoder@gmail.com>
4341
4342 grub-shell: skip font copying when no font is available.
4343
4344 Don't use -mlong-calls on arm.
4345 We don't really need it and it's flaky and creates
4346 bogus symbols with clang.
4347
4348 configure: Disable movw/movt with clang.
4349 Those relocations are not compatible with PE and also
4350 not compatible with custom uboot relocator.
4351 Disable them.
4352
4353 grub-fs-tester: Delete directory once we're done.
4354
4355 grub-fs-tester: Accomodate for slower systems.
4356 fstime can be more different with xz squashfs.
4357 Allow difference up to 3 seconds.
4358 This code is ugly now but rewriting it now is not on the
4359 table.
4360
4361 grub-fs-tester: Accomodate for testing in proot containers.
4362 proot creates hidden files with .proot prefix and name
4363 derived from real file name. So decrease file name length
4364 and path depth. For some reason depth 85 also results in
4365 undeleteable directory, so use 84 instead of 85.
4366
4367 2017-01-24 Andrei Borzenkov <arvidjaar@gmail.com>
4368
4369 osdep/linux: handle autofs entries in /proc/self/mountinfo
4370 These entries have placeholder for device name and so are useless for our
4371 purpose. grub failed with something like
4372
4373 grub-install: error: failed to get canonical path of `systemd-1'.
4374
4375 When we see autofs entry, record it (to keep parent-child relationship) but
4376 continue to look for real mount. If it is found, we process it as usual. If
4377 only autofs entry exists, attempt to trigger mount by opening mount point
4378 and retry. Mount point itself is then kept open to avoid timeout.
4379
4380 Recent systemd is by default using automount for /boot/efi so this should
4381 become more popular problem on EFI systems.
4382
4383 Closes: 49942
4384
4385 2017-01-08 Andrei Borzenkov <arvidjaar@gmail.com>
4386
4387 linux: fix "vga=XX deprecated" warning for text mode
4388 Arguments were in reverse order which resulted in
4389
4390 text is deprecated. Use set gfxpayload=vga=0 before linux command instead.
4391
4392 2016-12-22 Andrei Borzenkov <arvidjaar@gmail.com>
4393
4394 configure: fix check for sys/sysmacros.h under glibc 2.25+
4395 glibc 2.25 still includes sys/sysmacros.h in sys/types.h but also emits
4396 deprecation warning. So test for sys/types.h succeeds in configure but later
4397 compilation fails because we use -Werror by default.
4398
4399 While this is fixed in current autoconf GIT, we really cannot force everyone
4400 to use bleeding edge (that is not even released right now). So run test under
4401 -Werror as well to force proper detection.
4402
4403 This should have no impact on autoconf 2.70+ as AC_HEADER_MAJOR in this version
4404 simply checks for header existence.
4405
4406 Reported and tested by Khem Raj <raj.khem@gmail.com>
4407
4408 2016-12-22 Michael Chang <mchang@suse.com>
4409
4410 Fix fwpath in efi netboot
4411 The path returned by grub_efi_net_config has already been stripped for the
4412 directory part extracted from cached bootp packet. We should just return the
4413 result to avoild it be stripped again.
4414
4415 It fixed the problem that grub.efi as NBP image always looking for grub.cfg and
4416 platform directory in upper folder rather than current one it gets loaded while
4417 $prefix is empty. The behavior is inconsistent with other architecture and how
4418 we would expect empty $prefix going to be in general.
4419
4420 The only exception to the general rule of empty $prefix is that when loaded
4421 from platform directory itself, the platform part is stripped thus upper folder
4422 is used for looking up files. It meets the case for how grub-mknetdir lay out
4423 the files under tftp root directory, but also hide away this issue to be
4424 identified as it appears to be just works.
4425
4426 Also fix possible memory leak by moving grub_efi_get_filename() call after
4427 grub_efi_net_config().
4428
4429 2016-12-15 Andrei Borzenkov <arvidjaar@gmail.com>
4430
4431 efi: properly terminate filepath with NULL in chainloader
4432 EFI File Path Media Device Path is defined as NULL terminated string;
4433 but chainloader built file paths without final NULL. This caused error
4434 with Secure Boot and Linux Foundation PreLoader on Acer with InsydeH20 BIOS.
4435 Apparently firmware failed verification with EFI_INVALID_PARAMETER which is
4436 considered fatal error by PreLoader.
4437
4438 Reported and tested by Giovanni Santini <itachi.sama.amaterasu@gmail.com>
4439
4440 2016-12-14 Magnus Granberg <zorry@gentoo.org>
4441
4442 configure: add check for -no-pie if the compiler default to -fPIE
4443 When Grub is compile with gcc 6.1 that have --enable-defult-pie set.
4444 It fail with.
4445 -ffreestanding -m32 -Wl,-melf_i386 -Wl,--build-id=none -nostdlib -Wl,-N -Wl,-r,-d -
4446 o trig.module trig_module-trigtables.o
4447 grep 'MARKER' gcry_whirlpool.marker.new > gcry_whirlpool.marker; rm -f
4448 gcry_whirlpool.marker.new
4449 /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -
4450 shared may not be used together
4451 collect2: error: ld returned 1 exit status
4452 Makefile:26993: recipe for target 'trig.module' failed
4453
4454 Check that compiler supports -no-pie and add it to linker flags.
4455
4456 2016-12-14 Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
4457
4458 ofnet: implement the receive buffer
4459 get_card_packet() from ofnet.c allocates a netbuff based on the device's MTU:
4460
4461 nb = grub_netbuff_alloc (dev->mtu + 64 + 2);
4462
4463 In the case when the MTU is large, and the received packet is
4464 relatively small, this leads to allocation of significantly more memory,
4465 than it's required. An example could be transmission of TFTP packets
4466 with 0x400 blksize via a network card with 0x10000 MTU.
4467
4468 This patch implements a per-card receive buffer in a way similar to efinet.c,
4469 and makes get_card_packet() allocate a netbuff of the received data size.
4470
4471 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4472
4473 2016-12-14 Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
4474
4475 ofnet: move the allocation of the transmit buffer into a function
4476 In the current code search_net_devices() uses the "alloc-mem" command
4477 from the IEEE1275 User Interface for allocation of the transmit buffer
4478 for the case when GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN is set.
4479
4480 I don't have hardware where this flag is set to verify if this
4481 workaround is still needed. However, further changes to ofnet will
4482 require to execute this workaround one more time. Therefore, to
4483 avoid possible duplication of code I'm moving this piece of
4484 code into a function.
4485
4486 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4487
4488 2016-11-24 Alexander Graf <agraf@suse.de>
4489
4490 efi: Move fdt helper into own file
4491 We only support FDT files with EFI on arm and arm64 systems, not
4492 on x86. So move the helper that finds a prepopulated FDT UUID
4493 into its own file and only build it for architectures where it
4494 also gets called.
4495
4496 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4497
4498 2016-11-22 Andrei Borzenkov <arvidjaar@gmail.com>
4499
4500 NEWS updates
4501
4502 2016-11-22 Andrei Borzenkov <arvidjaar@gmail.com>
4503
4504 bootp: export next server IP as environment variable
4505 Network boot autoconfiguration sets default server to next server IP
4506 (siaddr) from BOOTP/DHCP reply, but manual configuration using net_bootp
4507 exports only server name. Unfortunately semantic of server name is not
4508 clearly defined. BOOTP RFC 951 defines it only for client request, and
4509 DHCP RFC 1541 only mentions it, without any implied usage. It looks like
4510 this field is mostly empty in server replies.
4511
4512 Export next server IP as net_<interface>_next_server variable. This allows
4513 grub configuration script to set $root/$prefix based on information obtained
4514 by net_bootp.
4515
4516 Reported and tested by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
4517 Cc: nikunj@linux.vnet.ibm.com
4518
4519 v2: change variable name to net_<interface>_next_server as discussed on the list
4520
4521 2016-11-22 Aaro Koskinen <aaro.koskinen@iki.fi>
4522
4523 configure.ac: don't require build time grub-mkfont on powerpc-ieee1275
4524 Don't require build time grub-mkfont on powerpc-ieee1275.
4525
4526 2016-11-14 Dirk Mueller <dmueller@suse.com>
4527
4528 grub-mknetdir: Add support for ARM64 EFI
4529
4530 2016-11-12 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
4531
4532 .gitignore: Add grub-core/build-grub-module-verifier
4533
4534 2016-11-10 Alexander Graf <agraf@suse.de>
4535
4536 arm efi: Use fdt from firmware when available
4537 If EFI is nice enough to pass us an FDT using configuration tables on 32bit
4538 ARM, we should really try and make use of it.
4539
4540 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4541
4542 2016-11-10 Alexander Graf <agraf@suse.de>
4543
4544 arm64: Move firmware fdt search into global function
4545 Searching for a device tree that EFI passes to us via configuration tables
4546 is nothing architecture specific. Move it into generic code.
4547
4548 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4549
4550 2016-11-05 Corey Hickey <bugfood-ml@fatooh.org>
4551
4552 fix detection of non-LUKS CRYPT
4553 grub_util_get_dm_abstraction() does a string comparison of insufficient
4554 length. When using a UUID such as "CRYPT-PLAIN-sda6_crypt", the function
4555 returns GRUB_DEV_ABSTRACTION_LUKS.
4556
4557 This results in the error:
4558 ./grub-probe: error: disk `cryptouuid/sda6_crypt' not found.
4559
4560 This appears to be a copy/paste error introduced in:
4561 a10e7a5a8918bea6e2632055129fa9b516fe965a
4562
4563 The bug was (apparently) latent until revealed by:
4564 3bca85b4184f74995a7cc2791e432173fde26d34
4565
4566 2016-10-27 Juergen Gross <jgross@suse.com>
4567
4568 xen: add capability to load p2m list outside of kernel mapping
4569 Modern pvops linux kernels support a p2m list not covered by the
4570 kernel mapping. This capability is flagged by an elf-note specifying
4571 the virtual address the kernel is expecting the p2m list to be mapped
4572 to.
4573
4574 In case the elf-note is set by the kernel don't place the p2m list
4575 into the kernel mapping, but map it to the given address. This will
4576 allow to support domains with larger memory, as the kernel mapping is
4577 limited to 2GB and a domain with huge memory in the TB range will have
4578 a p2m list larger than this.
4579
4580 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4581
4582 2016-10-27 Juergen Gross <jgross@suse.com>
4583
4584 xen: modify page table construction
4585 Modify the page table construction to allow multiple virtual regions
4586 to be mapped. This is done as preparation for removing the p2m list
4587 from the initial kernel mapping in order to support huge pv domains.
4588
4589 This allows a cleaner approach for mapping the relocator page by
4590 using this capability.
4591
4592 The interface to the assembler level of the relocator has to be changed
4593 in order to be able to process multiple page table areas.
4594
4595 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4596
4597 2016-10-27 Juergen Gross <jgross@suse.com>
4598
4599 xen: add capability to load initrd outside of initial mapping
4600 Modern pvops linux kernels support an initrd not covered by the initial
4601 mapping. This capability is flagged by an elf-note.
4602
4603 In case the elf-note is set by the kernel don't place the initrd into
4604 the initial mapping. This will allow to load larger initrds and/or
4605 support domains with larger memory, as the initial mapping is limited
4606 to 2GB and it is containing the p2m list.
4607
4608 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4609
4610 2016-10-27 Juergen Gross <jgross@suse.com>
4611
4612 xen: factor out allocation of page tables into separate function
4613 Do the allocation of page tables in a separate function. This will
4614 allow to do the allocation at different times of the boot preparations
4615 depending on the features the kernel is supporting.
4616
4617 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4618
4619 2016-10-27 Juergen Gross <jgross@suse.com>
4620
4621 xen: factor out allocation of special pages into separate function
4622 Do the allocation of special pages (start info, console and xenbus
4623 ring buffers) in a separate function. This will allow to do the
4624 allocation at different times of the boot preparations depending on
4625 the features the kernel is supporting.
4626
4627 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4628
4629 2016-10-27 Juergen Gross <jgross@suse.com>
4630
4631 xen: factor out p2m list allocation into separate function
4632 Do the p2m list allocation of the to be loaded kernel in a separate
4633 function. This will allow doing the p2m list allocation at different
4634 times of the boot preparations depending on the features the kernel
4635 is supporting.
4636
4637 While at this remove superfluous setting of first_p2m_pfn and
4638 nr_p2m_frames as those are needed only in case of the p2m list not
4639 being mapped by the initial kernel mapping.
4640
4641 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4642
4643 2016-10-27 Juergen Gross <jgross@suse.com>
4644
4645 xen: synchronize xen header
4646 Get actual version of include/xen/xen.h from the Xen repository in
4647 order to be able to use constants defined there.
4648
4649 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4650
4651 2016-10-27 Juergen Gross <jgross@suse.com>
4652
4653 xen: add elfnote.h to avoid using numbers instead of constants
4654 Various features and parameters of a pv-kernel are specified via
4655 elf notes in the kernel image. Those notes are part of the interface
4656 between the Xen hypervisor and the kernel.
4657
4658 Instead of using num,bers in the code when interpreting the elf notes
4659 make use of the header supplied by Xen for that purpose.
4660
4661 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4662
4663 2016-10-27 Juergen Gross <jgross@suse.com>
4664
4665 xen: reduce number of global variables in xen loader
4666 The loader for xen paravirtualized environment is using lots of global
4667 variables. Reduce the number by making them either local or by putting
4668 them into a single state structure.
4669
4670 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4671
4672 2016-10-27 Juergen Gross <jgross@suse.com>
4673
4674 xen: avoid memleaks on error
4675 When loading a Xen pv-kernel avoid memory leaks in case of errors.
4676
4677 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4678
4679 2016-10-27 Juergen Gross <jgross@suse.com>
4680
4681 xen: make xen loader callable multiple times
4682 The loader for xen paravirtualized environment isn't callable multiple
4683 times as it won't free any memory in case of failure.
4684
4685 Call grub_relocator_unload() as other modules do it before allocating
4686 a new relocator or when unloading the module.
4687
4688 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
4689
4690 2016-10-27 Daniel Kiper <daniel.kiper@oracle.com>
4691
4692 multiboot2: Add support for relocatable images
4693 Currently multiboot2 protocol loads image exactly at address specified in
4694 ELF or multiboot2 header. This solution works quite well on legacy BIOS
4695 platforms. It is possible because memory regions are placed at predictable
4696 addresses (though I was not able to find any spec which says that it is
4697 strong requirement, so, it looks that it is just a goodwill of hardware
4698 designers). However, EFI platforms are more volatile. Even if required
4699 memory regions live at specific addresses then they are sometimes simply
4700 not free (e.g. used by boot/runtime services on Dell PowerEdge R820 and
4701 OVMF). This means that you are not able to just set up final image
4702 destination on build time. You have to provide method to relocate image
4703 contents to real load address which is usually different than load address
4704 specified in ELF and multiboot2 headers.
4705
4706 This patch provides all needed machinery to do self relocation in image code.
4707 First of all GRUB2 reads min_addr (min. load addr), max_addr (max. load addr),
4708 align (required image alignment), preference (it says which memory regions are
4709 preferred by image, e.g. none, low, high) from multiboot_header_tag_relocatable
4710 header tag contained in binary (at this stage load addresses from multiboot2
4711 and/or ELF headers are ignored). Later loader tries to fulfill request (not only
4712 that one) and if it succeeds then it informs image about real load address via
4713 multiboot_tag_load_base_addr tag. At this stage GRUB2 role is finished. Starting
4714 from now executable must cope with relocations itself using whole static and
4715 dynamic knowledge provided by boot loader.
4716
4717 This patch does not provide functionality which could do relocations using
4718 ELF relocation data. However, I was asked by Konrad Rzeszutek Wilk and Vladimir
4719 'phcoder' Serbinenko to investigate that thing. It looks that relevant machinery
4720 could be added to existing code (including this patch) without huge effort.
4721 Additionally, ELF relocation could live in parallel with self relocation provided
4722 by this patch. However, during research I realized that first of all we should
4723 establish the details how ELF relocatable image should look like and how it should
4724 be build. At least to build proper test/example files.
4725
4726 So, this patch just provides support for self relocatable images. If ELF file
4727 with relocs is loaded then GRUB2 complains loudly and ignores it. Support for
4728 such files will be added later.
4729
4730 This patch was tested with Xen image which uses that functionality. However, this Xen
4731 feature is still under development and new patchset will be released in about 2-3 weeks.
4732
4733 Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
4734
4735 2016-10-27 Daniel Kiper <daniel.kiper@oracle.com>
4736
4737 multiboot2: Do not pass memory maps to image if EFI boot services are enabled
4738 If image requested EFI boot services then skip multiboot2 memory maps.
4739 Main reason for not providing maps is because they will likely be
4740 invalid. We do a few allocations after filling them, e.g. for relocator
4741 needs. Usually we do not care as we would have finished boot services.
4742 If we keep boot services then it is easier/safer to not provide maps.
4743 However, if image needs memory maps and they are not provided by bootloader
4744 then it should get itself just before ExitBootServices() call.
4745
4746 Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
4747 Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
4748
4749 2016-10-27 Daniel Kiper <daniel.kiper@oracle.com>
4750
4751 multiboot2: Add tags used to pass ImageHandle to loaded image
4752 Add tags used to pass ImageHandle to loaded image if requested.
4753 It is used by at least ExitBootServices() function.
4754
4755 Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
4756 Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
4757
4758 2016-10-27 Daniel Kiper <daniel.kiper@oracle.com>
4759
4760 i386/relocator: Add grub_relocator64_efi relocator
4761 Add grub_relocator64_efi relocator. It will be used on EFI 64-bit platforms
4762 when multiboot2 compatible image requests MULTIBOOT_TAG_TYPE_EFI_BS. Relocator
4763 will set lower parts of %rax and %rbx accordingly to multiboot2 specification.
4764 On the other hand processor mode, just before jumping into loaded image, will
4765 be set accordingly to Unified Extensible Firmware Interface Specification,
4766 Version 2.4 Errata B, section 2.3.4, x64 Platforms, boot services. This way
4767 loaded image will be able to use EFI boot services without any issues.
4768
4769 Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
4770 Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
4771
4772 2016-10-18 Sakar Arora <Sakar.Arora@nxp.com>
4773
4774 net/ip: Fix limit_time calculation in freeing old fragments
4775 limit_time underflows when current time is less than 90000ms.
4776 This causes packet fragments received during this time, i.e.,
4777 till 90000ms pass since timer init, to be rejected.
4778
4779 Hence, set it to 0 if its less than 90000.
4780
4781 2016-09-28 Andrei Borzenkov <arvidjaar@gmail.com>
4782
4783 asm-tests/i386-pc: Check that movl is 5 bytes.
4784 LLVM 3.9 now emits short form of jump instructions, but it is still using
4785 32 bit addresses for some movl instructions. Fortunately it was caught early:
4786
4787 clang ... boot/i386/pc/boot.S
4788 clang -cc1as: fatal error: error in backend: invalid .org offset '440' (at offset '441')
4789
4790 Add additional check to catch it during configure run and force -no-integrated-as.
4791
4792 Closes: 49200
4793
4794 More details in
4795 https://lists.gnu.org/archive/html/grub-devel/2015-02/msg00099.html
4796 https://llvm.org/bugs/show_bug.cgi?id=22662
4797
4798 2016-08-13 Pete Batard <pete@akeo.ie>
4799
4800 Add missing va_end() to xasprintf() in grub-emu.
4801
4802 2016-07-27 Andrei Borzenkov <arvidjaar@gmail.com>
4803
4804 at_keyboard: fix numpad "0" and "." mapping
4805 Reported for set 1 by fgndevelop <fgndevelop@posteo.org>. Apparently
4806 set 2 was reversed too.
4807
4808 2016-07-26 Andrei Borzenkov <arvidjaar@gmail.com>
4809
4810 dns: fix buffer overflow for data->addresses in recv_hook
4811 We may get more than one response before exiting out of loop in
4812 grub_net_dns_lookup, but buffer was allocated for the first response only,
4813 so storing answers from subsequent replies wrote past allocated size.
4814 We never really use more than the very first address during lookup so there
4815 is little point in collecting all of them. Just quit early if we already have
4816 some reply.
4817
4818 Code needs serious redesign to actually collect multiple answers
4819 and select the best fit according to requested type (IPv4 or IPv6).
4820
4821 Reported and tested by Michael Chang <mchang@suse.com>
4822
4823 2016-07-26 Andrei Borzenkov <arvidjaar@gmail.com>
4824
4825 xfs: accept filesystem with meta_uuid
4826 XFS V5 stores UUID in metadata and compares them with superblock UUID.
4827 To allow changing of user-visible UUID it stores original value in new
4828 superblock field (meta_uuid) and sets incompatible flag to indicate that
4829 new field must be used to verify metadata. Our driver currently does not
4830 check metadata UUID so simply accept such filesystem.
4831
4832 Reported-By: Marcos Mello <marcosfrm@outlook.com>
4833 Reviewd by Jan Kara <jack@suse.cz>
4834
4835 2016-05-03 Andrei Borzenkov <arvidjaar@gmail.com>
4836
4837 net: translate pxe prefix to tftp when checking for self-load
4838 Commit ba218c1 missed legacy pxe and pxe: prefixes which are
4839 translated to tftp, so comparison failed.
4840
4841 2016-04-30 Andrei Borzenkov <arvidjaar@gmail.com>
4842
4843 net: reset net->stall in grub_net_seek_real
4844 If we open new connection, we need to reset stall indication, otherwise
4845 nothing will ever be polled (low level code rely on this field being
4846 zero when establishing connection).
4847
4848 2016-04-30 Stefan Fritsch <sf@sfritsch.de>
4849
4850 http: reset EOF indication in http_seek
4851 Otherwise next read will stop polling too early due to stale EOF
4852 indicator, returning incomplete data to caller.
4853
4854 2016-04-24 Mike Gilbert <floppym@gentoo.org>
4855
4856 build: Use AC_HEADER_MAJOR to find device macros
4857 Depending on the OS/libc, device macros are defined in different
4858 headers. This change ensures we include the right one.
4859
4860 sys/types.h - BSD
4861 sys/mkdev.h - Sun
4862 sys/sysmacros.h - glibc (Linux)
4863
4864 glibc currently pulls sys/sysmacros.h into sys/types.h, but this may
4865 change in a future release.
4866
4867 https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
4868
4869 2016-04-09 Michael Chang <mchang@suse.com>
4870
4871 http: fix superfluous null line in range request header
4872 At least the apache sever is very unhappy with that extra null line and will
4873 take more than ten seconds in responding to each range request, which slows
4874 down a lot the entire http file transfer process or even time out.
4875
4876 2016-03-22 Andrei Borzenkov <arvidjaar@gmail.com>
4877
4878 configure: set -fno-pie together with -fno-PIE
4879 OpenBSD 5.9 apparently defaults to -fpie. We use -fno-PIE when appropriate
4880 already, but that is not enough - it does not turn off -fpie.
4881
4882 Actually check for -fPIE is not precise enough. __PIE__ is set for both
4883 -fpie and -fPIE but with different values. As far as I can tell, both
4884 options were introduced at the same time, so both should always be supported.
4885
4886 This fixes compilation on OpenBSD 5.9 which otherwise created insanely big
4887 lzma_decompress.img.
4888
4889 Reported, suggested and tested by: Jiri B <jirib@devio.us>
4890
4891 2016-03-20 Andrei Borzenkov <arvidjaar@gmail.com>
4892
4893 bootp: check that interface is not NULL in configure_by_dhcp_ack
4894 grub_net_add_addr may fail with OOM and we use returned interface
4895 later without any checks.
4896
4897 2016-03-19 Andrei Borzenkov <arvidjaar@gmail.com>
4898
4899 bootp: fix memory leak in grub_cmd_dhcpopt
4900
4901 2016-03-15 Aaron Luft <aluft@lifesize.com>
4902
4903 Remove the variable oldname which is attempting to free stack space.
4904 Historically this variable hold previous value of filename that
4905 had to be freed if allocated previously. Currently this branch
4906 is entered only if filename was not allocated previously so it
4907 became redundant. It did not cause real problems because grub_free
4908 was not called, but code is confusing and causes compilation error
4909 in some cases.
4910
4911 2016-03-13 Andrei Borzenkov <arvidjaar@gmail.com>
4912
4913 Makefile.util.def: add $LIBINTL to grub-macbless flags
4914 Fixes compilation on OpenBSD 5.9.
4915
4916 Reported by Jiri B <jirib@devio.us>
4917
4918 2016-03-11 Robert Marshall <rmarshall@redhat.com>
4919
4920 Failed config now returns exit code (#1252311)
4921 Grub would notify the user if the new config was invalid, however, it
4922 did not exit properly with exit code 1. Added the proper exit code.
4923
4924 Resolves: rhbz#1252311
4925
4926 2016-03-11 Michael Chang <mchang@suse.com>
4927
4928 xen_file: Fix invalid payload size
4929
4930 2016-03-10 Vladimir Serbinenko <phcoder@gmail.com>
4931
4932 multiboot2: Remove useless GRUB_PACKED
4933 Reported by: Daniel Kiper
4934
4935 2016-03-06 Andrei Borzenkov <arvidjaar@gmail.com>
4936
4937 20_linux_xen: fix test for GRUB_DEVICE
4938 Same fix as in 082bc9f.
4939
4940 2016-03-06 Mike Gilbert <floppym@gentoo.org>
4941
4942 10_linux: Fix grouping of tests for GRUB_DEVICE
4943 Commit 7290bb562 causes GRUB_DISABLE_LINUX_UUID to be ignored due to
4944 mixing of || and && operators. Add some parens to help with that.
4945
4946 2016-02-28 Andrei Borzenkov <arvidjaar@gmail.com>
4947
4948 NEWS update
4949
4950 2016-02-28 Vladimir Serbinenko <phcoder@gmail.com>
4951
4952 Release 2.02~beta3
4953
4954 grub_arch_sync_dma_caches: Accept volatile address
4955
4956 2016-02-27 Leif Lindholm <leif.lindholm@linaro.org>
4957
4958 efidisk: Respect block_io_protocol buffer alignment
4959 Returned from the OpenProtocol operation, the grub_efi_block_io_media
4960 structure contains the io_align field, specifying the minimum alignment
4961 required for buffers used in any data transfers with the device.
4962
4963 Make grub_efidisk_readwrite() allocate a temporary buffer, aligned to
4964 this boundary, if the buffer passed to it does not already meet the
4965 requirements.
4966
4967 Also sanity check the io_align field in grub_efidisk_open() for
4968 power-of-two-ness and bail if invalid.
4969
4970 2016-02-27 Vladimir Serbinenko <phcoder@gmail.com>
4971
4972 usbtrans: Fix memory coherence and use-after-free.
4973
4974 ehci: Fix memory coherence
4975 This is a no-op on x86 but necessarry on ARM and may be necessarry on MIPS.
4976
4977 arm-uboot: Make self-relocatable to allow loading at any address
4978
4979 Allow _start == 0 with relocatable images
4980
4981 2016-02-27 Vladimir Serbinenko <phcoder@gmail.com>
4982
4983 Provide __bss_start and _end symbols in grub-mkimage.
4984 For this ensure that all bss sections are merged.
4985
4986 We need this to correctly prelink non-PE relocatable images.
4987
4988 2016-02-27 Vladimir Serbinenko <phcoder@gmail.com>
4989
4990 Encapsulate image layout into a separate structure.
4991 Currently we pass around a lot of pointer. Instead put all relevant data
4992 into one structure.
4993
4994 mkimagexx: Split PE and generic part for relocations.
4995 As a preparation for U-Boot relocations, split emitting PE-relocations
4996 from parsing source ELF-relocations.
4997
4998 mkimage.c: Split into separate files.
4999 util/grub-mkimagexx.c is included in a special way into mkimage.c.
5000 Interoperation between defines makes this very tricky. Instead
5001 just have a clean interface and compile util/grub-mkimage*.c separately
5002 from mkimage.c
5003
5004 bsd: Ensure that kernel is loaded before loading module.
5005 kernel_type may be set to the type of failed kernel. This patching-up is
5006 easier than to reflow kernel loading routines.
5007
5008 cat: Don't switch terminal mode when there is nothing to highlight.
5009 This just pollutes serial console.
5010
5011 Use console rather than serial_efi0 on arm64-efi in tests
5012
5013 2016-02-27 Andrei Borzenkov <arvidjaar@gmail.com>
5014
5015 efidisk: fix misplaced parenthesis in b00e4c2
5016
5017 2016-02-26 Andrei Borzenkov <arvidjaar@gmail.com>
5018
5019 efidisk: prevent errors from diskfilter scan of removable drives
5020 Map EFI_NO_MEDIA to GRUB_ERR_OUT_OF_RANGE that is ignored by diskfilter. This
5021 actually matches pretty close (we obviously attempt to read outside of media)
5022 and avoids adding more error codes.
5023
5024 This affects only internally initiated scans. If read/write from removable is
5025 explicitly requested, we still return an error and text explanation is more
5026 clear for user than generic error.
5027
5028 Reported and tested by Andreas Loew <Andreas.Loew@gmx.net>
5029
5030 2016-02-26 Vladimir Serbinenko <phcoder@gmail.com>
5031
5032 Regenerate checksums
5033
5034 Makefile: Don't delete default_payload.elf if it doesn't exist.
5035
5036 2016-02-25 Josef Bacik <jbacik@fb.com>
5037
5038 net: fix ipv6 routing
5039 ipv6 routing in grub2 is broken, we cannot talk to anything outside our local
5040 network or anything that doesn't route in our global namespace. This patch
5041 fixes this by doing a couple of things
5042
5043 1) Read the router information off of the router advertisement. If we have a
5044 router lifetime we need to take the source address and create a route from it.
5045
5046 2) Changes the routing stuff slightly to allow you to specify a gateway _and_ an
5047 interface. Since the router advertisements come in on the link local address we
5048 need to associate it with the global address on the card. So when we are
5049 processing the router advertisement, either use the SLAAC interface we create
5050 and add the route to that interface, or loop through the global addresses we
5051 currently have on our interface and associate it with one of those addresses.
5052 We need to have a special case here for the default route so that it gets used,
5053 we do this by setting the masksize to 0 to mean it encompasses all networks.
5054 The routing code will automatically select the best route so if there is a
5055 closer match we will use that.
5056
5057 With this patch I can now talk to ipv6 addresses outside of my local network.
5058 Thanks,
5059
5060 2016-02-24 Vladimir Serbinenko <phcoder@gmail.com>
5061
5062 ieee1275: fix signed comparison
5063
5064 2016-02-23 Andrei Borzenkov <arvidjaar@gmail.com>
5065
5066 search: actually skip floppy with --no-floppy
5067 grub_device_iterate() ignores device when iterator returns 1, not 0.
5068
5069 Reported by Carlos E. R. <robin.listas@telefonica.net>
5070
5071 2016-02-23 Andrei Borzenkov <arvidjaar@gmail.com>
5072
5073 multiboot2: zero reserved field in memory map
5074 Documentation says, bootloader should set reserved field to zero.
5075
5076 Reported by Wink Saville <wink@saville.com>
5077
5078 2016-02-22 Vladimir Serbinenko <phcoder@gmail.com>
5079
5080 Improve EHCI logging
5081 Add dprintf's on common error paths and remove some entries which are too
5082 noisy.
5083
5084 usb_keyboard: Remove useless include
5085 This prevents non-PCI machines from having USB.
5086
5087 Refresh before abort
5088 This ensures that abort message is actually visible to the user.
5089
5090 2016-02-22 Eric Snowberg <eric.snowberg@oracle.com>
5091
5092 ieee1275: prevent buffer over-read
5093 Prevent buffer over-read in grub_machine_mmap_iterate. This was
5094 causing phys_base from being calculated properly. This then
5095 caused the wrong value to be placed in ramdisk_image within
5096 struct linux_hdrs. Which prevented the ramdisk from loading on
5097 boot.
5098
5099 Newer SPARC systems contain more than 8 available memory entries.
5100
5101 For example on a T5-8 with 2TB of memory, the memory layout could
5102 look like this:
5103
5104 T5-8 Memory
5105 reg 00000000 30000000 0000003f b0000000
5106 00000800 00000000 00000040 00000000
5107 00001000 00000000 00000040 00000000
5108 00001800 00000000 00000040 00000000
5109 00002000 00000000 00000040 00000000
5110 00002800 00000000 00000040 00000000
5111 00003000 00000000 00000040 00000000
5112 00003800 00000000 00000040 00000000
5113 available 00003800 00000000 0000003f ffcae000
5114 00003000 00000000 00000040 00000000
5115 00002800 00000000 00000040 00000000
5116 00002000 00000000 00000040 00000000
5117 00001800 00000000 00000040 00000000
5118 00001000 00000000 00000040 00000000
5119 00000800 00000000 00000040 00000000
5120 00000000 70000000 0000003f 70000000
5121 00000000 6eef8000 00000000 00002000
5122 00000000 30400000 00000000 3eaf6000
5123 name memory
5124
5125 2016-02-22 Thomas Huth <thuth@redhat.com>
5126
5127 menu_entry: Disable cursor during update_screen()
5128 When running grub in a VGA console of a KVM pseries guest on PowerPC,
5129 you can see the cursor sweeping over the whole line when entering a
5130 character in editor mode. This is visible because grub always refreshes
5131 the whole line when entering a character in editor mode, and drawing
5132 characters is quite a slow operation with the firmware used for the
5133 powerpc pseries guests (SLOF).
5134 To avoid this ugliness, the cursor should be disabled when refreshing
5135 the screen contents during update_screen().
5136
5137 2016-02-17 Vladimir Serbinenko <phcoder@gmail.com>
5138
5139 default_payload.elf: Always rebuild and remove before build.
5140 It's difficult to know all dependencies. Since it's manual and cheap
5141 target anyway, simply always rebuild it.
5142
5143 default_payload.elf: Include password_pbkdf2.
5144 Withoout this module we may end up in a system where no password is
5145 accepted.
5146
5147 default_payload.elf: Add modules from $(EXTRA_PAYLOAD_MODULES).
5148 This allows coreboot building system to add extra modules depending
5149 on user config.
5150
5151 mm: Avoid integer overflow.
5152
5153 Remove -Wno-maybe-uninitialized as it may not be present.
5154
5155 Fix warnings when compiling with -O3
5156
5157 2016-02-14 Vladimir Serbinenko <phcoder@gmail.com>
5158
5159 Add wbinvd around bios call.
5160 Via C3 has problems with cache coherency when transitioning between the modes,
5161 so flush it around bios calls.
5162
5163 2016-02-12 Eric Snowberg <eric.snowberg@oracle.com>
5164
5165 OBP available region contains grub. Start at grub_phys_end.
5166 This prevents a problem where grub was being overwritten since
5167 grub_phys_start does not start at a zero offset within the memory
5168 map.
5169
5170 2016-02-12 Andreas Freimuth <andreas_freimuth@web.de>
5171
5172 Add Thinkpad T410s button cmos address.
5173
5174 2016-02-12 Vladimir Serbinenko <phcoder@gmail.com>
5175
5176 TODO: Remove obsolete link
5177
5178 2016-02-12 Toomas Soome <tsoome@me.com>
5179
5180 lz4: Fix pointer overflow
5181
5182 2016-02-12 Vladimir Serbinenko <phcoder@gmail.com>
5183
5184 grub-shell: Update 32-bit OVMF binary name.
5185
5186 2016-02-12 Daniel Kiper <daniel.kiper@oracle.com>
5187
5188 relocator: Fix integer underflow.
5189
5190 2016-02-12 Vladimir Serbinenko <phcoder@gmail.com>
5191
5192 Change -v to -V for version of shell utils.
5193
5194 xnu: Add new kernel path to autoconfig.
5195
5196 arm64: Use cpu timer for timekeeping.
5197
5198 powerpc: Trim header in tests.
5199
5200 default_payload: Include syslinuxcfg, all filesystems and xnu.
5201
5202 xnu: Supply random seed.
5203 Now we're able to load kernels up to El Capitan.
5204
5205 Add RNG module.
5206
5207 yylex: use grub_fatal for exit.
5208 lexer calls yylex_fatal on fatal internal errors. yylex_fatal itself is
5209 declared as noreturn and calls exit. Returning from noreturn function has
5210 unpredictable consequences.
5211
5212 printf: Fix and test %% behaviour in presence of subsequenbt args.
5213
5214 Split pmtimer wait and tsc measurement from pmtimer tsc calibration.
5215
5216 Make grub_cpu_is_tsc_supported generally available.
5217
5218 Make grub_acpi_find_fadt accessible generically
5219
5220 Make unaligned types public.
5221 This simplifies code which has to handle those types.
5222
5223 Fix emu compilation error on arm.
5224
5225 2016-02-11 Vladimir Serbinenko <phcoder@gmail.com>
5226
5227 xnu: Include relocated EFI in heap size.
5228
5229 xnu: supply ramsize to the kernel.
5230 Without this info recent kernels crash as they allocate no heap.
5231
5232 2016-02-03 Andrei Borzenkov <arvidjaar@gmail.com>
5233
5234 support modules without symbol table
5235 all_video module does not have any code or data and exists solely for
5236 .moddeps section to pull in dependencies. This makes all symbols unneeded.
5237
5238 While in current binutils (last released version as of this commit is 2.26)
5239 ``strip --strip-unneeded'' unintentionally adds section symbols for each
5240 existing section, this behavior was considered a bug and changed in commit
5241 14f2c699ddca1e2f706342dffc59a6c7e23e844c to completely strip symbol table
5242 in this case.
5243
5244 Older binutils (verified with 2.17) and some other toolchains (at least
5245 elftoolchain r3223M), both used in FreeBSD, remove symbol table in all_video
5246 as well.
5247
5248 Relax run-time check and do not return error for modules without symbol table.
5249 Add additional checks to module verifier to make sure such modules
5250
5251 a) have non-empty .moddeps section. Without either externally visible symbols
5252 or .moddeps modules are completely useless and should not be built.
5253
5254 b) do not have any relocations.
5255
5256 Closes: 46986
5257
5258 v2: add run-time check for empty symbol table if relocations are present as
5259 suggested by Vladimir.
5260
5261 2016-02-01 Andrei Borzenkov <arvidjaar@gmail.com>
5262
5263 10_linux: avoid multi-device root= kernel argument
5264 If root filesystem is multidev btrfs, do not attempt to pass all devices as
5265 kernel root= argument. This results in splitting command line in GRUB due to
5266 embedded newline and even if we managed to quote it, kernel does not know how
5267 to interpret it anyway. Multidev btrfs requires user space device scanning,
5268 so passing single device would not work too.
5269
5270 This still respects user settings GRUB_DISABLE_LINUX_UUID. Not sure what we
5271 should do in this case.
5272
5273 Closes: 45709
5274
5275 2016-01-22 Vladimir Serbinenko <phcoder@gmail.com>
5276
5277 Error out if mtools invocation fails.
5278
5279 arm64: Add support for relocations needed for linaro gcc
5280
5281 efiemu: Fix compilation failure
5282
5283 Document cpuid -p
5284
5285 2016-01-22 Robert Elliott <elliott@hpe.com>
5286
5287 efiemu: Handle persistent RAM and unknown possible future additions.
5288
5289 2016-01-22 Vladimir Serbinenko <phcoder@gmail.com>
5290
5291 Document expr1 expr2 syntax for test command
5292
5293 2016-01-22 Michael Chang <mchang@suse.com>
5294
5295 Restore terminal settings on grub-emu exit.
5296
5297 2016-01-22 Vladimir Serbinenko <phcoder@gmail.com>
5298
5299 xen_boot: Remove obsolete module type distinctions.
5300
5301 arm: Ignore qemu clock bug
5302
5303 i386-ieee1275: Increase maximum heap size to accomodate highres graphi tests
5304
5305 2016-01-20 Colin Watson <cjwatson@ubuntu.com>
5306
5307 Remove pragmas related to -Wunreachable-code
5308 -Wunreachable-code has been a no-op since GCC 4.5; GRUB hasn't been
5309 compiled with it since 2012; and GCC 6 produces "error:
5310 '-Wunreachable-code' is not an option that controls warnings" for these.
5311
5312 Fixes Debian bug #812047.
5313
5314 2016-01-16 Colin Watson <cjwatson@ubuntu.com>
5315
5316 loader/bsd: Fix signed/unsigned comparison
5317
5318 ahci, ehci: Fix typos
5319
5320 2016-01-16 Andrei Borzenkov <arvidjaar@gmail.com>
5321
5322 grub-probe: fix memory leak
5323 Found by: Coverity scan.
5324 CID: 73783
5325
5326 2016-01-16 Andrei Borzenkov <arvidjaar@gmail.com>
5327
5328 tftp: fix memory leaks in open
5329 If protocol open fails, file is immediately freed, so data was leaked.
5330
5331 Found by: Coverity scan.
5332 CID: 96659
5333
5334 2016-01-16 Andrei Borzenkov <arvidjaar@gmail.com>
5335
5336 tcp: fix memory leaks
5337 Found by: Coverity scan.
5338 CID: 96639, 96647
5339
5340 net: fix memory leaks
5341 Found by: Coverity scan.
5342 CID: 96638, 96648
5343
5344 legacycfg: fix memory leaks and add NULL check
5345 Memory leaks found by Coverity scan.
5346 CID: 96642, 96645
5347
5348 2016-01-15 Andrei Borzenkov <arvidjaar@gmail.com>
5349
5350 loader: Unintended sign extension
5351 CID: 96707, 96699, 96693, 96691, 96711, 96709, 96708, 96703, 96702,
5352 96700, 96698, 96696, 96695, 96692, 96710, 96705
5353
5354 2016-01-12 Andrei Borzenkov <arvidjaar@gmail.com>
5355
5356 script: fix memory leak
5357 Found by: Coverity scan.
5358 CID: 96637
5359
5360 normal: fix memory leak
5361 Found by: Coverity scan.
5362 CID: 96641, 96670, 96667
5363
5364 xnu: fix memory leak
5365 Found by: Coverity scan.
5366 CID: 96663
5367
5368 truecrypt: fix memory leak
5369 Found by: Coverity scan.
5370 CID: 156611
5371
5372 gfxmenu: fix memory leak
5373 Found by: Coverity scan.
5374 CID: 96657
5375
5376 efiemu: fix memory leak
5377 Found by: Coverity scan.
5378 CID: 156610
5379
5380 efidisk: fix memory leak
5381 Found by: Coverity scan.
5382 CID: 96644
5383
5384 verify: fix memory leak
5385 Found by: Coverity scan.
5386 CID: 96643
5387
5388 password_pbkdf2: fix memory leak
5389 Found by: Coverity scan.
5390 CID: 96656
5391
5392 parttool: fix memory leak
5393 Found by: Coverity scan.
5394 CID: 96652
5395
5396 2016-01-12 Andrei Borzenkov <arvidjaar@gmail.com>
5397
5398 nativedisk: fix memory leak
5399 Based on Coverity scan.
5400 CID: 96660
5401
5402 Extended to also cover other error return places.
5403
5404 2016-01-12 Andrei Borzenkov <arvidjaar@gmail.com>
5405
5406 acpi: fix memory leak
5407 Found by: Coverity scan.
5408 CID: 96673
5409
5410 2016-01-10 Andrei Borzenkov <arvidjaar@gmail.com>
5411
5412 grub-install: include ehci in list of native modules
5413 This matches behavior of "nativedisk" command.
5414
5415 Reported and tested by Smith Henry <sh37092@gmail.com>
5416
5417 2016-01-10 Andrei Borzenkov <arvidjaar@gmail.com>
5418
5419 grub-mkimage: remove redundant NULL check
5420 Found by: Coverity scan.
5421 CID: 73737
5422
5423 2016-01-10 Andrei Borzenkov <arvidjaar@gmail.com>
5424
5425 net: remove dead and redundant code
5426 server cannot be NULL at this point (we return error earlier if it is).
5427 Also structure is zalloc'ed, so no need to explicitly initialize
5428 members to 0.
5429
5430 Found by: Coverity scan.
5431 CID: 73837
5432
5433 2016-01-10 Andrei Borzenkov <arvidjaar@gmail.com>
5434
5435 hostdisk: fix device detection
5436 Condition was apparently reversed so GRUB assumed all devices were
5437 files. This later made it skip BLKFLSBUF ioctl on Linux which caused
5438 various page cache coherency issues. Observed were
5439
5440 - failure to validate blocklist install (read content did not match
5441 just written)
5442
5443 - failure to detect Linux MD on disk after online hot addition
5444 (GRUB got stale superblock)
5445
5446 Closes: 46691
5447
5448 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5449
5450 setup: fix NULL pointer dereference
5451 Check return value of grub_guess_root_devices
5452
5453 Found by: Coverity scan.
5454 CID: 73638, 73751
5455
5456 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5457
5458 mkimage: fix unintended sign extension
5459 Found by: Coverity scan.
5460 CID: 73691, 73717
5461
5462 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5463
5464 util/getroot: delete dead code
5465 is_part cannot be non-zero at this point.
5466
5467 Found by: Coveruty scan.
5468 CID: 73838
5469
5470 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5471
5472 loader/multiboot: fix unintended sign extension
5473 Found by: Coveruty scan.
5474 CID: 73700, 73763
5475
5476 kern/elf: fix unintended sign extension
5477 Found by: Coverity scan.
5478 CID: 73729, 73735, 73758, 73760
5479
5480 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5481
5482 xfs: fix possible inode corruption in directory scan
5483 grub_xfs_iterate_dir did not restore first character after inline
5484 name when match was found. Dependning on XFS format this character
5485 could be inode number and we could return to the same node later in
5486 find_file if processing cycled symlinks.
5487
5488 CID: 86724
5489
5490 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5491
5492 rescue_parser: restructure code to avoid Coverity false positive
5493 If line contains single word, line and argv[0] are aliases, so
5494 no NULL dereference is possible, but Coverity does not know it.
5495 Change code to avoid ambiguity and also remove redundant call to
5496 grub_strchr.
5497
5498 CID: 86725
5499
5500 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5501
5502 grub-mklayout: check subscript bounds
5503 Found by: Coverity scan.
5504 CID: 73686
5505
5506 grub-probe: fix memory leak
5507 Found by: Coverity scan.
5508 CID: 73783
5509
5510 gfxmenu: fix memory leak
5511 Found by: Coverity scan.
5512 CID: 73766
5513
5514 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5515
5516 util/setup: fix grub_util_path_list leak
5517 Add helper grub_util_free_path_list and use it where appropriate.
5518
5519 Found by: Coverity scan.
5520 CID: 73727
5521
5522 2016-01-09 Andrei Borzenkov <arvidjaar@gmail.com>
5523
5524 setup: fix memory leak
5525 Found by: Coverity scan.
5526 CID: 73680, 73715
5527
5528 efiemu: check return value of grub_efiemu_write_value
5529 Found by: Coverity scan.
5530 CID: 73590
5531
5532 efiemu: change code to avoid Coverity false positive
5533 CID: 73623
5534
5535 efiemu: fix unintended sign extension
5536 Found by: Coverity scan.
5537 CID: 73883, 73637
5538
5539 hfs: fix memory leak
5540 Found by: Coverity scan.
5541 CID: 156531
5542
5543 grub-module-verifier: fix unintended sign extension
5544 Found by: Coverity scan.
5545 CID: 156533, 156532
5546
5547 2016-01-08 Vladimir Serbinenko <phcoder@gmail.com>
5548
5549 Tests: Support arm-efi
5550
5551 2016-01-07 Vladimir Serbinenko <phcoder@gmail.com>
5552
5553 arm64/setjmp: Add missing move for arg1 == 0 case.
5554
5555 grub-shell: Support arm64-efi
5556
5557 2016-01-07 Mark Salter <msalter@redhat.com>
5558
5559 arm-efi: Reduce timer event frequency by 10
5560 Timer event to keep grub msec counter was running at 1000HZ. This was too
5561 fast for UEFI timer driver and resulted in a 10x slowdown in grub time
5562 versus wallclock. Reduce the timer event frequency and increase tick
5563 increment accordingly to keep better time.
5564
5565 2016-01-07 Vladimir Serbinenko <phcoder@gmail.com>
5566
5567 x86_64-efi: Automatically add -bios OVMF.fd to qemu in tests.
5568
5569 Allow GRUB_QEMU_OPTS to override machine.
5570
5571 arm64: Disable tests that need native drivers.
5572
5573 Disable NetBSD bootcheck on EFI until it supports ACPI on EFI.
5574
5575 grub-shell: Use new cbfstool syntax.
5576
5577 grub-shell: On i386-ieee1275 don't try to switch to console.
5578 console goes to serial as well, so this doesn't stop garbage from going
5579 to serial. But it creates garbage itself.
5580
5581 hddboot_test: reenable on OVMF
5582 OVMF now supports booting from disks.
5583
5584 iee1275/datetime: Fix off-by-1 error.
5585
5586 2016-01-07 Vladimir Serbinenko <phcoder@gmail.com>
5587
5588 Adjust bootcheck tests for multiboot/coreboot/qemu to match real support.
5589 coreboot has ACPI while 2 others don't. *BSD need ACPI and have trouble
5590 without it. Don't even attempt to boot *BSD on multiboot or qemu targets.
5591
5592 On coreboot boot all *BSD except 32-bit NetBSD which apparently does some
5593 early BIOS calls.
5594
5595 2016-01-05 Vladimir Serbinenko <phcoder@gmail.com>
5596
5597 minixfs_test: Check if mkfs.minixfs supports -B option.
5598
5599 Add memdisk support to grub-emu.
5600 Use it to add custom files, so that tests which need them work.
5601
5602 Move file loading functions to grub-emu.
5603 So that we can use it in grub-emu as well as utils.
5604
5605 Disable progress indicator in grub-shell.
5606 This disables progress indicator for tests. This in turn fixes test
5607 flakiness as they ended up timing-dependent.
5608
5609 Update checksums
5610
5611 2016-01-02 Andrei Borzenkov <arvidjaar@gmail.com>
5612
5613 acpihalt: add GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD (0x8a)
5614 Fixes ACPI halt on ASUSTeK P8B75-V,
5615 Bios: American Megatrends v: 0414 date: 04/24/2012
5616
5617 Reported-By: Goh Lip <g.lip@gmx.com>
5618
5619 2016-01-02 Andrei Borzenkov <arvidjaar@gmail.com>
5620
5621 acpihalt: fix GRUB_DSDT_TEST compilation
5622
5623 2016-01-01 Andrei Borzenkov <arvidjaar@gmail.com>
5624
5625 Add missing BUILD_EXEEXT
5626
5627 2015-12-31 Vladimir Serbinenko <phcoder@gmail.com>
5628
5629 configure.ac: Reorder efiemu check to after link format check.
5630 efiemu is supposed to be disabled when compiling through exe format.
5631 Unfortunately format was determined only after efiemu check. Reorder to fix the
5632 problem
5633
5634 2015-12-31 Andrey Borzenkov <arvidjaar@gmail.com>
5635
5636 remove temporary .bin files (kernel and modules)
5637
5638 add dejavu built fonts to cleanfiles
5639
5640 2015-12-31 Andrei Borzenkov <arvidjaar@gmail.com>
5641
5642 Add grub-module-verifier files to EXTRA_DIST
5643
5644 2015-12-31 Vladimir Serbinenko <phcoder@gmail.com>
5645
5646 configure: Add -fno-unwind-tables if supported.
5647 Unwind tables are useless for us bt consume space if present. Ensure that they
5648 are not.
5649
5650 module-verifier: allow limited-range relocations on sparc64.
5651 clang as incomplete mcmodel=large support. As we don't currently need full
5652 mcmodel=large support for sparc64, relax those checks.
5653
5654 Disable build-time module check on emu.
5655 On emu some checks can be laxer like check for relocation range. Additionally
5656 module loading in emu is rarely used. So skip this check rather than making
5657 it laxer for all platforms. In ideal we may want to have slightly different
5658 check for emu but for now this is good enough.
5659
5660 configure: Fix grub_cv_cc_fno_unwind_tables check.
5661 Check tries -fno-dwarf2-cfi-asm but adds -fno-asynchronous-unwind-tables
5662 to TARGET_CFLAGS. Fix this.
5663
5664 Add -mno-stack-arg-probe on mingw.
5665 This argument disables generation of calls to __chkstk_ms. Those calls are
5666 useless on GRUB as function is dummy. Yet they increase module size and
5667 use limited-range relocations which may not work under some memory layouts.
5668 We currently don't use such layouts on concerned platforms but lt's correct
5669 this.
5670
5671 Strip .ARM.exidx
5672 This section is generated by clang and is useful only for debugging.
5673 It contains exotic relocations, so strip them to avoid them interferring
5674 with module loading.
5675
5676 module-verifier: Check range-limited relative relocations.
5677 Check that they point to the same module, so will end up in the same
5678 chunk of memory.
5679
5680 xen/relocator: Use local symbol to ensure that code is relocation-free.
5681
5682 backtrace: Fix register call syntax
5683
5684 Verify modules on build-time rather than failing in runtime.
5685
5686 sparc64: Fix assembly to let compiler to fill in memory references.
5687 This fixes the use of not fully relocatable (they assume that variables are
5688 under 4G limit in virtual memory) references.
5689
5690 2015-12-30 Andrey Borzenkov <arvidjaar@gmail.com>
5691
5692 30_os-prober: derive --class from os-prober generated label
5693 Currently only Windows gets distinguished icons, everything else is displayed
5694 using the same generic one. Add additional --class based on os-prober returned
5695 label, which usually is expected to match primary distribution name.
5696
5697 Also use it for Windows as well - chainloader prober may actually return
5698 different strings (Windows, MS-DOS, Windows9xME).
5699
5700 2015-12-30 Vladimir Serbinenko <phcoder@gmail.com>
5701
5702 backtrace: Remove assembly assumption that grub_backtrace_pointer is under 4G
5703
5704 2015-12-30 Andrei Borzenkov <arvidjaar@gmail.com>
5705
5706 menu: fix line count calculation for long lines
5707 It gave one extra screen line if length was exactly equal to screen
5708 width.
5709
5710 Reported by Michael Chang.
5711 Also-By: Michael Chang <mchang@suse.com>
5712
5713 2015-12-29 Vladimir Serbinenko <phcoder@gmail.com>
5714
5715 grub-mkrescue: Delete temporary file
5716 Reported by: Thomas Schmitt
5717
5718 grub-mount: Fix oath parsing.
5719 Brackets detection was copied from somewhere else and makes no sense in case
5720 of grub-mount and prevents user from accessing and files with ) in them.
5721
5722 exfat: Fix stream extension flag parsing.
5723
5724 2015-12-26 Andrei Borzenkov <arvidjaar@gmail.com>
5725
5726 devmapper: check for valid device abstraction in get_grub_dev
5727 This was lost when code was refactored. Patch restores previous behavior.
5728
5729 It is still not clear whether this is the right one. Due to the way we
5730 detect DM abstraction, partitions on DM are skipped, we fall through to
5731 generic detection which ends up in assuming parent device is BIOS disk.
5732
5733 It is useful to install GRUB on VM disk from the host. But it also means
5734 that GRUB will mistakenly allow install on real system as well.
5735
5736 For now let's fix regression; future behavior needs to be discussed.
5737
5738 Closes: 45163
5739
5740 2015-12-19 Andrei Borzenkov <arvidjaar@gmail.com>
5741
5742 windows: correct LBA in generated EFI HDD media paths
5743 GRUB keeps partition offset and size in units of 512B sectors. Media paths
5744 are defined in terms of LBA which are presumed to match HDD sector size.
5745
5746 This is probably cosmetic (EFI requires that partition is searched by GUID)
5747 and still incorrect if GPT was created using different logical block size.
5748 But current code is obviously wrong and new has better chances to be correct.
5749
5750 2015-12-17 Robert Elliott <elliott@hpe.com>
5751
5752 lsefimmap: support persistent memory and other UEFI 2.5 features
5753 This should accompany
5754 76ce1de740 Translate UEFI persistent memory type
5755
5756 1. Add a string for the EfiPersistentMemory type 14 that was
5757 added in UEFI 2.5.
5758
5759 2. Decode the memory attributes that were added in UEFI 2.5:
5760 * NV (non-volatile)
5761 * MORE_RELIABLE (higher reliable, e.g., mirrored memory in a system
5762 with partial memory mirroring)
5763 * RO (read-only)
5764
5765 3. Use proper IEC binary units (KiB, MiB, etc.) for power-of-two
5766 values rather than misusing SI power-of-ten units (KB, MB, etc.)
5767
5768 4. The lsmmap command only decodes memory ranges sizes up to GiB scale
5769 units. Persistent memory ranges will reach into the TiB scale.
5770 Since 64-bit size field supports TiB, PiB, and EiB, decode all of
5771 them for completeness.
5772
5773 5. In the lsefimmap command, rewrite the print statements to
5774 * avoid rounding
5775 * avoid a big nested if/else tree.
5776
5777 For example: In the sixth entry below, the value of 309MB implies
5778 316416KB but is really reporting 316436KB.
5779
5780 Widen the size column to 6 digits to accommodate typical cases.
5781 The worst case value would require 14 digits; if that happens,
5782 let the columns get out of sync.
5783
5784 Old format:
5785 Type Physical start - end #Pages Size Attributes
5786 conv-mem 0000000000000000-0000000000092fff 00000093 588KB UC WC WT WB
5787 reserved 0000000000093000-0000000000093fff 00000001 4KB UC WC WT WB
5788 conv-mem 0000000000094000-000000000009ffff 0000000c 48KB UC WC WT WB
5789 conv-mem 0000000000100000-000000000fffffff 0000ff00 255MB UC WC WT WB
5790 BS-code 0000000010000000-0000000010048fff 00000049 292KB UC WC WT WB
5791 conv-mem 0000000010049000-000000002354dfff 00013505 309MB UC WC WT WB
5792 ldr-data 000000002354e000-000000003ecfffff 0001b7b2 439MB UC WC WT WB
5793 BS-data 000000003ed00000-000000003ed7ffff 00000080 512KB UC WC WT WB
5794 conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 705MB UC WC WT WB
5795 reserved 000000006af60000-000000006b55ffff 00000600 6MB UC WC WT WB
5796 BS-data 000000006b560000-000000006b560fff 00000001 4KB UC WC WT WB
5797 RT-data 000000006b561000-000000006b5e1fff 00000081 516KB RT UC WC WT WB
5798 BS-data 000000006b5e2000-000000006ecfafff 00003719 55MB UC WC WT WB
5799 BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KB UC WC WT WB
5800 conv-mem 000000006ecfc000-00000000711fafff 000024ff 36MB UC WC WT WB
5801 BS-data 00000000711fb000-000000007128dfff 00000093 588KB UC WC WT WB
5802 Unk 0d 0000000880000000-0000000e7fffffff 00600000 24GB UC WC WT WB NV
5803 reserved 0000001680000000-0000001c7fffffff 00600000 24GB UC WC WT WB NV
5804
5805 New format:
5806 Type Physical start - end #Pages Size Attributes
5807 conv-mem 0000000000000000-0000000000092fff 00000093 588KiB UC WC WT WB
5808 reserved 0000000000093000-0000000000093fff 00000001 4KiB UC WC WT WB
5809 conv-mem 0000000000094000-000000000009ffff 0000000c 48KiB UC WC WT WB
5810 conv-mem 0000000000100000-000000000fffffff 0000ff00 255MiB UC WC WT WB
5811 BS-code 0000000010000000-0000000010048fff 00000049 292KiB UC WC WT WB
5812 conv-mem 0000000010049000-000000002354dfff 00013505 316436KiB UC WC WT WB
5813 ldr-data 000000002354e000-000000003ecfffff 0001b7b2 450248KiB UC WC WT WB
5814 BS-data 000000003ed00000-000000003ed7ffff 00000080 512KiB UC WC WT WB
5815 conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 722816KiB UC WC WT WB
5816 reserved 000000006af60000-000000006b55ffff 00000600 6MiB UC WC WT WB
5817 BS-data 000000006b560000-000000006b560fff 00000001 4KiB UC WC WT WB
5818 RT-data 000000006b561000-000000006b5e1fff 00000081 516KiB RT UC WC WT WB
5819 BS-data 000000006b5e2000-000000006ecfafff 00003719 56420KiB UC WC WT WB
5820 BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KiB UC WC WT WB
5821 conv-mem 000000006ecfc000-0000000071222fff 00002527 38044KiB UC WC WT WB
5822 BS-data 0000000071223000-00000000712ddfff 000000bb 748KiB UC WC WT WB
5823 persist 0000000880000000-0000000e7fffffff 00600000 24GiB UC WC WT WB NV
5824 reserved 0000001680000000-0000001c7fffffff 00600000 24GiB UC WC WT WB NV
5825
5826 2015-12-16 Andrei Borzenkov <arvidjaar@gmail.com>
5827
5828 kernel: print and reset grub_errno after each embedded config line
5829 Otherwise it causes subsequent file open to fail, because grub_file_open
5830 misinterprets set grub_errno for grub_file_get_device_name failure.
5831
5832 Closes: 46540
5833
5834 2015-12-16 Andrei Borzenkov <arvidjaar@gmail.com>
5835
5836 Erase backspaced character in grub_username_get
5837 It probably does not work across linefeed, but hopefully user names are not
5838 that long (and nobody is using terminal that small).
5839
5840 2015-12-16 Hector Marco-Gisbert <hecmargi@upv.es>
5841
5842 Fix security issue when reading username and password
5843 This patch fixes two integer underflows at:
5844 * grub-core/lib/crypto.c
5845 * grub-core/normal/auth.c
5846
5847 CVE-2015-8370
5848
5849 Also-By: Andrey Borzenkov <arvidjaar@gmail.com>
5850
5851 2015-12-15 Andrei Borzenkov <arvidjaar@gmail.com>
5852
5853 NEWS: more additions
5854 Also-By: Robert Elliott <elliott@hpe.com>
5855
5856 2015-12-15 Robert Elliott <elliott@hpe.com>
5857
5858 Translate UEFI persistent memory type
5859 Define
5860 * GRUB_EFI_PERSISTENT_MEMORY (UEFI memory map type 14) per UEFI 2.5
5861 * GRUB_MEMORY_PERSISTENT (E820 type 7) per ACPI 3.0
5862 * GRUB_MEMORY_PERSISTENT_LEGACY (E820 unofficial type 12) per ACPI 3.0
5863
5864 and translate GRUB_EFI_PERSISTENT_MEMORY to GRUB_MEMORY_PERSISTENT in
5865 grub_efi_mmap_iterate().
5866
5867 Includes
5868 * adding the E820 names to lsmmap
5869 * handling the E820 types in make_efi_memtype()
5870
5871 Suggested-by: Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
5872 Suggested-by: Andrei Borzenkov <arvidjaar@gmail.com>
5873
5874 2015-12-14 Vladimir Serbinenko <phcoder@gmail.com>
5875
5876 Document bootlocation discovery limitations and xen platform limitations
5877
5878 2015-12-07 Josef Bacik <jbacik@fb.com>
5879
5880 tcp: ack when we get an OOO/lost packet
5881 While adding tcp window scaling support I was finding that I'd get some packet
5882 loss or reordering when transferring from large distances and grub would just
5883 timeout. This is because we weren't ack'ing when we got our OOO packet, so the
5884 sender didn't know it needed to retransmit anything, so eventually it would fill
5885 the window and stop transmitting, and we'd time out. Fix this by ACK'ing when
5886 we don't find our next sequence numbered packet. With this fix I no longer time
5887 out. Thanks,
5888
5889 2015-12-01 Michael Chang <mchang@suse.com>
5890
5891 i386: fix TSC calibration using PIT
5892 Condition was accidentally reversed, so PIT calibration always failed
5893 when PIT was present and always succeeded when PIT was missing, but in
5894 the latter case resulted in absurdly fast clock.
5895
5896 Reported and tested by Vitaly Kuznetsov <vkuznets@redhat.com>
5897
5898 2015-11-28 Andrei Borzenkov <arvidjaar@gmail.com>
5899
5900 Do not include generated gnulib headers in tarball
5901 gnulib files are already handled by recursive make distdir invocation.
5902 Including all generated headers (after make completed) causes build
5903 failure if target system is different (different compile version etc).
5904
5905 2015-11-27 Andrei Borzenkov <arvidjaar@gmail.com>
5906
5907 Replace numbers with grub_memory_type_t enums
5908
5909 2015-11-27 Andrei Borzenkov <arvidjaar@gmail.com>
5910
5911 configure: fix macports flex version detection
5912 Macports add extra information after version itself:
5913
5914 $flex --version
5915 flex 2.5.35 Apple(flex-31)
5916
5917 We require at least felx 2.5.35 so do not need to care about prehistoric
5918 "flex version n.n.n"; just use second field always.
5919
5920 Reported by Peter Cheung <mcheung63@hotmail.com>
5921
5922 2015-11-27 Vladimir Serbinenko <phcoder@gmail.com>
5923
5924 tsc: Use alternative delay sources whenever appropriate.
5925 PIT isn't available on some of new hardware including Hyper-V. So
5926 use pmtimer for calibration. Moreover pmtimer calibration is faster, so
5927 use it on coreboor where booting time is important.
5928
5929 Based on patch by Michael Chang.
5930
5931 2015-11-26 Andrei Borzenkov <arvidjaar@gmail.com>
5932
5933 efi: really mark memory of unknown type as reserved
5934 9be4c45dbe3c877d1f4856e99ee15133c6cd2261 added switch case between
5935 fall through cases, causing all memory regions of unknown type to be
5936 marked as available.
5937
5938 Move default case into its own block and add explicit FALLTHROUGH
5939 annotation.
5940
5941 Reported by Elliott, Robert (Persistent Memory) <elliott@hpe.com>
5942
5943 2015-11-24 Josef Bacik <jbacik@fb.com>
5944
5945 net: reset nb->data per dns record lookup loop
5946 We were resetting nb->data every time we tried a new server, but we need to do
5947 it every time we try for a different record, otherwise we don't end up falling
5948 back to the A record properly. Thanks,
5949
5950 2015-11-18 Andrei Borzenkov <arvidjaar@gmail.com>
5951
5952 unix: do not close stdin in grub_passwd_get
5953 This makes it impossible to read from stdin without controlling tty:
5954
5955 10:/mnt # echo -e passwd\\npasswd | setsid ./grub-mkpasswd-pbkdf2
5956 Enter password:
5957 Reenter password: ./grub-mkpasswd-pbkdf2: error: failure to read password.
5958 10:/mnt
5959
5960 2015-11-17 Andrei Borzenkov <arvidjaar@gmail.com>
5961
5962 lsefisystab: add missing comma after 7994077
5963
5964 2015-11-14 Pavel Bludov <pbludov@gmail.com>
5965
5966 Add some UUIDs found in the hardware
5967
5968 2015-11-13 Konstantin Vlasov <kvlasov@odin.com>
5969
5970 gfxterm: fix calculation of terminal-top and terminal-height
5971 They used screen width, not height.
5972
5973 2015-11-12 Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
5974
5975 ofdisk: add sas disks to the device list
5976
5977 2015-11-12 Vladimir Serbinenko <phcoder@gmail.com>
5978
5979 multiboot: Don't rely on particular ordering of options.
5980
5981 multiboot_mbi: Fix handling of --quirk-bad-kludge.
5982
5983 2015-11-12 Fu Wei <fu.wei@linaro.org>
5984
5985 xen_boot: Remove useless file_name_index variable.
5986
5987 Document ARM64 xen commands
5988
5989 2015-11-11 Vladimir Serbinenko <phcoder@gmail.com>
5990
5991 asm-tests/i386-pc: Check that near jumps are 2 bytes.
5992 We already check that jump over 300 bytes gap is 3 bytes in code16-mode.
5993 Some clang versions generate 3-byte opcode for short jumps which makes
5994 boot.img blow over 512-byte limit. Enforce -no-integrated-as in such cases
5995
5996 2015-11-11 Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
5997
5998 ofdisk: add a comment about vscsi method
5999
6000 2015-11-09 Vladimir Serbinenko <phcoder@gmail.com>
6001
6002 fdt.mod: Move license tag to the right file.
6003
6004 2015-11-09 Fu Wei <fu.wei@linaro.org>
6005
6006 fdt.mod: Add missing license tag.
6007
6008 2015-11-09 Vladimir Serbinenko <phcoder@gmail.com>
6009
6010 kern/elf: Ignore cast-align warnings
6011
6012 2015-11-09 Vladimir Serbinenko <phcoder@gmail.com>
6013
6014 cbfs: Fix corner case and compilation with recdent gcc
6015 Accept the header to touch the jump address at 0xfffffff0.
6016
6017 Fix compilation for 64-bit EFI with recent GCC.
6018
6019 2015-11-08 Vladimir Serbinenko <phcoder@gmail.com>
6020
6021 fstester: Enforce LC_ALL=C
6022
6023 Adapt build-system to use imported xen headers.
6024
6025 Import xen headers directly into GRUB
6026
6027 cbfs: Check for ptr range sanity.
6028 Triaged by Andrei and enhanced with suggestions by Aaron Durbin
6029 Also-By: Andrei Borzenkov <arvidjaar@gmail.com>
6030
6031 Remove reliance C.UTF-8
6032
6033 genmoddep.awk: Add a test that we have no circular dependencies
6034
6035 Makefile.core.def: Break circular dependency on arm64.
6036
6037 autogen: Use cp instead of ln -s.
6038 libgcrypt-grub shouldn't be modified directly anyway. With this patch
6039 tarball without contrib can be unpacked on FAT and stay usable for
6040 out-of-tree compile on full POSIX FS (compile on FAT not tested).
6041
6042 2015-11-07 Andrei Borzenkov <arvidjaar@gmail.com>
6043
6044 partmap_test: check that parted is available
6045 Skip test if parted is unavailable instead of returning false failure.
6046
6047 2015-11-07 grub-devel@iam.tj <grub-devel@iam.tj>
6048
6049 cryptodisk: teach grub_cryptodisk_insert() about partitions (bug #45889)
6050 It is not possible to configure encrypted containers on multiple partitions of
6051 the same disk; after the first one all subsequent fail with
6052
6053 disk/cryptodisk.c:978: already mounted as crypto0
6054
6055 Store partition offset in cryptomount descriptor to distinguish between them.
6056
6057 2015-11-07 Andrey Borzenkov <arvidjaar@gmail.com>
6058
6059 doc: document config_directory and config_file variables
6060
6061 2015-11-07 Andrei Borzenkov <arvidjaar@gmail.com>
6062
6063 unix/getroot: remove unused MAJOR definition
6064 We use major() everywhere, these definitions just add to confusion.
6065
6066 Add comments to code for commit d313218
6067
6068 2015-11-07 Andrei Borzenkov <arvidjaar@gmail.com>
6069
6070 devmapper/getroot: use makedev instead of direct shift
6071 Fixes device detection with large number of devices.
6072
6073 Reported by Tim Wallberg <twalberg@comcast.net>
6074
6075 2015-11-06 Andrei Borzenkov <arvidjaar@gmail.com>
6076
6077 mkimage: zero fill alignment space
6078 This did not cause real problem but is good for reproducible builds. I hit
6079 it with recent bootinfoscript that displays embedded config; I was puzzled
6080 by random garbage at the end.
6081
6082 Prezero memory buffer used to assemble core.img. This makes individual
6083 memset redundant. Also ensure buffer is filled with zeroes in several other
6084 places.
6085
6086 Also remove redundant zeroing code where we fill in the whole memory block
6087 anyway.
6088
6089 2015-11-06 Vladimir Serbinenko <phcoder@gmail.com>
6090
6091 configure.ac: Explicitly add -mno-sse3 on x86.
6092
6093 README: Remove dead link to the wiki
6094
6095 2015-10-29 Andrei Borzenkov <arvidjaar@gmail.com>
6096
6097 NEWS: mention powerpc64le support
6098
6099 2015-10-29 Ignat Korchagin <ignat>
6100
6101 tcp: Fix uninited mac address when accepting connection.
6102
6103 2015-10-29 Fu Wei <fu.wei@linaro.org>
6104
6105 arm64: Add support for xen boot protocol.
6106
6107 2015-10-29 Vladimir Serbinenko <phcoder@gmail.com>
6108
6109 arm64: Move FDT functions to separate module
6110
6111 2015-10-27 Andrei Borzenkov <arvidjaar@gmail.com>
6112
6113 efi: fix warnings with recent GCC
6114 ../../grub-core/term/efi/console.c:128:32: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
6115 if (key.unicode_char >= 0x20 && key.unicode_char <= 0x7f
6116
6117 2015-10-26 Eric Snowberg <eric.snowberg@oracle.com>
6118
6119 ofdisk: Fix devpath freeing logic.
6120
6121 2015-10-26 Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
6122
6123 Implement cross-endian ELF load for powerpc
6124
6125 2015-10-25 Peter Jones <pjones@redhat.com>
6126
6127 Use EFI_SIMPLE_TEXT_INPUT_EX to support key combinations.
6128
6129 2015-10-14 Andrei Borzenkov <arvidjaar@gmail.com>
6130
6131 configure: find options to force endian on MIPS
6132
6133 2015-10-14 Andrei Borzenkov <arvidjaar@gmail.com>
6134
6135 configure: force o32 ABI on MIPS
6136 GRUB code expects O32 or N32. N32 is less tested than O32, so we prefer to
6137 compile with O32. Some systems (e.g. GNU Guix) default to using newer
6138 n64 or n32 ABI. Try to find suitable options to force o32.
6139
6140 For GCC this is simply -mabi=32. While clang supports this option as well,
6141 o32 ABI is valid for MIPS target and n32/64 ABI are valid for MIPS64 target
6142 only, so use "-target mips/mipsel -mabi=32".
6143
6144 Reported-By: Mark H Weaver <mhw@netris.org>
6145 Also-By: Mark H Weaver <mhw@netris.org>
6146
6147 2015-10-12 Andrei Borzenkov <arvidjaar@gmail.com>
6148
6149 net: avoid closing NULL socket in DNS lookup
6150 Refactor code so that we do not store NULL pointers in array
6151 of in-flight DNS servers.
6152
6153 Reported-By: Josef Bacik <jbacik@fb.com>
6154
6155 2015-10-11 Andrei Borzenkov <arvidjaar@gmail.com>
6156
6157 install: --compress argument is not optional
6158 Fixes crash if argument is not specified. Also use `|' to separate choices
6159 in list of compression methods to align it with --core-compress.
6160
6161 2015-10-11 Vladimir Serbinenko <phcoder@gmail.com>
6162
6163 mips: Make setjmp code N32-compliant.
6164
6165 mips: Make the assembly-code N32-compatible.
6166 There are no $t4 or $t5 in N32 but there are $a4 and $a5.
6167
6168 2015-10-10 Andrei Borzenkov <arvidjaar@gmail.com>
6169
6170 progress: avoid NULL dereference for net files
6171 From original patch by dann frazier <dann.frazier@canonical.com>:
6172
6173 grub_net_fs_open() saves off a copy of the file structure it gets passed and
6174 uses it to create a bufio structure. It then overwrites the passed in file
6175 structure with this new bufio structure. Since file->name doesn't get set
6176 until we return back to grub_file_open(), it means that only the bufio
6177 structure gets a valid file->name. The "real" file's name is left
6178 uninitialized. This leads to a crash when the progress module hook is called
6179 on it.
6180
6181 grub_net_fs_open() already saved copy of file name as ->net->name, so change
6182 progress module to use it.
6183
6184 Also, grub_file_open may leave file->name as NULL if grub_strdup fails. Check
6185 for it.
6186
6187 Also-By: dann frazier <dann.frazier@canonical.com>
6188
6189 2015-10-10 Andrei Borzenkov <arvidjaar@gmail.com>
6190
6191 file: ignore host disk in blocklist check
6192 It cannot work anyway because host disk cannot be read. This fixes hostfs access
6193 on native Windows build where filenames start with '\' or do not have initial
6194 separator at all (d:\foo).
6195
6196 Issue was observed when running grub-fstest on Windows. On UNIX image name is
6197 canonicalized to always start with `/' so this was not noticed.
6198
6199 This has side effect of allowing relative path names on host, but this already
6200 was the case with `ls' command, so it just extends it to all commands.
6201
6202 Reported-By: Arch Stack <archstacker@gmail.com>
6203 Also-By: Arch Stack <archstacker@gmail.com>
6204
6205 2015-10-09 Vladimir Serbinenko <phcoder@gmail.com>
6206
6207 mips/dl: Handle addend in RELA entries.
6208
6209 gfxmenu/model: Delete empty file.
6210
6211 2015-10-09 Alexander Bluhm <bluhm@genua.de>
6212
6213 ufs: Fix parameters to grub_memset.
6214 len = 0 made simply no sense. Fix parameters to be in line with read.
6215
6216 2015-10-07 Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
6217
6218 ofnet: Do not set SUFFIX for sun4v network devices
6219 sun4v vnet devices do not implement the support of duplex and speed
6220 instance attributes. An attempt to open such a device with
6221 the attributes will fail:
6222
6223 ok select net:speed=auto,duplex=auto
6224 Unknown key 'speed'
6225 Unknown key 'duplex'
6226 Manual Configuration: Host IP, boot server and filename must be specified
6227 WARNING: /virtual-devices@100/channel-devices@200/network@0: Can't open OBP standard TFTP package
6228
6229 Can't open device
6230 ok
6231
6232 Therefore, let's not set SUFFIX for such devices.
6233
6234 2015-10-07 Eric Snowberg <eric.snowberg@oracle.com>
6235
6236 sparc64 - use correct drive name within grub_util_sparc_setup
6237 Incorrect drive name was being passed into grub_util_sparc_setup,
6238 causing the grub-install to fail.
6239
6240 2015-09-13 Andrei Borzenkov <arvidjaar@gmail.com>
6241
6242 cryptodisk: strip parenthesis from backing device name
6243 Otherwise subsequent disk open fails.
6244
6245 Reported-By: Klemens Nanni <contact@autoboot.org>
6246
6247 2015-08-22 Felix Zielcke <fzielcke@z-51.de>
6248
6249 disk/ldm, partmap/msdos.c: fix spelling error
6250
6251 2015-08-13 Andrei Borzenkov <arvidjaar@gmail.com>
6252
6253 net: do not try to load protocol module via itself
6254 Otherwise we get infinite recursion.
6255
6256 Closes: 45729
6257
6258 2015-08-09 Josef Bacik <jbacik@fb.com>
6259
6260 efinet: handle get_status() on buggy firmware properly
6261 The EFI spec indicates that get_status() should return the address of the buffer
6262 we passed into transmit to indicate the the buffer was transmitted. However we
6263 have boxes where the firmware returns some arbitrary address instead, which
6264 makes grub think that we've not sent anything. So since we have the SNP stuff
6265 opened in exclusive mode just assume any non-NULL txbuf means that our transmit
6266 occurred properly. This makes grub able to do its networking stuff properly on
6267 our broken firmware. Thanks,
6268
6269 cc: Peter Jones <pjones@redhat.com>
6270
6271 2015-08-09 Andrei Borzenkov <arvidjaar@gmail.com>
6272
6273 linguas.sh: fix error when removing non-existing autogenerated files
6274
6275 2015-07-28 Vladimir Serbinenko <phcoder@gmail.com>
6276
6277 ahci: Ensure that bus mastering is set.
6278 Fixes ahci_test failing on several platforms.
6279
6280 2015-07-27 Vladimir Serbinenko <phcoder@gmail.com>
6281
6282 archelp: Never pass NULL as mtime.
6283 Moves complexity from fs code (NULL check) to common code (passing non-NULL).
6284
6285 HFS: Convert to fshelp.
6286 HFS doesn't handle "." and ".." properly. Convert it to fshelp to reuse the
6287 logic.
6288
6289 FAT: Convert to fshelp.
6290 exFAT doesn't handle "." and ".." correctly, convert it to fshelp to
6291 reuse the same logic.
6292
6293 BFS: Convert to fshelp.
6294 BFS doesn't handle ".." correctly, so convert it to fshelp to reuse the logic.
6295
6296 fshelp: Add handling of "." and ".." and grub_fshelp_find_file_lookup.
6297 Recent tests have discovered that many of our filesystems have flawed
6298 handling of "." and "..". Rather than attempting to fix it in filesystems
6299 themselves, make the common code fshelp aware of "." and ".." and handle
6300 them in this layer. Add grub_fshelp_find_file_lookup for easy conversion
6301 of BFS, HFS and exFAT which have the same problem and don't use fshelp.
6302
6303 Switch procfs to use archelp.
6304 This fixes handling of "." and "..".
6305
6306 grub-install: Use a+ in fopen rather than r+.
6307 r+ does not create a file if none exists.
6308
6309 Add transform_data as a variant of data with substitutions.
6310 This fixrs name mismatch for grub.chrp with
6311 transform_program_name='s,grub,grub2,g'
6312
6313 2015-07-24 Ignat Korchagin <ignat@cloudflare.com>
6314
6315 efi: fix GetVariable return status check in 81ca24a
6316 GetVariable should return EFI_BUFFER_TOO_SMALL if given buffer of size
6317 zero; commit incorrectly checked for EFI_SUCCESS.
6318
6319 2015-07-24 Vladimir Serbinenko <phcoder@gmail.com>
6320
6321 zfs_test: Skip dotdot in volume root test.
6322 Given special semantics of ZFS it's far from clear what the expected
6323 result is. Just skip it for now
6324
6325 xfs_test: Test both crc and non-crc filesystems.
6326
6327 xfs: Fix handling of symlink with crc-enabled filesystem.
6328
6329 reiserfs: Fix handling of first entry in the directory.
6330 Fixes garbage being added to "." filename.
6331
6332 2015-07-23 Ignat Korchagin <ignat@cloudflare.com>
6333
6334 efi: fix memory leak in variable handling
6335
6336 2015-07-23 Vladimir Serbinenko <phcoder@gmail.com>
6337
6338 exclude.pot: Add missing blacklisted strings.
6339
6340 archelp: Fix handling of dot and dotdot at the end of the name.
6341 Fixes cpio_test and tar_test.
6342
6343 arm-emu: Add __aeabi_memcpy* and __aeabi_memclr* symbols.
6344 Fixes compilation with clang.
6345
6346 2015-07-22 Vladimir Serbinenko <phcoder@gmail.com>
6347
6348 fwstart: Fix loading of address of read_spd_fail.
6349
6350 fwstart: Add missing argument to p2align.
6351 Resulting binary is unchanged as it happens we were already aligned
6352 by chance.
6353
6354 2015-07-22 Vladimir Serbinenko <phcoder@gmail.com>
6355
6356 fwstart: Replace blt with bltz.
6357 blt A, $zero, B and bltz A, B are equivalent but clang recognizes only
6358 later, so use it.
6359
6360 Resulting binary is unchanged.
6361
6362 2015-07-22 Vladimir Serbinenko <phcoder@gmail.com>
6363
6364 Remove mips_attributes.
6365 mips_attributes was introduced to work around clang problems with
6366 -msoft-float. Those problems are now fixed and moreover .gnu_attributes
6367 itself is unportable and creates problem with clang.
6368
6369 Revert "mips: Fix soft-float handling."
6370
6371 This partially reverts commit 6a4ecd276ed39f66be0ad6ff0f8ff67598098605.
6372
6373 2015-07-22 Vladimir Serbinenko <phcoder@gmail.com>
6374
6375 ARM: provide __aeabi_memclr* and __aeabi_memcpy* symbols
6376 Fixes compilation with recent clang.
6377
6378 diskfilter: Make name a const char to fix compilation error.
6379
6380 dmraid_nvidia: Set a name to usable value to avoid null dereference.
6381 Reported by: Andrei Borzenkov
6382
6383 configure.ac: Handle powerpc64le compiler
6384 Also-by: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
6385
6386 2015-07-20 Bernhard Übelacker <bernhardu@vr-web.de>
6387
6388 loader/linux: Make trailer initrd entry aligned again.
6389 Regression from commit:
6390 loader/linux: do not pad initrd with zeroes at the end
6391 a8c473288d3f0a5e17a903a5121dea1a695dda3b
6392
6393 Wimboot fails since the change above because it expects the "trailer"
6394 initrd element on an aligned address.
6395 This issue shows only when newc_name is used and the last initrd
6396 entry has a not aligned size.
6397
6398 2015-07-16 Vladimir Serbinenko <phcoder@gmail.com>
6399
6400 XFS: Fix wrong alignment treatment.
6401
6402 grub_ext2_read_block: Fix return type on error.
6403
6404 2015-07-05 Andrei Borzenkov <arvidjaar@gmail.com>
6405
6406 use TARGET_LDFLAGS in grub_PROG_OBJCOPY_ABSOLUTE
6407 That's what Makefile will use and it is required if unusual flags
6408 must be passed to linker (e.g. to build ppc32 code on ppc64le with clang).
6409
6410 2015-06-26 Michael Chang <mchang@suse.com>
6411
6412 Fix missing byte order conversion in get_btrfs_fs_prefix function
6413 Since btrfs on-disk format uses little-endian, the searched item types
6414 (ROOT_REF, INODE_REF) need converting the byte order in order to
6415 function properly on big-endian systems.
6416
6417 2015-06-26 Andrei Borzenkov <arvidjaar@gmail.com>
6418
6419 chainloader: fix resoource leak
6420 Found by: Coverity scan.
6421 CID: 96651
6422
6423 loader/bsd: fix memory leak
6424 Found by: Coverity scan.
6425 CID: 96662, 96665
6426
6427 2015-06-20 Andrei Borzenkov <arvidjaar@gmail.com>
6428
6429 loader/bsd: free memory leaks
6430 Found by: Coverity scan.
6431 CID: 96671, 96658, 96653
6432
6433 search_wrap: fix memory leak
6434 Found by: Coverity scan.
6435 CID: 96675
6436
6437 password_pbkdf2: fix memory leak
6438 Found by: Coverity scan.
6439 CID: 96676
6440
6441 normal: fix memory leak
6442 Found by: Coverity scan.
6443 CID: 96677
6444
6445 efi/serial: fix memory leak
6446 Found by: Coverity scan.
6447 CID: 96678
6448
6449 ohci: fix memory leak
6450 Found by: Coverity scan.
6451 CID: 96679
6452
6453 loader/bsd: free memory leaks
6454 Found by: Coverity scan.
6455 CID: 96682
6456
6457 multiboot: fix memory leak
6458 Found by: Coverity scan.
6459 CID: 96684
6460
6461 normal: fix memory leak
6462 Found by: Coverity scan.
6463 CID: 96685
6464
6465 loader/bsd: fix memory leak
6466 Found by: Coverity scan.
6467 CID: 96686
6468
6469 reed_solomon: fix memory leak
6470 Found by: Coverity scan.
6471 CID: 96688
6472
6473 usb: fix use after free
6474 Found by: Coverity scan.
6475 CID: 96704
6476
6477 xnu: fix use after free
6478 Found by: Coverity scan.
6479 CID: 96706
6480
6481 disk/scsi: fix use after free
6482 Found by: Coverity scan.
6483 CID: 96713
6484
6485 efi/chainloader: fix use after free
6486 Found by: Coverity scan.
6487 CID: 96714
6488
6489 search: fix use after free
6490 Found by: Coverity scan.
6491 CID: 96715
6492
6493 NEWS: emu libusb support removed
6494
6495 2015-06-19 Andrei Borzenkov <arvidjaar@gmail.com>
6496
6497 grub-probe: fix memory leak in probe (ofpath)
6498 Found by: Coverity scan.
6499 CID: 73772
6500
6501 2015-06-19 Andrei Borzenkov <arvidjaar@gmail.com>
6502
6503 grub-probe: restructure code to make static analysis easier
6504 Current code in probe() could not be verified to not contain memory leaks.
6505 Restructure code and ensure grub_device_close is always called at the end of
6506 loop.
6507
6508 Calms down Coverity scan.
6509 CID: 73739
6510
6511 2015-06-19 Andrei Borzenkov <arvidjaar@gmail.com>
6512
6513 zfs: fix memory leak
6514 Found by: Coverity scan.
6515 CID: 73647
6516
6517 xfs: silence Coverity overflow warning
6518 inode size cannot really overflow integer, but Coverity does not know it.
6519 CID: 96602
6520
6521 zfs: memory leak
6522 Found by Coverity scan.
6523 CID: 96603
6524
6525 unix/getroot: memory leak
6526 Found by Coverity scan.
6527 CID: 96605
6528
6529 unix/relpath: memory leak
6530 Found by Coverity scan.
6531 CID: 96606
6532
6533 2015-06-19 Andrei Borzenkov <arvidjaar@gmail.com>
6534
6535 syslinux_parse: assorted issues found by Coverity
6536 1. Remove unneeded NULL check
6537 CID: 96607
6538
6539 2. Do not allocate storage for initrd, copy it directly from input
6540 buffer. Avoids memory leak in failure path.
6541 CID: 96604
6542
6543 3. Unchecked error return from print()
6544 CID: 96601, 73595
6545
6546 2015-06-19 Andrei Borzenkov <arvidjaar@gmail.com>
6547
6548 syslinux_parse: make print_escaped actually stop before `to'
6549 The only current user is mboot.c32 which unfortunately is not covered
6550 by regression tests.
6551
6552 2015-06-18 Andrei Borzenkov <arvidjaar@gmail.com>
6553
6554 fat: fix handling of "." and ".." directory entries
6555 Emulate dot and dotdot in root directory. For other directories do not
6556 add separator between name and extension for these two special entries.
6557
6558 Closes: 45335
6559
6560 2015-06-18 Andrei Borzenkov <arvidjaar@gmail.com>
6561
6562 tests: regression tests for "." and ".." directory entries
6563
6564 2015-06-16 Andrei Borzenkov <arvidjaar@gmail.com>
6565
6566 efinet: enable hardware filters when opening interface
6567 Exclusive open on SNP will close all existing protocol instances which
6568 may disable all receive filters on interface. Reinstall them after we
6569 opened protocol exclusively.
6570
6571 Also follow UEFI specification recommendation and stop interfaces when
6572 closing them:
6573
6574 Unexpected system errors, reboots and hangs can occur if an OS is loaded
6575 and the network devices are not Shutdown() and Stopped().
6576
6577 Also by: Mark Salter <msalter@redhat.com>
6578 Closes: 45204
6579
6580 2015-06-16 Andrei Borzenkov <arvidjaar@gmail.com>
6581
6582 NEWS: mention libgcc removal
6583
6584 2015-06-15 Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
6585
6586 Add flag for powerpc ieee1275 to avoid unneeded optimizations
6587
6588 2015-06-12 Mark Salter <msalter@redhat.com>
6589
6590 Fix exit to EFI firmware
6591 The current code for EFI grub_exit() calls grub_efi_fini() before
6592 returning to firmware. In the case of ARM, this leaves a timer
6593 event running which could lead to a firmware crash. This patch
6594 changes this so that grub_machine_fini() is called with a NORETURN
6595 flag. This allows machine-specific shutdown to happen as well
6596 as the shutdown done by grub_efi_fini().
6597
6598 2015-06-12 Paul Menzel <paulepanter@users.sourceforge.net>
6599
6600 disk/ahci.c: Use defines `GRUB_AHCI_HBA_PORT_CMD_SPIN_UP` and `GRUB_AHCI_HBA_PORT_CMD_POWER_ON`
6601 Instead of hard coding `2` and `4` use the macros defined already at the
6602 top of the file. As a consequence, wrap the now too long line.
6603
6604 2015-06-12 Andrei Borzenkov <arvidjaar@gmail.com>
6605
6606 NEWS: XFS v5 support
6607
6608 2015-06-12 Jan Kara <jack@suse.cz>
6609
6610 xfs: V5 filesystem format support
6611 Add support for new XFS on disk format. We have to handle optional
6612 filetype fields in directory entries, additional CRC, LSN, UUID entries
6613 in some structures, etc.
6614
6615 xfs: Add helpers for inode size
6616 Add helpers to return size of XFS inode on disk and when loaded in
6617 memory.
6618
6619 2015-06-04 Toomas Soome <tsoome@me.com>
6620
6621 multiboot_header_tag_module_align fix to confirm multiboot specification
6622
6623 2015-06-02 Leif Lindholm <leif.lindholm@linaro.org>
6624
6625 configure.ac: clean up arm64 soft-float handling
6626 Fix compilation with gcc 5.1 (avoid internal compiler error), by
6627 replacing explicit -march +nofp+nosimd options with -mgeneral-regs-only.
6628
6629 This also enables the removal of some further conditional build flag
6630 setting.
6631
6632 2015-06-01 dann frazier <dann.frazier@canonical.com>
6633
6634 arm64/setjmp: Add missing license macro
6635 Including the setjmp module in an arm64-efi image will cause it to
6636 immediately exit with an "incompatible license" error.
6637
6638 The source file includes a GPLv3+ boilerplate, so fix this by declaring a
6639 GPLv3+ license using the GRUB_MOD_LICENSE macro.
6640
6641 2015-05-31 Paul Menzel <paulepanter@users.sourceforge.net>
6642
6643 disk/ahci.c: Add port number to port debug messages
6644 Currently, some messages cannot be mapped to the port they belong to as
6645 the port number is missing from the output. So add `port: n` to the
6646 debug messages.
6647
6648 2015-05-30 Andrei Borzenkov <arvidjaar@gmail.com>
6649
6650 Clarify use of superusers variable and menu entry access
6651 superusers controls both CLI and editing. Also explicitly mention that
6652 empty superusers disables them.
6653
6654 "Access to menuentry" is a bit vague - change to "execute menuentry"
6655 to make it obvious, what access is granted.
6656
6657 2015-05-30 Paul Menzel <paulepanter@users.sourceforge.net>
6658
6659 Correct spelling of *scheduled*
6660 Run the command below
6661
6662 $ git grep -l schedulded | xargs sed -i 's/schedulded/scheduled/g'
6663
6664 and revert the change in `ChangeLog-2015`.
6665
6666 Including "miscellaneous" spelling fix noted by richardvoigt@gmail.com
6667
6668 2015-05-30 Toomas Soome <tsoome@me.com>
6669
6670 zfs extensible_dataset and large_blocks feature support
6671 large blocks basically use extensible dataset feature, or to be exact,
6672 setting recordsize above 128k will trigger large_block feature to be
6673 enabled and storing such blocks is using feature extensible dataset. so
6674 the extensible dataset is prerequisite.
6675
6676 Changes implement read support extensible dataset… instead of fixed DMU
6677 types they dont specify type, making it possible to use fat zap objects
6678 from bonus area.
6679
6680 2015-05-27 Vladimir Serbinenko <phcoder@gmail.com>
6681
6682 multiboot1: never place modules in low memory.
6683 While in theory permitted by the spec, modules rarely fit in low memory
6684 anyway and not every kernel is able to handle modules in low memory anyway.
6685 At least VMWare is known not to be able to handle modules at arbitrary
6686 locations.
6687
6688 2015-05-24 Paul Menzel <paulepanter@users.sourceforge.net>
6689
6690 disk/ahci: Use defines `GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ`
6691 Instead of hard coding `0x88` use the macros defined in `disk/ata.h`.
6692
6693 2015-05-19 Paul Menzel <paulepanter@users.sourceforge.net>
6694
6695 cb_timestamps.c: Add new time stamp descriptions
6696 Add the descriptions of the “core”, that means no vendorcode or payload,
6697 coreboot time stamps added up to coreboot commit a7d92441 (timestamps:
6698 You can never have enough of them!) [1].
6699
6700 Running `coreboot_boottime` in the GRUB command line interface now shows
6701 descriptions for all time stamps again on the ASRock E350M1.
6702
6703 [1] http://review.coreboot.org/9608
6704
6705 2015-05-17 Andrei Borzenkov <arvidjaar@gmail.com>
6706
6707 bootp: ignore gateway_ip (relay) field.
6708 From RFC1542:
6709
6710 The 'giaddr' field is rather poorly named. It exists to facilitate
6711 the transfer of BOOTREQUEST messages from a client, through BOOTP
6712 relay agents, to servers on different networks than the client.
6713 Similarly, it facilitates the delivery of BOOTREPLY messages from the
6714 servers, through BOOTP relay agents, back to the client. In no case
6715 does it represent a general IP router to be used by the client. A
6716 BOOTP client MUST set the 'giaddr' field to zero (0.0.0.0) in all
6717 BOOTREQUEST messages it generates.
6718
6719 A BOOTP client MUST NOT interpret the 'giaddr' field of a BOOTREPLY
6720 message to be the IP address of an IP router. A BOOTP client SHOULD
6721 completely ignore the contents of the 'giaddr' field in BOOTREPLY
6722 messages.
6723
6724 Leave code ifdef'd out for the time being in case we see regression.
6725
6726 Suggested by: Rink Springer <rink@rink.nu>
6727 Closes: 43396
6728
6729 2015-05-17 Andrei Borzenkov <arvidjaar@gmail.com>
6730
6731 hostdisk: fix crash with NULL device.map
6732 grub-macbless calls grub_util_biosdisk_init with NULL device.map.
6733
6734 2015-05-14 Andrei Borzenkov <arvidjaar@gmail.com>
6735
6736 zfs: fix integer truncation in zap_lookup
6737 Size after shift could exceed 16 bits; use grub_unit32_t for result.
6738
6739 Reported and tested by: Kostya Berger <bergerkos@yahoo.co.uk>
6740 Closes: 44448
6741
6742 2015-05-13 Andrei Borzenkov <arvidjaar@gmail.com>
6743
6744 remove extra newlines in grub_util_* strings
6745 grub_util_{info,warn,error} already add trailing newlines, so remove
6746 them from format strings. Also trailing full stops are already added.
6747
6748 2015-05-12 Jan Kara <jack@suse.cz>
6749
6750 xfs: Convert inode numbers to cpu endianity immediately after reading
6751 Currently XFS driver converted inode numbers to native endianity only
6752 when using them to compute inode position. Although this works, it is
6753 somewhat confusing. So convert inode numbers when reading them from disk
6754 structures as every other field.
6755
6756 2015-05-11 Jan Kara <jack@suse.cz>
6757
6758 xfs: Fix termination loop for directory iteration
6759 Directory iteration used wrong position (sizeof wrong structure) for
6760 termination of iteration inside a directory block. Luckily the position
6761 ended up being wrong by just 1 byte and directory entries are larger so
6762 things worked out fine in practice. But fix the problem anyway.
6763
6764 2015-05-08 Andrei Borzenkov <arvidjaar@gmail.com>
6765
6766 acpi: do not skip BIOS scan if EBDA length is zero
6767 EBDA layout is not standardized so we cannot assume first two bytes
6768 are length. Neither is it required by ACPI standard. HP 8710W is known
6769 to contain zeroes here.
6770
6771 Closes: 45002
6772
6773 2015-05-07 Andrei Borzenkov <arvidjaar@gmail.com>
6774
6775 Add asm-tests to tarball
6776
6777 2015-05-07 Vladimir Serbinenko <phcoder@gmail.com>
6778
6779 util/grub-mkrescue: Fix compilation
6780
6781 2015-05-07 Andrei Borzenkov <arvidjaar@gmail.com>
6782
6783 efinet: open Simple Network Protocol exclusively
6784 EDK2 network stack is based on Managed Network Protocol which is layered
6785 on top of Simple Management Protocol and does background polling. This
6786 polling races with grub for received (and probably trasmitted) packets
6787 which causes either serious slowdown or complete failure to load files.
6788
6789 Open SNP device exclusively. This destroys all child MNP instances and
6790 stops background polling.
6791
6792 Exclusive open cannot be done when enumerating cards, as it would destroy
6793 PXE information we need to autoconfigure interface; and it cannot be done
6794 during autoconfiguration as we need to do it for non-PXE boot as well. So
6795 move SNP open to card ->open method and add matching ->close to clean up.
6796
6797 Based on patch from Mark Salter <msalter@redhat.com>
6798
6799 Also-By: Mark Salter <msalter@redhat.com>
6800 Closes: 41731
6801
6802 2015-05-07 Andrei Borzenkov <arvidjaar@gmail.com>
6803
6804 efinet: skip virtual IPv4 and IPv6 devices when enumerating cards
6805 EDK2 PXE driver creates two child devices - IPv4 and IPv6 - with
6806 bound SNP instance. This means we get three cards for every physical
6807 adapter when enumerating. Not only is this confusing, this may result
6808 in grub ignoring packets that come in via the "wrong" card.
6809
6810 Example of device hierarchy is
6811
6812 Ctrl[91] PciRoot(0x0)/Pci(0x3,0x0)
6813 Ctrl[95] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)
6814 Ctrl[B4] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0)
6815 Ctrl[BC] PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000)
6816
6817 Skip PXE created virtual devices when enumerating cards. Make sure to
6818 find real card when applying initial autoconfiguration during PXE boot,
6819 this information is associated with one of child devices.
6820
6821 2015-05-07 Andrei Borzenkov <arvidjaar@gmail.com>
6822
6823 efidisk: move device path helpers in core for efinet
6824
6825 convert to, not from, CPU byte order in DNS receive function
6826
6827 2015-05-07 Andrei Borzenkov <arvidjaar@gmail.com>
6828
6829 loader/linux: do not pad initrd with zeroes at the end
6830 Syslinux memdisk is using initrd image and needs to know uncompressed
6831 size in advance. For gzip uncompressed size is at the end of compressed
6832 stream. Grub padded each input file to 4 bytes at the end, which means
6833 syslinux got wrong size.
6834
6835 Linux initramfs loader apparently does not care about trailing alignment.
6836 So change code to align beginning of each file instead which atomatically
6837 gives us the correct size for single file.
6838
6839 Reported-By: David Shaw <dshaw@jabberwocky.com>
6840
6841 2015-05-07 Daniel Kiper <daniel.kiper@oracle.com>
6842
6843 i386/relocator: Remove unused extern grub_relocator64_rip_addr
6844
6845 2015-05-07 Vladimir Serbinenko <phcoder@gmail.com>
6846
6847 grub-install-common: Increase buf size to 8192 as modinfo.sh is bigger.
6848
6849 2015-05-07 Vladimir Serbinenko <phcoder@gmail.com>
6850
6851 grub-mkrescue: Recognize -output as an alias of --output.
6852 This helps us to be in line with xorriso -as mkisofs.
6853
6854 Suggested by: Thomas Schmitt
6855
6856 2015-05-07 Vladimir Serbinenko <phcoder@gmail.com>
6857
6858 linux.c: Ensure that initrd is page-aligned.
6859
6860 Revert parts accidentally committed 2 commits ago.
6861
6862 2015-05-07 Fu Wei <fu.wei@linaro.org>
6863
6864 fdt.h: Add grub_fdt_set_reg64 macro
6865
6866 arm64: Export useful functions from linux.c
6867
6868 2015-05-04 Andrei Borzenkov <arvidjaar@gmail.com>
6869
6870 Revert "efinet: memory leak on module removal"
6871 This reverts commits 47b2bee3ef0ea60fc3f5bfc37f3784e559385297
6872 and 8d3c4544ffdd0289a4b0bdeb0cdc6355f801a4b3. It is not safe
6873 to free allocated cards, dangling pointers main remain. Such
6874 cleanup requires more changes in net core.
6875
6876 efinet: cannot free const char * pointer
6877
6878 efinet: memory leak on module removal
6879
6880 2015-05-03 Andrei Borzenkov <arvidjaar@gmail.com>
6881
6882 zfs: add missing NULL check and fix incorrect buffer overwrite
6883 grub_memset should zero out padding after data end. It is not clear
6884 why it is needed at all - ZFS block is at least 512 bytes and power
6885 of two, so it is always multiple of 16 bytes. This grub_memset
6886 apparently never did anything.
6887
6888 2015-05-03 Toomas Soome <tsoome@me.com>
6889
6890 zfs: com.delphix:embedded_data feature support
6891
6892 zfs: com.delphix:hole_birth feature support
6893 In the past birth was always zero for holes. This feature started
6894 to make use of birth for holes as well, so change code to test for
6895 valid DVA address instead.
6896
6897 2015-04-29 Andrei Borzenkov <arvidjaar@gmail.com>
6898
6899 grub-mkconfig: use $pkgdatadir in scripts
6900 Otherwise scripts will source wrong grub-mkconfig_lib.
6901
6902 2015-04-24 Vladimir Serbinenko <phcoder@gmail.com>
6903
6904 Remove -V in grub-mkrescue.c
6905 It clashhes with -V which is alias to -volid.
6906
6907 2015-04-13 Toomas Soome <tsoome@me.com>
6908
6909 getroot: include sys/mkdev.h for makedev
6910 Solaris (like) systems need to include sys/mkdev.h for makedev() function.
6911
6912 2015-04-13 Toomas Soome <tsoome@me.com>
6913
6914 core/partmap: rename 'sun' to avoid clash with predefined symbol
6915 the symbol “sun” is defined macro in solaris derived systems, from
6916 gcc -dM -E:
6917
6918 and therefore can not be used as name.
6919
6920 2015-04-12 Paul Menzel <paulepanter@users.sourceforge.net>
6921
6922 docs/grub.texi: Fix spelling of cbfstool
6923
6924 2015-04-06 Andrei Borzenkov <arvidjaar@gmail.com>
6925
6926 core: avoid NULL derefrence in grub_divmod64s
6927 It can be called with NULL for third argument. grub_divmod32* for
6928 now are called only from within wrappers, so skip check.
6929
6930 Reported-By: Michael Zimmermann <sigmaepsilon92@gmail.com>
6931
6932 2015-03-28 Andrei Borzenkov <arvidjaar@gmail.com>
6933
6934 do not emit cryptomount without crypto UUID
6935
6936 2015-03-28 Sarah Newman <srn@prgmr.com>
6937
6938 grub-core/loader/i386/xen.c: Initialized initrd_ctx so we don't free a random pointer from the stack.
6939
6940 2015-03-27 Andrei Borzenkov <arvidjaar@gmail.com>
6941
6942 net: trivial grub_cpu_to_XX_compile_time cleanup
6943
6944 2015-03-27 Lunar <lunar@torproject.org>
6945
6946 syslinux: Support {vesa,}menu.c32.
6947
6948 2015-03-27 Steve McIntyre <steve@einval.com>
6949
6950 Recognize EFI platform even in case of mismatch between Linux and EFI.
6951 Some x86 systems might be capable of running a 64-bit Linux kernel but
6952 only use a 32-bit EFI (e.g. Intel Bay Trail systems). It's useful for
6953 grub-install to be able to recognise such systems, to set the default
6954 x86 platform correctly.
6955
6956 To allow grub-install to know the size of the firmware rather than
6957 just the size of the kernel, there is now an extra EFI sysfs file to
6958 describe the underlying firmware. Read that if possible, otherwise
6959 fall back to the kernel type as before.
6960
6961 2015-03-27 Michael Zimmermann <sigmaepsilon92@gmail.com>
6962
6963 Add missing initializers to silence suprious warnings.
6964
6965 2015-03-27 Leif Lindholm <leif.lindholm@linaro.org>
6966
6967 dl_helper: Cleanup
6968 Use the new thumb_get_instruction_word/thumb_set_instruction_word
6969 helpers throughout.
6970
6971 Style cleanup (missing spaces).
6972
6973 Move Thumb MOVW/MOVT handlers into Thumb relocation section of file.
6974
6975 2015-03-27 Martin Wilck <martin.wilck@ts.fujitsu.com>
6976
6977 efinet: Check for immediate completition.
6978 This both speeds GRUB up and workarounds unexpected EFI behaviour.
6979
6980 2015-03-27 Vladimir Serbinenko <phcoder@gmail.com>
6981
6982 Make Makefile.util.def independent of platform.
6983
6984 2015-03-27 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6985
6986 util/mkimage: Use stable timestamp when generating binaries.
6987
6988 2015-03-27 Vladimir Serbinenko <phcoder@gmail.com>
6989
6990 modinfo.sh.in: Add missing config variables.
6991
6992 Makefile.core.def: Remove obsolete LDADD_KERNEL
6993
6994 arp, icmp: Fix handling in case of oversized or invalid packets.
6995 This restrict ARP handling to MAC and IP addresses but in practice we need
6996 only this case anyway and other cases are very rar if exist at all. It makes
6997 code much simpler and less error-prone.
6998
6999 2015-03-23 Colin Watson <cjwatson@ubuntu.com>
7000
7001 hostfs: Drop unnecessary feature test macros
7002 _BSD_SOURCE was added to allow the use of DT_DIR, but that was removed
7003 in e768b77068a0b030a07576852bd0f121c9a077eb. While adding
7004 _DEFAULT_SOURCE as well works around problems with current glibc,
7005 neither is in fact needed nowadays.
7006
7007 2015-03-20 Vladimir Serbinenko <phcoder@gmail.com>
7008
7009 compiler-rt-emu: Add missing file.
7010
7011 emunet: Fix init error checking.
7012 Otherwise emunet doesn't expose any cards.
7013
7014 fddboot_test: Add -no-pad to xorriso.
7015
7016 grub-mkrescue: pass all unrecognized options unchanged to xorriso.
7017
7018 cacheinfo: Add missing license information.
7019
7020 2015-03-19 Andrei Borzenkov <arvidjaar@gmail.com>
7021
7022 grub-fs-tester: add LVM RAID1 support
7023 LVM miscalculates bitmap size with small extent, so start with 16K as
7024 for other RAID types.
7025
7026 Until version 2.02.103 LVM counts metadata segments twice when checking
7027 available space, reduce segment count by one to account for this bug.
7028
7029 2015-03-19 Andrei Borzenkov <arvidjaar@gmail.com>
7030
7031 core: add LVM RAID1 support
7032 Closes 44534.
7033
7034 2015-03-16 Andrei Borzenkov <arvidjaar@gmail.com>
7035
7036 grub-fs-tester: explicitly set segment type for LVM mirror
7037 LVM mirror defaults to RAID1 today and can be different on different
7038 systems as set in lvm.conf.
7039
7040 2015-03-15 Andrei Borzenkov <arvidjaar@gmail.com>
7041
7042 grub-fs-tester: better estimation of filesystem time for LVM/RAID
7043 Write activity with LVM/RAID can happen after filesystem is unmounted.
7044 In my testing modification time of loop files was 15 - 20 seconds
7045 after unmount. So use time as close to unmount as possible as
7046 reference instead.
7047
7048 2015-03-06 Vladimir Serbinenko <phcoder@gmail.com>
7049
7050 hfsplus: Fix potential access to uninited memory on invalid FS
7051
7052 2015-03-06 Jon McCune <jonmccune@google.com>
7053
7054 autogen.sh: Allow overriding the python to be used by setting $PYTHON.
7055 Some installations have several python versions installed. Allow user
7056 to choose which one to use by setting $PYTHON.
7057
7058 2015-03-05 Andrei Borzenkov <arvidjaar@gmail.com>
7059
7060 update gnulib/argp-help.c to fix garbage in grub-mknetdir --help output
7061 argp_help attempts to translate empty string, which results in printing
7062 meta information about translation, like in
7063
7064 bor@opensuse:~/build/grub> grub2-mknetdir --help
7065 Использование: grub2-mknetdir [ПАРАМЕТР…]
7066 Project-Id-Version: grub 2.02-pre2
7067 Report-Msgid-Bugs-To: bug-grub@gnu.org
7068 ...
7069
7070 Update gnulib/argp-help.c to the current version which fixes this
7071 (commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d).
7072
7073 2015-03-05 Andrey Borzenkov <arvidjaar@gmail.com>
7074
7075 update m4/extern-inline.m4 to upstream version to fix compilation on FreeBSD
7076 In file included from util/grub-mkimage.c:54:0:
7077 ./grub-core/gnulib/argp.h:627:49: error: '__sbistype' is static but
7078 used in inline function '_option_is_short' which is not static
7079 [-Werror] cc1: all warnings being treated as errors gmake[2]: ***
7080 [util/grub_mkimage-grub-mkimage.o] Error 1
7081
7082 Update m4/extern-inline.m4 to current upstream gnulib version that
7083 contains fix for this (commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d).
7084
7085 Reported-By: Beeblebrox <zaphod@berentweb.com>
7086
7087 2015-03-04 Vladimir Serbinenko <phcoder@gmail.com>
7088
7089 syslinux_parse: Fix the case of unknown localboot.
7090 Reported by: Jordan Uggla
7091
7092 configure.ac: Fix the name of pciaccess header.
7093
7094 Fix canonicalize_file_name clash.
7095 canonicalize_file_name clashed with gnulib function. Additionally
7096 it was declared in 2 places: emu/misc.h and util/misc.h. Added
7097 grub_ prefix and removed second declaration.
7098
7099 2015-03-03 Vladimir Serbinenko <phcoder@gmail.com>
7100
7101 Remove emu libusb support.
7102 It's disabled by default and has been broken for a long time.
7103 As nobody is interested in fixing and maintaining it, remove it.
7104
7105 configure.ac: Remove unused COND_clang
7106
7107 Remove libgcc dependency.
7108 libgcc for boot environment isn't always present and compatible.
7109 libgcc is often absent if endianness or bit-size at boot is different
7110 from running OS.
7111 libgcc may use optimised opcodes that aren't available on boot time.
7112 So instead of relying on libgcc shipped with the compiler, supply
7113 the functions in GRUB directly.
7114 Tests are present to ensure that those replacement functions behave the
7115 way compiler expects them to.
7116
7117 types.h: Use __builtin_bswap* with clang.
7118 clang pretends to be GCC 4.2 but we use __builtin_bswap* only with GCC 4.3+.
7119 clang support __builtin_bswap*, so use it.
7120
7121 configure.ac: Set $CPPFLAGS when checking for no_app_regs.
7122 Fixes compilation for sparc64 with clang.
7123
7124 Don't continue to query block-size if disk doesn't have it.
7125 Stops poluting screen with a lot of "block-size: exception -21".
7126
7127 2015-02-28 Andrei Borzenkov <arvidjaar@gmail.com>
7128
7129 grub-probe: free temporary variable
7130
7131 2015-02-28 Vladimir Serbinenko <phcoder@gmail.com>
7132
7133 exclude.pot: Add new technical strings
7134
7135 grub-probe: Mark a "[default=]" for translation.
7136
7137 grub-shell: Add missing --locale-directory.
7138 Fixes the language tests is no make install was done.
7139
7140 ntfs_test: Skip is setfattr is unavailable.
7141
7142 2015-02-26 Vladimir Serbinenko <phcoder@gmail.com>
7143
7144 emu/cache: Change declaration of __clear_cache to match builtin declaration.
7145 Fixes compile of arm64-emu.
7146
7147 arm/dl: Fix handling of nonstandard relocation sizes
7148
7149 gzio: Optimize by removing division.
7150
7151 raid6: Optimize by removing division.
7152
7153 dmraid_nvidia: Fix division by 0 and missing byte-swap.
7154
7155 crypto: restrict cipher block size to power of 2.
7156 All current ciphers have blocks which are power of 2 and it's
7157 unlikely to change. Other block length would be tricky to handle anyway.
7158 This restriction allows avoiding extra divisions.
7159
7160 jpeg: Optimise by replacing division with shifts.
7161
7162 png: Optimize by avoiding divisions.
7163
7164 Add missing lib/division.c
7165
7166 fbblit: Optimize by replacing division with additions and shifts.
7167
7168 bitmap_scale: Optimize by moving division out of the loop.
7169
7170 minilzo: Skip parts tha we don't need.
7171
7172 2015-02-23 Vladimir Serbinenko <phcoder@gmail.com>
7173
7174 mips: Fix soft-float handling.
7175 Add -msoft-float alongside clang arguments to specify ABI.
7176 Specify ABI in asm files explicitly.
7177 This trigers asm warning due to gcc failing to propagate -msoft-float
7178 but it's tolerable.
7179
7180 Add missing grub_ prefix in memcpy invocation
7181
7182 Allow clang compilation for thumb with -mthumb-interwork.
7183 clang already uses -mthumb-interwork behaviour even thout it doesn't
7184 support the option.
7185
7186 arm64: Fix compilation failure.
7187 Don't supply +nosimd to asm files.
7188 Otherwise +nosimd coming from flags forbids some of instructions
7189 used in cache_flush.
7190
7191 Supply signed division to fix ARM compilation.
7192 Previously we supplied only unsigned divisions on platforms that need software
7193 division.
7194 Yet compiler may itself use a signed division. A typical example would be a
7195 difference between 2 pointers which involves division by object size.
7196
7197 2015-02-22 Vladimir Serbinenko <phcoder@gmail.com>
7198
7199 acpi: Fix unused function warning.
7200
7201 configure.ac: Add ia64-specific way to disable floats.
7202
7203 i386/tsc: Fix unused function warning on xen.
7204
7205 2015-02-22 Vladimir Serbinenko <phcoder@gmail.com>
7206
7207 Experimental support for clang for sparc64.
7208 Automatically discover command line options to make clang and
7209 gcc behave in same way.
7210
7211 Tested with qemu.
7212
7213 2015-02-22 Vladimir Serbinenko <phcoder@gmail.com>
7214
7215 Discover which option provides soft-float on configure stage.
7216 Deals with clang needing other arguments to stop issuing floating
7217 instructions than gcc.
7218
7219 2015-02-21 Vladimir Serbinenko <phcoder@gmail.com>
7220
7221 mips: Switch to more portable .org
7222 Binary is unchanged.
7223
7224 sparc64: Switch to more portable .org.
7225 Binaries are unchanged.
7226
7227 kernel-8086: Switch to more portable .org.
7228
7229 Relax requirements on asm for non-BIOS i386 platforms.
7230 These platforms don't have a hard limit on size of resulting code16
7231 code, so we don't care if assembly is bigger than necessarry.
7232
7233 qemu: Switch to more portable .org
7234 Binary is checked identical.
7235
7236 qemu: Fix GateA20 enabling.
7237 GateA20 code was inactive due to address error.
7238
7239 qemu: Fix compilation
7240
7241 Remove realmode.S from coreboot and qemu.
7242 It's not used there.
7243
7244 Remove obsolete ADDR32 and DATA32 checks.
7245
7246 i386: Remove needless ADDR32 prefixes when address is known and fixed.
7247 Shaves off 6 bytes in lzma_decompress.img.
7248
7249 i386-pc/boot: Explicitly mark kernel_address[_high] as local.
7250 Otherwise apple asm might try to make accesses relocatable.
7251
7252 Change dot assignmnet to more portable .org.
7253 Binary is unchanged (verified)
7254
7255 i386: Move from explicit ADDR32/DATA32 prefixes to instruction suffixes.
7256 Is more portable.
7257 Binary is unchanged (verified).
7258
7259 Test which flags make our asm compile.
7260 Previously we relied on assumption that clang always needs -no-integrated-as
7261 but it's not always true.
7262
7263 INSTALL: clarify that clang support is experimental
7264
7265 zfs/mzap_lookup: Fix argument types
7266
7267 wildcard: Mark unused argument as such.
7268
7269 ofdisk: Exclude floppies from scanning.
7270 It causes similar hang as CD on at least the qemu.
7271
7272 configure: Add -msoft-float to CCASFLAGS
7273 Otherwise mismatch between API flags triggers linker failure
7274
7275 mips/startup_raw: Use more portable .asciz
7276
7277 Provide __aeabi_mem{cpy,set}
7278 Fixes ARM compilation
7279
7280 div_test: Don't try to divide by zero
7281
7282 INSTALL: Fix names of host flags to match actual behaviour
7283
7284 Strip .MIPS.abiflags which causes compile failure
7285
7286 2015-02-20 Vladimir Serbinenko <phcoder@gmail.com>
7287
7288 configure: Move adding of include options to the very end to avoid subshell.
7289
7290 configure: Add missing comma.
7291
7292 2015-02-16 Vladimir Serbinenko <phcoder@gmail.com>
7293
7294 ext2: Ignore INCOMPAT_MMP.
7295 It's not really incompatible as long as driver never writes to FS.
7296
7297 ext2: Support META_BG.
7298 This fixes bug that system would become unbootable after ext*
7299 online resize if no resize_inode was created at ext* format time.
7300
7301 2015-02-16 Andrei Borzenkov <arvidjaar@gmail.com>
7302
7303 tests: remove hardcoded paths from syslinux_test
7304 abs_top_srcdir appeared in Autoconf 2.52f. Minimal grub requirement
7305 is 2.60 so we should be good here.
7306
7307 build-sys: add syslinux test files to tarball
7308
7309 2015-02-16 Vladimir Serbinenko <phcoder@gmail.com>
7310
7311 Add test for syslinux converter
7312
7313 2015-02-16 Vladimir Serbinenko <phcoder@gmail.com>
7314
7315 Don't remove initrd= parameter.
7316 Based on simplified patch by Lunar.
7317
7318 Reported by: Lunar
7319
7320 2015-02-16 Vladimir Serbinenko <phcoder@gmail.com>
7321
7322 syslinux_parse: Always output comments even if no entries are found.
7323
7324 2015-02-15 Andrei Borzenkov <arvidjaar@gmail.com>
7325
7326 diskfilter_make_raid: more memory leaks in failure path
7327
7328 2015-02-14 Vladimir Serbinenko <phcoder@gmail.com>
7329
7330 disk/lvm: Use zalloc to ensure that segments are initialised to sane value.
7331 Reported by: EmanueL Czirai.
7332
7333 2015-02-14 Daniel Kiper <daniel.kiper@oracle.com>
7334
7335 multiboot2: Fix information request tag size calculation
7336
7337 2015-02-14 Andrei Borzenkov <arvidjaar@gmail.com>
7338
7339 diskfilter: fix double free of lv names for mdraid
7340 Avoid micro-optimization in grub_diskfilter_make_raid and make sure
7341 name and fullname are independent strings. This avoids need to special
7342 case it everywhere else.
7343
7344 Also fix memory leak in failure case in grub_diskfilter_make_raid.
7345
7346 Closes: 41582
7347
7348 2015-02-14 Andrei Borzenkov <arvidjaar@gmail.com>
7349
7350 diskfilter: fix crash in validate_lv for mdraid arrays
7351 Commit 750f4bacd3262376ced3f837d8dc78f834ca233a put LV validation before
7352 actual vg assignment. Make grub_diskfilter_make_raid to assign ->vg as
7353 happens in other cases for consistency. Also clean up redundant code and add
7354 explicit NULL lv->vg check in validate_lv.
7355
7356 Also fix segment validation in validate_lv; it became obvious when crash
7357 was fixed.
7358
7359 Closes: 44199
7360
7361 2015-02-12 Jiri Slaby <jslaby@suse.cz>
7362
7363 util: mkimage, fix gcc5 build failure
7364 gcc5 reports:
7365 ../util/mkimage.c: In function 'grub_install_get_image_target':
7366 ../util/mkimage.c:954:5: error: loop exit may only be reached after undefined behavior [-Werror=aggressive-loop-optimizations]
7367 && j < ARRAY_SIZE (image_targets[i].names); j++)
7368 ^
7369 ../util/mkimage.c:953:39: note: possible undefined statement is here
7370 for (j = 0; image_targets[i].names[j]
7371 ^
7372
7373 Well, let's move the index 'j' test before accesing the array to:
7374 1) make the loop obvious
7375 2) make gcc happy
7376
7377 2015-02-03 Leif Lindholm <leif.lindholm@linaro.org>
7378
7379 arm: implement additional relocations generated by gcc 4.9 at -O3
7380 GCC 4.9 also generates R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_ABS,
7381 as an alternative to ABS32.
7382
7383 2015-01-30 Andrei Borzenkov <arvidjaar@gmail.com>
7384
7385 setup: fix blocklist size calculation
7386 Found by: Coverity scan.
7387
7388 grub-fstest: fix descriptor leak
7389 Found by: Coverity scan.
7390
7391 2015-01-30 Andrei Borzenkov <arvidjaar@gmail.com>
7392
7393 net/pxe: fix error condition
7394 Test return value of grub_netbuff_reserve(), buf itself cannot be
7395 NULL here.
7396
7397 Found by: Coverity scan.
7398
7399 2015-01-30 Andrei Borzenkov <arvidjaar@gmail.com>
7400
7401 grub-mkimage: fix potential NULL pointer dereference
7402 Move fatal check whether symtab_section is NULL before first reference.
7403
7404 Found by: Coverity scan.
7405
7406 2015-01-30 Andrei Borzenkov <arvidjaar@gmail.com>
7407
7408 net/ip: check result of grub_netbuff_push
7409 Found by: Coverity scan.
7410
7411 tests: add test command file tests
7412 This requires access to files in both host and grub image, so
7413 implementing as separate test unit instead of script test was
7414 more easy.
7415
7416 test: consistently use TMPDIR and same name pattern for temp files
7417
7418 test: fix previous commit - we need to return from subexpression
7419 ( ... ) was processed recursively, we need to return from it. Revert
7420 this change.
7421
7422 test: do not stop after first file test or closing bracket
7423 Closes: 44115
7424
7425 2015-01-28 Leif Lindholm <leif.lindholm@linaro.org>
7426
7427 configure.ac: don't use -msoft-float for arm64
7428 aarch64 toolchains do not support the -msoft-float option added by
7429 commit 3661261f. Insted, for arm64 use -march=armv8-a+nofp+nosimd.
7430
7431 Reported-by: Ryan Harkin <ryan.harkin@linaro.org>
7432
7433 2015-01-28 Andrei Borzenkov <arvidjaar@gmail.com>
7434
7435 script/execute.c: fix memory leak.
7436 Make sure to continue loop over array after failure to free
7437 allocated strings.
7438
7439 Found by: Coverity scan.
7440
7441 2015-01-28 Andrei Borzenkov <arvidjaar@gmail.com>
7442
7443 syslinux_parse: fix memory leak.
7444 Found by: Coverity scan.
7445
7446 2015-01-27 Andrei Borzenkov <arvidjaar@gmail.com>
7447
7448 Change quotes to match overall style in NEWS
7449
7450 loader/xnu: fix memory leak.
7451 Foound by: Coverity scan.
7452
7453 util/grub-probe: fix memory leaks.
7454 Found by: Coverity scan.
7455
7456 fs/hfsplus: fix memory leak.
7457 Found by: Coverity scan.
7458
7459 fs/zfs/zfscrypt.c: fix indentation.
7460
7461 fs/zfs/zfscrypt.c: fix memory leaks.
7462 Found by: Coverity scan.
7463
7464 commands/parttool: fix memory leak.
7465 Found by: Coverity scan.
7466
7467 fs/zfs/zfs.c: fix memory leak.
7468 Found by: Coverity scan.
7469
7470 linux/ofpath: fix descriptor leak
7471 Found by: Coverity scan
7472
7473 linux/hostdisk: use strncpy instead of strlcpy
7474 strlcpy is not available on Linux as part of standard libraries.
7475 It probably is not worth extra configure checks espicially as we
7476 need to handle missing function anyway.
7477
7478 2015-01-27 Vladimir Serbinenko <phcoder@gmail.com>
7479
7480 Document intentional fallthroughs.
7481 Found by: Coverity scan.
7482
7483 linux/ofpath: Fix error handling.
7484 Found by: Coverity Scan.
7485
7486 linux/hostdisk: Limit strcpy size to buffer size.
7487 Found by: Coverity scan.
7488
7489 fs/zfscrypt: Add missing explicit cast.
7490 Found by: Coverity scan.
7491
7492 fs/zfs: Fix error handling.
7493 Found by: Coverity Scan.
7494
7495 2015-01-27 Vladimir Serbinenko <phcoder@gmail.com>
7496
7497 fs/{cbfs,cpio}: Remove useless check if mode is NULL.
7498 Callers already ensure that it's not null.
7499
7500 Found by: Coverity Scan.
7501
7502 2015-01-27 Vladimir Serbinenko <phcoder@gmail.com>
7503
7504 commands/acpi: Use ALIGN_UP rather than manual expression.
7505 Improves readability and hopefully automatic scanning.
7506
7507 Found by: Coverity Scan.
7508
7509 2015-01-26 Andrei Borzenkov <arvidjaar@gmail.com>
7510
7511 util/setup: fix memory leak.
7512 Found by: Coverity scan.
7513
7514 util/mkimage: fix memory leaks.
7515 Found by: Coverity scan.
7516
7517 util/grub-mount: fix descriptor leak.
7518 Found by: Coverity scan.
7519
7520 util/grub-mkstandalone: fix memory leak.
7521 Found by: Coverity scan.
7522
7523 util/grub-install: rearrange code to avoid memory leak.
7524 Found by: Coverity scan.
7525
7526 linux/getroot: fix memory leak.
7527 Found by: Coverity scan.
7528
7529 util/install: fix memory leak.
7530 Found by: Coverity scan.
7531
7532 util/setup: fix memory leak.
7533 Found by: Coverity scan.
7534
7535 linux/ofpath: fix various memory leaks.
7536 Found by: Coverity scan.
7537
7538 linux/getroot: fix descriptor leak.
7539 Found by: Coverity scan.
7540
7541 2015-01-26 Vladimir Serbinenko <phcoder@gmail.com>
7542
7543 util/misc.c: Check ftello return value.
7544 Found by: Coverity scan.
7545
7546 grub-macbless: Fix resource leak.
7547 Found by: Coverity scan.
7548
7549 grub-install: Fix memory leak.
7550 Found by: Coverity scan.
7551
7552 grub-install-common: Fix sizeof usage.
7553 Found by: Coverity scan.
7554
7555 util/getroot: Add missing grub_disk_close.
7556 Found by: Coverity scan.
7557
7558 vbe: Fix incorrect register usage.
7559 Found by: Coverity scan.
7560
7561 unix/password: Fix file descriptor leak.
7562 Found by: Coverity scan.
7563
7564 linux/getroot: Fix error handling.
7565 Found by: Coverity scan.
7566
7567 linux/blocklist: Fix memory leak.
7568 Found by: Coverity scan.
7569
7570 devmapper/getroot: Fix memory leak.
7571 Found by: Coverity scan.
7572
7573 normal/misc: Close device on all pathes.
7574 Found by: Coverity scan.
7575
7576 normal/main: Fix error handling.
7577 Found by: Coverity scan.
7578
7579 xnu: Add missing error check.
7580 Found by: Coveriy scan.
7581
7582 plan9: Add missing grub_device_close.
7583 Found by: Coverity scan.
7584
7585 multiboot: Simplify to avoid confusing assignment.
7586 Found by: Coverity scan.
7587
7588 bsd: Add missing null-pointer check.
7589 Found by: Coverity scan.
7590
7591 lib/syslinux_parse: Add missing error check.
7592 Found by: Coverity scan.
7593
7594 lib/syslinux_parse: Fix memory leak.
7595 Found by: Coveriy scan.
7596
7597 lib/syslinux_parse: Add missing alloc check.
7598 Found by: Coverity scan.
7599
7600 i386/pc/mmap: Fix memset size.
7601 Found by: Coverity scan.
7602
7603 gfxmenu/theme_loader: Add missing allos error check.
7604 Found by: Coverity scan.
7605
7606 gfxmenu/icon_manager: Fix null pointer dereference.
7607 Found by: Coverity scan.
7608
7609 fs/ufs: Add missing error check.
7610 Found by: Coverity scan.
7611
7612 configure.ac: Always add -D_FILE_OFFSET_BITS=64.
7613
7614 2015-01-25 Vladimir Serbinenko <phcoder@gmail.com>
7615
7616 fs/sfs: Fix error check and add sanity check.
7617 Found by: Coverity scan.
7618
7619 fs/reiserfs: Fix sector count overflow.
7620 Found by: Coverity scan.
7621
7622 fs/ntfs: Add sizes sanity checks.
7623 Found by: Coverity scan.
7624
7625 fs/ntfs: Add missing free.
7626 Found by: Coverity scan.
7627
7628 2015-01-25 Vladimir Serbinenko <phcoder@gmail.com>
7629
7630 fs/minix: Fix sector promotion to 64-bit.
7631 While on it make GRUB_MINIX_ZONE2SECT into function.
7632
7633 Found by: Coverity scan
7634
7635 2015-01-25 Vladimir Serbinenko <phcoder@gmail.com>
7636
7637 grub_iso9660_read: Explicitly check read_node return value.
7638 Not really needed as grub_errno is already checked but is nicer.
7639
7640 Found by: Coverity scan.
7641
7642 2015-01-25 Andrei Borzenkov <arvidjaar@gmail.com>
7643
7644 commands/fileXX: Fix remaining memory leak.
7645 Found by: Coverity Scan.
7646
7647 2015-01-25 Vladimir Serbinenko <phcoder@gmail.com>
7648
7649 fs/hfs: Add pointer sanity checks.
7650 Found by: Coverity scan.
7651
7652 fs/hfs/hfs_open: Check that mount succeeded.
7653 Found by: Coverity scan.
7654
7655 fs/fat: Fix codepath to properly free on error.
7656 Found by: Coverity scan.
7657
7658 fs/cpio_common: Add a sanity check on namesize.
7659 Found by: Coverity scan.
7660
7661 fs/cbfs: Add missing free.
7662 Found by: Coverity scan.
7663
7664 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7665
7666 font: Add missing free.
7667 Found by: Coverity Scan.
7668
7669 biosdisk: Add missing cast.
7670 Found by: Coverity scan.
7671
7672 disk/geli: Add missing free.
7673 Found by: Coverity scan.
7674
7675 disk/geli: Add missing seek success check.
7676 Found by: Coverity scan.
7677
7678 disk/diskfilter: Add missing lv presence check.
7679 Found by: Coverity scan.
7680
7681 disk/cryptodisk: Add missing error check.
7682 Found by: Coverity scan.
7683
7684 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7685
7686 disk/ahci: Fix device_map_range argument.
7687 Argument is not used on x86, hence it's gone unnoticed.
7688
7689 Found by: Coverity scan.
7690
7691 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7692
7693 disk/AFsplitter: check argument validity before doing any allocs.
7694 This avoids possible memory leaks.
7695
7696 Found by: Coverity scan.
7697
7698 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7699
7700 commands/wildcard: Add missing free.
7701 Found by: Coverity scan.
7702
7703 commands/verify: Fix sha1 context zeroing-out.
7704 Current code doesn't zero-out context completely. It's a minor issue
7705 really as sha1 init already takes care of initing the context.
7706
7707 commands/tr: Simplify and fix missing parameter test.
7708 Found by: Coverity scan
7709
7710 commands/syslinux: Add missing free.
7711 Found by: Coverity scan.
7712
7713 commands/parttool: Add missing device close.
7714 Found by: Coverity scan.
7715
7716 commands/nativedisk: Add missing device_close.
7717 Found by: Coverity scan.
7718
7719 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7720
7721 commands/macbless: Handle device opening errors correctly.
7722 Wrong variable was checked for errors.
7723
7724 Found by: Coverity scan.
7725
7726 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7727
7728 commands/macbless: Fix potential overflow.
7729 Is a minor concern as no such FS would be created under normal circumstances
7730 and failure was benign.
7731
7732 Found by: Coverity scan.
7733
7734 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7735
7736 commands/macbless: Remove incorrect grub_free.
7737 Found by: Coverity Scan
7738
7739 commands/legacycfg: Fix resource leaks.
7740
7741 zfs: Fix disk-matching logic.
7742 Reported by: Tim Chase <dweeezil>
7743
7744 commands/hdparm: Add missing grub_disk_close.
7745 Found by: Coverity scan.
7746
7747 gptsync: Add missing device_close.
7748 Found by: Coverity scan
7749
7750 commands/fileXX: Fix memory leak.
7751 Found by: Coverity Scan.
7752
7753 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7754
7755 commands/file: Change the confusing loop stop condition.
7756 Old condition was used to zero-out header variable on exit of the loop.
7757 This is correct but confusing. Replace with in-loop logic.
7758
7759 Found by: Coverity Scan.
7760
7761 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7762
7763 commands/acpi: Use ALIGN_UP rather than manual expression.
7764 Improves readability and hopefully automatic scanning.
7765
7766 Found by: Coverity Scan.
7767
7768 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7769
7770 uhci: Fix null pointer dereference.
7771 Found by: Coverity scan.
7772
7773 Always add -msoft-float to avoid compiler generating float arithmetics.
7774
7775 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7776
7777 Generate empty ChangeLog if no .git is available.
7778 When making dist from a git snapshot without repo available make dist would
7779 fail to find ChangeLog. Generate empty ChangeLog if no ChangeLog is already
7780 present and repo is not available.
7781
7782 Reported by: Andrei Borzenkov <arvidjaar@gmail.com>
7783
7784 2015-01-24 Vladimir Serbinenko <phcoder@gmail.com>
7785
7786 Makefile.am: Fix Changelog cutoff address.
7787 gitlog-to-changelog Doesn't generate entries for cutoff day, only
7788 for days after the cutoff date, adjust by one to compensate.
7789
7790 efidisk: Return the determined root disk even if partition is unknown.
7791
7792 util/grub-mkrescue.c: Always include part_msdos and part_gpt on EFI.
7793 When booted from stick, EFI would use GPT partition and our root
7794 device detection algortihm depends on GRUB's ability to see the same
7795 partitions. Hence include msdos and gpt partmap modules on EFI even when
7796 they're not needed to access root filesystem.
7797
7798 conf/Makefile.common: Remove unused {LD,C}FLAGS_CPU.
7799
7800 Autogenerate ChangeLog from git changelog.
7801 Old ChangeLog is moved to ChangeLog-2015. For all changes starting from
7802 this one ChangeLog will be generated from gitlog only on explicit make
7803 invocation and make dist.
7804
7805 2015-01-23 Vladimir Serbinenko <phcoder@gmail.com>
7806
7807 * tests/file_filter/file: Really add missing file.
7808
7809 2015-01-23 Andrei Borzenkov <arvidjaar@gmail.com>
7810
7811 Mention platform "none" in NEWS
7812
7813 2015-01-23 Andrey Borzenkov <arvidjaar@gmail.com>
7814
7815 accept also hdX as alias to native Xen disk name
7816 To be compatible with legacy pv-grub, sort disks by increasing order of handle
7817 value. This allows reusing legacy pv-grub menu.lst which is using hdX names.
7818
7819 Suggested-By: Michael Chang <mchang@suse.com>
7820 Closes: 44026