Buildroot patch fails on flexbuild_lsdk2004_update_290520 and flexbuild_lsdk2012

cancel
Showing results for 
Search instead for 
Did you mean: 

Buildroot patch fails on flexbuild_lsdk2004_update_290520 and flexbuild_lsdk2012

163 Views
kkrambo
Contributor I

The flex-builder function build_distro_rfs_buildroot() clones the buildroot repository, checks-out the appropriate tag and creates a branch, and then applies patches with the "git am" command.

When I run this with flexbuild_lsdk1906_290719 release, the patching works successfully with the following output:

Applying: package: fmlib: Add fmlib support for layerscape platform
Applying: package: fmc: Add fmc support for layerscape platform

When I run the same thing with flexbuild_lsdk2004_290520 or flexbuild_lsdk2012, the patching fails with the following output:

Applying: package: fmlib: Add fmlib support for layerscape platform
error: patch failed: package/fmlib/fmlib.hash:1
error: package/fmlib/fmlib.hash: patch does not apply
Patch failed at 0001 package: fmlib: Add fmlib support for layerscape platform
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

  1. What do these patches do and are they important?
  2. Are the buildroot patches still necessary after lsdk1906?
  3. How should I apply the patches on lsdk2004 and lsdk2012?
  4. Are there updated patch files available for lsdk2004 and lsdk2012?
0 Kudos
9 Replies

48 Views
karlgilkey
Contributor I

So is there an solution to this error.

0 Kudos

29 Views
kkrambo
Contributor I

Yes, NXP Tech Support emailed updated patch files to me.  (However the NXP Community site keeps stripping the files when I try to attach them.  Here is one last attempt as a .zip file.)  These files should replace the old patch files in <flexbuild-dir>/configs/buildroot/patch.  You may need to clean-up/cancel the old "git am" session from the failed patch attempt before attempting the patch anew.

0 Kudos

7 Views
karlgilkey
Contributor I

I get many declaration errors after I replaced the patch file

Example:

ption_ptr’
operator=(const exception_ptr&) _GLIBCXX_USE_NOEXCEPT;
^~~~~~~~~~~~~
/usr/include/c++/7/bits/exception_ptr.h:144:30: error: expected ‘;’ at end of member declaration
explicit operator bool() const
^
/usr/include/c++/7/bits/exception_ptr.h:144:32: error: ‘const’ does not name a type
explicit operator bool() const
^~~~~
/usr/include/c++/7/bits/exception_ptr.h:149:18: error: ‘const’ has not been declared
operator==(const exception_ptr&, const exception_ptr&)
^~~~~
/usr/include/c++/7/bits/exception_ptr.h:149:37: error: expected ‘,’ or ‘...’ before ‘&’ token
operator==(const exception_ptr&, const exception_ptr&)
^
/usr/include/c++/7/bits/exception_ptr.h:150:49: error: ‘bool std::__exception_ptr::operator==(int)’ must have an argument of class or enumerated type
_GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));

0 Kudos

123 Views
Pavel
NXP TechSupport
NXP TechSupport

I have tested the "flex-builder -i mkrfs -r buildroot:tiny" using LSDK2012 under Ubuntu 18.04.

See attached message log.

There is no error message for this command.

 

The following command sequence was used for installing this LSDK:

sudo apt-get install git

tar xvzf flexbuild_lsdk2012.tgz

source setup.env

flex-builder -i mkrfs -a arm64

flex-builder -c linux -a arm64 -m ls1046ardb

flex-builder -i mkrfs -r buildroot:tiny

0 Kudos

108 Views
kkrambo
Contributor I

The patch failed for you too.  The error message is on lines 5 and 6 of your log.  Line 5 says, "patching buildroot repo ...", because the .patched file does not exist because the patch has not been successfully applied yet.  Line 6 says, "fatal: previous rebase..." because that is the error message that is displayed on subsequent attempts to apply the patch.  The original clone, checkout, and patch attempt occurred earlier, during one of your previous flex-builder commands.  The original patch failure leaves the repo in bad state.  Then the subsequent patch attempt results in the fatal error in your log.

Try these commands:

  cd flexbuild_lsdk2012/packages/rfs/buildroot

  ls -la

There will be no file named ".patched" because the patch was not successful.

  git status

You will see the message, "You are in the middle of an am session."  This is because the original patch attempt (with the "git am" command) failed and you need to manually resolve the situation.

 

0 Kudos

138 Views
kkrambo
Contributor I

I've done some research and I'll attempt to answer my questions.

1. The patches are to fmlib (Frame Manager library) and fmc (Frame Manager Configuration tool) packages, which are packages for configuring and interfacing with the NXP Frame Manager.  The Frame Manager (FMan) is a component of the QorIQ DPAA (Data Path Acceleration Architecture) hardware.  For more information, see docs such as QorIQ DPAA Primer for Software Architecture and Frame Manager Configuration Tool Example Configuration and Policy.

