[Q] android kernel compilation giving error - Android Q&A, Help & Troubleshooting

I am new to android. i am try to compile android kernel 3.4.0 for HTC device.
After running cross compile command,
"export CROSS_COMPILE=/home/jharvard/ndk-x86/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-"
when I run make clean command
"make clean && make mrproper"
It shows errors,
/home/jharvard/kernel-code/linux/scripts/gcc-version.sh: line 25: arm-eabi-gcc: command not found
/home/jharvard/kernel-code/linux/scripts/gcc-version.sh: line 26: arm-eabi-gcc: command not found
I am not getting any clue to solve this error. Suggest me how to get rid of this error. Thank you in advance.

tyr to use arm-linux-androideabi-4.8
it's work for me

Related

[Q] Run Linux execute file on Android

Hello I Want to run This File in my phone (via terminal emulator).
but after type ./amxxpc i have error
line 1: syntax error: unexpected "("
how i can fix that?
File witch I Want to start is in scripting.zip
Bump!
cheqolada said:
Hello I Want to run This File in my phone (via terminal emulator).
but after type ./amxxpc i have error
line 1: syntax error: unexpected "("
how i can fix that?
File witch I Want to start is in scripting.zip
Click to expand...
Click to collapse
Not possible.
a) The file is compiled for the wrong architecture and can only be executed on a Intel 386 type machine.
b) The file is linked with the GNU libraries, and can not be executed in the Android (bionic) environment.
You need to solve those two issues by recompiling it for the ARM architecture using the Android bionic libraries.
Try to get source and to compile for your device.

getting an error while building the source code

Hi,
i have downloaded android (jelly bean )source code, while building i have gone through this command
.build/envsetup.sh
then i got the following error
No command '.build' found, did you mean:
Command 'sbuild' from package 'sbuild' (universe)
Command 'pbuild' from package 'pbuilder-scripts' (universe)
Command 'xbuild' from package 'mono-xbuild' (main)
.build: command not found
i am not getting how to build my source code
i wan your help to complete my work
i will be very thank ful to you ....
thanks in advance

Ask question about kernel compiling

