GithubHelp home page GithubHelp logo

ffs's People

Contributors

anoo1 avatar bradbishop avatar crgeddes avatar stewartsmith avatar williamspatrick avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffs's Issues

fcp: errno : libffs.c(709) : (code=12) __ffs_buffer => Cannot allocate memory (errno=12)

Symptom

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

Reproduce steps:

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.

Build log

########################/home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/hostboot_build_images//buildpnor.pl --pnorOutBin /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/pnor/palmetto.pnor --pnorLayout /home/alvin/op-build/output/build/openpower-pnor-ed1682e10526ebd85825427fbf397361bb0e34aa/defaultPnorLayoutSingleSide.xml --binFile_HBD /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//PALMETTO_HB.targeting.bin.ecc --binFile_SBE /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//venice_sbe.img.ecc --binFile_SBEC /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//centaur_sbec_pad.img.ecc --binFile_WINK /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//p8.ref_image.hdr.bin.ecc --binFile_HBB /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//hostboot.header.bin.ecc --binFile_HBI /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//hostboot_extended.header.bin.ecc --binFile_HBRT /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//hostboot_runtime.header.bin.ecc --binFile_HBEL /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//hbel.bin.ecc --binFile_GUARD /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//guard.bin.ecc --binFile_PAYLOAD /home/alvin/op-build/output/images/skiboot.lid --binFile_BOOTKERNEL /home/alvin/op-build/output/images/zImage.epapr --binFile_NVRAM /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//nvram.bin.ecc --binFile_MVPD /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//mvpd_fill.bin.ecc --binFile_DJVPD /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//djvpd_fill.bin.ecc --binFile_CVPD /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//cvpd.bin.ecc --binFile_ATTR_TMP /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//attr_tmp.bin.ecc --binFile_ATTR_PERM /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//attr_perm.bin.ecc --binFile_OCC /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/occ/occ.bin.ecc --binFile_FIRDATA /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//firdata.bin.ecc --binFile_CAPP /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_pnor_scratch//cappucode.bin.ecc --binFile_VERSION /home/alvin/op-build/output/host/usr/powerpc64-buildroot-linux-gnu/sysroot/openpower_version/openpower-pnor.version.txt --fpartCmd "fpart" --fcpCmd "fcp"

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 this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)

image that only updates the non-golden side

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'

Not able to compile the src on PPC64 Ubuntu LE Power NV machine

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
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:
# cat /etc/os-release
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
clib ecc fcp ffs fpart LICENSE Makefile NOTICE
root@ltc-garri2:
/ffs# cd fcp/
root@ltc-garri2:~/ffs/fcp# ls
fcp.sh Makefile ppc Rules.mk src x86

root@ltc-garri2:~/ffs/fcp# cat Makefile

IBM_PROLOG_BEGIN_TAG

This is an automatically generated prolog.

$Source: fcp/Makefile $

OpenPOWER FFS Project

Contributors Listed Below - COPYRIGHT 2014,2015

[+] International Business Machines Corp.

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or

implied. See the License for the specific language governing

permissions and limitations under the License.

IBM_PROLOG_END_TAG

SUBDIRS=x86

.PHONY: subdirs $(SUBDIRS)

subdirs: $(SUBDIRS)

$(SUBDIRS)::
$(MAKE) -C $@ $(MAKECMDGOALS)

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.

fpart/libffs doesn't initialized reserved FFS header to 0

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.

fpart fails on memory constrained systems

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.