diff options
author | Felix Singer <felixsinger@posteo.net> | 2023-11-04 01:39:44 +0000 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2023-11-06 02:58:33 +0000 |
commit | 0fcdfcd7cb0f0af1d510a87ab22a8facaf9835b4 (patch) | |
tree | 11e6d08b5174a136f5151cf429c8a38e34999972 /payloads | |
parent | 66e346cad3d07aac928057bc8e7ab601871131de (diff) |
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 <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78924
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/external/iPXE/Makefile | 16 |
1 files changed, 6 insertions, 10 deletions
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) |