10343 Commits

Author SHA1 Message Date
Glenn Washburn
0cfb9240ae po: Un-transliterate the %zu format code
Commit 45bffae13 (util/resolve: Bail with error if moddep.lst file line is
too long) uses the %zu format specifier which has not been used in
any translated strings yet. So the sed scripts used for transliterating
certain languages need to be updated otherwise creation of the message
indexes will fail on an unknown format code. This is essentially the same
issue fixed for the %m format code in commit 2e246b6f (po: Fix replacement
of %m in sed programs).

Also reorder transliteration lines to be more lexicographically ordered.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 23:05:00 +01:00
Daniel Axtens
e976dc27f8 net: Check against nb->tail in grub_netbuff_pull()
GRUB netbuff structure members track 2 different things: the extent of memory
allocated for the packet, and the extent of memory currently being worked on.

This works out in the structure as follows:

  nb->head: beginning of the allocation
  nb->data: beginning of the working data
  nb->tail: end of the working data
  nb->end:  end of the allocation

The head and end pointers are set in grub_netbuff_alloc() and do not change.
The data and tail pointers are initialised to point at start of the
allocation (that is, head == data == tail initially), and are then
manipulated by grub_netbuff_*() functions. Key functions are as follows:

  - grub_netbuff_put():     "put" more data into the packet - advance nb->tail
  - grub_netbuff_unput():   trim the tail of the packet - retract nb->tail
  - grub_netbuff_pull():    "consume" some packet data - advance nb->data
  - grub_netbuff_reserve(): reserve space for future headers - advance nb->data and nb->tail
  - grub_netbuff_push():    "un-consume" data to allow headers to be written - retract nb->data

Each of those functions does some form of error checking. For example,
grub_netbuff_put() does not allow nb->tail to exceed nb->end, and
grub_netbuff_push() does not allow nb->data to be before nb->head.

However, grub_netbuff_pull()'s error checking is a bit weird. It advances nb->data
and checks that it does not exceed nb->end. That allows you to get into the
situation where nb->data > nb->tail, which should not be.

Make grub_netbuff_pull() check against both nb->tail and nb->end. In theory just
checking against ->tail should be sufficient but the extra check should be
cheap and seems like good defensive practice.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 23:05:00 +01:00
Fabian Vogt
a385f10480 grub-mount: Add support for libfuse3
The libfuse 3.0.0 got released in 2016, with some API changes compared to 2.x.
This commit introduces support for 3.x while keeping it compatible with 2.6
as a fallback still.

To detect fuse3, switch configure over to use pkg-config, which is simpler yet
more reliable than looking for library and header manually. Also set
FUSE_USE_VERSION that way, as it depends on the used libfuse version.

Now that the CFLAGS are read from pkg-config, use just <fuse.h>, which works
with 2.x as well as 3.x and is recommended by libfuse upstream.

One behavior change of libfuse3 is that FUSE_ATOMIC_O_TRUNC is set by default,
which means that open with O_TRUNC is passed as-is instead of calling the
truncate operation. With libfuse2, truncate failed with -ENOSYS and that was
returned to the application. To make O_TRUNC fail with libfuse3, return -EROFS
explicitly if writing was requested.

Signed-off-by: Fabian Vogt <fvogt@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 21:33:35 +01:00
Elyes Haouas
91803b0a1b include: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 16:01:26 +01:00
Elyes Haouas
d07084e50c util: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 16:01:07 +01:00
Elyes Haouas
1f48917d8d video: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 16:00:48 +01:00
Elyes Haouas
955a370ccf tests: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 16:00:27 +01:00
Elyes Haouas
b232f6f66e term: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 16:00:06 +01:00
Elyes Haouas
c1d79dbcc9 script: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:59:45 +01:00
Elyes Haouas
8cd33b300a partmap: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:59:07 +01:00
Elyes Haouas
55e237b57d osdep: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:58:46 +01:00
Elyes Haouas
8ff08468d3 normal: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:58:27 +01:00
Elyes Haouas
e453a4a643 net: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:58:06 +01:00
Elyes Haouas
6a4d9e859e loader: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:47:32 +01:00
Elyes Haouas
98b5065006 lib: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:47:13 +01:00
Elyes Haouas
edd9af9192 kern: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:46:55 +01:00
Elyes Haouas
0d41cc0a29 io: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:46:38 +01:00
Elyes Haouas
a2f71c73b0 gfxmenu: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:46:18 +01:00
Elyes Haouas
509ccd22fb gfxmenu: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:45:59 +01:00
Elyes Haouas
5b077d05b3 fs: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:45:30 +01:00
Elyes Haouas
f1f912f9c1 font: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:45:03 +01:00
Elyes Haouas
b441ca3238 disk: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:44:45 +01:00
Elyes Haouas
51f284f82d commands: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:44:26 +01:00
Elyes Haouas
b3897585dd bus: Remove trailing whitespaces
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-14 15:43:58 +01:00
Chad Kimes
c216df4036 net/ethernet: Fix VLAN networking on little-endian systems
VLAN configuration seems to have never worked on little-endian systems.
This is likely because VLANTAG_IDENTIFIER is not byte-swapped before
copying into the net buffer, nor is inf->vlantag. We can resolve this by
using grub_cpu_to_be16{_compile_time}() and its inverse when copying
VLAN info to/from the net buffer.

