[Q]Building kernel - LG G2 Mini

i was trying to build a custom kernel for our device.
i got everything setup with ndk and the d620r kernel source from lg's site
when im trying to point the ndk to the kernel and make mrproper i get
Code:
[email protected]:~/kernel$ export CROSS_COMPILE=/home/john/NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
[email protected]:~/kernel$ make clean && make mrproper
objcopy: '.ihex': No such file
/home/john/kernel/firmware/Makefile:328: målet "/home/john/kernel/firmware/melfas/" anges flera gånger i samma regel.
objcopy: '.ihex': No such file
/home/john/kernel/firmware/Makefile:328: målet "/home/john/kernel/firmware/melfas/" anges flera gånger i samma regel.
CLEAN scripts/basic
CLEAN include/config
[email protected]:~/kernel$
does anyone know what the problem is ?
målet is : goal and anges flera gånger i samma regel is like "spotted many times in the same rules"
EDIT*
okej so i got pass making the .config file and got into the menuconfig and saved it. now im trying to compile the new kernel
and this is what i get. even though that -cc file is in that folder.
MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0xc044): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_linear_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_linear_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0xc05c): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_legacy_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_legacy_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
make[1]: *** [vmlinux.o] Error 1
make: *** [vmlinux.o] Error 2
[email protected]:~/android/kernel/kernel$
Click to expand...
Click to collapse

invaderjohn said:
i was trying to build a custom kernel for our device.
i got everything setup with ndk and the d620r kernel source from lg's site
when im trying to point the ndk to the kernel and make mrproper i get
Code:
[email protected]:~/kernel$ export CROSS_COMPILE=/home/john/NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
[email protected]:~/kernel$ make clean && make mrproper
objcopy: '.ihex': No such file
/home/john/kernel/firmware/Makefile:328: målet "/home/john/kernel/firmware/melfas/" anges flera gånger i samma regel.
objcopy: '.ihex': No such file
/home/john/kernel/firmware/Makefile:328: målet "/home/john/kernel/firmware/melfas/" anges flera gånger i samma regel.
CLEAN scripts/basic
CLEAN include/config
[email protected]:~/kernel$
does anyone know what the problem is ?
målet is : goal and anges flera gånger i samma regel is like "spotted many times in the same rules"
EDIT*
okej so i got pass making the .config file and got into the menuconfig and saved it. now im trying to compile the new kernel
and this is what i get. even though that -cc file is in that folder.
Click to expand...
Click to collapse
i have the same problem,any clue how to solve this problem?

Related

[HOWTO] Build custom kernel, libraries and applications on your own