The patches add support for the Layerscape platform.  This includes updating the referenced repository from an older freescale repository to a newer codeaurora repository, adding Arm dependencies to existing PowerPC dependencies, and other updates for Layerscape and Flex-builder.

2.  The buildroot repository branch used for LSDK v20.04 and LSDK v20.12 does not have the updates already applied so I suspect the patch is still necessary.  The reason that the patch fails on the newer branch is that the .hash files associated with the packages have changed.  There is an additional line in the .hash file for the license file, which wasn’t present in the earlier LSDK v19.06 branch.  I think this is seen as a conflict by the patching tool and causes the patch to fail.

3.  I'm unsure how to apply the patch to LSDK v20.04 and v20.12.  The other two patched files would be straightforward but I don't know how to resolve the conflict in the .hash file.  Does the hash of the license file change?  If so, to what?

0 Kudos

147 Views
Pavel
NXP TechSupport
NXP TechSupport

 

Send please full message dump includes your command and error message.

0 Kudos

137 Views
kkrambo
Contributor I

Here is an example dump of commands and error messages.

LSDK v19.06 succeeds:

kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2$ git clone https://github.com/buildroot/buildroot.git rfs_lsdk1906
Cloning into 'rfs_lsdk1906'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 407380 (delta 2), reused 3 (delta 1), pack-reused 407371
Receiving objects: 100% (407380/407380), 120.93 MiB | 5.06 MiB/s, done.
Resolving deltas: 100% (270840/270840), done.
Checking out files: 100% (12180/12180), done.
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2$ cd rfs_lsdk1906/
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2/rfs_lsdk1906$ git checkout 2019.02 -b 2019.02
Checking out files: 100% (8907/8907), done.
Switched to a new branch '2019.02'
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2/rfs_lsdk1906$ git am ../../Eval/flexbuild_lsdk1906_update_290719/configs/buildroot/patch/*.patch
Applying: package: fmlib: Add fmlib support for layerscape platform
Applying: package: fmc: Add fmc support for layerscape platform

LSDK v20.04 fails:

kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2/rfs_lsdk1906$ cd ..
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2$ git clone https://github.com/buildroot/buildroot.git rfs_lsdk2004
Cloning into 'rfs_lsdk2004'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 407380 (delta 2), reused 3 (delta 1), pack-reused 407371
Receiving objects: 100% (407380/407380), 120.94 MiB | 4.36 MiB/s, done.
Resolving deltas: 100% (270836/270836), done.
Checking out files: 100% (12180/12180), done.
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2$ cd rfs_lsdk2004/
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2/rfs_lsdk2004$ git checkout 2020.02 -b 2020.02
Checking out files: 100% (5503/5503), done.
Switched to a new branch '2020.02'
kkramb@ENG-LT-KKRAMB:/mnt/c/Users/kkramb/Documents/junk2/rfs_lsdk2004$ git am ../../Eval/flexbuild_lsdk2004_update_290520/configs/buildroot/patch/*.patch
Applying: package: fmlib: Add fmlib support for layerscape platform
error: patch failed: package/fmlib/fmlib.hash:1
error: package/fmlib/fmlib.hash: patch does not apply
Patch failed at 0001 package: fmlib: Add fmlib support for layerscape platform
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

0 Kudos

139 Views
kkrambo
Contributor I

The error will occur when you run a command such as "flex-builder -i mkrfs -r buildroot:tiny" with either flexbuild_lsdk2004_update_290520 or flexbuild_lsdk2012.  However, the error will be buried within thousands of other lines of output.  The problem occurs in the first few lines of the build_distro_rfs_buildroot() function in flex-builder.

build_distro_rfs_buildroot() {
    if [ ! -d $PACKAGES_PATH/rfs/buildroot ]; then
    git clone $buildroot_repo_url $PACKAGES_PATH/rfs/buildroot && \
    cd $PACKAGES_PATH/rfs/buildroot && git checkout $buildroot_repo_tag -b $buildroot_repo_tag && cd -
    fi
    if [ ! -f $PACKAGES_PATH/rfs/buildroot/.patched ]; then
    cd $PACKAGES_PATH/rfs/buildroot && echo patching buildroot repo ... && \
    git am $FBDIR/configs/buildroot/patch/*.patch && touch .patched && cd -
    fi

The "git checkout" command creates a branch from the buildroot_repo_tag associated with the LSDK version (defined in build_lsdk.cfg).  The .patched file does not exist initially so the function attempts to apply the patch with the "git am" command.  The "git am" command succeeds if buildroot_repo_tag is "2019.02" (LSDK v19.06), but if fails if buildroot_repo_tag is "2020.02" (LSDK v20.04 or v20.12).  The failure message is in my original post.  When the "git am" command fails, the patched files are not updated and the .patch file is not created.  Then on subsequent attempts you'll get a different failure message because the repository is left in state with an incomplete patch as described in the error message.

0 Kudos