From 0fcdfcd7cb0f0af1d510a87ab22a8facaf9835b4 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Sat, 4 Nov 2023 01:39:44 +0000 Subject: payloads/ipxe/Makefile: Use sed more properly Instead of redirecting the output of sed into a temporary file and copying it to its target then, just tell sed to do the replacements in-place and don't let it create a backup of the original file. The overhead is not needed. Change-Id: I442616cd78098b653af5bd49bc7a4f021c99e081 Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/78924 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- payloads/external/iPXE/Makefile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'payloads/external/iPXE') diff --git a/payloads/external/iPXE/Makefile b/payloads/external/iPXE/Makefile index b6aa1b63ef..773a1a2005 100644 --- a/payloads/external/iPXE/Makefile +++ b/payloads/external/iPXE/Makefile @@ -36,25 +36,21 @@ config: checkout ifeq ($(CONSOLE_SERIAL),yy) cp "$(project_dir)/src/config/console.h" "$(project_dir)/src/config/console.h.cb" cp "$(project_dir)/src/config/serial.h" "$(project_dir)/src/config/serial.h.cb" - sed 's|//#define\s*CONSOLE_SERIAL.*|#define CONSOLE_SERIAL|' "$(project_dir)/src/config/console.h" > "$(project_dir)/src/config/console.h.tmp" - mv "$(project_dir)/src/config/console.h.tmp" "$(project_dir)/src/config/console.h" - sed 's|#define\s*COMCONSOLE.*|#define COMCONSOLE $(IPXE_UART)|' "$(project_dir)/src/config/serial.h" > "$(project_dir)/src/config/serial.h.tmp" - sed 's|#define\s*COMSPEED.*|#define COMSPEED $(CONFIG_TTYS0_BAUD)|' "$(project_dir)/src/config/serial.h.tmp" > "$(project_dir)/src/config/serial.h" + sed -i'' 's|//#define\s*CONSOLE_SERIAL.*|#define CONSOLE_SERIAL|' "$(project_dir)/src/config/console.h" + sed -i'' 's|#define\s*COMCONSOLE.*|#define COMCONSOLE $(IPXE_UART)|' "$(project_dir)/src/config/serial.h" + sed -i'' 's|#define\s*COMSPEED.*|#define COMSPEED $(CONFIG_TTYS0_BAUD)|' "$(project_dir)/src/config/serial.h" endif ifneq ($(filter y,$(CONFIG_HAS_SCRIPT) $(CONFIG_PXE_NO_PROMPT)),) cp "$(project_dir)/src/config/general.h" "$(project_dir)/src/config/general.h.cb" endif ifeq ($(CONFIG_HAS_SCRIPT),y) - sed 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp" - mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h" + sed -i'' 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "$(project_dir)/src/config/general.h" endif ifeq ($(CONFIG_PXE_NO_PROMPT),y) - sed 's|#define\s*BANNER_TIMEOUT.*|#define BANNER_TIMEOUT 0|' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp" - mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h" + sed -i'' 's|#define\s*BANNER_TIMEOUT.*|#define BANNER_TIMEOUT 0|' "$(project_dir)/src/config/general.h" endif ifeq ($(CONFIG_PXE_HAS_HTTPS),y) - sed 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp" - mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h" + sed -i'' 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "$(project_dir)/src/config/general.h" endif build: config $(CONFIG_SCRIPT) -- cgit v1.2.3