Signed-off-by: Chad Kimes <chkimes@github.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 16:03:28 +01:00
Heinrich Schuchardt
8b7a0e262a commands/efi/lsefisystab: Short text EFI_IMAGE_SECURITY_DATABASE_GUID
The EFI_IMAGE_SECURITY_DATABASE_GUID is used for the image execution
information table (cf. UEFI specification 2.9, 32.5.3.1 Using The Image
Execution Information Table).

The lsefisystab command is used to display installed EFI configuration
tables. Currently it only shows the GUID but not a short text for the
table.

Provide a short text for the EFI_IMAGE_SECURITY_DATABASE_GUID.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:48:57 +01:00
Glenn Washburn
0ac14cd776 tests: Fix whitespace formatting
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:48:20 +01:00
Peter Jones
74bf39ca34 ChangeLog: Retire ChangeLog-2015
ChangeLog-2015 has been untouched for over 7 years now, and any
information in it is purely for historical purposes. At the same time,
grepping for code winds up matching this file quite a bit, almost never
accomplishing anything other than cluttering up your grep results. We
don't need this in the main repo, and "git show" will find it if you're
looking at the old history of commits on some file.

This patch deletes it and the Makefile.am rule to distribute it.

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:46:38 +01:00
Peter Levine
000b5cd04f templates: Properly handle multiple initrd paths in 30_os-prober
os-prober now effectively handles multiple paths passed to initrd, but
grub-mkconfig still truncates off any subsequent space-delimited paths.

Support proper parsing of space-delimited initrd paths passed from
os-prober for distributions, like Manjaro, that require it.

Fixes: https://savannah.gnu.org/bugs/?47681

Signed-off-by: Peter Levine <plevine457@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:39:25 +01:00
Samuel Thibault
666c6f8adb templates: Add support for pci-arbiter and rumpdisk on Hurd
This adds pci-arbiter and rumpdisk as bootstrap modules whenever they are
available. This opens the path for fully-userland disk support.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:32:18 +01:00
Glenn Washburn
a4430355a3 mm: Temporarily disable grub_mm_debug while calling grub_vprintf() in grub_printf()
To prevent infinite recursion when grub_mm_debug is on, disable it when
calling grub_vprintf(). One such call loop is:
  grub_vprintf() -> parse_printf_args() -> parse_printf_arg_fmt() ->
    grub_debug_calloc() -> grub_printf() -> grub_vprintf().

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:26:21 +01:00
Glenn Washburn
701295516d mm: Export grub_mm_dump() and grub_mm_dump_free()
These functions may be useful within modules as well. Export them so that
modules can use them.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:14:00 +01:00
Glenn Washburn
563dca1a5e configure: Properly handle MM_DEBUG
Define MM_DEBUG in config.h when --enable-mm-debug is passed to configure.
It was being defined in config-util.h which only gets used when building
GRUB utilities for the host side. The enabling of debugging for memory
management in include/grub/mm.h explicitly does not happen when compiling
for the GRUB utilities. So this debugging code effectively could never be
enabled. Note, that MM_DEBUG is defined in an #if directive because the
enabling of debugging checks if MM_DEBUG is defined, not what its value is.
So even if MM_DEBUG were defined to nothing, the debugging code would
still be enabled.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:11:26 +01:00
Fangrui Song
b16257b51b configure: Replace -Wl,-r,-d with -Wl,-r and add -fno-common
In GNU ld and ld.lld, -d is used with -r to allocate space to COMMON symbols.
This behavior is presumably to work around legacy projects which inspect
relocatable output by themselves and do not handle COMMON symbols. The GRUB
does not do this.

