Add PKGBUILD for Chromium OS version of flashrom.

This commit is contained in:
stratum nine 2013-02-22 21:38:46 -05:00
parent af32647004
commit 3534c71626
2 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,60 @@
# Maintainer: stratum nine <strata@dropswitch.net>
#
# Please do not consider this a replacement for flashrom.
# This is Google's version. There are differences.
#
buildarch=4
pkgname=flashroom-google
pkgrel=1
pkgver=20130222
pkgdesc="Chromium's fork of flashrom needed for SAMSUNG ARM Chromebook"
arch=('armv7h')
url="http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git"
license=('GPL2')
makedepends=('git')
source=('stubbery.patch')
md5sums=('a24b8cb6d4a678ba25ffa3cb270c46c8')
_gitroot='http://git.chromium.org/chromiumos/third_party/flashrom.git'
_gitname='flashrom-google'
_githead='release-R26-3701.B'
build() {
cd "$srcdir"
msg "Connecting to GIT server...."
if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone "$_gitroot" "$_gitname"
cd "$_gitname"
git checkout "$_githead"
fi
msg "GIT checkout done or server timeout"
msg "Starting build..."
rm -rf "$srcdir/$_gitname-build"
git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
cd "$srcdir/$_gitname-build"
#
# Some dirty hacks were needed to get this to build outside of
# chromium + build on ARM.
#
patch -Np1 -i "${srcdir}/stubbery.patch"
CONFIG_SATAMV=no CONFIG_LINUX_I2C=no CONFIG_LINUX_SPI=yes WARNERROR=no \
make
}
package() {
cd "$srcdir/$_gitname-build"
mkdir -p "${pkgdir}/usr/bin"
cp flashrom "${pkgdir}/usr/bin/flashrom.google"
}
# vim:set ts=2 sw=2 et:

View file

@ -0,0 +1,48 @@
diff -urN flashrom-google/internal.c flashrom-google-build/internal.c
--- flashrom-google/internal.c 2013-02-22 21:23:49.091306851 -0500
+++ flashrom-google-build/internal.c 2013-02-22 21:27:34.661306653 -0500
@@ -301,10 +301,10 @@
* fix up any scripts which depend on "-p internal:bus=lpc" for
* flashing EC firmware.
*/
- if ((target_bus == BUS_PROG) || (target_bus == BUS_LPC)) {
+ /*if ((target_bus == BUS_PROG) || (target_bus == BUS_LPC)) {
if (!gec_probe_i2c(NULL))
return 0;
- }
+ }*/
#endif
#if defined(__arm__) && CONFIG_LINUX_SPI == 1
diff -urN flashrom-google/Makefile flashrom-google-build/Makefile
--- flashrom-google/Makefile 2013-02-22 21:23:49.091306851 -0500
+++ flashrom-google-build/Makefile 2013-02-22 21:26:15.056307031 -0500
@@ -362,9 +362,9 @@
PROGRAMMER_OBJS += gec_lpc.o it87spi.o it85spi.o mec1308.o sb600spi.o wbsio_spi.o mcp6x_spi.o wpce775x.o ene_lpc.o
PROGRAMMER_OBJS += ichspi.o ich_descriptors.o
else
-ifeq ($(ARCH),"arm")
-PROGRAMMER_OBJS += gec_i2c.o tegra2_spi.o
-endif
+#ifeq ($(ARCH),"arm")
+#PROGRAMMER_OBJS += gec_i2c.o tegra2_spi.o
+#endif
NEED_PCI := yes
endif
endif
diff -urN flashrom-google/processor_enable.c flashrom-google-build/processor_enable.c
--- flashrom-google/processor_enable.c 2013-02-22 21:23:49.091306851 -0500
+++ flashrom-google-build/processor_enable.c 2013-02-22 21:28:33.701306988 -0500
@@ -159,10 +159,10 @@
/* FIXME(yjlou): 0xc09 seems ARMv7, not tegra* specified.
* Also, the tegra2_spi_init() should move out of
* the processor enable code logic. */
- if (is_tegra2()) {
+/* if (is_tegra2()) {
msg_pdbg("Detected NVIDIA Tegra 2.\n");
return tegra2_spi_init();
- }
+ }*/
#endif
/* Not implemented yet. Oh well. */
return 1;