ostroproject / ostro-os

Ostro OS
Other
93 stars 43 forks source link

libpam_1.3.0 and linux-yocto_4.4 recipes fail #184

Open dangpzanco opened 7 years ago

dangpzanco commented 7 years ago

Hi,

I get an error when patching 0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch on the linux-yocto_4.4.bb:do_patch task. I've managed to make it build ok by commenting out this patch, but I would like to know if I've there's a fix for this.

You can check my local.conf and bblayers.conf

I've ran the following commands:

daniel@daniel-ubuntu:$ mkdir ~/Documents/ostro-project
daniel@daniel-ubuntu:~/Documents/ostro-project/$ cd ~/Documents/ostro-project
daniel@daniel-ubuntu:~/Documents/ostro-project/$ git clone https://github.com/ostroproject/ostro-os.git
daniel@daniel-ubuntu:~/Documents/ostro-project/ostro-os/$ cd ostro-os/
daniel@daniel-ubuntu:~/Documents/ostro-project/ostro-os/$ source oe-init-build-en
daniel@daniel-ubuntu:~/Documents/ostro-project/ostro-os/build$ bitbake -k ostro-image-noswupd

And this is the log file for this error:

DEBUG: Executing shell function do_patch (1/1) 0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch [INFO]: check of .kernel-meta//patches//./0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch with "git am" did not pass, trying reduced context. [INFO]: Context reduced git-am of .kernel-meta//patches//./0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch with "git am" did not work, trying "apply".

*\ Please tell me who you are.

Run

git config --global user.email "you@example.com" git config --global user.name "Your Name"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'daniel@daniel-ubuntu.(none)') WARNING: exit code 4 from a shell command. ERROR: Function failed: do_patch (log file is located at /home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/work/i586-nlp-32-intel-common-ostro-linux/linux-yocto/4.4.18+gitAUTOINC+6988358411_cb96b51d4b-r0/temp/log.do_patch.4668)

All the other recipes run just fine, but only if I disable a check with SUPPORTED_RECIPES_CHECK = "" in local.conf.

Edit:

The recipe "ostro-os/meta/recipes-extended/pam/libpam_1.3.0.bb:do_compile" also fails.... Log is here.

My computer:

daniel@daniel-ubuntu:~$ uname -a
Linux daniel-ubuntu 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
daniel@daniel-ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial
daniel@daniel-ubuntu:~$ gcc --version
gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dangpzanco commented 7 years ago

Okay, as I found out, 0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch fails because it is already applied to the sources...

The fix would be deleting it from "ostro-os/meta-ostro-bsp/recipes-kernel/linux-yocto/linux-yocto" and removing its reference in the "ostro-os/meta-ostro-bsp/recipes-kernel/linux-yocto/linux-yocto_4.4.bb" file, as follows:

# Workaround for IMA/overlayfs deadlock.
#SRC_URI_append_intel-quark = " \
#    file://0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch \
#"
#
#SRC_URI_append_intel-core2-32 = " \
#    file://0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch \
#"
#
#SRC_URI_append_intel-corei7-64 = " \
#    file://0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch \
#"
#
#SRC_URI_append_beaglebone = " \
#    file://0001-ovl-setxattr-don-t-deadlock-when-called-from-ima_fix.patch \
#"

Now bitbake -k ostro-image-noswupd outputs:

NOTE: Tasks Summary: Attempted 2876 tasks of which 2823 didn't need to be rerun and 2 failed.

Summary: 2 tasks failed:
  /home/daniel/Documents/ostro-project/ostro-os/meta/recipes-extended/pam/libpam_1.3.0.bb:do_compile
  virtual:native:/home/daniel/Documents/ostro-project/ostro-os/meta/recipes-extended/pam/libpam_1.3.0.bb:do_compile
Summary: There were 2 WARNING messages shown.
Summary: There were 4 ERROR messages shown, returning a non-zero exit code.
dangpzanco commented 7 years ago

I've managed to manually compile libpam by doing the following:

daniel@daniel-ubuntu:~$ cd /home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/work/x86_64-linux/libpam-native/1.3.0-r5/build/doc/specs
daniel@daniel-ubuntu:~/Documents/ostro-project/ostro-os/build/tmp-glibc/work/x86_64-linux/libpam-native/1.3.0-r5/build/doc/specs$ make clean
daniel@daniel-ubuntu:~/Documents/ostro-project/ostro-os/build/tmp-glibc/work/x86_64-linux/libpam-native/1.3.0-r5/build/doc/specs$ make

This code is supposed to be run on that folder, but it fails, make clean; make; fixed it, I don't know why:

../../x86_64-linux-libtool --tag=CC --mode=link gcc -isystem/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/usr/include -O2 -pipe -L/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/usr/lib -L/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/lib -Wl,-rpath-link,/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/lib -Wl,-rpath,/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/home/daniel/Documents/ostro-project/ostro-os/build/tmp-glibc/sysroots/x86_64-linux/lib -Wl,-O1 -o padout parse_l.o parse_y.o

Is this a bug?

PS: I switched from gcc-4.9 to gcc-5, not sure if that's what made it compile. I did a bitbake -k -c compile libpam with gcc-5 active and it didn't work either.

mythi commented 7 years ago

@dangpzanco You should be able to benefit from pre-built SSTATE cache. Make sure your build is able to access the SSTATE_MIRROR configured in local.conf.

This works at least if you have a vanilla ostro-os repo.

dangpzanco commented 7 years ago

@mythi Hi, how could I check if my "build is able to access the SSTATE_MIRROR"? I don't quite understand what you mean.

My local.conf has the following configuration: SSTATE_MIRRORS ?= "file://.* http://download.ostroproject.org/sstate/ostro-os/PATH"

Is "PATH" a keyword? How should I interpret the string above?

My /ostro-os/build/sstate-cache has 6.160 items, totalling 4.5 GB, the folders are 00 - ff and universal, just like in http://download.ostroproject.org/sstate/ostro-os/.

mythi commented 7 years ago

@dangpzanco your local.conf looks correct. With the pre-built sstate cache bitbake should just use the binary artifacts from the mirror and no rebuilding locally should happen (at least if you are using an unmodified ostro-os master).

mythi commented 7 years ago

@dangpzanco did you try setting

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

there was a change in how kernel patches are applied and that won't work without proper git config. We're still checking how this can be fixed properly.