For building own custom stuff for my Gen8 Device I set up an Ubuntu 10.10 32bit Virtual Machine, so everything in here refers to it, may be different on other linux system.
[disclaimer]This is only a HowTo, if you brick your android device with some custom kernels or other stuff, don't blame me! I'm not responsible for anything you do![/disclaimer]
Notice: ** = you only have to do this step once
Prerequisites for Ubuntu 10.10 32 Bit: **
Code:
# sudo apt-get install git-core flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl automake autoconf libtool gettext texinfo libmpfr1ldbl
Prepare environment: **
Code:
# mkdir -pv $HOME/{archos,bin}
# echo export ARCHOS=\$HOME/archos >> ~/.bashrc
# echo export PATH=\$HOME/bin:\$PATH >> ~/.bashrc
# cd $HOME/archos
# wget -Oavos_env.tgz http://archos-gen8-dvb.googlecode.com/files/avos_env_20110415.tgz
# tar xzf avos_env.tgz
# install -m755 cross $HOME/bin/
# rm -f cross avos_env.tgz
RESTART CONSOLE OR REBOOT COMPUTER!
Toolchain: **
Code:
# cd $ARCHOS
# make all
Configure kernel:
Code:
# cd $ARCHOS
# make kernel-config
Restore kernel config:
Code:
# cd $ARCHOS
# make kernel-reset
Build kernel:
Code:
# cd $ARCHOS
# make kernel-build
CrossCompile: (this is just an example for if you want to build some linux libraries or tools)
Code:
# echo $ARCHOS
# cd ..xyz../..zyx../
# cross make
I followed your instructions, and I got all the way to the end, but when I did 'make kernel-build' it ended with this:
drivers/built-in.o: In function `archos_dpm_suspend':
/home/zyntax/archos/gen8-gpl-froyo/linux/drivers/usb/storage/archos_hdd.c:261: undefined reference to `usbsata_power'
make[3]: *** [.tmp_vmlinux1] Error 1
make[2]: *** [sub-make] Error 2
make[2]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/linux'
make[1]: *** [/home/zyntax/archos/gen8-gpl-froyo/buildroot//linux/arch/arm/boot/zImage] Error 2
make[1]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/buildroot'
make: *** [kernel-build] Error 2
[email protected]:~/archos$
This is on a fresh install of Ubuntu 10.10 32-bit in Virtualbox. I installed it, updated the OS, then started your steps. Not sure if this is normal and I'm holding off on the last step. I did do one extra step: in 'make kernal-config' I deselected all the Archos boards under System Type except for the A101IT since that's what I have.
jbradshw said:
This is on a fresh install of Ubuntu 10.10 32-bit in Virtualbox. I installed it, updated the OS, then started your steps. Not sure if this is normal and I'm holding off on the last step. I did do one extra step: in 'make kernal-config' I deselected all the Archos boards under System Type except for the A101IT since that's what I have.
Click to expand...
Click to collapse
can you please try again without modifying kernel config?
Did that, now I get this:
CC [M] drivers/usb/musb/omap2430.o
/home/zyntax/archos/gen8-gpl-froyo/linux/drivers/usb/musb/omap2430.c:221: warning: 'omap_phy_read' defined but not used
LD [M] drivers/usb/musb/musb_hdrc.o
LD drivers/built-in.o
make[2]: *** [sub-make] Error 2
make[2]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/linux'
make[1]: *** [/home/zyntax/archos/gen8-gpl-froyo/buildroot//linux/arch/arm/boot/zImage] Error 2
make[1]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/buildroot'
make: *** [kernel-build] Error 2
I don't believe I changed anything besides what I mentioned earlier. Is there anyway to get back a default kernel-config?
hehe, I thought you should try with default kernel-config
I added a section for restoring kernel config in the start posting :
chulri said:
[*]Restore kernel config:
Code:
# cd $ARCHOS
# tar xzf gen8-gpl-froyo.tgz gen8-gpl-froyo/linux/linux.config
Click to expand...
Click to collapse
Well I did poke around in the config, but as far as I remember I only removed those extra archos systems. I'll restore the default and run it again later tonight.
Thanks.
jbradshw said:
Well I did poke around in the config, but as far as I remember I only removed those extra archos systems. I'll restore the default and run it again later tonight.
Click to expand...
Click to collapse
You can't remove other devices (like A32, A101 etc) from Linux kernel config because Archos made bad dependencies for different parts of the kernel and even 70S requires some USB kernel code, it's only compiled when you choose A101 - so either you clean it up manually, or you are required to leave checked other archos devices :/
Thanks for this howto, this is gonna be useful for me, should be a sticky.
OK the make kernel-build worked without errors. Now I'm just questioning the command 'cd ..xyz../..zyx../' I don't have any files or directories called that, and running that reports the same. Can I just skip that and do the make cross?
@jbradshw that's just a sample if someone wants to crosscompile something (e.g. some linux library or application like linuxtv-dvb-apps or w_scan)
you don't have to do everything mentioned in the howto. it's a HowTo not a HaveTo
Ahh OK. So I guess I'm done then. I haven't installed the SDE on my Archos yet, but what's the final 'thing' that came out of this procedure that I'll be placing on the tablet?
Also I don't have an microSD card yet, and I know there was talk of putting stuff on there - can this be done using just the internal memory (8 GB for me)?
you have to install the SDE to install a custom kernel. follow this guide: http://forum.xda-developers.com/showthread.php?p=10157349#post10157349
Yeah I saw that guide, my question is where is the zImage and initramfs.cpio.gz that I assume was part of the compiling I just did? And also if a microSD card is needed for any of this?
no microsd is needed
initramfs.cpio.gz can be extracted from current installation ( /dev/mmcblk0p1 -> init ), read this: http://forum.xda-developers.com/showthread.php?t=880321&page=5
zImage is compiled at this location: $ARCHOS/gen8-gpl-froyo/buildroot/linux/arch/arm/boot/zImage
Shouldn't it be
Code:
cross make kernel-build
?
Here I have to use cross, which makes sense to find gcc arm binaries.
No you don't. In case of building stuff which comes with the gen8-gpl-froyo.tgz (e.g. kernel) the env vars are set up by the supplied makefiles
chulri said:
No you don't. In case of building stuff which comes with the gen8-gpl-froyo.tgz (e.g. kernel) the env vars are set up by the supplied makefiles
Click to expand...
Click to collapse
If I don't use cross, here is what I get:
[email protected]:~/archos$ make kernel-build
make -C gen8-gpl-froyo/linux mrproper
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/home/ubuntu/archos/gen8-gpl-froyo/linux'
make[3]: arm-linux-gcc: Command not found
But using cross it compiled fine, though I followed carefully your directions !
Apparently I was too frightened by the error messages, since it does work in the end
Thank you very much, hope some good things come from this !
Cheers !
desiresush said:
Apparently I was too frightened by the error messages, since it does work in the end
Click to expand...
Click to collapse
Yeah it's just an annoying bug, it doesn't hurt because "mrproper" only cleans the build directory and doesn't need compiler at all
2.6.29 kernel for Froyo?
Does anybody know, why Archos releases the SDK with a 2.6.29 kernel?
Shouldn't 2.2 Froyo be a 2.6.32 kernel?

[Q] Building Kernel error

Hello,
I want build the kernel of Xperia S but I hava this error :
Code:
arch/arm/mach-msm/qdsp6v2/audio_acdb.c: In function 'store_vocvol_cal':
/home/cemal/Bureau/Sourceicsxs/kernel/arch/arm/include/asm/atomic.h:249: error: 'asm' operand requires impossible reload
Thank you !
Solved
Solved I write in the Makefile the flag --disable-werror. Nice
Edit : BUT i have a new error
Code:
arch/arm/mach-msm/qdsp6v2/audio_acdb.c: In function 'store_vocvol_cal':
/home/cemal/Bureau/Sourceicsxs/kernel/arch/arm/include/asm/atomic.h:249: error: 'asm' operand requires impossible reload
make[2]: *** [arch/arm/mach-msm/qdsp6v2/audio_acdb.o] Erreur 1
make[1]: *** [arch/arm/mach-msm/qdsp6v2] Erreur 2
make: *** [arch/arm/mach-msm] Erreur 2
Anything Ideas ?
c3ma138 said:
Solved I write in the Makefile the flag --disable-werror. Nice
Edit : BUT i have a new error
Code:
arch/arm/mach-msm/qdsp6v2/audio_acdb.c: In function 'store_vocvol_cal':
/home/cemal/Bureau/Sourceicsxs/kernel/arch/arm/include/asm/atomic.h:249: error: 'asm' operand requires impossible reload
make[2]: *** [arch/arm/mach-msm/qdsp6v2/audio_acdb.o] Erreur 1
make[1]: *** [arch/arm/mach-msm/qdsp6v2] Erreur 2
make: *** [arch/arm/mach-msm] Erreur 2
Anything Ideas ?
Click to expand...
Click to collapse
You shouldn't have to edit the Makefile. Are you using the tool chain recommended by Sony? Make sure your path selects them before anything else. Also I would reset locale to C before compiling ("Erreur"?!), it may play some tricks.
kuisma said:
You shouldn't have to edit the Makefile. Are you using the tool chain recommended by Sony? Make sure your path selects them before anything else. Also I would reset locale to C before compiling ("Erreur"?!), it may play some tricks.
Click to expand...
Click to collapse
I use the ndk toolchain, where can I find the Sony toolchain
Edit : arm-[...].4.6
c3ma138 said:
I use the ndk toolchain, where can I find the Sony toolchain
Edit : arm-[...].4.6
Click to expand...
Click to collapse
You find the specific instructions for the Xperia S at http://developer.sonymobile.com/wp/...-archive-released-with-building-instructions/ referring to the kernel building howto at http://developer.sonymobile.com/wp/2011/05/06/how-to-build-a-linux-kernel/ recommending you to use the tool chain at https://sourcery.mentor.com/sgpp/lite/arm/portal/[email protected]=lite
Follow those instructions before start tinkering with Makefiles, tools, build environment etc and I'm sure you'll succeed.
And reset locale to C! I.e. unset the LANG and LC_* environment variables in your shell before running the build scripts.
kuisma said:
You find the specific instructions for the Xperia S at http://developer.sonymobile.com/wp/...-archive-released-with-building-instructions/ referring to the kernel building howto at http://developer.sonymobile.com/wp/2011/05/06/how-to-build-a-linux-kernel/ recommending you to use the tool chain at https://sourcery.mentor.com/sgpp/lite/arm/portal/[email protected]=lite
Follow those instructions before start tinkering with Makefiles, tools, build environment etc and I'm sure you'll succeed.
And reset locale to C! I.e. unset the LANG and LC_* environment variables in your shell before running the build scripts.
Click to expand...
Click to collapse
thank you,
But this does not work
I download: https://sourcery.mentor.com/sgpp/lite/arm/portal/release2188
then: http://developer.sonymobile.com/wportal/devworld/downloads/download/61a0452tarbz2
I unzipped all in my Desktop and in a terminal, I wrote:
- cd source/kernel
- ARCH=arm CROSS_COMPILE=/home/cemal/Bureau/arm-2012.03/bin/arm-none-eabi- make fuji_nozomi_defconfig
- ARCH=arm CROSS_COMPILE=/home/cemal/Bureau/arm-2012.03/bin/arm-none-eabi- make
c3ma138 said:
But this does not work
Click to expand...
Click to collapse
Sorry, but I'm no mind reader. "does not work" is not sufficient information for me to reply anything helpful to.
The basic is, if you don't know what you are doing, do it by the book. Still not working? Ask for help. Sony Xperia has presented quite a verbose instruction about how to compile their kernels. Try following this before choosing your own tool chain, edit Makefiles and so. When you get problems, read the instructions more carefully and/or ask the community (hi!) for help, with somewhat more detailed information about what you did and how it failed. The more verbose information you present, the more likely you are to get a useful reply.
Best of luck.
------------------
(edit)
A curious question, why do you want to compile a new kernel? I get the impression this is not your field of expertise, and maybe you are trying to achieve something somewhat more complicated than needed.
Hello,
I encounter the same kind of issue. Does anyone could help me ?
I work in an Ubuntu PC (10.04).
I have downloaded the toolchain for Linux from sourcery.mentor.com (arm-2012.03-57-arm-none-linux-gnueabi.bin)
Then the kernel source code 6.1.A.0.452 from developer.sonymobile.com/downloads/xperia-open-source-archives/open-source-archive-for-build-6-1-a-0-452-6-1-a-0-453-and-6-1-a-0-454
and I execute:
cd kernel
ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make fuji_nozomi_defconfig
ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make
Then I have the following error:
CC arch/arm/mm/proc-syms.o
CC arch/arm/mm/alignment.o
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:298:15: warning: 'offset.un' may be used uninitialized in this function [-Wuninitialized]
error, forbidden warning: alignment.c:298
make[1]: *** [arch/arm/mm/alignment.o] Error 1
make: *** [arch/arm/mm] Error 2
Many thanks in advance for your help
zongojim said:
Hello,
I encounter the same kind of issue. Does anyone could help me ?
I work in an Ubuntu PC (10.04).
I have downloaded the toolchain for Linux from sourcery.mentor.com (arm-2012.03-57-arm-none-linux-gnueabi.bin)
Then the kernel source code 6.1.A.0.452 from developer.sonymobile.com/downloads/xperia-open-source-archives/open-source-archive-for-build-6-1-a-0-452-6-1-a-0-453-and-6-1-a-0-454
and I execute:
cd kernel
ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make fuji_nozomi_defconfig
ARCH=arm CROSS_COMPILE=~/Toolchain/ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make
Then I have the following error:
CC arch/arm/mm/proc-syms.o
CC arch/arm/mm/alignment.o
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:298:15: warning: 'offset.un' may be used uninitialized in this function [-Wuninitialized]
error, forbidden warning: alignment.c:298
make[1]: *** [arch/arm/mm/alignment.o] Error 1
make: *** [arch/arm/mm] Error 2
Many thanks in advance for your help
Click to expand...
Click to collapse
You need android-ndk-r5b to compile the Xperia kernel source. I.e. you can not use the latest NDK.
Thanks a lot for your answer
Unfortunately, I didn't find android-ndk-r5b for Linux.
Could you kindly indicate me where I can get it ?
thanks !
zongojim said:
Thanks a lot for your answer
Unfortunately, I didn't find android-ndk-r5b for Linux.
Could you kindly indicate me where I can get it ?
thanks !
Click to expand...
Click to collapse
http://dl.google.com/android/ndk/android-ndk-r5b-linux-x86.tar.bz2
Thanks again, I really apreciate your support !
I have downladed and extracted android-ndk-r5b to my Ubuntu station.
it seems that is is not a built version, right ?
I have tried to navigate in the documentation, but it does not look so trivial...
Would you know how to simply compile it ?
zongojim said:
Thanks again, I really apreciate your support !
I have downladed and extracted android-ndk-r5b to my Ubuntu station.
it seems that is is not a built version, right ?
I have tried to navigate in the documentation, but it does not look so trivial...
Would you know how to simply compile it ?
Click to expand...
Click to collapse
It's compiled ready to use.
Read the documentation at http://developer.sonymobile.com/wp/2011/05/06/how-to-build-a-linux-kernel/
Replace the toolchain path with e.g. "CROSS_COMPILE=/opt/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-" and you are good to go.
ok nice.
Then I tried again and... I've got a different error !
Here is what I have done:
$ ARCH=arm CROSS_COMPILE=~/Toolchain/arm-2011.03-41-arm-none-linux-gnueabi/bin/arm-none-ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make fuji_nozomi_defconfig
arch/arm/mach-msm/Kconfig:2107:warning: defaults for choice values not supported
arch/arm/mach-msm/Kconfig:2113:warning: defaults for choice values not supported
#
# configuration written to .config
#
$ ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make clean
$ ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm/mach-msm/Kconfig:2107:warning: defaults for choice values not supported
arch/arm/mach-msm/Kconfig:2113:warning: defaults for choice values not supported
make[1]: `include/generated/mach-types.h' is up to date.
arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables"
arch/arm/mach-msm/qdsp6v2/audio_acdb.c: In function 'store_vocvol_cal':
/prj/mms/smdswv/users/jmgrimaud/Xperia/6.1.A.0.452/kernel/arch/arm/include/asm/atomic.h:249: error: 'asm' operand requires impossible reload
make[2]: *** [arch/arm/mach-msm/qdsp6v2/audio_acdb.o] Error 1
make[1]: *** [arch/arm/mach-msm/qdsp6v2] Error 2
make: *** [arch/arm/mach-msm] Error 2
zongojim said:
ok nice.
Then I tried again and... I've got a different error !
Here is what I have done:
$ ARCH=arm CROSS_COMPILE=~/Toolchain/arm-2011.03-41-arm-none-linux-gnueabi/bin/arm-none-ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make fuji_nozomi_defconfig
arch/arm/mach-msm/Kconfig:2107:warning: defaults for choice values not supported
arch/arm/mach-msm/Kconfig:2113:warning: defaults for choice values not supported
#
# configuration written to .config
#
$ ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make clean
$ ARCH=arm CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- make
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm/mach-msm/Kconfig:2107:warning: defaults for choice values not supported
arch/arm/mach-msm/Kconfig:2113:warning: defaults for choice values not supported
make[1]: `include/generated/mach-types.h' is up to date.
arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables"
arch/arm/mach-msm/qdsp6v2/audio_acdb.c: In function 'store_vocvol_cal':
/prj/mms/smdswv/users/jmgrimaud/Xperia/6.1.A.0.452/kernel/arch/arm/include/asm/atomic.h:249: error: 'asm' operand requires impossible reload
make[2]: *** [arch/arm/mach-msm/qdsp6v2/audio_acdb.o] Error 1
make[1]: *** [arch/arm/mach-msm/qdsp6v2] Error 2
make: *** [arch/arm/mach-msm] Error 2
Click to expand...
Click to collapse
Only specify ONE toolchain ...
Also, I'm note quite sure if I used 4.4.0 or 4.4.3, since both are included in the same r5b distribution. You can also try;
CROSS_COMPILE=~/Toolchain//android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-
Thank you kuisma.
Sorry it was a copy/paste error, I had for sure specified only one toolchain.
So I am making a new test with CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-
I'll keep you informed
---------- Post added at 11:51 AM ---------- Previous post was at 11:15 AM ----------
It built, thanks again for your support, kuisma !
Not sure it is still in the scope of this topic, but continuing to execute the instructions found in developer.sonymobile.com/2011/05/06/how-to-build-a-linux-kernel/, I have some questions regarding Step C, absolutly not clear for me
What should I do exactly to prepare my boot.img ? What have I to do to create a ramdisk.img file, or where can I find it ? (in fact I do not know what it the ramdisk in the picture...is it required ?)
zongojim said:
Thank you kuisma.
Sorry it was a copy/paste error, I had for sure specified only one toolchain.
So I am making a new test with CROSS_COMPILE=~/Toolchain/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-
I'll keep you informed
---------- Post added at 11:51 AM ---------- Previous post was at 11:15 AM ----------
It built, thanks again for your support, kuisma !
Not sure it is still in the scope of this topic, but continuing to execute the instructions found in developer.sonymobile.com/2011/05/06/how-to-build-a-linux-kernel/, I have some questions regarding Step C, absolutly not clear for me
What should I do exactly to prepare my boot.img ? What have I to do to create a ramdisk.img file, or where can I find it ? (in fact I do not know what it the ramdisk in the picture...is it required ?)
Click to expand...
Click to collapse
Start with the original root filesystem from the standard boot.img you are already running.
You'll find my tool working with boot.img here: http://whiteboard.ping.se/Android/Unmkbootimg
Also, read the links on the page my signature links to, to get more information about how to build boot images, root file systems etc.
The ramdisk contains the root filesystem, and yes, it's very much needed.
Ok understood
last point: how to retrieve the boot.img from my Xperia S phone ? (that is already unlocked)
zongojim said:
Ok understood
last point: how to retrieve the boot.img from my Xperia S phone ? (that is already unlocked)
Click to expand...
Click to collapse
Last? Ok, I'll take your word for it.
http://www.youtube.com/watch?v=bB77gWRUI_A
Remember, Google is your friend.
help me somebody please
i'm trying to build custom kernel for my xperia M dual
got sources from sony's website, doing build by guide
here is an error:
Code:
In file included from drivers/usb/gadget/android.c:51:0:
drivers/usb/gadget/f_qdss.c: In function 'qdss_bind_config':
drivers/usb/gadget/f_qdss.c:586:38: warning: argument to 'sizeof' in 'strncmp' call is the same expression as the second source; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: f_qdss.c:586
make[3]: *** [drivers/usb/gadget/android.o] Error 1
make[2]: *** [drivers/usb/gadget] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2
is it an NDK version issue?
I'm running:
Code:
make -j8 ARCH=arm CROSS_COMPILE=/home/dev/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-
thanks

Building a PAC-Man ROM for an unsupported device

Hi guys!
I hereby state that I am a github and source-building n00b, and i could need your help
The thing is, I want to build a PAC-man ROM for the HTC Sensation. The pacman source is on github: https://github.com/PAC-man
And here is the device specific files, which I forked form the Pyramid CM10 Repo (Just to explore github) : https://github.com/InfinityFTW/android_device_htc_pyramid
And I was wondering, how does one add these files into the ROM, in order to build it properly?
I have searched, but I could not find a solution. I have heard about merging it in with the sources, but i'm not sure what way to go
If someone is familiar with this, please let me know.
Thanks
InfinityFTW said:
Hi guys!
I hereby state that I am a github and source-building n00b, and i could need your help
The thing is, I want to build a PAC-man ROM for the HTC Sensation. The pacman source is on github: https://github.com/PAC-man
And here is the device specific files, which I forked form the Pyramid CM10 Repo (Just to explore github) : https://github.com/InfinityFTW/android_device_htc_pyramid
And I was wondering, how does one add these files into the ROM, in order to build it properly?
I have searched, but I could not find a solution. I have heard about merging it in with the sources, but i'm not sure what way to go
If someone is familiar with this, please let me know.
Thanks
Click to expand...
Click to collapse
You need to clone device tree
Code:
cd android
cd device
mkdir htc
cd htc
git clone git://github.com/InfinityFTW/android_device_htc_pyramid.git -b jellybean pyramid
Then you need extract propietary files
Code:
cd pyramid
./extract-files.sh
And finally type
Code:
. build/envsetup.sh
lunch "select your device"
make -j4
Enviado desde mi X10i
Building error?
I got to the build part, and when i run the commands i got from a tutorial about compiling cm10 for the pyramid, and here is the entire log:
Code:
[email protected]:~/android/system$ . build/envsetup.sh; lunch cm_pyramid-userdebug; mka bacon
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including vendor/pa/vendorsetup.sh
including sdk/bash_completion/adb.bash
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
Device pyramid not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_htc_pyramid
Adding dependency: CyanogenMod/android_device_htc_pyramid -> device/htc/pyramid
Syncing repository to retrieve project.
error: .repo/manifests/: contains uncommitted changes
Repository synced!
Looking for dependencies
Adding dependencies to manifest
Adding dependency: CyanogenMod/android_device_htc_msm8660-common -> device/htc/msm8660-common
Syncing dependencies
error: .repo/manifests/: contains uncommitted changes
Done
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_pyramid'
** Do you have the right repo manifest?
The program 'schedtool' is currently not installed. You can install it by typing:
sudo apt-get install schedtool
What to do?
InfinityFTW said:
I got to the build part, and when i run the commands i got from a tutorial about compiling cm10 for the pyramid, and here is the entire log:
Code:
[email protected]:~/android/system$ . build/envsetup.sh; lunch cm_pyramid-userdebug; mka bacon
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including vendor/pa/vendorsetup.sh
including sdk/bash_completion/adb.bash
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
Device pyramid not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_htc_pyramid
Adding dependency: CyanogenMod/android_device_htc_pyramid -> device/htc/pyramid
Syncing repository to retrieve project.
error: .repo/manifests/: contains uncommitted changes
Repository synced!
Looking for dependencies
Adding dependencies to manifest
Adding dependency: CyanogenMod/android_device_htc_msm8660-common -> device/htc/msm8660-common
Syncing dependencies
error: .repo/manifests/: contains uncommitted changes
Done
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_pyramid'
** Do you have the right repo manifest?
The program 'schedtool' is currently not installed. You can install it by typing:
sudo apt-get install schedtool
What to do?
Click to expand...
Click to collapse
hey im trying to work my way thru the same thing...there is a lot of info out there, it takes forever to sort your way thru it..
so...first off, it helps us figure out problems with its output..do what it says.
sudo apt-get install schedtool
start there, then try again and see what comes up next
InfinityFTW said:
I got to the build part, and when i run the commands i got from a tutorial about compiling cm10 for the pyramid, and here is the entire log:
Code:
[email protected]:~/android/system$ . build/envsetup.sh; lunch cm_pyramid-userdebug; mka bacon
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including vendor/pa/vendorsetup.sh
including sdk/bash_completion/adb.bash
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
Device pyramid not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_htc_pyramid
Adding dependency: CyanogenMod/android_device_htc_pyramid -> device/htc/pyramid
Syncing repository to retrieve project.
error: .repo/manifests/: contains uncommitted changes
Repository synced!
Looking for dependencies
Adding dependencies to manifest
Adding dependency: CyanogenMod/android_device_htc_msm8660-common -> device/htc/msm8660-common
Syncing dependencies
error: .repo/manifests/: contains uncommitted changes
Done
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_pyramid'
** Do you have the right repo manifest?
The program 'schedtool' is currently not installed. You can install it by typing:
sudo apt-get install schedtool
What to do?
Click to expand...
Click to collapse
first of all
HTML:
The program 'schedtool' is currently not installed. You can install it by typing:
sudo apt-get install schedtool
there is a software missing install it next...
HTML:
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/pyramid/cm.mk]]: "device/htc/msm8660-common/msm8660.mk" does not exist. Stop.
it has found pyramid/cm.mk required for building but your device is configured to use the common config of msm8660 cpu so its looking for
msm8660-common
in device folder
htc
therefore find the common config download it via zip rename the folder containing the files to
msm8660-common
copy and paste it in htc folder then follow the previuos commands... i will subscribe to this thread if you get any more errors post on this thread i will be happy to help
Thanks for everything, guys, and i have now attempted to build
i used otapackage, and it seems to have stopped. Here is the latest output:
Code:
/home/martin/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: /home/martin/android/system/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::AudioHardware::doAudioRouteOrMute(unsigned int):hardware/qcom/audio/msm8660/AudioHardware.cpp:1956: error: undefined reference to 'msm_get_voc_session'
/home/martin/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: /home/martin/android/system/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::AudioHardware::doAudioRouteOrMute(unsigned int):hardware/qcom/audio/msm8660/AudioHardware.cpp:1961: error: undefined reference to 'msm_start_voice_ext'
/home/martin/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: /home/martin/android/system/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::AudioHardware::doAudioRouteOrMute(unsigned int):hardware/qcom/audio/msm8660/AudioHardware.cpp:1962: error: undefined reference to 'msm_set_voice_tx_mute_ext'
/home/martin/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: /home/martin/android/system/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::AudioHardware::doAudioRouteOrMute(unsigned int):hardware/qcom/audio/msm8660/AudioHardware.cpp:1982: error: undefined reference to 'msm_end_voice_ext'
collect2: ld returned 1 exit status
make: *** [/home/martin/android/system/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/LINKED/audio.primary.msm8660.so] Error 1
[email protected]:~/android/system$
just the last few lines wont help post more of what happened before the breaking of the build
Well, on pacmans git, there are instructions on how to build Pac-man, which includes a build-pac.sh script, and it says command not found when i run it. And i forked the htc pyramid device repo into pacmans gerrit, so i will try to do everything again, maybe something went wrong during cloning or syncing
Sent from a muffin inside a muffin using muffintalk.
InfinityFTW said:
Well, on pacmans git, there are instructions on how to build Pac-man, which includes a build-pac.sh script, and it says command not found when i run it. And i forked the htc pyramid device repo into pacmans gerrit, so i will try to do everything again, maybe something went wrong during cloning or syncing
Sent from a muffin inside a muffin using muffintalk.
Click to expand...
Click to collapse
dont use the pac script is the normal way of lunch or brunch...btw have u extracted the vendors?
speed_bot said:
dont use the pac script is the normal way of lunch or brunch...btw have u extracted the vendors?
Click to expand...
Click to collapse
Do you mean propartiary-files.sh?
And btw, i had my local repo cluttered with previous attempts at building PA, so i deleted everything and init'd the repo and synced it again.
you dont need to delete and resync again instead do
PHP:
make clean
and
HTML:
make clobber
to delete all compiled files and if you have modified the source do
HTML:
git checkout
it will remove all local changes that was you can save time and bandwidth ...
---------- Post added at 07:11 AM ---------- Previous post was at 07:10 AM ----------
InfinityFTW said:
Do you mean propartiary-files.sh?
And btw, i had my local repo cluttered with previous attempts at building PA, so i deleted everything and init'd the repo and synced it again.
Click to expand...
Click to collapse
propeitary files and just vendors for the device they cant break the build process///
Did you figure it out? if not let me know and I can help you.. send me a P.M.
Racing19969 said:
Did you figure it out? if not let me know and I can help you.. send me a P.M.
Click to expand...
Click to collapse
When I try to do make clean and make clobber, it says something like: Fatal, not a git repository, so I was unable to start over -.-
Sent from a muffin inside a muffin using muffintalk.
InfinityFTW said:
When I try to do make clean and make clobber, it says something like: Fatal, not a git repository, so I was unable to start over -.-
Sent from a muffin inside a muffin using muffintalk.
Click to expand...
Click to collapse
if thats the error your sources havent synced completely yet
It probably would not build, coz when it gives you to choose you will choose cm_* and it will build cm10.To buil PAC you need to choose pac_*
If I am not right please correct me.
Code:
Erachter system # lunch
You're building on Linux
Breakfast menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. mini_armv7a_neon-userdebug
5. mini_armv7a-userdebug
6. full_panda-userdebug
7. cm_a700-userdebug
8. cm_anzu-userdebug
9. cm_captivatemtd-userdebug
10. cm_crespo-userdebug
11. cm_crespo4g-userdebug
12. cm_coconut-userdebug
13. cm_d2att-userdebug
14. cm_d2mtr-userdebug
15. cm_d2spr-userdebug
16. cm_d2tmo-userdebug
17. cm_d2usc-userdebug
18. cm_d2vzw-userdebug
19. cm_encore-userdebug
20. cm_endeavoru-userdebug
21. cm_epicmtd-userdebug
22. cm_everest-userdebug
23. cm_evita-userdebug
24. cm_fascinatemtd-userdebug
25. cm_galaxysbmtd-userdebug
26. cm_galaxysmtd-userdebug
27. cm_grouper-userdebug
28. cm_haida-userdebug
29. cm_hallon-userdebug
30. cm_hercules-userdebug
31. cm_i777-userdebug
32. cm_i9100-userdebug
33. cm_i9100g-userdebug
34. cm_i9300-userdebug
35. cm_iyokan-userdebug
36. cm_jewel-userdebug
37. cm_maguro-userdebug
38. cm_mako-userdebug
39. mr1-staging
40. cm_mango-userdebug
41. cm_manta-userdebug
42. cm_mesmerizemtd-userdebug
43. cm_mint-userdebug
44. cm_n7000-userdebug
45. cm_n7100-userdebug
46. cm_n8000-userdebug
47. cm_n8013-userdebug
48. cm_p1c-userdebug
49. cm_p1l-userdebug
50. cm_p1n-userdebug
51. cm_p1-userdebug
52. cm_p3-userdebug
53. cm_p3100-userdebug
54. cm_p3110-userdebug
55. cm_p4-userdebug
56. cm_p4tmo-userdebug
57. cm_p4vzw-userdebug
58. cm_p4wifi-userdebug
59. cm_p5100-userdebug
60. cm_p5110-userdebug
61. cm_p930-userdebug
62. cm_p970-userdebug
63. cm_quincyatt-userdebug
64. cm_quincytmo-userdebug
65. cm_satsuma-userdebug
66. cm_skyrocket-userdebug
67. cm_smultron-userdebug
68. cm_stingray-userdebug
69. cm_su640-userdebug
70. cm_t769-userdebug
71. cm_tf101-userdebug
72. cm_tf201-userdebug
73. cm_tf300t-userdebug
74. cm_tf700t-userdebug
75. cm_toroplus-userdebug
76. cm_toro-userdebug
77. cm_urushi-userdebug
78. cm_vibrantmtd-userdebug
79. cm_ville-userdebug
80. cm_wingray-userdebug
81. pac_anzu-userdebug
82. pac_haida-userdebug
83. pac_mango-userdebug
84. pac_mint-userdebug
85. pac_smultron-userdebug
86. pac_urushi-userdebug
87. pac_zeus-userdebug
88. pac_zeusc-userdebug
89. pac_hercules-userdebug
90. pac_i9100-userdebug
91. pac_i9100g-userdebug
92. pac_quincyatt-userdebug
93. pac_skyrocket-userdebug
94. pac_cooper-userdebug
95. pac_grouper-userdebug
96. pa_crespo-userdebug
97. pa_grouper-userdebug
98. pa_maguro-userdebug
99. pa_toro-userdebug
100. pa_toroplus-userdebug
That shouldn't be a prob coz its just configuring hardware to software and pac is based on cm and aokp and aokp is inturn based on cm so I doubt this part causing problems in the future
I got the pac sources synced an all, and i run envsetup, and I breakfast it, and then i rum make -j4, and it seems to build correctly for some thime, until:
Code:
Import includes file: /home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.a2dp.default_intermediates/import_includes
system/core/libpixelflinger/codeflinger/disassem.c:710:1: warning: initialization from incompatible pointer type [enabled by default]
system/core/libpixelflinger/codeflinger/disassem.c:710:1: warning: (near initialization for 'disassemble_di.di_printf') [enabled by default]
target thumb C: libpower <= hardware/libhardware_legacy/power/power.c
target thumb C: audio.primary.default <= hardware/libhardware/modules/audio/audio_hw.c
make: *** No rule to make target `/home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/lib/libaudioalsa.so', needed by `/home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/LINKED/audio.primary.msm8660.so'. Stop.
make: *** Waiting for unfinished jobs....
Import includes file: /home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/import_includes
InfinityFTW said:
I got the pac sources synced an all, and i run envsetup, and I breakfast it, and then i rum make -j4, and it seems to build correctly for some thime, until:
Code:
Import includes file: /home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.a2dp.default_intermediates/import_includes
system/core/libpixelflinger/codeflinger/disassem.c:710:1: warning: initialization from incompatible pointer type [enabled by default]
system/core/libpixelflinger/codeflinger/disassem.c:710:1: warning: (near initialization for 'disassemble_di.di_printf') [enabled by default]
target thumb C: libpower <= hardware/libhardware_legacy/power/power.c
target thumb C: audio.primary.default <= hardware/libhardware/modules/audio/audio_hw.c
make: *** No rule to make target `/home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/lib/libaudioalsa.so', needed by `/home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/LINKED/audio.primary.msm8660.so'. Stop.
make: *** Waiting for unfinished jobs....
Import includes file: /home/android/WORKING_DIRECTORY/out/target/product/pyramid/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/import_includes
Click to expand...
Click to collapse
ok see if the libhardware is working or not means like they patch the hardware to make the rom boot see if anybody has patched it
https://github.com/TheMuppets/proprietary_vendor_htc/tree/jellybean
szl.kiev said:
https://github.com/TheMuppets/proprietary_vendor_htc/tree/jellybean
Click to expand...
Click to collapse
Do I curl it into my device repo?
Sent from my GT-P3113 using Tapatalk 2

