[coreboot] [PATCH] Use a tag for SeaBIOS stable checkouts.

Peter Stuge peter at stuge.se
Mon Jan 24 00:35:05 CET 2011

Stefan Reinauer wrote:
> Not sure what the right fix is for this.

We'll find one, but need to decide on how to handle the situation
where there have been changes made in the repo. Both commited ones
and uncommitted ones (like what make patch currently produces).

> I neither want to check the changes I make to the config file in to
> the local repository

Can we please not use perl for this? sed can do it just fine.

Can I ask why you don't want to create a commit for the changes?

> nor do I want to undo/redo the changes for every build,

Well, but every build can (outside abuild) switch to a different
branch. And we need to handle that. (Ie. a user first building with
master, then building with stable.)

> nor do I want to re-checkout for every target.

Why not? Note we are talking git checkout now, not git clone.

> Is this possible with git?

Yes, it can do whatever we decide on, but so far we haven't really
considered all cases, so what we have right now doesn't work.

Kevin O'Connor wrote:
> The following makes it less of a problem for me, but I'm not sure it's
> the right way either.
> +++ b/payloads/external/SeaBIOS/Makefile.inc
> +TAG-$(CONFIG_SEABIOS_MASTER)=origin/master
>  checkout:
>         echo "Checking out SeaBIOS $(TAG-y)"
> -       test -d seabios && ( cd seabios; git pull ) || \
> +       test -d seabios && ( cd seabios; git fetch ) || \

I agree that git fetch should be here, certainly not git pull.

But we need to consider what we want to happen if someone has made
local changes in this repository. And we also need to consider *our*
local changes that are done in this repository. The fact that they
are not so easily distinguishable is a problem.

> -       cd seabios; git checkout $(TAG-y)
> +       cd seabios; git checkout -m $(TAG-y)

I don't really like trying to do a merge of local changes here. It
will quickly conflict with later development from upstream.

We need to weigh two objectives against each other:

1. someone has local changes in payloads/external/SeaBIOS/seabios
that we don't want to erase

2. we want make to use the particular version of SeaBIOS specified
by the user or by abuild during config

> The best way is probably to never checkout a branch - only ever pull
> a tag.  Then the build can detect if the tag ever changes and reapply
> the patch.

I think merging is always the wrong thing to do, because it will make
a mess of the repo and what the user has configured is exclusively
one of the tags we offer, so that is what they should always get.

What I'm saying is that I think objective 2. above takes priority
over objective 1. and then we can not really have local changes in
the seabios repo. That means *any* local changes, theirs or ours.

The .patched thingy is sorta an ugly trick too. As I see it, what we
want is to build a certain way, without having to change any files,
so I think we should pass CONFIG_ on the command line. Patches

-------------- next part --------------
>From be44530690aabfe4c66351f842bf073e2728ce02 Mon Sep 17 00:00:00 2001
From: Peter Stuge <peter at stuge.se>
Date: Mon, 24 Jan 2011 00:15:18 +0100
Subject: [PATCH 1/2] Allow initial COMMONCFLAGS to be set from the make command line

 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 384bf79..ccdf96a 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
               /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
 # Default compiler flags
-COMMONCFLAGS = -Os -MD -Wall -Wno-strict-aliasing -Wold-style-definition \
+COMMONCFLAGS += -Os -MD -Wall -Wno-strict-aliasing -Wold-style-definition \
                $(call cc-option,$(CC),-Wtype-limits,) \
                -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
                -mrtd -minline-all-stringops \

-------------- next part --------------
>From 36623f4be0a33f4ff72f69f6869da4a2e0695bc2 Mon Sep 17 00:00:00 2001
From: Peter Stuge <peter at stuge.se>
Date: Mon, 24 Jan 2011 00:20:18 +0100

This allows the coreboot build system control over these parameters
without having to modify src/config.h.
 src/config.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/config.h b/src/config.h
index db3e578..f0cba10 100644
--- a/src/config.h
+++ b/src/config.h
@@ -13,12 +13,18 @@
 // Configure as a coreboot payload.
 // Control how verbose debug output is.
 // Send debugging information to serial port
 // Screen writes are also sent to debug ports.
@@ -120,7 +126,9 @@
 // Support generation of ACPI tables (for emulators)
 #define CONFIG_ACPI 1
 // Support bios callbacks specific to via vgabios.
 // Support S3 resume handler.
 #define CONFIG_S3_RESUME 1
 // Run the vga rom during S3 resume.

-------------- next part --------------
Index: payloads/external/SeaBIOS/Makefile.inc
--- payloads/external/SeaBIOS/Makefile.inc	(revision 6292)
+++ payloads/external/SeaBIOS/Makefile.inc	(working copy)
@@ -5,20 +5,12 @@
 all: seabios
-seabios: patch
-	cd seabios; $(MAKE) CC="$(CC)" LD="$(LD)"
+seabios: checkout
-patch: checkout
-	test -r seabios/.patched || \
-	perl -pi -e "s,#define CONFIG_COREBOOT 0,#define CONFIG_COREBOOT 1,;" \
-		 -e "s,#define CONFIG_DEBUG_SERIAL 0,#define CONFIG_DEBUG_SERIAL 1,;" \
-		 -e "s,#define CONFIG_VGAHOOKS 0,#define CONFIG_VGAHOOKS 1,;" \
-		 seabios/src/config.h
-	touch seabios/.patched
 	echo "Checking out SeaBIOS $(TAG-y)"
-	test -d seabios && ( cd seabios; git pull ) || \
+	test -d seabios && ( cd seabios; git fetch ) || \
 	git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios
 	cd seabios; git checkout $(TAG-y)
@@ -28,4 +20,4 @@
 	rm -rf seabios
-.PHONY: seabios
+.PHONY: seabios checkout clean distclean

More information about the coreboot mailing list