Replace signrom with shell script v3
PATCH 1/1 Replace signrom with shell script v3
In order to not execute code we just compiled, let's replace signrom with a shell script that does the same thing while staying compatible to pretty much every system available.
This should make cross-compilation for windows easier.
---
v2 changes:
- make the script work with ash
- calculate file size from header
v3 changes:
- add copyright
--- pc-bios/optionrom/Makefile | 9 ++--- pc-bios/optionrom/signrom.c | 79 ------------------------------------------ pc-bios/optionrom/signrom.sh | 45 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 85 deletions(-) delete mode 100644 pc-bios/optionrom/signrom.c create mode 100755 pc-bios/optionrom/signrom.sh
pc-bios/optionrom/Makefile +3 -6
@@ -37,12 +37,9 @@ build-all: multiboot.bin %.img: %.o $(LD) --oformat binary -Ttext 0 -o $@ $< -%.bin: %.img signrom - ./signrom $< $@ +%.bin: %.img + ./signrom.sh $< $@ cp $@ $(SRC_PATH)/pc-bios/ -signrom: signrom.c - $(CC) -o $@ -g -Wall $^ - clean: - $(RM) *.o *.img *.bin signrom *~ + $(RM) *.o *.img *.bin *~
pc-bios/optionrom/signrom.c deleted +0 -79
79 lines not on this page · raw message
pc-bios/optionrom/signrom.sh new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.6.0.2
Quoted 5 lines · Alexander Graf
In order to not execute code we just compiled, let's replace signrom
with a shell script that does the same thing while staying compatible to pretty much every system available.This should make cross-compilation for windows easier.
Why don't you use $(HOST_CC) to compile the signrom binary?
Quoted 10 lines · Blue Swirl
Quoted 5 lines · Alexander Graf
In order to not execute code we just compiled, let's replace signrom
with a shell script that does the same thing while staying compatible to pretty much every system available.This should make cross-compilation for windows easier.
Why don't you use $(HOST_CC) to compile the signrom binary?
Like with this patch? Fixes Mingw32 compile for me.
From c9acd60a94b403bf591562617e086e9343c78721 Mon Sep 17 00:00:00 2001
From: Blue Swirl <[email protected]>
Date: Thu, 2 Jul 2009 18:05:49 +0000
Subject: [PATCH] Use HOST_CC and HOST_LD (added) to compile signrom
--- configure | 8 +++++++- pc-bios/optionrom/Makefile | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-)
configure +7 -1
@@ -30,6 +30,7 @@ audio_drv_list="" audio_card_list="ac97 es1370 sb16" audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus" host_cc="gcc" +host_ld="ld" ar="ar" make="make" install="install"
@@ -376,6 +377,8 @@ for opt do ;; --host-cc=*) host_cc="$optarg" ;; + --host-ld=*) host_ld="$optarg" + ;; --make=*) make="$optarg" ;; --install=*) install="$optarg"
@@ -600,7 +603,8 @@ echo "Advanced options (experts only):" echo " --source-path=PATH path of source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" echo " --cc=CC use C compiler CC [$cc]" -echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." +echo " --host-cc=CC use C compiler CC [$host_cc] for build time tools" +echo " --host-ld=LD use linker LD [$host_ld] for build time tools" echo " --extra-cflags=CFLAGS add C compiler flags CFLAGS" echo " --extra-ldflags=LDFLAGS add linker flags LDFLAGS" echo " --make=MAKE use specified make [$make]"
@@ -1400,6 +1404,7 @@ fi echo "Source path $source_path" echo "C compiler $cc" echo "Host C compiler $host_cc" +echo "Host linker $host_ld" echo "ARCH_CFLAGS $ARCH_CFLAGS" echo "make $make" echo "install $install"
@@ -1486,6 +1491,7 @@ echo "INSTALL_DATA=$install -m0644 -p" >> $config_mak echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak echo "CC=$cc" >> $config_mak echo "HOST_CC=$host_cc" >> $config_mak +echo "HOST_LD=$host_ld" >> $config_mak echo "AR=$ar" >> $config_mak # XXX: only use CFLAGS and LDFLAGS ? # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
pc-bios/optionrom/Makefile +3 -3
@@ -32,17 +32,17 @@ endif build-all: multiboot.bin %.o: %.S - $(CC) $(CFLAGS) -o $@ -c $< + $(HOST_CC) $(CFLAGS) -o $@ -c $< %.img: %.o - $(LD) --oformat binary -Ttext 0 -o $@ $< + $(HOST_LD) --oformat binary -Ttext 0 -o $@ $< %.bin: %.img signrom ./signrom $< $@ cp $@ $(SRC_PATH)/pc-bios/ signrom: signrom.c - $(CC) -o $@ -g -Wall $^ + $(HOST_CC) -o $@ -g -Wall $^ clean: $(RM) *.o *.img *.bin signrom *~
Signature · 1 line
1.5.6.5
Quoted 7 lines · Blue Swirl
Quoted 5 lines · Blue Swirl
Quoted 4 lines · Alexander Graf
In order to not execute code we just compiled, let's replace signrom
with a shell script that does the same thing while staying compatible to pretty much every system available.
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
This should make cross-compilation for windows easier.
Why don't you use $(HOST_CC) to compile the signrom binary?
Like with this patch? Fixes Mingw32 compile for me.
If you're cross compiling, HOST_CC is the wrong compiler to use for the ROM build. For instance, if you were on a PPC host building an i386 QEMU package.
Building signrom with HOST_CC may be reasonable.
Regards,
Anthony Liguori
Quoted 17 lines · Anthony Liguori
Quoted 16 lines · Blue Swirl
Quoted 13 lines · Blue Swirl
Quoted 1 line · Alexander Graf
In order to not execute code we just compiled, let's replace
signrom
Quoted 1 line
with a shell script that does the same thing while staying
compatible
Quoted 3 lines
to pretty much every system available.
This should make cross-compilation for windows easier.
Why don't you use $(HOST_CC) to compile the signrom binary?
Quoted 6 lines
Quoted 2 lines
Like with this patch? Fixes Mingw32 compile for me.
If you're cross compiling,
HOST_CCis the wrong compiler to use for the ROM build. For instance, if you were on a PPC host building an i386 QEMU package.Building signrom with
HOST_CCmay be reasonable.
I'm rather indifferent either way. Shell should work pretty much everywhere and it's not really much / highly complex code.
It's also not exactly code I'd want to spend more time on than necessary, so if you feel like doing this in C with HOST_CC is better, feel free to do so.
Whatever works is fine with me.
Alex