[GUIDE]Newbie's Guide to Kernel Compiling

Background :
So I was asked by some people on how I compile kernels so I am just posting some stuff related to same .
This is a beginners' tutorial and is mostly relevant to Xperia 2011 MDPI section . It might work on other sections but I won't be offering any guarantee .
For whom is this tutorial designed for ?
People who like to read stuff and can read stuff ,people who have desire to learn something and would like a more hands on approach .
Index :
#post 1 = Introduction & Setup Environment
#post 2 =Index of Toolchains & sources+FAQ
#post 3 =Kernel Manipulation
#post 4=Compiling , Source Distribution
Click to expand...
Click to collapse
Requirements :
Linux Distro installed on PC .Thats preferrable . Search,read ,install.It's not rocket science .
I am using Linux Mint 13 in this tutorial . Ubuntu,Debian and Ubuntu/debian based distros should be similar to setup.
This tutorial should work on other distros too ...
Click to expand...
Click to collapse
I am not going to support questions/doubts regarding
Cygwin on Windows
Linux installed in Virtual machine
Live Linux distributions .
I would rather spend time fixing issue then figuring out how to do same thing in another environment .
Get tools for stuff you need not know
install these tools via relevant package manager
Code:
build-essential,bzip2,gcc-multilib,g++-multilib,git,gnupg,libncurses5-dev,lib32ncurses5-dev,lib32z1-dev,kernel-package,ia32-libs,zlib1g-dev,zip
e.g for Linux Mint it's
Code:
sudo apt-get install build-essential bzip2 gcc-multilib g++-multilib git gnupg libncurses5-dev lib32ncurses5-dev lib32z1-dev kernel-package ia32-libs zlib1g-dev zip
Next download Android SDK and configure adb and fastboot . Use the amazing service known as google to set up .Test run if they work properly .
Click to expand...
Click to collapse
Some information :
Q1:What is boot.img ,kernel and ramdisk ?
Boot.img or the file you flash to boot partion .It is actually made up of two parts.
zImage is the actual kernel .You can't edit it .You have to recompile it using the kernel sources
initrd.img is the ramdisk .Using tools like Android Kitchen or kernel-tools-master you can edit it .
More about each part in relevant section .
Q2:How do you manipulate ramdisk,change bootlogo ?
A: Check @dsixda 's Android Kitchen or @championswimmer 's kernel-tools-master
Q3:Where does BOOTCLASSPATH lie in ramdisk ?
A:It's present in init.rc
Q4:Where do you change the path to wifi libs ?
A:Check init.semc.rc
Steps I use to work with Boot.img
Modify Ramdisk with Android Kitchen completely .
Use Stock kernel
Repack using Android kitchen
Check if kernel boots
if it does than you have a working ramdisk.
Now you just have to change zImage after compiling it.
Click to expand...
Click to collapse
Sources :
For Xperia Phones
Download the stock sources from
http://developer.sonymobile.com/dow...s/open-source-archive-for-build-4-0-2-a-0-84/
http://developer.sonymobile.com/dow...ves/open-source-archive-for-build-4-1-b-1-13/
to fix toolchain errors
I peeked into wedgess' Lupus and kast's Kappa sources
https://github.com/garwedgess/LuPuS-STOCK-ICS-Xperia2011
Toolchains :
Toolchains are the compilers (cross compilers to be exact ) with which kernel is compiled .
There are tooooooooo many compilers .
I can't test everyone
The best way is to go for compilers which are proven to be work
Path to the compiler .
Before compiling kernels the path to cross compiler must be exported using
Code:
export CROSS_COMPILE=path_ to_compiler
e.g.
My 4.4.3 compiler lies in
/home/user/android-ndk-r8d/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
In the folder of the toolchain the compiler is present ,all the tools are prefixed with arm-linux-android-eabi-
so the path to compiler becomes
Code:
export CROSS_COMPILE=/home/karan/xd/android-ndk-r8d/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin//arm-linux-androideabi-
Some have arm-eabi- as prefix ,some have no prefixes .Adjust the path accordingly
The usual path of compiler is in bin folder .
Toolchain sources :
Source no 1 : Android NDK
http://developer.android.com/tools/sdk/ndk/index.html
Download the one which has above 360MB of download size ...I have the older version and it has 4.4.3,4.6,4.7
Source no. 2 : Github of @DooMLoRD and @wedgess
https://github.com/garwedgess/toolchains
https://github.com/DooMLoRD/android_prebuilt_toolchains
Doomlord has 4.4.3,Linaro 4.6.2,4.7
Wedgess has 4.4.3 ,Linaro 4.6.2 , Linaro 4.7.3
Use git clone command to download the toolchains
e.g
Code:
git clone https://github.com/DooMLoRD/android_prebuilt_toolchains.git
Code:
git clone https://github.com/garwedgess/toolchains.git
@Christopher83's thread
http://forum.xda-developers.com/showthread.php?p=36677987
He has one toolchain for every occasion . If you wish to dabble ,feel free to dive in ...
FAQ:
What Toolchain works on Stock sources ?
On pure Stock ROM ,without any modification I have been able to compile only on the 4.4.3 by DoomLord ..I would recommend using that one.It works fine on both ICS and GB stock kernels .The kernels boot fine
What should be done so that that you can compile with other toolchains ?
A:There are certain changes in the main Makefile which need to be carried out
Open the main makefile and search for
KBUILD_CFLAGS
Replace
Code:
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Werror \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks
with
Code:
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Wno-unused-but-set-variable -Wno-uninitialized \
-fno-strict-aliasing -fno-common \
-Wimplicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks
Now open
Code:
/include/linux/netfilter/x_tables.h
and delete these lines
Code:
const struct xt_match *match;
const void *matchinfo;
That should fix 4.6.2 & 4.7.3 erros
The Linaro 4.7.3 toolchain requires editing the /arch/arm/boot/compressed/Makefile.Honestly ,peek into kast's Makefile ,since I was able to compile only by applying his Makefile fix .
For others ,Please check logs and correct errors
Making changes to source :
Governors,I/O schedulers & Overclocking :-
Check XDA university's thread
http://xda-university.com/as-a-developer/adding-features-to-your-kernel
It's very well written and i don't want to repeat the same stuff
Making changes to Partition on MDPI
this is a post I made earlier :Read it for details ..
http://forum.xda-developers.com/showthread.php?t=2532418
Compiling the kernel :
First Open Terminal in the main kernel directory .
It is in kernel folder of stock sources .
Step no. 1
Export the architecture .Our phone use arm architecture . Some phones use x86 architecture like our phones .Hence the architecture must be defined before compiling .Do this by .
Code:
export ARCH=arm
Step no. 2
Export the Cross Compiler since thats what will be used to compile kernel .
Code:
export CROSS_COMPILE=/home/karan/a/android_prebuilt_toolchains/arm-linux-androideabi-4.7/bin/arm-linux-androidwabi-
Step no. 3
Clean earlier builds . Important before recompiling
Code:
make clean && make mrproper
Step no. 4
Specify the defconfig
The default config for xperia is in /arch/arm/configs ...they are like semc_mango_defconfig or whatever phone you are using
use
Code:
make semc_mango_defconfig
Step no. 5 Editing: optional
Make edits via menuconfig or xconfig :
This allows you to enable/disable governors,schedulers,filesytems ,modify other parameters which were predefined in defconfig
Code:
make menuconfig
OR
Code:
make xconfig
menuconfig is Command line tool while xconfig is the graphical interface .
You can save the config and use it later and use that as defconfig next time instead
Step 6: Compile
Initiate Compiling ....
Code:
make
If you are compiling for first time it's recommended to use
Code:
make
instead of
Code:
make -j2
or whatever . It will help you to troubleshoot errors .Else errors will be thrown ,you wouldn't be abele to view in terminal and there would be no zImage
Step no. 7: Grab zImage and pack it
after successful compiling zImage will be present in /arch/arm/boot folder
Then use Android kitchen to pack it .
Source Distribution :
1)In a tar ball like sony
Just use an archive manager and make a tar archive ...
Advantages : Easy ,hassle free
Disadvantages : Too large in size if modifying very few aspects
2.)Using diff patch
It's like a comparing tool
e.g If I am my base kernel source is Lupus and I have added some tweak then I can create a patch file which can be used on the Lupus source and the result will be my work .It's pretty handy if you are dealing with few files .
Advantages : small size ,pretty handy ,
Disadvantages : Without a proper text editor like Geany ,check patches is a nuisance .The Mesa patch for MDPI has over 1,500,000 lines ...enough to screw with normal text editors
3)Git with github or similar site
It's a fantastic way to upload source .It allows many features to a developer which makes life lot easier .
Advantages : Excellent Version Control
Disadvantages : Steep learning curve .
Git is quite complex for a newbie and it can overwhelm a person .I would suggest reading a lot about git and experimenting thoroughly before diving in .
Credits :
@pinkflozd
For helping me out when i needed
@DooMLoRD
 @wedgess
 @kast
 @an0nym0us_
