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>
This commit is contained in:
parent
66e346cad3
commit
0fcdfcd7cb
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue