Git Product home page Git Product logo

Comments (44)

KonstaT avatar KonstaT commented on July 19, 2024 2

@ezebongiovi As commented in lineage-rpi/android_local_manifest#8 (comment) I haven't released the full device specific source code for my LineageOS 16.0 & 17.1 builds (both Pi 3 & Pi 4). You can use these sources to build Linux kernel and other GPL licensed parts included in my images. There's also source code for the graphics drivers used in my builds if someone wants to work on that.

from android_kernel_brcm_rpi.

 avatar commented on July 19, 2024 1

I need android on my rpi3 with alsa snd loop modul active, so I tried to build the kernel.

Therefor, I'm using docker. I'll leave the dockerfile here incase anyone needs to build the kernel.
NOTE that I'm not entirly sure if its ok to mix the branches lineage-17.1-4.19 and lineage-17.1 as described in the dockerfile, so mabye you want to replace lineage-17.1-4.19 with lineage-17.1 if you are not targeting the rpi3. Oh and make sure to remove the CONFIG_SND_ALOOP line if you don't need the alsa snd loop modul.

FROM ubuntu:focal
	
# Install dependencies
# Installing is split into three parts on purpose
# Combining the first two might fail because of tzdata
# After the second part, we installed all the basics so git cloning is possible
# Then we clone before installing the third dependency part, since clonig takes time
# and dependencies in the third part may change (and if they do, we don't have to clone
# again due to build caching)
RUN apt-get update \
        && TZ="Europe/Germany" DEBIAN_FRONTENTD="noninteractive" apt-get install -y --no-install-recommends \
		tzdata
RUN apt-get update \
        &&DEBIAN_FRONTENTD="noninteractive" apt-get install -y --no-install-recommends \
        nano \
        wget \
        tmux \
		git git-core\
		curl \
		ca-certificates ca-certificates-java ca-certificates-mono

# Clone the gits, do it in three commands since target branches may change
WORKDIR /app
RUN git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 -b pie-release
RUN git clone https://github.com/lineage-rpi/proprietary_vendor_brcm -b lineage-17.1
# I'm using the lineage-17.1-4.19 branch here instead of the lineage-17.1 branch since the later seems to lack the lineageos_rpi3_defconfig file
RUN git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi -b lineage-17.1-4.19

# Install dependencies, part 3
RUN apt-get update \
        &&DEBIAN_FRONTENTD="noninteractive" apt-get install -y --no-install-recommends \
		make gcc flex bison build-essential zip unzip python3 bc \
		libssl-dev \
		openjdk-8-jdk gnupg gperf \
		zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev \
		x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils \
		xsltproc liblz4-tool vboot-utils u-boot-tools \
		device-tree-compiler 
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Prepare build environment
ENV BUILD_CORES=4
ENV PI_GENERATION=4
ENV ARCH=arm
ENV CROSS_COMPILE=/app/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-
# Update firmware path
RUN sed -i 's+CONFIG_EXTRA_FIRMWARE_DIR="../../../vendor/brcm/rpi+CONFIG_EXTRA_FIRMWARE_DIR="/app/proprietary_vendor_brcm/rpi+g' /app/android_kernel_brcm_rpi/arch/arm/configs/lineageos_rpi${PI_GENERATION}_defconfig
# Enable alsa loopback
RUN sed -i 's+# CONFIG_SND_ALOOP is not set+CONFIG_SND_ALOOP=m+g' /app/android_kernel_brcm_rpi/arch/arm/configs/lineageos_rpi${PI_GENERATION}_defconfig

# Actual building
WORKDIR /app/android_kernel_brcm_rpi
RUN make lineageos_rpi${PI_GENERATION}_defconfig
RUN make zImage dtbs -j${BUILD_CORES}
# Get the result
WORKDIR /app
RUN mv /app/android_kernel_brcm_rpi/arch/arm/boot/zImage /app/kernel_rpi${PI_GENERATION}.img

