How to build LineageOs for the hero2lte device? - android-source

The method to build lineageos from source used to be very straight forward but I'm not having success when building it to the device hero2lte which is the Samsung galaxy S7 Edge.
To reproduce the issue, just follow the build steps according to official documentation, the only difference is that I'm trying to build lineage-15.1 branch instead.
repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
And I also tried adding manually the repos for the device, kernel and vendor trees in local_manifests.xml:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="vendor"
fetch="https://github.com"
revision="lineage-15.1" />
<remote name="device"
fetch="https://github.com"
revision="lineage-15.1"/>
<remote name="kernel"
fetch="https://github.com"
revision="lineage-15.1"/>
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="vendor"/>
<project name="LineageOS/android_device_samsung_hero2lte" path="device/samsung/hero2lte" remote="device" />
<project name="LineageOS/android_hardware_samsung" path="hardware/samsung" remote="github" />
<project name="LineageOS/android_kernel_samsung_universal8890" path="kernel/samsung/universal8890" remote="kernel" />
</manifest>
But every way I try ends up in the error when I run breakfast hero2lte:
including vendor/lineage/vendorsetup.sh
build/core/product_config.mk:243: *
_nic.PRODUCTS.[[device/samsung/hero2lte/lineage.mk]]: "device/samsung/hero-common/hero-common.mk" does not exist. Stop.
Device hero2lte not found. Attempting to retrieve device repository
from LineageOS Github (http://github.com/LineageOS). Found repository:
android_device_samsung_hero2lte Default revision: lineage-15.1
Checking branch info Checking if device/samsung/hero2lte is fetched
from android_device_samsung_hero2lte
LineageOS/android_device_samsung_hero2lte already fetched to
device/samsung/hero2lte Syncing repository to retrieve project.
remote: Enumerating objects: 13, done. remote: Counting
objects: 100% (13/13), done. remote: Compressing objects: 100%
(11/11), done. remote: Total 17 (delta 4), reused 7 (delta 1),
pack-reused 4 From git://github.com/LineageOS/android
f56ece1..800af59 lineage-16.0 -> origin/lineage-16.0
43f3fd0..152210f lineage-17.0 -> origin/lineage-17.0 fatal: duplicate
path device/samsung/hero2lte in
/home/fabio/android/lineage15.1/.repo/manifest.xml Repository synced!
Looking for dependencies in device/samsung/hero2lte Looking for
dependencies in device/samsung/hero-common device/samsung/hero-common
has no additional dependencies. Done build/core/product_config.mk:243:
* _nic.PRODUCTS.[[device/samsung/hero2lte/lineage.mk]]: "device/samsung/hero-common/hero-common.mk" does not exist. Stop.
build/core/product_config.mk:243: ***
_nic.PRODUCTS.[[device/samsung/hero2lte/lineage.mk]]: "device/samsung/hero-common/hero-common.mk" does not exist. Stop.
** Don't have a product spec for: 'lineage_hero2lte'
** Do you have the right repo manifest?
EDIT In my example I'm building for lineage-15.1 but I'm accepting answers for lineage-16.0 or lineage-17.1 too. Thanks in advance.

It looks like your local_manifest.xml is missing the hero-common repo.
<project name="LineageOS/android_device_samsung_hero-common" path="device/samsung/hero-common" remote="device" />

Related

External string does not exist error while trying to deploy through Jenkins

We have repo with salesforce code. Goal is to deploy it to scratch org and launch tests.
Below is the error as we are getting while running a Jenkins pipeline for common libraries.
Error src/main/java/com/spartasystems/twd/security/PermissionGuard.cls External string does
not exist: PERMISSION_DENIED_AN_OBJECT (27:82)
Error src/main/java/com/spartasystems/twd/security/PermissionGuard.cls External string does
not exist: PERMISSION_DENIED_A_FIELD (29:82)
ERROR running force:source:deploy: Deploy failed.
My deploy code looks like as shows below:
stage('MDAPI Deploy To Scratch Org'){
sh 'ls -al'
sh 'cat sfdx-project.json'
sh 'cat src/labels/*'
SFDX.deployMDAPISourceCodeToScratchOrg("./abc/src/");
SFDX.deployMDAPISourceCodeToScratchOrg("./xyz/src/");
sh 'rm src/main/java/com/company/twd/util/DebuggingUtil'
sh 'sfdx force:source:deploy -x src/main/resources/package.xml'
}
Here is the package.xml file
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<version>49.0</version>
</Package>
Can anyone help me here as I am stuck and unable to fix this issue ?
I have got a response from Salesforce Stack Exchange that this might be something related to third-party java library . I am unable to understand whether there is an issue with Labels missing in Salesforce org or what else.
Kindly help me with this.
If you are using custom label then 'Custom label' must already exist in targeting environment(where you are deploying the code through Jenkins).
I don't think you understand my question from comments.
If the apex class PermissionGuard contains references like Label.PERMISSION_DENIED_AN_OBJECT then:
that "custom label" must already exist in the target environment
or your deployment must be creating that custom label in the same action that creates/updates this class.
It's not a Jenkins problem. You're pulling the files from some Git repo or locally on filesystem? If the developer committed to Git only the class but not the custom labels file - shout at the dev that this is not deployable. Whether to scratch org, to sandbox or to production.
The labels\CustomLabels.labels file will look similar to this
<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
<labels>
<fullName>CommunityAccessSuspended</fullName>
<categories>Community, Login</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>CommunityAccessSuspended</shortDescription>
<value>Your access is disabled. Please contact your site administrator.</value>
</labels>
</CustomLabels>
If the dev doesn't know how to download the fresh file from org, sfdx force:mdapi:retrieve -r ./mdapi -u yourUsername#yourCompany.com -k ./path/to/package.xml should be a good start.

how to find kernel branch and commit corresponding to shipped kernel on nexus device

I want to build kernel with some flags enabled for my Samsung Nexus 10. Here is the info from android About device.
Android version
5.1.1
Kernel Version
3.4.67-g84ad5a4
android-build#wpee22.hot.corp.google.com#1
Fri Nov 13 21:33:05 UTC 2015
Build Number
LMY49J
I am following this AOSP guide to build the kernel -
https://source.android.com/source/building-kernels
I have cloned the repo but have no clue which branch and the commit to checkout.
arpit#arpit-ubuntu:~/kernel$ git clone https://android.googlesource.com/kernel/exynos.git
Cloning into 'exynos'...
remote: Sending approximately 874.72 MiB ...
remote: Counting objects: 15, done
remote: Total 3997821 (delta 3353407), reused 3997821 (delta 3353407)
Receiving objects: 100% (3997821/3997821), 874.72 MiB | 9.86 MiB/s, done.
Resolving deltas: 100% (3353407/3353407), done.
Checking connectivity... done.
arpit#arpit-ubuntu:~/kernel$ cd exynos/
arpit#arpit-ubuntu:~/kernel/exynos$ ls -l
total 0
arpit#arpit-ubuntu:~/kernel/exynos$
This directory is empty, so the logic given on AOSP to find commit and branch info from kernel binary logs is not applicable here.
git branch -a returns the following .
arpit#arpit-ubuntu:~/kernel/exynos$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/android-exynos-3.4
remotes/origin/android-exynos-koi-3.10-marshmallow-dr1-wear-release
remotes/origin/android-exynos-koi-3.10-marshmallow-mr1-wear-release
remotes/origin/android-exynos-koi-3.18-nougat-mr1-wear-release
remotes/origin/android-exynos-manta-3.4-adf
remotes/origin/android-exynos-manta-3.4-jb-mr1
remotes/origin/android-exynos-manta-3.4-jb-mr1-fr
remotes/origin/android-exynos-manta-3.4-jb-mr1.1
remotes/origin/android-exynos-manta-3.4-jb-mr2
remotes/origin/android-exynos-manta-3.4-kitkat-mr0
remotes/origin/android-exynos-manta-3.4-kitkat-mr1
remotes/origin/android-exynos-manta-3.4-kitkat-mr2
remotes/origin/android-exynos-manta-3.4-lollipop-mr1
remotes/origin/android-exynos-manta-3.4-lollipop-release
remotes/origin/master
arpit#arpit-ubuntu:~/kernel/exynos$
My possible guess is the branch name is remotes/origin/android-exynos-manta-3.4-lollipop-mr1.
But none of the commits in this branch has this substring 84ad5a4 (Obtained from kernel version on device). Google search for string 84ad514 also doesn't return anything.
So I am struck here. I want to use the exact code corresponding to the kernel shipped on my device and not the most recent code on the kernel branch. Can you tell me how to figure out the branch and exact commit corresponding to the shipped kernel on my device.

Is it possible to use current Buildroot for Raspberry Pi 2

http://git.buildroot.net/buildroot/tree/board/raspberrypi/readme.txt states the following — where the last line is the interesting one:
The raspberrypi_defconfig configuration is a minimal configuration
with all that is required to bring the Raspberry Pi up. You should
base your work on this defconfig:
$ make raspberrypi_defconfig
Alternatively, if you want to test support for the Device Tree:
$ make raspberrypi_dt_defconfig
For Raspberry Pi 2 use a different defconfig:
$ make raspberrypi2_defconfig
Is that raspberrypi2_defconfig required to use buildroot on an Raspberry Pi 2, or does it just contain RPi2 optimizations? The reason why I'm asking is that I don't find that configuration in the latest stable version of Buildroot, and the current git version abort the build with an
"HTTP request sent, awaiting response... 404: Not Found"
====================================
Console printout after second build crasch:
make[1]: Leaving directory `/home/fredrik/buildroot/output/build/host-lzop-1.03'
>>> linux 2c4959b772a35d9d459b0a92f39bb066e9a44d37 Downloading
Doing shallow clone
Cloning into bare repository 'linux-2c4959b772a35d9d459b0a92f39bb066e9a44d37'...
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-BVQjKJ/pkcs11: No such file or directory
POST git-upload-pack (gzip 1077 to 570 bytes)
POST git-upload-pack (gzip 1086 to 577 bytes)
remote: Counting objects: 223619, done.
remote: Compressing objects: 100% (141382/141382), done.
remote: Total 223619 (delta 145491), reused 134621 (delta 80295), pack-reused 0
Receiving objects: 100% (223619/223619), 271.86 MiB | 1.80 MiB/s, done.
Resolving deltas: 100% (145491/145491), done.
warning: Remote branch 2c4959b772a35d9d459b0a92f39bb066e9a44d37 not found in upstream origin, using HEAD instead
fatal: not a tree object
--2015-04-13 00:26:38-- http://sources.buildroot.net/linux-2c4959b772a35d9d459b0a92f39bb066e9a44d37.tar.gz
Resolving sources.buildroot.net (sources.buildroot.net)... 176.9.16.109
Connecting to sources.buildroot.net (sources.buildroot.net)|176.9.16.109|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-04-13 00:26:38 ERROR 404: Not Found.
make: *** [/home/fredrik/buildroot/output/build/linux-2c4959b772a35d9d459b0a92f39bb066e9a44d37/.stamp_downloaded] Error 1
It's not mandatory, but it's a prebuilt configuration that ensures that you will have a working system.
When pasting errors, please include more lines (like 50-100 lines), because the real error is not this 404. It's earlier, the fact that it can't find in the RPi kernel Git repository the commit we're looking for. Try again with the latest Buildroot, I think we've updated the raspberrypi2_defconfig with a more recent RPi kernel commit.
The problem is that the RPi kernel git repository is often rebased against the linux-stable kernel, which means that the commit that buildroot refers to is no longer accessible.
The solution is to use a stable branch from the RPi kernel git repository, where no rebasing is done. This is done by this patch.

FATAL: Invalid id: Process leaked file descriptors - Jenkins (github)

I am getting following error in jenkins with github.
Using strategy: Default
Last Built Revision: Revision 8d7d3f0898bc4583a80848033d6e0d27cc3e2096 (origin/master, origin/HEAD)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Seen branch in repository origin/svn
Seen 3 remote branches
Commencing build of Revision 8d7d3f0898bc4583a80848033d6e0d27cc3e2096 (origin/master, origin/HEAD)
Checking out Revision 8d7d3f0898bc4583a80848033d6e0d27cc3e2096 (origin/master, origin/HEAD)
FATAL: Invalid id: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
java.lang.IllegalArgumentException: Invalid id: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:232)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.doRevList(CliGitAPIImpl.java:959)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revList(CliGitAPIImpl.java:945)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.isCommitInRepo(CliGitAPIImpl.java:970)
at hudson.plugins.git.GitAPI.isCommitInRepo(GitAPI.java:181)
at hudson.plugins.git.GitSCM.computeChangeLog(GitSCM.java:1292)
at hudson.plugins.git.GitSCM.access$1300(GitSCM.java:58)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1257)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1211)
at hudson.FilePath.act(FilePath.java:909)
at hudson.FilePath.act(FilePath.java:882)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1211)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1408)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
at hudson.model.Run.execute(Run.java:1603)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Normally it works fine during the day and when I start my system again on next day, it gives this error and can only be resolved by re-installing the github in Jenkins. The link in the error message says about Spawning process from build but I don't understand what does that mean (I run 1-2 builds only; on windows).
Thanks.

Heroku push: gzip stdin not in gzip format

When I try to push an update to Heroku in one of my PHP apps I get the following problem:
Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (13/13), 1.20 KiB, done.
Total 13 (delta 10), reused 0 (delta 0)
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> PHP app detected
-----> Run Sitebase buildpack
-----> Bundling Apache version 2.2.22
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
! Heroku push rejected, failed to compile Php app
To git#heroku.com:x
! [remote rejected] feature-removeapi -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:x'
Never had this problem before so I totally don't have a clue what the problem can be.
Is it possible that this is a bug on Heroku's side?
If I look in the Heroku logs I also see the following line:
Slug compilation failed: failed to compile Php app
All help is welcome.
I my cases that I had this problem it seemed to be a Heroku problem. Just waiting 10 minutes or so did the trick for me.
After so many years and still, this issue occurs.
Btw: My fix was to pin to a specific version as mentioned here:
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v75 -a my-app
Same issue had occurred for my Java application which was built with Maven.
It got fixed by configuring Java buildpack provided by Heroku (Earlier I was using custom buildpack which used to work on heroku for same application).