See https://github.com/llvm/llvm-project/issues/53660
-d is quite useless and ld.lld 15.0.0 will make -d no-op.

COMMON symbols have special symbol resolution semantics which can cause surprise
(see https://maskray.me/blog/2022-02-06-all-about-common-symbols). GCC<10 and
Clang<11 defaulted to -fcommon. Just use -fno-common to avoid COMMON symbols.

Signed-off-by: Fangrui Song <maskray@google.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 15:05:22 +01:00
Glenn Washburn
5e10be48e5 tests: Add check-native and check-nonnative make targets
This allows for testing only tests that run directly on the build machine or
only tests that run in a virtualized environment. When testing multiple
targets on the same build machine the native tests only need to be run once
for all targets. Whereas, the nonnative tests must be run for each target
because the test is potentially compiled differently for each target.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 14:24:28 +01:00
Renaud Métrich
68ba54c229 commands/search: Fix bug stopping iteration when --no-floppy is used
When using --no-floppy and a floppy was encountered, iterate_device()
was returning 1, causing the iteration to stop instead of continuing.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 14:21:06 +01:00
Glenn Washburn
be257de00c Revert "iee1275/datetime: Fix off-by-1 error."
This is causing the test grub_cmd_date() to fail because the returned
date is one day more than it should be.

This reverts commit 607d66116 (iee1275/datetime: Fix off-by-1 error.).

Signed-off-by: Glenn Washburn <development@efficientek.com>
Tested-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-03-07 14:18:44 +01:00
Glenn Washburn
a9c2257761 tests: Remove $((BASE#NUM)) bashism in grub-fs-tester
This bashism allows converting NUM in base BASE to decimal. Its not needed
because the only place its used is to convert from hexidecimal and this can
also be done with the more portable $((0xHEXNUM)) syntax.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Glenn Washburn
cdefaf1f58 tests: Skip pata_test on i386-efi
In comparison to other i386 targets, on i386-efi the Q35 QEMU machine type
is used to do the testing to be able to make use of the EFI firmware in
QEMU. On the Q35 machine type there is no way to use ATA to communicate with
an IDE, only AHCI.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Glenn Washburn
199b3ec00c tests: Do not remove image file on error in pata_test
The image file can be useful in debugging an issue when the test fails.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Alec Brown
aeff4a1dc1 util/grub-module-verifierXX: Validate elf section header table index for section name string table
In grub-module-verifierXX.c, the function find_section() uses the value from
grub_target_to_host16 (e->e_shstrndx) to obtain the section header table index
of the section name string table, but it wasn't being checked if the value was
there.

According to the elf(5) manual page,
"If the index of section name string table section is larger than or equal
to SHN_LORESERVE (0xff00), this member holds SHN_XINDEX (0xffff) and the real
index of the section name string table section is held in the sh_link member of
the initial entry in section header table. Otherwise, the sh_link member of the
initial entry in section header table contains the value zero."

Since this check wasn't being made, the function get_shstrndx() is being added
to make this check and use e_shstrndx if it doesn't have SHN_XINDEX as a value,
else use sh_link. We also need to make sure e_shstrndx isn't greater than or
equal to SHN_LORESERVE and sh_link isn't less than SHN_LORESERVE.

Note that it may look as though the argument *arch isn't being used, it's
actually required in order to use the macros grub_target_to_host*(x) which are
unwinded to grub_target_to_host*_real(arch, (x)) based on defines earlier in
the file.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Alec Brown
cdb21e0b9c util/grub-module-verifierXX: Validate number of elf section header table entries
In grub-module-verifierXX.c, grub_target_to_host16 (e->e_shnum) is used to
obtain the number of section header table entries, but it wasn't being
checked if the value was there.

According to the elf(5) manual page,
"If the number of entries in the section header table is larger than or equal
to SHN_LORESERVE (0xff00), e_shnum holds the value zero and the real number of
entries in the section header table is held in the sh_size member of the intial
entry in section header table. Otherwise, the sh_size member of the initial
entry in the section header table holds the value zero."

Since this check wasn't being made, the function get_shnum() is being added to
make this check and use whichever member doesn't have a value of zero. If both
are zero, then we must return an error. We also need to make sure that e_shnum
doesn't have a value greater than or equal to SHN_LORESERVE and sh_size isn't
less than SHN_LORESERVE.

Note that it may look as though the argument *arch isn't being used, it's
actually required in order to use the macros grub_target_to_host*(x) which are
unwinded to grub_target_to_host*_real(arch, (x)) based on defines earlier in
the file.

Fixes: CID 314021
Fixes: CID 314027
Fixes: CID 314033

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Alec Brown
e92633850c util/grub-module-verifierXX: Add function to calculate section headers
Added the function get_shdr() which returns the section header at a given index
parameter passed into this function. This helps traverse the section header
table and reduces repeated calls to lengthy equations used to obtain section
headers.

Note that it may look as though the argument *arch isn't being used, it's
actually required in order to use the macros grub_target_to_host*(x) which are
unwinded to grub_target_to_host*_real(arch, (x)) based on defines earlier in the
file.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Alec Brown
ebf32bc4e9 fs/affs: Fix resource leaks
In commit 178ac5107389 (affs: Fix memory leaks), fixes were made to
grub_affs_iterate_dir() to prevent memory leaks from occurring after it
returns without freeing node. However, there were still some instances
where node was causing a memory leak when the function returns after
calling grub_affs_create_node(). In this function, new memory is
allocated to node but doesn't get freed until the hook() function is
called near the end. Before hook() is called, node should be freed in
grub_affs_create_node() before returning out of it.

Fixes: 178ac5107389 (affs: Fix memory leaks)
Fixes: CID 73759

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:50 +01:00
Heinrich Schuchardt
049efdd72e RISC-V: Adjust -march flags for binutils 2.38
As of version 2.38 binutils defaults to ISA specification version
2019-12-13. This version of the specification has has separated the
the csr read/write (csrr*/csrw*) instructions and the fence.i from
the I extension and put them into separate Zicsr and Zifencei
extensions.

This implies that we have to adjust the -march flag passed to the
compiler accordingly.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00
Heinrich Schuchardt
eb29f2ac9a efi: Correct struct grub_efi_boot_services
The UEFI specification defines that the EFI_BOOT_SERVICES.Exit(() service may return
EFI_SUCCESS or EFI_INVALID_PARAMETER. So it cannot be __attribute__((noreturn)).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00
Glenn Washburn
15f2f328e9 conf/Makefile.common: Order alphabetically variables
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00
Stephen Balousek
ac8a37dda0 net/http: Allow use of non-standard TCP/IP ports
Allow the use of HTTP servers listening on ports other 80. This is done
with an extension to the http notation:

  (http[,server[,port]])

 - or -

  (http[,server[:port]])

Signed-off-by: Stephen Balousek <sbalousek@wickedloop.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00
Glenn Washburn
a0548c140c Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst
Under certain conditions libgrub.pp gets generated with a such that it
contains a bunch of CPP defines, at least one of which contains "@MARKER@".
This line should not be used when generating libgrub_a_init.lst, otherwise
we get compiler errors like:

  libgrub_a_init.c:22:18: error: stray ‘#’ in program
     22 | extern void grub_#define_init (void);
        |                  ^
  libgrub_a_init.c:22:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘define_init’
     22 | extern void grub_#define_init (void);
        |                   ^~~~~~~~~~~
  libgrub_a_init.c:23:18: error: stray ‘#’ in program
     23 | extern void grub_#define_fini (void);
        |                  ^
  libgrub_a_init.c:23:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘define_fini’
     23 | extern void grub_#define_fini (void);
        |                   ^~~~~~~~~~~
  ...

When generating libgrub_a_init.lst only lines starting with "@MARKER@"
are desired.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00
Glenn Washburn
a274bf458d gentpl.py: Fix issue where sometimes marker files have CPP defines
When generating video.lst, modules whose marker file contains the string
VIDEO_LIST_MARKER are selected. But when the marker file contains the CPP
defines, one of the defines is VIDEO_LIST_MARKER and is present in all
marker files, so they are all selected. By removing the defines, the correct
modules are selected.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-02-08 16:06:49 +01:00