Skip to content

Commit

Permalink
shim: move the bulk of set_second_stage() to its own file
Browse files Browse the repository at this point in the history
This moves set_second_stage() and some of the helper functions it uses
out of shim.c, so that it's easier to write test cases for.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed Jul 20, 2021
1 parent 59a34a5 commit cda8128
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 422 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CFLAGS += -DENABLE_SHIM_CERT
else
TARGETS += $(MMNAME) $(FBNAME)
endif
OBJS = shim.o mok.o netboot.o cert.o replacements.o tpm.o version.o errlog.o sbat.o sbat_data.o pe.o httpboot.o csv.o
OBJS = shim.o mok.o netboot.o cert.o replacements.o tpm.o version.o errlog.o sbat.o sbat_data.o pe.o httpboot.o csv.o load-options.o
KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key shim.cer
ORIG_SOURCES = shim.c mok.c netboot.c replacements.c tpm.c errlog.c sbat.c pe.c httpboot.c shim.h version.h $(wildcard include/*.h)
MOK_OBJS = MokManager.o PasswordCrypt.o crypt_blowfish.o errlog.o sbat_data.o
Expand Down
20 changes: 20 additions & 0 deletions include/load-options.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* load-options.h - all the stuff we need to parse the load options
*/

#ifndef SHIM_ARGV_H_
#define SHIM_ARGV_H_

EFI_STATUS generate_path_from_image_path(EFI_LOADED_IMAGE *li,
CHAR16 *ImagePath,
CHAR16 **PathName);

EFI_STATUS parse_load_options(EFI_LOADED_IMAGE *li);

extern CHAR16 *second_stage;
extern void *load_options;
extern UINT32 load_options_size;

#endif /* !SHIM_ARGV_H_ */
// vim:fenc=utf-8:tw=75:noet
Loading

0 comments on commit cda8128

Please sign in to comment.