Peeked in their sources and learnt Stuff
Recommended Text Editor :If you want to seriously dabble with sources I would suggest to use Geany .
It saves a lot of time .It's a must have if you peek a lot into patch files and/or sources .
Reserved for future FAQ
Reserved Just in case
Reserved Just in case
Stuck with this errors!
trying to find solution from a week
Xperia Mini | Stock GB Kernel Source | android-ndk-r9b-linux-x86.tar.bz2 with x32 ubuntu
http://forum.xda-developers.com/showthread.php?t=2569212
Thanks for the guide
Now i dont have to search around.
Thanx
@karandpr- a guide like this suits for the android general or appropriate forums!
Why keep it so inside? just a suggestion though
Thanx for this!
piousheart said:
Stuck with this errors!
trying to find solution from a week
Xperia Mini | Stock GB Kernel Source | android-ndk-r9b-linux-x86.tar.bz2 with x32 ubuntu
http://forum.xda-developers.com/showthread.php?t=2569212
Thanks for the guide
Now i dont have to search around.
Click to expand...
Click to collapse
usually the error of unknown CPU architecture is because you're using linaro toolchain but without proper definition of CPU architecture in Makefile flags. stay away from linaro for first timer. i would strongly suggest using google vanilla 4.4.3 toolchain. abit old but always work given that the're no actual error in the source itself.
Finally karan:thumbup: Thanks a lot for the guide. Really helpful
Cheers,
Vatsal
piousheart said:
Stuck with this errors!
trying to find solution from a week
Xperia Mini | Stock GB Kernel Source | android-ndk-r9b-linux-x86.tar.bz2 with x32 ubuntu
http://forum.xda-developers.com/showthread.php?t=2569212
Thanks for the guide
Now i dont have to search around.
Click to expand...
Click to collapse
add
Code:
-Wno-unused-but-set-variable
in the makefile in KBUILD_CFLAGS =
Didn't check the second error .
It's because you are using Linaro 4.7.3
Like i said above
Code:
/arch/arm/boot/compressed/Makefile
You need to change it a bit ...
Compare it with changes of Kappa or Lupus .
http://forum.xda-developers.com/showthread.php?p=36677987
an0nym0us_ said:
usually the error of unknown CPU architecture is because you're using linaro toolchain but without proper definition of CPU architecture in Makefile flags. stay away from linaro for first timer. i would strongly suggest using google vanilla 4.4.3 toolchain. abit old but always work given that the're no actual error in the source itself.
Click to expand...
Click to collapse
Thanks for the reply!
I'm not using linaro toolchain but ndk r9b (something 4.8)
i also modified makefile according to your solution i found when searching google in one of the xda thread.
---------- Post added at 11:20 AM ---------- Previous post was at 11:18 AM ----------
karandpr said:
add
Code:
-Wno-unused-but-set-variable
in the makefile in KBUILD_CFLAGS =
Didn't check the second error .
It's because you are using Linaro 4.7.3
Like i said above
Code:
/arch/arm/boot/compressed/Makefile
You need to change it a bit ...
Compare it with changes of Kappa or Lupus .
http://forum.xda-developers.com/showthread.php?p=36677987
Click to expand...
Click to collapse
I'm not using Linaro but ndk r9b. (correct me if ndk is also known as Linaro, im a Noob)
piousheart said:
Thanks for the reply!
I'm not using linaro toolchain but ndk r9b (something 4.8)
i also modified makefile according to your solution i found when searching google in one of the xda thread.
---------- Post added at 11:20 AM ---------- Previous post was at 11:18 AM ----------
I'm not using Linaro but ndk r9b. (correct me if ndk is also known as Linaro, im a Noob)
Click to expand...
Click to collapse
I will take a look at it but for time being ,I would recommend switching to 4.4.3 since it has least erros and the zImage boots fine .
Congratulations karan for finally making the guide will be very helpful for many of us :good:
[email protected] ~/13/kernel $ export ARCH=arm
[email protected] ~/13/kernel $ export CROSS_COMPILE=~/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
[email protected] ~/13/kernel $ make semc_haida_defconfig
#
# configuration written to .config
#
[email protected] ~/13/kernel $ make -j4
make: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC scripts/mod/empty.o
/bin/sh: 1: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
CC kernel/bounds.s
/bin/sh: 1: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
[email protected] ~/13/kernel $
Hey karan can you look into this error?
koradiavatsal said:
[email protected] ~/13/kernel $ export ARCH=arm
[email protected] ~/13/kernel $ export CROSS_COMPILE=~/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
[email protected] ~/13/kernel $ make semc_haida_defconfig
#
# configuration written to .config
#
[email protected] ~/13/kernel $ make -j4
make: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC scripts/mod/empty.o
/bin/sh: 1: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
CC kernel/bounds.s
/bin/sh: 1: /home/vatsal/file:///home/vatsal/android/kernel/ndk/toolchains/4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
[email protected] ~/13/kernel $
Hey karan can you look into this error?
Click to expand...
Click to collapse
Check Path to toolchains
Can i use the guide for 2010 devices? X10mini..
piousheart said:
Can i use the guide for 2010 devices? X10mini..
Click to expand...
Click to collapse
Yes... Except you will need different source...
Sent from my MT11i using Tapatalk 2
Attitude.SSJ said:
Yes... Except you will need different source...
Sent from my MT11i using Tapatalk 2
Click to expand...
Click to collapse
can you prefer any toolchain?

