open-power / ffs Goto Github PK
View Code? Open in Web Editor NEWTools for manipulating 'ffs' flash images.
License: Apache License 2.0
Tools for manipulating 'ffs' flash images.
License: Apache License 2.0
use fcp to dump PNOR image, the content of VERSION partition are all 0xFF.
ex:
cd ~/op-build/output/images/
~/op-build/output/host/usr/bin/fcp -R -o 0 palmetto.pnor:VERSION VERSION.txt
cat VERSION.txt
Run op-build in an machine with few memory, in my case it's 2G memory. I increased my VM memory from 2G to 4G and that fixed this issue.
TRACE: main::loadPnorLayout: metadata: imageSize = 33554432, blockSize=4096, arrangement = A-D-B, numOfSides: 1, sideSize: 33554432, tocSize: 32768
TRACE: A-D-B: side:A HBB:32927744, primaryTOC:0, backupTOC:33521664, golden: no
TRACE: Done checkSpaceConstraints
TRACE: createPnorPartition:: 0
TRACE: createPnorImg:: 0
TRACE: createPnorPartition:: 33521664
TRACE: createPnorImg:: 33521664
TRACE: fpart --target /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/palmetto.pnor --partition-offset 0 --add --offset 33521664 --size 32768 --name BACKUP_PART --flags 0x0
TRACE: fpart --target /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/palmetto.pnor --partition-offset 33521664 --add --offset 0 --size 32768 --name BACKUP_PART --flags 0x0
TRACE: fillPnorImage:: 0
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)ls
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
/usr/bin/install /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/"palmetto.pnor" /home/alvin/op-build/output/images
if [ """" != "" ]; then dd if=/home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/"palmetto.pnor" of=/home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/"" bs=32M count=1; /usr/bin/install /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/"" /home/alvin/op-build/output/images; fi
make: Leaving directory `/home/alvin/op-build/buildroot'
Hi,
I have downloaded the ffs git tree and tried to compile the fcp source files on a ppc64 LE Ubuntu OS.
root@ltc-garri2:# uname -a# cat /etc/os-release
Linux ltc-garri2 4.4.0-30-generic #49-Ubuntu SMP Fri Jul 1 10:00:36 UTC 2016 ppc64le ppc64le ppc64le GNU/Linux
root@ltc-garri2:
NAME="Ubuntu"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
root@ltc-garri2:~#
root@ltc-garri2:~# git clone https://github.com/open-power/ffs.git
Cloning into 'ffs'...
remote: Counting objects: 465, done.
remote: Total 465 (delta 0), reused 0 (delta 0), pack-reused 465
Receiving objects: 100% (465/465), 385.59 KiB | 325.00 KiB/s, done.
Resolving deltas: 100% (280/280), done.
Checking connectivity... done.
root@ltc-garri2:/ffs# ls/ffs# cd fcp/
clib ecc fcp ffs fpart LICENSE Makefile NOTICE
root@ltc-garri2:
root@ltc-garri2:~/ffs/fcp# ls
fcp.sh Makefile ppc Rules.mk src x86
root@ltc-garri2:~/ffs/fcp# cat Makefile
SUBDIRS=x86
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS)::
all clean install: $(SUBDIRS)
As can be seen in the Makefile, the SUBDIRS is showing as only supporting x86 and not ppc.
So, how can we compile the source files on a PPC64 LE HOST OS and build the fcp binaries.
When running the fpart test suite under valgrind, you can see that it writes unitialized data to disk (pnor) in the very first test:
./fpart/fpart --target /tmp/create.nor --size 64MiB --block 64kb --partition-offset 0x7f0000 --create
This is because libffs.c doesn't properly initialize the reserved area.
Thus, it could contain any old crap sitting around in memory - essentially making the reserved fields useless.
Somebody will need to audit EVERY libffs created thing in the wild
before ever using that reserved space.
On a amd64 machine with 1GB of RAM, I get the following when running op-build:
TRACE: fpart --target /home/joel/op-build/output/host/usr/powerpc64le-buildroot-linux-gnu/sysroot/pnor/palmetto.pnor --partition-offset 33521664 --user 1 --name BACKUP_PART --value 2097152 --force
TRACE: fillPnorImage:: 0
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.