Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Towards ffspart rather than much perl #2498

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 11c256c70355e4aa12c7a993c43d602aeb46dee0 Mon Sep 17 00:00:00 2001
From: Stewart Smith <[email protected]>
Date: Mon, 3 Dec 2018 11:19:02 +1100
Subject: [PATCH] ffspart: Increase MAX_LINE to above PATH_MAX

Otherwise we saw failures in CI and the ~221 character paths Jankins
likes to have.

Signed-off-by: Stewart Smith <[email protected]>
---
external/ffspart/ffspart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/ffspart/ffspart.c b/external/ffspart/ffspart.c
index 179ed582170b..eeee0d4d657b 100644
--- a/external/ffspart/ffspart.c
+++ b/external/ffspart/ffspart.c
@@ -50,7 +50,7 @@
* Plus \n 40
* Lets do 50.
*/
-#define MAX_LINE 255
+#define MAX_LINE (PATH_MAX+255)
#define MAX_TOCS 10
#define SEPARATOR ','

--
2.19.2

3 changes: 3 additions & 0 deletions openpower/package/libflash/libflash.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ define HOST_LIBFLASH_BUILD_CMDS
$(MAKE) -C $(@D)/external/pflash
$(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
$(MAKE) -C $(@D)/external/gard
$(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
$(MAKE) -C $(@D)/external/ffspart
endef

define LIBFLASH_INSTALL_STAGING_CMDS
Expand All @@ -56,6 +58,7 @@ endef

define HOST_LIBFLASH_INSTALL_CMDS
$(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash
$(INSTALL) $(@D)/external/ffspart/ffspart $(HOST_DIR)/usr/bin/ffspart
endef

$(eval $(generic-package))
Expand Down
7 changes: 4 additions & 3 deletions openpower/package/openpower-pnor/openpower-pnor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#
################################################################################

OPENPOWER_PNOR_VERSION ?= aa94a39eb470d1a50138f4d0b04a5a135c4431ff
OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION))
OPENPOWER_PNOR_VERSION ?= d3e41ea1efffc8fa0f96c8239d154dbbe3ee29b4
OPENPOWER_PNOR_SITE ?= $(call github,stewart-ibm,pnor,$(OPENPOWER_PNOR_VERSION))

OPENPOWER_PNOR_LICENSE = Apache-2.0
OPENPOWER_PNOR_LICENSE_FILES = LICENSE
OPENPOWER_PNOR_DEPENDENCIES = hostboot-binaries machine-xml skiboot host-openpower-ffs capp-ucode
OPENPOWER_PNOR_DEPENDENCIES = hostboot-binaries machine-xml skiboot host-openpower-ffs capp-ucode host-libflash

ifeq ($(BR2_OPENPOWER_POWER9),y)
OPENPOWER_PNOR_DEPENDENCIES += hcode
Expand Down Expand Up @@ -158,6 +158,7 @@ define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
-openpower_version_filename $(OPENPOWER_PNOR_SCRATCH_DIR)/openpower_pnor_version.bin

$(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
$(TARGET_MAKE_ENV) ../openpower/scripts/pnordiff.sh $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(STAGING_DIR)/pnor/ffspart.pnor

# if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
# image that only updates the non-golden side
Expand Down
22 changes: 22 additions & 0 deletions openpower/scripts/pnordiff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

T=$(mktemp -d)
A=$1
B=$2
R=0

pflash -i -F $A |grep -v '^Name' > $T/A.toc
pflash -i -F $B |grep -v '^Name' > $T/B.toc
diff -u $T/A.toc $T/B.toc
if [ $? != 0 ]; then R=1; fi

for p in $(pflash -i -F $A |awk '/^ID\=[0-9]+\w+(.*)/ { print $2};'); do
pflash -F $A -P $p -r $T/$p.A >/dev/null
pflash -F $B -P $p -r $T/$p.B >/dev/null
diff -u $T/$p.A $T/$p.B
if [ $? != 0 ]; then R=1; fi
done

if [ $R == 0 ]; then rm -rf $T; fi

exit $R