So, now my question is, after building, how can I incorperate my kernel into the images you provide (I'm refering to these)?

Edit: Oh and @wilsavery1 I got the same problem during building, I think installing libssl-dev fixed this error.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024 1

Thanks! I had missed that step this time around. Finally got it working. I appreciate your help!

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

There's three different ways to compile the kernel.

  1. Compiling kernel as part of Android build works for Pi 3 & Pi 4 for both lineage-16.0 & lineage-17.1 branches.

Setup build environment:
https://source.android.com/setup/build/initializing
https://source.android.com/setup/develop#installing-repo

E.g. for LineageOS 17.1 on Pi 4:

repo init -u git://github.com/LineageOS/android.git -b lineage-17.1
curl --create-dirs -L -o .repo/local_manifests/manifest_brcm_rpi.xml -O -L https://raw.githubusercontent.com/lineage-rpi/android_local_manifest/lineage-17.1/manifest_brcm_rpi.xml
repo sync

You can also add '--depth=1' parameter to the first command to create a shallow clone and save time and bandwidth on syncing the sources (repo init -u git://github.com/LineageOS/android.git -b lineage-17.1 --depth=1).

To compile:

. build/envsetup.sh
lunch lineage_rpi4-userdebug
mka kernel
  1. Building the kernel as standalone is also possible but requires some extra effort. It will save you from downloading the whole Android source code for this.

E.g. for LineageOS 18 on Pi 4:

Clone kernel source (https://github.com/lineage-rpi/android_kernel_brcm_rpi/tree/lineage-18.1).
Clone proprietaries to get firmware files (https://github.com/lineage-rpi/proprietary_vendor_brcm/tree/lineage-18.1).
Clone AOSP toolchains for 32-bit & 64-bit (https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/+/refs/heads/pie-release & https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+/refs/heads/pie-release).

git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi -b lineage-18.1
git clone https://github.com/lineage-rpi/proprietary_vendor_brcm -b lineage-18.1
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 -b pie-release
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b pie-release

Modify firmware path according to where you've saved them (https://github.com/lineage-rpi/android_kernel_brcm_rpi/blob/lineage-18.1/arch/arm/configs/lineageos_rpi4_defconfig#L1429 for 32-bit or https://github.com/lineage-rpi/android_kernel_brcm_rpi/blob/lineage-18.1/arch/arm64/configs/lineageos_rpi4_defconfig#L1441 for 64-bit). Also make note where you've saved the toolchain.

To compile 32-bit kernel execute from the root of kernel source (where X is the number of threads on your CPU for parallel jobs):

ARCH=arm CROSS_COMPILE=path/to/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make lineageos_rpi4_defconfig
ARCH=arm CROSS_COMPILE=path/to/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make zImage dtbs -jX

To compile 64-bit kernel execute from the root of kernel source (where X is the number of threads on your CPU for parallel jobs):

ARCH=arm64 CROSS_COMPILE=path/to/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make lineageos_rpi4_defconfig
ARCH=arm64 CROSS_COMPILE=path/to/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make Image dtbs -jX
  1. Using separate kernel build environment.

For Android 12 kernel build refer to https://github.com/lineage-rpi/android_kernel_manifest/tree/lineage-19.1.
For Android 13 kernel build refer to https://github.com/lineage-rpi/android_kernel_manifest/tree/lineage-20.0.

from android_kernel_brcm_rpi.

AmbientTech avatar AmbientTech commented on July 19, 2024

I created a android folder in my Documents where I store all 3 git files.

I have gotten all the way to
ARCH=arm CROSS_COMPILE=home/username/Documents/android/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make zImage dtbs -j1

and I get this
make: *** No rule to make target 'zImage'. Stop.

What did I do wrong?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

You need to be on the root of the kernel source directory to execute

ARCH=arm make lineageos_rpi4_defconfig
ARCH=arm CROSS_COMPILE=path/to/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make zImage dtbs -jX

You have a used a relative path for the toolchain (home/...) where you would've needed an absolute one (/home/...).

from android_kernel_brcm_rpi.

ezebongiovi avatar ezebongiovi commented on July 19, 2024

Hi @KonstaT I'm having this error when trying to build lineage-16.0
Screenshot from 2020-12-29 16-56-42

from android_kernel_brcm_rpi.

wilsavery1 avatar wilsavery1 commented on July 19, 2024

Hi KonstaT,
I follow the step by step to Building the kernel as standalone.
for some reason I keep getting this errors.
root@builder1:~/kernel/android_kernel_brcm_rpi# ARCH=arm make lineageos_rpi4_defconfig

WARNING: unmet direct dependencies detected for GENERIC_GETTIMEOFDAY
Depends on [n]: HAVE_GENERIC_VDSO [=n]
Selected by [y]:

  • HAVE_ARM_ARCH_TIMER [=y] && CPU_V7 [=y]

WARNING: unmet direct dependencies detected for GENERIC_GETTIMEOFDAY
Depends on [n]: HAVE_GENERIC_VDSO [=n]
Selected by [y]:

  • HAVE_ARM_ARCH_TIMER [=y] && CPU_V7 [=y]

configuration written to .config

ARCH=arm CROSS_COMPILE=/root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make zImage dtbs -j4
ake: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: No such file or directory
scripts/kconfig/conf --syncconfig Kconfig
./scripts/gcc-version.sh: 17: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 18: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 19: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 17: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 18: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 19: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
./scripts/clang-version.sh: 11: /root/kernel/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc: not found
init/Kconfig:34:warning: 'GCC_VERSION': number is invalid

Maybe you can point me in the right direction.

Thank you.

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@wilsavery1 Check the path for the toolchain.

Where did you clone it? Did you clone the right branch (pie-release)? Change into the directory you cloned it and run 'pwd' to get the path.

from android_kernel_brcm_rpi.

wilsavery1 avatar wilsavery1 commented on July 19, 2024

Thank you @KonstaT for you prompt response.
All source I got following the above instruction:
Clone kernel source (https://github.com/lineage-rpi/android_kernel_brcm_rpi/tree/lineage-17.1).
Clone proprietaries to get firmware files (https://github.com/lineage-rpi/proprietary_vendor_brcm/tree/lineage-17.1).
Clone AOSP toolchain (https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/+/refs/heads/pie-release).

Now I encounter another issue (bellow)
Please note that my building machine is a MacOS.

Thank you again for your help.

scripts/extract-cert.c:21:10: scripts/sortextable.cfatal error:: 23:10: 'openssl/bio.h'fatal error : file not found'elf.h'
file not found
#include <elf.h>#include <openssl/bio.h>

     ^~~~~~~         ^~~~~~~~~~~~~~~

scripts/recordmcount.c:28:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
1 error generated.
make[2]: *** [scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
DTCO arch/arm/boot/dts/overlays/act-led.dtbo
DTC arch/arm/boot/dts/bcm2708-rpi-b-plus.dtb
In file included from scripts/selinux/mdp/mdp.c:36:
In file included from ./security/selinux/include/classmap.h:2:
In file included from ./include/uapi/linux/capability.h:17:
./include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
In file included from scripts/selinux/genheaders/genheaders.c:18:
In file included from ./security/selinux/include/classmap.h:2:
In file included from ./include/uapi/linux/capability.h:17:
./include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Above instructions also specify that you clone the correct branches.

git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi -b lineage-17.1
git clone https://github.com/lineage-rpi/proprietary_vendor_brcm -b lineage-17.1
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 -b pie-release

There's a different toolchain for Mac (assuming you're using x86 one and not the new ARM kind).

git clone https://android.googlesource.com/platform/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.9 -b pie-release

from android_kernel_brcm_rpi.

wilsavery1 avatar wilsavery1 commented on July 19, 2024

Thank again @KonstaT.
I cloned the toolchain, double, and triple check my environment, made sure all path are correct.

I'm still getting the same error, still no luck.

scripts/sortextable.c:23:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
DTC arch/arm/boot/dts/bcm2708-rpi-b-plus.dtb
scripts/recordmcount.c:28:10: fatal error: 'elf.h' file not found
#include <elf.h>
^~~~~~~
scripts/extract-cert.c:21:10: fatal error: 'openssl/bio.h' file not found
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
DTCO arch/arm/boot/dts/overlays/adafruit18.dtbo
1 error generated.
In file included from scripts/selinux/mdp/mdp.c:36:
In file included from ./security/selinux/include/classmap.h:2:
In file included from ./include/uapi/linux/capability.h:17:
./include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
make[2]: *** [scripts/sortextable] Error 1
In file included from scripts/selinux/genheaders/genheaders.c:18:
In file included from ./security/selinux/include/classmap.h:2:
In file included from ./include/uapi/linux/capability.h:17:
./include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

I'm not a MacOS user so I really don't know about that.

Google searching the first error tells that it seems to be some common problem on MacOS trying to build Linux natively.

Problem with missing openssl headers can happen on Linux as well and for that you need to install libssl-dev package. No idea what is the MacOS equivalent.

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@EPNW Rather build the snd loop driver into the kernel instead of using a module (CONFIG_SND_ALOOP=y).

You can simply replace the kernel zImage on the boot partition of the Android image (/boot/zImage) with the kernel you built yourself.

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

Hello, I followed the instructions to compile a new version of the lineage os kernel for raspberry pi from my laptop to which I added a usb memory unit with the installation of the latest version of ubuntu, but typing the codes specified in the instructions the ubunto terminal cannot find the required files?

Thanks for the attention.

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

... but typing the codes specified in the instructions the ubunto terminal cannot find the required files?

Which steps did you follow? Can't find what required files?

from android_kernel_brcm_rpi.

ha-zhuzhu avatar ha-zhuzhu commented on July 19, 2024

From #24. I followed your first reply in this issue and used the second method.

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

From #24. I followed your first reply in this issue and used the second method.

Please be more precise on the exact steps. What OS are you using to build?

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

I performed the first step specified at the beginning of the instructions:
repo init -u git://github.com/LineageOS/android.git -b lineage-17.1
curl --create-dirs -L -o .repo/local_manifests/manifest_brcm_rpi.xml -O -L https://raw.githubusercontent.com/lineage-rpi/android_local_manifest/lineage-17.1/manifest_brcm_rpi.xml
repo sync
but the ubuntu 18.04 terminal gives the following result:
Copia di 1637505167044

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

... but the ubuntu 18.04 terminal gives the following result:

It even tells you exactly what to do. Also see https://source.android.com/setup/develop#installing-repo

from android_kernel_brcm_rpi.

ha-zhuzhu avatar ha-zhuzhu commented on July 19, 2024

From #24. I followed your first reply in this issue and used the second method.

Please be more precise on the exact steps. What OS are you using to build?

I was using ubuntu 20.04 in win10 wsl2.

I cloned the latest kernel source (https://github.com/lineage-rpi/android_kernel_brcm_rpi/tree/lineage-19.0), the corresponding firmware files (https://github.com/lineage-rpi/proprietary_vendor_brcm/tree/lineage-19.0) and 64-bit AOSP toolchains.

Then I made directories "vendor/brcm/" in the root of the kernel source, and copy the "rpi4/" directory into it.

At last I ran the commands to make Image then the error appeared.

ARCH=arm64 CROSS_COMPILE=path/to/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make lineageos_rpi4_defconfig
ARCH=arm64 CROSS_COMPILE=path/to/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make Image dtbs -jX

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@3ndym10n
Did you actually clone the repository with the git clone command? There's a lot of symlinks in the dts/overlays that can't break.

Firmware is also in the wrong place (unless you modified the line in defconfig as instructed) but it doesn't cause the error you saw.

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

... ma il terminale ubuntu 18.04 dà il seguente risultato:

Ti dice anche esattamente cosa fare. Vedi anche https://source.android.com/setup/develop#installing-repo

i ran the instructions on the page, on the ubuntu terminal but the result doesn't change

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

since using a terminal to find the files to download to compile them into an img file. for raspberry pi it involves many errors, it would not be easier to download the build files and modify them with a program that later converts them into an img file. ?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

i ran the instructions on the page, on the ubuntu terminal but the result doesn't change

I'm sure it does. If you install repo you can also use it to download the source code. Setting up the build environment is just something that you need to figure out.

since using a terminal to find the files to download to compile them into an img file. for raspberry pi it involves many errors, it would not be easier to download the build files and modify them with a program that later converts them into an img file. ?

Not sure you quite understand how this works. There's only bunch of source code that eventually gets compiled and packaged into a flashable image. But yes, if you managed to compile the kernel you would use it replace the /boot/zImage (or Image on 64-bit) on the existing Android image.

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

Not sure you quite understand how this works. There's only bunch of source code that eventually gets compiled and
packaged into a flashable image. But yes, if you managed to compile the kernel you would use it replace the /boot/zImage (or Image on 64-bit) on the existing Android image.

yes even if in this case the programs that make up the operating system will be grouped in a list and then used to make up the operating system which in turn is saved as an img file. to be installed.
However i am interested in making a simple modification to lineage, which concerns the multi-cam functions to be able to use apps with multiple usb webcams at the same time?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

However i am interested in making a simple modification to lineage, which concerns the multi-cam functions to be able to use apps with multiple usb webcams at the same time?

And this would have what to do with the kernel?

Android camera HAL I'm using on LineageOS 16/17/18 builds already supports up to three cameras (1 x camera module + 2 x USB webcams or 3 x USB webcams).

from android_kernel_brcm_rpi.

adriano98bis avatar adriano98bis commented on July 19, 2024

I'm trying an app that uses 3 usb webcams, but every time I select a new one the previous one is deactivated rather than continue to work, this is the code:
WebCamDevice[] devices = WebCamTexture.devices;
foreach (WebCamDevice device in devices)
{
if (GUILayout.Button(device.name, GUILayout.Width(200), GUILayout.Height(40)))
{
_mSelected = true;
_mTexture = new WebCamTexture(device.name, 128, 128, 30);
_mTexture.Play();
_mWebCamMaterial.mainTexture = _mTexture;
}
}
reading the articles on the android site I found that the system groups all the physical webcams into a single logical webcam, so I think a kernel modification is needed; or is it my code that prevents me from using 3 webcams?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@adriano98bis
Sorry, no idea but most likely nothing to do with the kernel.

Source code for the camera HAL is now here (https://github.com/lineage-rpi/android_hardware_camera-v4l2/tree/lineage-18.1).

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

I'm receiving the exact same errors as wilsavery1 did in his March 25, 2021 post on both my Raspberry Pi on RPOS and on Ubuntu 20.04 on my Lenovo laptop. I verified the path was correct by using it to copy the arm-linux-androidkernel-gcc to my desktop as well as with "ls -l". I am also receiving the errors related to ARM from the same post:
WARNING: unmet direct dependencies detected for GENERIC_GETTIMEOFDAY
Depends on [n]: HAVE_GENERIC_VDSO [=n]
Selected by [y]:

HAVE_ARM_ARCH_TIMER [=y] && CPU_V7 [=y]
WARNING: unmet direct dependencies detected for GENERIC_GETTIMEOFDAY
Depends on [n]: HAVE_GENERIC_VDSO [=n]
Selected by [y]:

HAVE_ARM_ARCH_TIMER [=y] && CPU_V7 [=y]

So neither issue appears to be Mac related

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@NumberOneGit There is no error there (just warning).

You need to use 64-bit toolchain and defconfig for lineage-18.1 and lineage-19.0 branches.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

Thanks, I will try to figure that out. Currently:
~/lineage18/android_kernel_brcm_rpi $ ARCH=arm CROSS_COMPILE=/home/pi/lineage18/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel- make lineageos_rpi4_defconfig
Traceback (most recent call last):
File "/home/pi/lineage18/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)

I will stick with it and figure it out

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@NumberOneGit That's not the actual error message either.

You're still trying to build 32-bit (arm) kernel.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

I get the same results with:
ARCH=arm64 CROSS_COMPILE=/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make lineageos_rpi4_defconfig

But are you saying the issue is that I've downloaded the wrong source code?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

I have no way of knowing what you've done (or what you've downloaded). I can't really help either if you don't post the output with the actual error message.

One of your edited/removed messages implied that you've given wrong path for the toolchain. Based on the 'pi' username you're trying to build this on Raspberry Pi which is obviously not going to work (these are x86 toolchains used to crosscompile arm executables on x86 architecture).

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

ARCH=arm64 CROSS_COMPILE=/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make Image dtbs -j8
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:38: LSE atomics not supported by binutils
arch/arm64/Makefile:52: Detected assembler with broken .inst; disassembly will be unreliable
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
scripts/kconfig/conf --syncconfig Kconfig
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
init/Kconfig:34:warning: 'GCC_VERSION': number is invalid
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:52: Detected assembler with broken .inst; disassembly will be unreliable
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
DTCO arch/arm64/boot/dts/overlays/act-led.dtbo
DTCO arch/arm64/boot/dts/overlays/adafruit18.dtbo
DTCO arch/arm64/boot/dts/overlays/adau1977-adc.dtbo
DTCO arch/arm64/boot/dts/overlays/adau7002-simple.dtbo
DTCO arch/arm64/boot/dts/overlays/ads1015.dtbo
DTCO arch/arm64/boot/dts/overlays/ads1115.dtbo
DTCO arch/arm64/boot/dts/overlays/ads7846.dtbo
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
make[2]: *** [scripts/Makefile.lib:319: arch/arm64/boot/dts/overlays/ads1015.dtbo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.lib:319: arch/arm64/boot/dts/overlays/ads1115.dtbo] Error 1
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compile
os.execv(self.argv0, self.execargs}
OSError: [Errno 8] Exec format error
CC scripts/mod/empty.o
make[2]: *** [scripts/Makefile.lib:319: arch/arm64/boot/dts/overlays/adau1977-adc.dtbo] Error 1
make[1]: *** [scripts/Makefile.build:553: arch/arm64/boot/dts/overlays] Error 2
CC scripts/mod/devicetable-offsets.s
make: *** [Makefile:1359: dtbs] Error 2
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
Traceback (most recent call last):
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 66, in
main(sys.argv)
make[1]: *** [scripts/Makefile.build:283: scripts/mod/empty.o] Error 1
make[1]: *** Waiting for unfinished jobs....
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 63, in main
cw.invoke_compiler()
File "/home/pi/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc", line 58, in invoke_compiler
os.execv(self.argv0, self.execargs)
OSError: [Errno 8] Exec format error
make[1]: *** [scripts/Makefile.build:99: scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1211: prepare0] Error 2

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

@NumberOneGit Like said, you can't use Raspberry Pi to compile this (using AOSP toolchains at least). Android build is only supported on linux-x86 (MacOS is also no longer supported https://source.android.com/setup/build/initializing). Raspberry Pi is an arm device which is also why you need to use specific toolchain to compile on x86 architecture.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

Ah, sorry. I seem to be replying to certain comments without having refreshed the page to see your updated comment. I think you added the second paragraph above after typing the first portion and I replied without refreshing the page. I'll try that all now, thanks for the help and your patience.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

I'm back to where I was in my original post referencing the earlier post from the other user on March 25, 2021. I didn't actually paste in the messages since they were identical in my first post, but:
tzar@C930:~/lineage/android_kernel_brcm_rpi$ ARCH=arm64 CROSS_COMPILE=/home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make lineageos_rpi4_defconfig
./scripts/gcc-version.sh: 17: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 18: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 19: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 17: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 18: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/gcc-version.sh: 19: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
./scripts/clang-version.sh: 11: /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc: not found
init/Kconfig:34:warning: 'GCC_VERSION': number is invalid

I copied and pasted the path from the "not found" message and can clearly see "aarch64-linux-androidkernel-gcc" in the /home/tzar/lineage/aarch64-linux-android-4.9/bin folder. I'm on a 64-bit version of Ubuntu on a Lenovo.

tzar@C930:~/lineage/android_kernel_brcm_rpi$ ls -l /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc
lrwxrwxrwx 1 tzar tzar 25 Feb 25 23:44 /home/tzar/lineage/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-gcc -> aarch64-linux-android-gcc

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Could be something missing/messed up in your build environment. Check https://source.android.com/setup/build/initializing that you've installed the required packages.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

If the kernel compiles properly will there be a successful build message at the end? After rolling back to an earlier Ubuntu, everything seemed to go mostly fine with a few minor errors. Will the final product of a successful build be an Image file in the /android_kernel_brcm_rpi folder?

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Build products will be in kernel source's arch/arm64/boot/ directory unless you've specified some other output directory.

from android_kernel_brcm_rpi.

NumberOneGit avatar NumberOneGit commented on July 19, 2024

It seems to get a good deal of the way through (after a regulatory.db error at the beginning), but ultimately ends with these errors. I decided to try to compile the kernel without changes until I could get it to work as is explicitly following the directions and these were results:

ARCH=arm64 CROSS_COMPILE=/home/tzar/lineage18/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel- make Image dtbs -j8 -k
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/regulatory.db', needed by 'drivers/base/firmware_loader/builtin/regulatory.db.gen.o'.
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/regulatory.db.p7s', needed by 'drivers/base/firmware_loader/builtin/regulatory.db.p7s.gen.o'.
UPD drivers/base/firmware_loader/builtin/regulatory.db.p7s.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43455-sdio.bin', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.bin.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.bin.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43455-sdio.clm_blob', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.clm_blob.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.clm_blob.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43455-sdio.txt', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.txt.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43455-sdio.txt.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43456-sdio.bin', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.bin.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.bin.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43456-sdio.clm_blob', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.clm_blob.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.clm_blob.gen.S
make[4]: *** No rule to make target '../../../vendor/brcm/rpi4/proprietary/vendor/firmware/brcm/brcmfmac43456-sdio.txt', needed by 'drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.txt.gen.o'.
UPD drivers/base/firmware_loader/builtin/brcm/brcmfmac43456-sdio.txt.gen.S
make[4]: Target '__build' not remade because of errors.
make[3]: *** [scripts/Makefile.build:553: drivers/base/firmware_loader/builtin] Error 2
make[3]: Target '__build' not remade because of errors.
make[2]: *** [scripts/Makefile.build:553: drivers/base/firmware_loader] Error 2

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Please read the instructions.

Modify firmware path according to where you've saved them (https://github.com/lineage-rpi/android_kernel_brcm_rpi/blob/lineage-18.1/arch/arm/configs/lineageos_rpi4_defconfig#L1424 for 32-bit or https://github.com/lineage-rpi/android_kernel_brcm_rpi/blob/lineage-18.1/arch/arm64/configs/lineageos_rpi4_defconfig#L1439 for 64-bit).

from android_kernel_brcm_rpi.

Related Issues (20)

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.