To close the loop on this--
We had a discussion off-line today and decided that since we're
contributing code to a third-party project which is not necessarily part of
Chromium OS we should assign copyright to "Google Inc." rather than "The
Chromium OS Authors." This coincides with the typical process Google
employees use for releasing open-source code.
A lot of confusion seems to stem from using "The Chromium OS Authors" when
checking code into a repository hosted on chromium.org, which is our
standard procedure. I've added a pre-submit check for developers working on
Chrome/Chromium OS so that developers on our use the correct copyright line
for files in our repository before sending patches upstream:
https://gerrit.chromium.org/gerrit/#/c/42569/ .
On Thu, Jan 31, 2013 at 8:48 PM, ron minnich <rminnich(a)gmail.com> wrote:
> On Thu, Jan 31, 2013 at 6:09 PM, Hung-Te Lin <hungte(a)chromium.org> wrote:
>
> > For same reason, for new commits we can be more careful to use latest
> > correct copyright string, but it seems no harm to keep old files as-is.
> What
> > do you think?
>
> don't change old strings.
>
> thanks
>
> ron
>
> --
> coreboot mailing list: coreboot(a)coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
>
--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2247
-gerrit
commit 7b6ad2cebc6a5403b9b0400281f03d8157ab2da3
Author: Zheng Bao <fishbaozi(a)gmail.com>
Date: Tue Feb 5 10:51:53 2013 +0800
crossgcc: Save the script itself when cross build is over.
In case that the new toolchains don't work well, we can trace back
and reproduce the old tools by checking the xgcc folder. It is useful
when my team members need to get my old toolchains on their host
machines.
Change-Id: I54e4bc6afcfbbf622165af6eae27bbb6efc2e8cc
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: zbao <fishbaozi(a)gmail.com>
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/crossgcc/buildgcc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index c69e7cd..24357e9 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -595,6 +595,8 @@ test -r $IASL_DIR/generate/unix/.failed && printf "${RED}failed${NC}\n" || \
test -r $IASL_DIR/generate/unix/.failed && exit 1
fi
+cp `pwd`/$0 $DESTDIR$TARGETDIR/$0.commit.`git describe`
+
if [ $SAVETEMPS -eq 0 ]; then
printf "Cleaning up... "
rm -rf ${GMP_DIR} build-gmp
the following patch was just integrated into master:
commit ed08bcc12dddfd65edb38353530fec5fae17258d
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Feb 4 19:15:06 2013 +0100
Hook up corebootPkg as Tianocore payload
This unplugs Stefan's PIANO project.
Change Tianocore payload configuration to use corebootPkg.
As argument you have to give it the COREBOOT.FD generated by
the Tianocore build system.
It automatically determines base address and entry point.
Compression setting is honored (ie. no compression if you don't
want), but corebootPkg currently assumes that coreboot is doing
it. Loading a 6MB payload into CBFS without compression will fail
more often than not.
Change-Id: If9c64c9adb4a846a677c8af40f149ce697059ee6
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/2280
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 4 19:28:52 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 4 22:53:57 2013, giving +2
See http://review.coreboot.org/2280 for details.
-gerrit
the following patch was just integrated into master:
commit f04e68e9e2a651b5db4d769d20d78d807426f109
Author: Steven Sherk <steven.sherk(a)se-eng.com>
Date: Wed Jan 30 16:02:14 2013 -0700
Add MMCONF resource to AMD fam15 PCI_DOMAIN
This is a port of the following:
commit d5c998be99709c92f200b3b08aed2ca3fee2d519
The coreboot resource allocator doesn't respect resources
claimed in the APIC_CLUSTER. Move the MMCONF resource to the
PCI_DOMAIN to prevent overlap with PCI devices.
original-Change-Id: I8541795f69bbdd9041b390103fb901d37e07eeb9
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
URL - http://review.coreboot.org/#/c/2167/
Change-Id: I6e585d5cf0d46bd58337a6801fb0690ab2dd000c
Signed-off-by: Steven Sherk <steven.sherk(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/2248
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303(a)gmail.com>
Build-Tested: build bot (Jenkins) at Mon Feb 4 18:54:08 2013, giving +1
Reviewed-By: Marc Jones <marcj303(a)gmail.com> at Mon Feb 4 23:59:41 2013, giving +2
See http://review.coreboot.org/2248 for details.
-gerrit
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2194
-gerrit
commit 9e64ffdcdc818dbbf3894fed0e75c2b47ff4a93e
Author: Hung-Te Lin <hungte(a)chromium.org>
Date: Tue Jan 29 01:56:17 2013 +0800
cbfstool: Add cbfs_image new CBFS image manipulation API.
Current cbfstool implementation is relying on global variables to pass processed
data, and the calculation of address is based on x86 architecture (ex, always
assuming 0x0000 as invalid address), not easy to be used on platforms without
top-aligned memory mapping. This CL is a first step to start a new cbfstool
without global variables, and to prevent assuming memory layout in x86 mode.
The first published APIs are for reading and writing existing CBFS ROM image
files (and to find file entries in a ROM file).
Read cbfs_image.h for detail usage of each API function.
Change-Id: I28c737c8f290e51332119188248ac9e28042024c
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
util/cbfstool/Makefile | 2 +-
util/cbfstool/Makefile.inc | 1 +
util/cbfstool/cbfs.h | 2 +
util/cbfstool/cbfs_image.c | 128 +++++++++++++++++++++++++++++++++++++++++++++
util/cbfstool/cbfs_image.h | 65 +++++++++++++++++++++++
5 files changed, 197 insertions(+), 1 deletion(-)
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index 17b00a7..3ace744 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -7,7 +7,7 @@ CFLAGS += -D_7ZIP_ST
BINARY:=$(obj)/cbfstool
-COMMON:=cbfstool.o common.o compress.o
+COMMON:=cbfstool.o common.o cbfs_image.o compress.o
COMMON+=cbfs-mkstage.o cbfs-mkpayload.o
# LZMA
COMMON+=lzma/lzma.o
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
index 5795507..2cee794 100644
--- a/util/cbfstool/Makefile.inc
+++ b/util/cbfstool/Makefile.inc
@@ -2,6 +2,7 @@ cbfsobj :=
cbfsobj += cbfstool.o
cbfsobj += common.o
cbfsobj += compress.o
+cbfsobj += cbfs_image.o
cbfsobj += cbfs-mkstage.o
cbfsobj += cbfs-mkpayload.o
# LZMA
diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h
index 3dbeefd..4a3ff94 100644
--- a/util/cbfstool/cbfs.h
+++ b/util/cbfstool/cbfs.h
@@ -42,6 +42,8 @@ struct cbfs_header {
#define CBFS_ARCHITECTURE_X86 0x00000001
#define CBFS_ARCHITECTURE_ARMV7 0x00000010
+#define CBFS_FILE_MAGIC "LARCHIVE"
+
struct cbfs_file {
uint8_t magic[8];
uint32_t len;
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
new file mode 100644
index 0000000..5754453
--- /dev/null
+++ b/util/cbfstool/cbfs_image.c
@@ -0,0 +1,128 @@
+/*
+ * CBFS Image Manipulation
+ *
+ * Copyright (C) 2013 The Chromium OS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common.h"
+#include "cbfs_image.h"
+
+/* The file name align is not defined in CBFS spec -- only a preference by
+ * (old) cbfstool. */
+#define CBFS_FILENAME_ALIGN (16)
+
+/* To make CBFS more friendly to ROM, fill -1 (0xFF) instead of zero. */
+#define CBFS_CONTENT_DEFAULT_VALUE (-1)
+
+static uint32_t align_up(uint32_t value, uint32_t align) {
+ if (value % align)
+ value += align - (value % align);
+ return value;
+}
+
+int cbfs_image_from_file(struct cbfs_image *image, const char *filename) {
+ if (buffer_from_file(&image->buffer, filename) != 0)
+ return -1;
+ DEBUG("read_cbfs_image: %s (%zd bytes)\n", image->buffer.name,
+ image->buffer.size);
+ image->header = cbfs_find_header(image->buffer.data,
+ image->buffer.size);
+ if (!image->header) {
+ ERROR("%s does not have CBFS master header.\n", filename);
+ cbfs_image_delete(image);
+ return -1;
+ }
+
+ return 0;
+}
+
+int cbfs_image_write_file(struct cbfs_image *image, const char *filename) {
+ assert(image && image->buffer.data);
+ return buffer_write_file(&image->buffer, filename);
+}
+
+int cbfs_image_delete(struct cbfs_image *image) {
+ buffer_delete(&image->buffer);
+ image->header = NULL;
+ return 0;
+}
+
+struct cbfs_header *cbfs_find_header(char *data, size_t size) {
+ size_t offset;
+ int found = 0;
+ uint32_t x86sig;
+ struct cbfs_header *header, *result = NULL;
+
+ // Try x86 style (check signature in bottom) header first.
+ x86sig = *(uint32_t *)(data + size - sizeof(uint32_t));
+ offset = (x86sig + (uint32_t)size);
+ DEBUG("x86sig: 0x%x, offset: 0x%zx\n", x86sig, offset);
+ if (offset >= size - sizeof(*header) ||
+ ntohl(((struct cbfs_header *)(data + offset))->magic) !=
+ CBFS_HEADER_MAGIC)
+ offset = 0;
+
+ for (; offset + sizeof(*header) < size; offset++) {
+ header = (struct cbfs_header *)(data + offset);
+ if (ntohl(header->magic) !=(CBFS_HEADER_MAGIC))
+ continue;
+ if (ntohl(header->version) != CBFS_HEADER_VERSION1 &&
+ ntohl(header->version) != CBFS_HEADER_VERSION2) {
+ // Probably not a real CBFS header?
+ continue;
+ }
+ found++;
+ result = header;
+ }
+ if (found > 1) {
+ ERROR("multiple (%d) CBFS headers found!\n",
+ found);
+ result = NULL;
+ }
+ return result;
+}
+
+
+struct cbfs_file *cbfs_find_first_entry(struct cbfs_image *image) {
+ assert(image && image->header);
+ return (struct cbfs_file *)(image->buffer.data +
+ ntohl(image->header->offset));
+}
+
+struct cbfs_file *cbfs_find_next_entry(struct cbfs_image *image,
+ struct cbfs_file *entry) {
+ uint32_t addr = cbfs_get_entry_addr(image, entry);
+ int align = ntohl(image->header->align);
+ assert(entry && cbfs_is_valid_entry(entry));
+ addr += ntohl(entry->offset) + ntohl(entry->len);
+ addr = align_up(addr, align);
+ return (struct cbfs_file *)(image->buffer.data + addr);
+}
+
+uint32_t cbfs_get_entry_addr(struct cbfs_image *image, struct cbfs_file *entry) {
+ assert(image && image->buffer.data && entry);
+ return (int32_t)((char *)entry - image->buffer.data);
+}
+
+int cbfs_is_valid_entry(struct cbfs_file *entry) {
+ return (entry &&memcmp(entry->magic, CBFS_FILE_MAGIC,
+ sizeof(entry->magic)) == 0);
+}
+
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
new file mode 100644
index 0000000..9535c2d
--- /dev/null
+++ b/util/cbfstool/cbfs_image.h
@@ -0,0 +1,65 @@
+/*
+ * CBFS Image Manipulation
+ *
+ * Copyright (C) 2013 The Chromium OS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+#ifndef __CBFS_IMAGE_H
+#define __CBFS_IMAGE_H
+#include "common.h"
+#include "cbfs.h"
+
+/* CBFS image processing */
+
+struct cbfs_image {
+ struct buffer buffer;
+ struct cbfs_header *header;
+};
+
+/* Loads a CBFS image from file. Returns 0 on success, otherwise non-zero. */
+int cbfs_image_from_file(struct cbfs_image *image, const char *filename);
+
+/* Writes a CBFS image into file. Returns 0 on success, otherwise non-zero. */
+int cbfs_image_write_file(struct cbfs_image *image, const char *filename);
+
+/* Releases the CBFS image. Returns 0 on success, otherwise non-zero. */
+int cbfs_image_delete(struct cbfs_image *image);
+
+/* Primitive CBFS utilities */
+
+/* Returns a pointer to the only valid CBFS header in give buffer, otherwise
+ * NULL (including when multiple headers were found). If there is a X86 ROM
+ * style signature (pointer at 0xfffffffc) found in ROM, it will be selected as
+ * the only header.*/
+struct cbfs_header *cbfs_find_header(char *data, size_t size);
+
+/* Returns the first cbfs_file entry in CBFS image by CBFS header (no matter if
+ * the entry has valid content or not), otherwise NULL. */
+struct cbfs_file *cbfs_find_first_entry(struct cbfs_image *image);
+
+/* Returns next cbfs_file entry (no matter if its content is valid or not), or
+ * NULL on failure. */
+struct cbfs_file *cbfs_find_next_entry(struct cbfs_image *image,
+ struct cbfs_file *entry);
+
+/* Returns ROM address (offset) of entry.
+ * This is different from entry->offset (pointer to content). */
+uint32_t cbfs_get_entry_addr(struct cbfs_image *image, struct cbfs_file *entry);
+
+/* Returns 1 if entry has valid data (by checking magic number), otherwise 0. */
+int cbfs_is_valid_entry(struct cbfs_file *entry);
+
+#endif
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2211
-gerrit
commit cf0babc23e90128ab8a63d076666865a55ed5425
Author: Hung-Te Lin <hungte(a)chromium.org>
Date: Tue Jan 29 03:16:20 2013 +0800
cbfstool: Fix incorrect CBFS free space by old cbfstool.
Old cbfstool may produce CBFS image with calculation error in size of last empty
entry, and then corrupts master header data when you really use every bit in
last entry. This fix will correct free space size when you load ROM images with
cbfs_image_from_file.
Change-Id: I2ada319728ef69ab9296ae446c77d37e05d05fce
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
util/cbfstool/cbfs_image.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index cc4460c..f8e2ae7 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -105,6 +105,31 @@ static int cbfs_calculate_file_header_size(const char *name) {
align_up(strlen(name) + 1, CBFS_FILENAME_ALIGN));
}
+static int cbfs_fix_legacy_size(struct cbfs_image *image) {
+ // A bug in old cbfstool may produce extra few bytes (by alignment) and
+ // cause cbfstool to overwrite things after free space -- which is
+ // usually CBFS header on x86. We need to workaround that.
+
+ struct cbfs_file *entry, *first = NULL, *last = NULL;
+ for (first = entry = cbfs_find_first_entry(image);
+ entry && cbfs_is_valid_entry(entry);
+ entry = cbfs_find_next_entry(image, entry)) {
+ last = entry;
+ }
+ if ((char *)first < (char *)image->header &&
+ (char *)entry > (char *)image->header) {
+ WARN("CBFS image was created with old cbfstool with size bug. "
+ "Fixing size in last entry...\n");
+ last->len = htonl(ntohl(last->len) -
+ ntohl(image->header->align));
+ DEBUG("Last entry has been changed from 0x%x to 0x%x.\n",
+ cbfs_get_entry_addr(image, entry),
+ cbfs_get_entry_addr(image,
+ cbfs_find_next_entry(image, last)));
+ }
+ return 0;
+}
+
int cbfs_image_from_file(struct cbfs_image *image, const char *filename) {
if (buffer_from_file(&image->buffer, filename) != 0)
return -1;
@@ -117,6 +142,7 @@ int cbfs_image_from_file(struct cbfs_image *image, const char *filename) {
cbfs_image_delete(image);
return -1;
}
+ cbfs_fix_legacy_size(image);
return 0;
}