[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)=master
> +TAG-$(CONFIG_SEABIOS_MASTER)=origin/master
>  TAG-$(CONFIG_SEABIOS_STABLE)=rel-0.6.1.3
..
>  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
attached.


//Peter
-------------- 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 \
-- 
1.7.2

-------------- 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
Subject: [PATCH 2/2] Allow override of CONFIG_COREBOOT CONFIG_DEBUG_SERIAL CONFIG_VGAHOOKS

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 @@
 #define CONFIG_APPNAME4 "BXPC"
 
 // Configure as a coreboot payload.
+#ifndef CONFIG_COREBOOT
 #define CONFIG_COREBOOT 0
+#endif
 
 // Control how verbose debug output is.
+#ifndef CONFIG_DEBUG_LEVEL
 #define CONFIG_DEBUG_LEVEL 1
+#endif
 // Send debugging information to serial port
+#ifndef CONFIG_DEBUG_SERIAL
 #define CONFIG_DEBUG_SERIAL 0
+#endif
 // Screen writes are also sent to debug ports.
 #define CONFIG_SCREEN_AND_DEBUG 1
 
@@ -120,7 +126,9 @@
 // Support generation of ACPI tables (for emulators)
 #define CONFIG_ACPI 1
 // Support bios callbacks specific to via vgabios.
+#ifndef CONFIG_VGAHOOKS
 #define CONFIG_VGAHOOKS 0
+#endif
 // Support S3 resume handler.
 #define CONFIG_S3_RESUME 1
 // Run the vga rom during S3 resume.
-- 
1.7.2

-------------- 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
+	cd seabios; $(MAKE) CC="$(CC)" LD="$(LD)" COMMONCFLAGS="-DCONFIG_COREBOOT=1 -DCONFIG_DEBUG_SERIAL=1 -DCONFIG_VGAHOOKS=1"
 
-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
-
 checkout:
 	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 @@
 distclean:
 	rm -rf seabios
 
-.PHONY: seabios
+.PHONY: seabios checkout clean distclean


More information about the coreboot mailing list