Files
meta-tegra/recipes-security/optee/optee-nvsamples/0001-Update-makefiles-for-OE-builds.patch
Khem Raj 4d6e2ffb75 recipes: Add missing Patch-Status
Its now mandatory field to have in patch header with latest oe-core [1]

[1] https://git.openembedded.org/openembedded-core/commit/?id=b7fb91c797ab37a029b8dd1eb7277a7468bc97ed

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-06-13 04:24:22 -07:00

220 lines
6.7 KiB
Diff

From 8ccc1b1b9158f7c25d1f4705c8a2cca785f21e0b Mon Sep 17 00:00:00 2001
From: Ilies CHERGUI <ichergui@nvidia.com>
Date: Thu, 29 Feb 2024 11:19:48 +0000
Subject: [PATCH] Update makefiles for OE builds
- Remove the OPTEE_CLIENT_EXPORT references
- Use install instead of cp to install host programs
- Add LDFLAGS to nvhwkey-app build
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ilies CHERGUI <ichergui@nvidia.com>
---
Makefile | 4 ----
cpubl-payload-dec/Makefile | 2 --
ftpm-helper/Makefile | 4 ----
ftpm-helper/host/Makefile | 16 ++++++----------
hwkey-agent/Makefile | 4 ----
hwkey-agent/host/Makefile | 15 ++++++---------
luks-srv/Makefile | 4 ----
luks-srv/host/Makefile | 14 +++++---------
8 files changed, 17 insertions(+), 46 deletions(-)
Index: samples/Makefile
===================================================================
--- samples.orig/Makefile
+++ samples/Makefile
@@ -4,8 +4,6 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
# TA_DEV_KIT_DIR: The base directory of the TA-devkit.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
SAMPLE_APPS_LIST := $(subst /,,$(dir $(wildcard */Makefile)))
@@ -21,7 +19,6 @@ sample_apps:
$(MAKE) -C $$apps \
CROSS_COMPILE=$(CROSS_COMPILE) \
TA_DEV_KIT_DIR=$(TA_DEV_KIT_DIR) \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O) || exit 1; \
done
@@ -29,7 +26,6 @@ clean-apps:
@for apps in $(SAMPLE_APPS_LIST); do \
$(MAKE) -C $$apps \
TA_DEV_KIT_DIR=$(TA_DEV_KIT_DIR) \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O) \
clean || exit 1; \
done
Index: samples/cpubl-payload-dec/Makefile
===================================================================
--- samples.orig/cpubl-payload-dec/Makefile
+++ samples/cpubl-payload-dec/Makefile
@@ -4,8 +4,6 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
# TA_DEV_KIT_DIR: The base directory of the TA-devkit.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
TARGET_DIR := $(notdir $(shell pwd))
Index: samples/hwkey-agent/Makefile
===================================================================
--- samples.orig/hwkey-agent/Makefile
+++ samples/hwkey-agent/Makefile
@@ -4,8 +4,6 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
# TA_DEV_KIT_DIR: The base directory of the TA-devkit.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
TARGET_DIR := $(notdir $(shell pwd))
@@ -18,7 +16,6 @@ all:
O=$(O)/ta/$(TARGET_DIR)
$(MAKE) -C host \
CROSS_COMPILE=$(CROSS_COMPILE) \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O)/ca/$(TARGET_DIR) \
--no-builtin-variables
@@ -29,7 +26,6 @@ clean:
O=$(O)/ta/$(TARGET_DIR) \
clean
$(MAKE) -C host \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O)/ca/$(TARGET_DIR) \
clean
rm -rf $(O)/ca/$(TARGET_DIR)
Index: samples/hwkey-agent/host/Makefile
===================================================================
--- samples.orig/hwkey-agent/host/Makefile
+++ samples/hwkey-agent/host/Makefile
@@ -3,35 +3,32 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
CC ?= $(CROSS_COMPILE)gcc
CFLAGS += -Wall -I../ta/include -I./include
-CFLAGS += -I$(OPTEE_CLIENT_EXPORT)/include
CFLAGS += -fstack-protector-strong
-LDADD += -lteec -L$(OPTEE_CLIENT_EXPORT)/lib
+LDADD += -lteec
SRCS = hwkey_agent_ca.c
OBJS = $(patsubst %.c,$(O)/%.o,$(SRCS))
BINARY = nvhwkey-app
.PHONY: all install
-all: $(BINARY) install
+all: $(BINARY)
$(BINARY): $(OBJS)
- $(CC) -o $(O)/$@ $< $(LDADD)
+ $(CC) $(LDFLAGS) -o $(O)/$@ $< $(LDADD)
$(O)/%.o: %.c
mkdir -p $(O)
$(CC) $(CFLAGS) -c $< -o $@
install: $(BINARY)
- mkdir -p $(OPTEE_CLIENT_EXPORT)/sbin
- cp $(O)/$(BINARY) $(OPTEE_CLIENT_EXPORT)/sbin
+ install -d $(DESTDIR)$(sbindir)
+ install -m 0755 $(O)/$(BINARY) $(DESTDIR)$(sbindir)/
.PHONY: clean
clean:
- rm -f $(OBJS) $(O)/$(BINARY) $(OPTEE_CLIENT_EXPORT)/sbin/$(BINARY)
+ rm -f $(OBJS) $(O)/$(BINARY)
Index: samples/luks-srv/Makefile
===================================================================
--- samples.orig/luks-srv/Makefile
+++ samples/luks-srv/Makefile
@@ -4,8 +4,6 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
# TA_DEV_KIT_DIR: The base directory of the TA-devkit.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
TARGET_DIR := $(notdir $(shell pwd))
@@ -18,7 +16,6 @@ all: early_ta_dir
O=$(O)/early_ta/$(TARGET_DIR)
$(MAKE) -C host \
CROSS_COMPILE=$(CROSS_COMPILE) \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O)/ca/$(TARGET_DIR) \
--no-builtin-variables
@@ -32,7 +29,6 @@ clean:
O=$(O)/early_ta/$(TARGET_DIR) \
clean
$(MAKE) -C host \
- OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \
O=$(O)/ca/$(TARGET_DIR) \
clean
rm -rf $(O)/early_ta/$(TARGET_DIR)
Index: samples/luks-srv/host/Makefile
===================================================================
--- samples.orig/luks-srv/host/Makefile
+++ samples/luks-srv/host/Makefile
@@ -3,8 +3,6 @@
# Input variables
# CROSS_COMPILE: The cross compiler.
-# OPTEE_CLIENT_EXPORT: The base directory points to optee client's
-# header files and libraries
# O: The base directory for build objects filetree.
CC ?= $(CROSS_COMPILE)gcc
@@ -12,10 +10,9 @@ LD ?= $(CROSS_COMPILE)ld
STRIP ?= $(CROSS_COMPILE)strip
CFLAGS += -Wall -I../ta/include -I./include
-CFLAGS += -I$(OPTEE_CLIENT_EXPORT)/include
CFLAGS += -fstack-protector-strong
LDADD += -pthread -lpthread
-LDADD += -lteec -L$(OPTEE_CLIENT_EXPORT)/lib
+LDADD += -lteec
LDFLAGS := -static
SRCS = luks_srv_ca.c
@@ -23,20 +20,19 @@ OBJS = $(patsubst %.c,$(O)/%.o,$(SRCS))
BINARY = nvluks-srv-app
.PHONY: all install
-all: $(BINARY) install
+all: $(BINARY)
$(BINARY): $(OBJS)
$(CC) $(LDFLAGS) -o $(O)/$@ $< $(LDADD)
- $(STRIP) $(O)/$@
$(O)/%.o: %.c
mkdir -p $(O)
$(CC) $(CFLAGS) -c $< -o $@
install: $(BINARY)
- mkdir -p $(OPTEE_CLIENT_EXPORT)/sbin
- cp $(O)/$(BINARY) $(OPTEE_CLIENT_EXPORT)/sbin
+ install -d $(DESTDIR)$(sbindir)
+ install -m 0755 $(O)/$(BINARY) $(DESTDIR)$(sbindir)/
.PHONY: clean
clean:
- rm -f $(OBJS) $(O)/$(BINARY) $(OPTEE_CLIENT_EXPORT)/sbin/$(BINARY)
+ rm -f $(OBJS) $(O)/$(BINARY)