i am ready to give answers for your question and douts about kernel compiling and rom compiling
i know its sometimes feel hard to find solution i know how its like so feel free to ask
This guy need help
http://forum.xda-developers.com/showthread.php?t=3397932
Sent from my SM-G361F
I'm getting this kernel error and in not sure why http://pastebin.com/3tHLAJGP. So I deleted the error in line 181 and ran into this error http://pastebin.com/bKnX70tQ. I'm on Ubuntu 16.04. I'm coming from 15.10 I've never ran into these errors. Not even on 14.04.
Sent from my SM-G900P using XDA-Developers mobile app
Problem when building mediatek kernel
Hello guys,
I'm facing a small problem when compiling the stock rom for my device from source, but the main problem is when compiling the kernel.
Well, the settings are the following:
Device: LG G Pro Lite (D683)
Android version: 4.4.2 (AOSP + LG official files)
Build environment: Fedora 23 (make 3.81), kernel 4.7.X.
//------------------------- (TRYING) BUILDING THE KERNEL -----------------
Steps:
Code:
-> $ cd /home/mauro.mascarenhas/Documents/Android_ROM
-> $ mkdir KERNEL
-> $ cd KERNEL
-> $ tar xvzf LGD683_GProLite_Kitkat_V20c_Kernel.tar.gz
-> $ PATH
-> $ PATH=$PATH:/home/mauro.mascarenhas/Documentos/Android_ROM/AOSP/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/
-> $ export PATH
-> $ ./mk muse77_phone_kk n k
After that I was supposed to have an output but I get lots of error messages in the beginning like this:
Code:
/bin/bash: scl: line 1: syntax error: premature end of file
/bin/bash: error when importing the definition to `BASH_FUNC_scl'
More details (logs) are on this post: http://forum.xda-developers.com/optimus-g-pro/d680-development/rom-genesisg3-1-0-t3183601/post67512342#post67512342
Since now,
thank you A LOT.

Building kernel for Google Pixel 3 - Syntax error: "(" unexpected

Following theese instructions on the AOSP site "Building Kernels"
repo init -u android.googlesource.com/kernel/manifest -b android-msm-bluecross-4.9-pie-qpr1
repo sync
sh build/build.sh //This command throws an error.
sh build/build.sh
build/build.sh: 97: build/build.sh: Syntax error: "(" unexpected
This is line 97:
function rel_path() {
So it triggers on the parenthesis. Ive googled a little back and forth. And as far as I can tell - this error triggers because of missing shebang line. The document starts with a shebang line:
#!/bin/bash
Not sure whats wrong - Should I roll back to 18.04 or 14.04?
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic
michaelburrow189 said:
Following theese instructions on the AOSP site "Building Kernels"
repo init -u android.googlesource.com/kernel/manifest -b android-msm-bluecross-4.9-pie-qpr1
repo sync
sh build/build.sh //This command throws an error.
sh build/build.sh
build/build.sh: 97: build/build.sh: Syntax error: "(" unexpected
This is line 97:
function rel_path() {
So it triggers on the parenthesis. Ive googled a little back and forth. And as far as I can tell - this error triggers because of missing shebang line. The document starts with a shebang line:
#!/bin/bash
Not sure whats wrong - Should I roll back to 18.04 or 14.04?
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic
Click to expand...
Click to collapse
Welcome to the wonderful world of missing android documentation! rel_path appears to be a deprecated function of realpath. This is all stackexchange knows about it, and the android developer website gives me nothing useful. The only suggested fix I found is to try installing realpath and coreutils again.
Run,
sudo apt-get install coreutils
sudo apt-get install realpath
Then try building again. If you still get an error at the parentheses, then try putting a space between rel_path() so it's rel_path (). If you still get an error after that, then I'm out of ideas. I sincerely wish you luck navigating the horrible mess that is android source code.
Spaceminer said:
Welcome to the wonderful world of missing android documentation! rel_path appears to be a deprecated function of realpath. This is all stackexchange knows about it, and the android developer website gives me nothing useful. The only suggested fix I found is to try installing realpath and coreutils again.
Run,
sudo apt-get install coreutils
sudo apt-get install realpath
Then try building again. If you still get an error at the parentheses, then try putting a space between rel_path() so it's rel_path (). If you still get an error after that, then I'm out of ideas. I sincerely wish you luck navigating the horrible mess that is android source code.
Click to expand...
Click to collapse
Code:
sudo apt-get install realpath
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package realpath is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
manpages-pl manpages-fr-extra
E: Package 'realpath' has no installation candidate
Code:
type -a realpath
realpath is /usr/bin/realpath
Installing manpages-pl and manpages-fr-ekstra did work though.
But it is throwing me the same parenthesis error as before. Thanks though! I thought building the clean kernel would work kind'a smooth.

how to compile custom kernel?

How to compile custom kernel? i checked on motorola github but the source code there is for 3.x kernel. mine is 4.14.117.
Model: Moto G Power
Hardware Version: pvt
Model Number: XT2041-4
Android Version: 10
Android path level: September 1, 2020
Kernel Version: 4.14.117-perf+ #1 Wed Sep 2 13:22:48 CDT 2020
Build number: QPMS30.80-51-8
i think i found the correct source for my phone:
QPMS30.80-51-5 kernel source
but it wont compile. i get python errors. i'm using Ubuntu 20.04.
Bash:
./scripts/gcc-version.sh: line 26: python: command not found
./scripts/gcc-version.sh: line 27: python: command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
I have both versions of python installed so i'm not sure what the problem is.
skilo83 said:
i think i found the correct source for my phone:
QPMS30.80-51-5 kernel source
but it wont compile. i get python errors. i'm using Ubuntu 20.04.
Bash:
./scripts/gcc-version.sh: line 26: python: command not found
./scripts/gcc-version.sh: line 27: python: command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
I have both versions of python installed so i'm not sure what the problem is.
Click to expand...
Click to collapse
I had this problem in another case. But this solved my problem. Check if pyhon 3 is installed. If not then...
Code:
sudo apt install python3
sudo apt install python-is-python3
Koken2003 said:
I had this problem in another case. But this solved my problem. Check if pyhon 3 is installed. If not then...
Code:
sudo apt install python3
sudo apt install python-is-python3
Click to expand...
Click to collapse
yes i actually install python-is-python2 and it solved my problem. the source for my device seems to be made with an older android NDK. i would appreciate any help i can get. i'm just not sure what compiler to use to compile the source. the NDK i downloaded doesn't have any compilers in it.

Categories

Resources