address review feedback

pull/700/head
Brett Nicholas 2026-03-03 11:45:39 -07:00 committed by Daniele Lacamera
parent 2924646695
commit 3d5499f90a
3 changed files with 20 additions and 4 deletions

View File

@ -51,7 +51,7 @@ wolfBoot_panic() (called on any fatal error)
## Build Configuration
First, Enable hooks in your `.config`
First, enable hooks in your `.config`:
```makefile
# Path to a single .c file containing your hook implementations

View File

@ -28,6 +28,10 @@
#ifndef WOLFBOOT_HOOKS_H
#define WOLFBOOT_HOOKS_H
#ifdef __cplusplus
extern "C" {
#endif
struct wolfBoot_image;
#ifdef WOLFBOOT_HOOK_LOADER_PREINIT
@ -46,4 +50,8 @@ void wolfBoot_hook_boot(struct wolfBoot_image *boot_img);
void wolfBoot_hook_panic(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* WOLFBOOT_HOOKS_H */

View File

@ -1154,20 +1154,28 @@ endif
# wolfBoot hooks framework
# WOLFBOOT_HOOKS_FILE: path to a single .c file containing hook definitions
ifneq ($(WOLFBOOT_HOOKS_FILE),)
OBJS += $(patsubst %.c,%.o,$(WOLFBOOT_HOOKS_FILE))
endif
WOLFBOOT_HOOKS_ENABLED :=
ifeq ($(WOLFBOOT_HOOK_LOADER_PREINIT),1)
CFLAGS += -DWOLFBOOT_HOOK_LOADER_PREINIT
WOLFBOOT_HOOKS_ENABLED := 1
endif
ifeq ($(WOLFBOOT_HOOK_LOADER_POSTINIT),1)
CFLAGS += -DWOLFBOOT_HOOK_LOADER_POSTINIT
WOLFBOOT_HOOKS_ENABLED := 1
endif
ifeq ($(WOLFBOOT_HOOK_BOOT),1)
CFLAGS += -DWOLFBOOT_HOOK_BOOT
WOLFBOOT_HOOKS_ENABLED := 1
endif
ifeq ($(WOLFBOOT_HOOK_PANIC),1)
CFLAGS += -DWOLFBOOT_HOOK_PANIC
WOLFBOOT_HOOKS_ENABLED := 1
endif
ifneq ($(WOLFBOOT_HOOKS_ENABLED),)
ifeq ($(WOLFBOOT_HOOKS_FILE),)
$(error WOLFBOOT_HOOKS_FILE must be set to a .c file when hooks are enabled)
endif
OBJS += $(patsubst %.c,%.o,$(WOLFBOOT_HOOKS_FILE))
endif
# Cert chain verification options