Makefile error: *** multiple target patterns. Stop.

I am currently trying to build an Ubuntu Touch-compatible kernel for use with the Xperia Z5 Compact. I have been following the How to build and flash a Linux kernel for AOSP supported devices guide and am at the point at which I have created an Ubuntu-compatible .config file but am having issues finally building the kernel (Step 7) using the .config file as I receive the following error:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 14
Makefile:791: *** multiple target patterns. Stop.
I know that this error is related to the call of link-vmlinux.sh which is referenced as follows on line 791 of the Makefile:
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
Any suggestions for debugging this problem would be greatly appreciated.
blackstar1744 said:
I am currently trying to build an Ubuntu Touch-compatible kernel for use with the Xperia Z5 Compact. I have been following the How to build and flash a Linux kernel for AOSP supported devices guide and am at the point at which I have created an Ubuntu-compatible .config file but am having issues finally building the kernel (Step 7) using the .config file as I receive the following error:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 14
Makefile:791: *** multiple target patterns. Stop.
I know that this error is related to the call of link-vmlinux.sh which is referenced as follows on line 791 of the Makefile:
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
Any suggestions for debugging this problem would be greatly appreciated.
Click to expand...
Click to collapse
Yah, I'm facing the same problem. Only with 64-bit targets (G4 and G4 Stylus), this doesn't happen with any 32bit targets. It doesn't matter if I swap out the toolchain, it doesn't matter which tree I'm working -- Omni, Bliss, CM13 -- all can't get past that error.
So it doesn't seem like it's in the build tree, but maybe my system. I'm using Arch, so I'm used to Android building snafus, but still I cannot figure this out. I've gone through every chain leading to the error and I can't seem to pin it down. It's really harshing my build.
Lil' help, y'all?
UPDATE: Nevermind, just had to set USE_HOST_LEX. Goddammit, I though I already tried that.
Any explanation for why you need to set USE_HOST_LEX? Is this an OS- or compiler-related modification? I'm compiling with UBERTC 4.9 on Ubuntu 14.04 LTS. I currently don't have USE_HOST_LEX in my .config file.
culot said:
Yah, I'm facing the same problem. Only with 64-bit targets (G4 and G4 Stylus), this doesn't happen with any 32bit targets. It doesn't matter if I swap out the toolchain, it doesn't matter which tree I'm working -- Omni, Bliss, CM13 -- all can't get past that error.
So it doesn't seem like it's in the build tree, but maybe my system. I'm using Arch, so I'm used to Android building snafus, but still I cannot figure this out. I've gone through every chain leading to the error and I can't seem to pin it down. It's really harshing my build.
Lil' help, y'all?
UPDATE: Nevermind, just had to set USE_HOST_LEX. Goddammit, I though I already tried that.
Click to expand...
Click to collapse
blackstar1744 said:
Any explanation for why you need to set USE_HOST_LEX? Is this an OS- or compiler-related modification? I'm compiling with UBERTC 4.9 on Ubuntu 14.04 LTS. I currently don't have USE_HOST_LEX in my .config file.
Click to expand...
Click to collapse
USE_HOST_LEX set the build to use host's Flex instead of the one in-tree. See build/core/config.mk:
Code:
ifeq ($(USE_HOST_LEX),yes)
LEX := flex
else
LEX := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/flex/flex-2.5.39
endif
I don't know about elsewhere, but this has been a problem on Arch for a while. Lately this has not longer been a problem for me, so I assumed it was not an issue. Apparently still a problem for 64bit build, but not 32bit. Hmm.
Another workaround was to preface your make with LC_ALL=C, but I tried that without setting 'USE_HOST_LEX=yes' and it didn't help.
EDIT: I don't think it's compiler-related, as I did try different toolchains and different toolchain versions -- none made a difference. I tried 3 different Make versions, no help. USE_HOST_LEX? That fixed it. Compiling as we speak.
I added export USE_HOST_LEX=yes to my .bashrc and went back to the GCC compiler...new problem to debug. Any suggestions on debugging control groups would be greatly appreciated
Code:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 1
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
<stdin>:1226:2: warning: #warning syscall sched_setattr not implemented [-Wcpp]
<stdin>:1229:2: warning: #warning syscall sched_getattr not implemented [-Wcpp]
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC kernel/cgroup.o
kernel/cgroup.c: In function 'subsys_cgroup_allow_attach':
kernel/cgroup.c:2138:59: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
if (current != task && cred->euid != tcred->uid &&
^
kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
cred->euid != tcred->suid)
^
make[1]: *** [kernel/cgroup.o] Error 1
make: *** [kernel] Error 2
Random side rant: The way Google shows search results is going wayyy downhill.

Categories

Resources