Hi All,
I'm not sure what I'm doing wrong here. I'm trying to compile a CyanogenMod kernel for my device (Transformer Prime, but this really applies to any device) so that I can create additional/alternative kernel modules.
I followed this wiki for a Fedora 64it system with some changes based on it being out of date: http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
Code:
yum install git gnupg java-1.6.0-openjdk-devel flex bison gperf SDL-devel esound-devel wxGTK-devel zip curl ncurses-devel zlib-devel gcc-c++
yum install glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo $PATH|grep ~/bin>/dev/null||export PATH="${PATH}":~/bin
mkdir -p [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/system
cd [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/system
repo init -u git://github.com/CyanogenMod/android.git -b [B]jellybean[/B]
repo sync -j16
I then downloaded Sourcery CodeBench Lite 2012.03-56 for ARM EABI from https://sourcery.mentor.com/GNUToolchain/release2188 as a tar.bz and extracted it out. Interestingly in 4.4.3 they added "none" into the executable name, though that didn't seem to cause any issues during compile.
Code:
export CCOMPILER=[B]"/storage/Software/Android/TransformerPrime/Cyanogenmod10/eabi/arm-2012.03/[/B]bin/arm-[B]none[/B]-eabi-"
mkdir -p [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10[/B]/android/kernel
cd [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/kernel
git clone git://github.com/CyanogenMod/cm-kernel.git
cd cm-kernel
Then went into my ADB folder to grab the config.gz file off my Transformer Prime and put it in the cm-kernel directory.
Code:
cat config.gz | gunzip > .config
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
It brought up the menu config, I went straight to exit and saved.
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
So in the above it compiled. I did not see any errors, but /storage/Software/Android/TransformerPrime/Cyanogenmod10/android/kernel/cm-kernel/arch/arm/boot/zImage was missing.
Any ideas why or what I've done wrong?
Thanks,
Ben
Interesting.. it didn't show errors at the end of the compile, but running the last make command again returned:
Code:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/mmc/host/sdhci.o
CC drivers/net/ppp_generic.o
CC drivers/power/power_supply_core.o
CC drivers/regulator/core.o
CC drivers/rtc/rtc-lib.o
drivers/mmc/host/sdhci.c: In function 'sdhci_suspend_host':
drivers/mmc/host/sdhci.c:1652:2: error: too few arguments to function 'mmc_suspend_host'
include/linux/mmc/host.h:285:12: note: declared here
CC drivers/regulator/dummy.o
make[3]: *** [drivers/mmc/host/sdhci.o] Error 1
make[2]: *** [drivers/mmc/host] Error 2
make[1]: *** [drivers/mmc] Error 2
make[1]: *** Waiting for unfinished jobs....
CC drivers/rtc/hctosys.o
CC drivers/rtc/class.o
CC drivers/power/power_supply_sysfs.o
CC drivers/regulator/fixed.o
CC drivers/rtc/interface.o
LD drivers/power/power_supply.o
LD drivers/power/built-in.o
CC drivers/rtc/rtc-dev.o
CC drivers/rtc/rtc-proc.o
CC drivers/rtc/rtc-sysfs.o
CC drivers/rtc/alarm.o
CC drivers/regulator/virtual.o
CC drivers/regulator/tps6586x-regulator.o
CC drivers/rtc/alarm-dev.o
CC drivers/net/ppp_mppe.o
LD drivers/rtc/rtc-core.o
CC drivers/net/pppox.o
CC drivers/net/pppolac.o
LD drivers/regulator/built-in.o
CC drivers/net/pppopns.o
CC drivers/net/slhc.o
LD drivers/rtc/built-in.o
CC drivers/net/dummy.o
CC drivers/net/tun.o
LD drivers/net/arm/built-in.o
LD drivers/net/caif/built-in.o
CC drivers/net/usb/asix.o
LD drivers/net/wireless/built-in.o
CC drivers/net/usb/cdc_ether.o
CC drivers/net/usb/smsc95xx.o
CC drivers/net/usb/cdc_subset.o
CC drivers/net/usb/usbnet.o
drivers/net/usb/cdc_subset.c:221:2: warning: #warning You need to configure some hardware for this driver [-Wcpp]
LD drivers/net/usb/built-in.o
LD drivers/net/built-in.o
make: *** [drivers] Error 2
Any thoughts?
And as a final thought, since I don't need the kernel just modules I commented out the line just to see if it would build, and came up with:
Code:
/storage/Software/Android/TransformerPrime/Cyanogenmod10/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ld: no machine record defined
/storage/Software/Android/TransformerPrime/Cyanogenmod10/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ld: no machine record defined
This was also after trying the toolchain that came with the cyanogenmod source.
Related
Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
stevedub40 said:
Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
Click to expand...
Click to collapse
Hmm, it doesn't look like my file uploaded. Here it is in code tags:
Code:
net/netfilter/xt_mark.c:16:37: error: linux/netfilter/xt_mark.h: No such file or directory
net/netfilter/xt_mark.c: In function 'mark_tg':
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: In function 'mark_mt':
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: At top level:
net/netfilter/xt_mark.c:49: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_tginfo2'
net/netfilter/xt_mark.c:58: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_mtinfo1'
make[2]: *** [net/netfilter/xt_mark.o] Error 1
make[1]: *** [net/netfilter] Error 2
make[1]: *** Waiting for unfinished jobs....
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
make[2]: *** [drivers/mfd/pm8921-core.o] Error 1
make[1]: *** [drivers/mfd] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [net] Error 2
make: *** Waiting for unfinished jobs....
CC drivers/media/video/msm/wfd/enc-subdev.o
CC drivers/media/video/msm/sensors/imx175_v4l2.o
CC drivers/media/video/msm/sensors/ov8838_v4l2.o
CC drivers/media/video/msm/sensors/s5k3h2yx_v4l2.o
CC drivers/media/video/msm/rawchip/Yushan_Platform_Specific.o
CC drivers/media/video/msm/wfd/vsg-subdev.o
CC drivers/media/video/msm/msm_gesture.o
CC drivers/media/video/msm/rawchip/Yushan_HTC_Functions.o
CC drivers/media/video/msm/sensors/ar0260_v4l2.o
CC drivers/media/video/msm/wfd/wfd-ioctl.o
CC drivers/media/video/msm/msm_axi_qos.o
CC drivers/media/video/msm/sensors/s5k3l1yx.o
CC drivers/media/video/msm/flash.o
CC drivers/media/video/msm/sensors/ov2722_v4l2.o
CC drivers/media/video/msm/wfd/wfd-util.o
CC drivers/media/video/msm/msm_io_8960.o
LD drivers/media/video/msm/sensors/built-in.o
CC drivers/media/video/msm/msm_vfe32.o
CC drivers/media/video/msm/rawchip/yushan_reg.o
LD drivers/media/video/msm/wfd/built-in.o
CC drivers/media/video/msm/msm_vpe.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r2.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r3.o
CC drivers/media/video/msm/rawchip/yushan_reg_s5k3h2yx.o
CC drivers/media/video/msm/rawchip/yushan_reg_imx175.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov8838.o
CC drivers/media/video/msm/rawchip/yushan_reg_ar0260.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov2722.o
LD drivers/media/video/msm/rawchip/built-in.o
LD drivers/media/video/msm/built-in.o
LD drivers/media/video/videodev.o
LD drivers/media/video/built-in.o
LD drivers/media/built-in.o
make: *** [drivers] Error 2
[email protected] ~/android/kernel/linux $
Talk to DSB9938 or Elkay, they work on kernels for our phone.
orangechoochoo said:
Talk to DSB9938 or Elkay, they work on kernels for our phone.
Click to expand...
Click to collapse
Will do. Thanks for the reply.
Alright, I have discovered my problem. It looks like I was in fact missing the xt_mark.h file. For some reason, the HTC kernel source only includes xt_MARK.h. I downloaded the kernel source for the Nexus 4 and pulled the necessary header files. I was missing a couple others, which I don't recall off hand. What has me baffled is that I seem to be the only one with this issue. I downloaded the HTC source again just to make sure, and just as I suspected it was missing some header files. Has anyone else experienced this?
EDIT: I just tested with a couple different toolchains and they all compile perfectly now. That is so strange that my problem this whole time has been missing header files from HTC.
i tried to compile using linaro 4.8 toolchain but i always get this error...
[email protected]:/usr/src/kernel# cd Vengeance-Kernel-MSM7x27
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# export ARCH=arm
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# export CROSS_COMPILE=/usr/src/toolchain/Linaro-Toolchain-4.8/bin/arm-linux-androideabi-
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/usr/src/toolchain/Linaro-Toolchain-4.8/bin/../libexec/gcc/arm-linux-androideabi/4.8.1/cc1: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
PratsPro said:
i tried to compile using linaro 4.8 toolchain but i always get this error...
[email protected]:/usr/src/kernel# cd Vengeance-Kernel-MSM7x27
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# export ARCH=arm
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# export CROSS_COMPILE=/usr/src/toolchain/Linaro-Toolchain-4.8/bin/arm-linux-androideabi-
[email protected]:/usr/src/kernel/Vengeance-Kernel-MSM7x27# make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/usr/src/toolchain/Linaro-Toolchain-4.8/bin/../libexec/gcc/arm-linux-androideabi/4.8.1/cc1: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
Click to expand...
Click to collapse
Try this:
sudo apt-get install lib32z1
And restart the build.
eagleeyetom said:
Try this:
sudo apt-get install lib32z1
And restart the build.
Click to expand...
Click to collapse
thanku.....compiled perfectly....just one more question....what r the files associated with clocks?? i have a kernel with oc and one without oc i want to know where the difference lies??
PratsPro said:
thanku.....compiled perfectly....just one more question....what r the files associated with clocks?? i have a kernel with oc and one without oc i want to know where the difference lies??
Click to expand...
Click to collapse
You're welcome It's not that easy, take a look at this commit: https://github.com/DooMLoRD/android...mmit/b572f11485465bc6de36b84270fb8bb0c418b487 to find out more.
So guys, I've tried to build my own kernel from johns github sources based on his kool-aid kernel. This happens with the msm8226_defconfig makefile
So I got my sources synced set up this linaro toolchain https://github.com/Christopher83/arm-cortex_a7-linux-gnueabihf-linaro_4.9, got the path set up in bashrc
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf
export PATH=$PATH:/home/steffen/toolchain/bin"
When running
Code:
make ARCH=arm CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf-
It starts compiling and everything seems fine, when it gets to this last part
Code:
CC [M] drivers/mmc/card/mmc_block_test.o
CC drivers/mmc/core/core.o
CC drivers/mmc/core/bus.o
CC drivers/mmc/core/host.o
CC drivers/mmc/core/mmc.o
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error, forbidden warning: mmc.c:1869
make[3]: *** [drivers/mmc/core/mmc.o] Error 1
make[2]: *** [drivers/mmc/core] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2
It seems to run into a problem with the drivers, tried searching up on the
Code:
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error
part, and only thing actually coming up has been some pastebins etc with the same error log as I got (almost), hoped someone could help out with this?
Also when I try using the g2m_global_com_defconfig instead, I get this at the end
Code:
AR lib/lib.a
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
drivers/built-in.o: In function `video_open':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5083: undefined reference to `hci_fm_smd_register'
drivers/built-in.o: In function `iris_remove':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5219: undefined reference to `hci_fm_smd_deregister'
make: *** [.tmp_vmlinux1] Error 1
[email protected]:~/kernel_lge_msm8226_g2m$
Help anyone?
Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum
steffenbakke said:
Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum
Click to expand...
Click to collapse
How you fix it????
Hello guys!
I have a bit specific problem with my Young 2s running Android 4.4.2. I intend to use a couple of those for a project which involves constant USB communication with a custom circuit board through a FTDI chip. I've already made an Android app which opens a USB Accessory, then sends and receives data constantly. It works, but only for a couple of hours, then the connection breaks down. After that, the only things that help are either rebooting the phone (even that doesn't always work) or re-plugging the USB cable. Anyways, after days of googling, I managed to trace the problem down to a bug that has been fixed "recently" (March 06, 2017):
issuetracker.google.com/issues/36981924
android-review.googlesource.com/#/c/256441/
"Awesome!" I said to myself, and downloaded the most recent ROM (May 01, 17) from updato , flashed the phone with Odin, only to find out that the Kernel version is from November 2016. I didn't let that ruin my day, so I downloaded the latest open source Kernel from Samsung, not really knowing what I'm doing (I started using Ubuntu 4-5 months ago):
opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=g130HN
I checked the f_accessory file to make sure the fix for the bug from earlier was inside, followed the simple readme and ended up with a zImage. There was an error while compiling though, I'll post the output at the end of the post. I took the boot.img from the ROM I downloaded earlier, unpacked it with Android Image Kitchen v2.8, replaced the boot.img-zImage file with my zImage and renamed it accordingly, repacked it, flashed it with TWRP, but sadly the phone hangs at the splash screen, even before the animated Samsung screen shows. I'm kinda at the end of my wits here, since there is so much I could have gotten wrong, so I don't know where to start.
So I'm hoping some of you guys could help me out with some advice.
Thanks in advance!
P.S. The compile output:
Code:
....
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
CC arch/arm/boot/compressed/string.o
SHIPPED arch/arm/boot/compressed/hyp-stub.S
AS arch/arm/boot/compressed/hyp-stub.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
SHIPPED arch/arm/boot/compressed/ashldi3.S
AS arch/arm/boot/compressed/ashldi3.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready <----------------------------------- zImage!
Building modules, stage 2.
MODPOST 8 modules
CC arch/arm/oprofile/oprofile.mod.o
LD [M] arch/arm/oprofile/oprofile.ko
CC crypto/ansi_cprng.mod.o
LD [M] crypto/ansi_cprng.ko
CC drivers/media/platform/soc_camera/soc_camera.mod.o
LD [M] drivers/media/platform/soc_camera/soc_camera.ko
CC drivers/media/platform/soc_camera/soc_camera_platform.mod.o
LD [M] drivers/media/platform/soc_camera/soc_camera_platform.ko
CC drivers/media/platform/soc_camera/soc_mediabus.mod.o
LD [M] drivers/media/platform/soc_camera/soc_mediabus.ko
CC drivers/media/v4l2-core/videobuf2-core.mod.o
LD [M] drivers/media/v4l2-core/videobuf2-core.ko
CC drivers/mmc/card/mmc_test.mod.o
LD [M] drivers/mmc/card/mmc_test.ko
CC drivers/w1/wire.mod.o
LD [M] drivers/w1/wire.ko
make[1]: Leaving directory '/home/vladich/G130HN/Kernel/common'
[2017-07-25 10:22:40] kernel [young2nfc3g-native_hw03_defconfig] done
[2017-07-25 10:43:30] making mali...
make[1]: Entering directory '/home/vladich/G130HN/Kernel/mali'
Makefile:83: ../kernel/.config: No such file or directory
Makefile:111: CONFIG_TRACEPOINTS required for profiling
make[1]: *** No rule to make target '../kernel/.config'. Stop.
make[1]: Leaving directory '/home/vladich/G130HN/Kernel/mali'
Makefile:27: recipe for target 'mali' failed
make: *** [mali] Error 2
P.P.S. Since I'm a newbie at xda, I'm currently not allowed to post full links, so you need to add a https prefix before every link, and I'm only allowed to post into Q&A, I'm not sure this thread belongs here :laugh:
Hi,
I'm trying to compile the kernel source from @flar2
I didn't find a specific build instructions so followed the usual method
After pointing to toolchain folder
Kernel source: https://github.com/korom42/ocean
My working setup:
Information about my OS:
Virtualization: oracle
OS: Ubuntu 16.04 Fedora 28 (Workstation Edition)
Kernel: Linux 4.17.17-200.fc28.x86_64
CPU: Intel Core i5-7200u @ 2x 2.7GHz [50.0°C]
GPU: intel
RAM: 2048MiB
Prepare :
Code:
export CROSS_COMPILE=/home/korom42/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
export USE_CCACHE=1
make elementalx_defconfig
make /or make O=out
Compile issue:
http://prntscr.com/kl1gyi
lib/Makefile:17: *** recipe commences before first target. Stop.
Makefile:1213: recipe for target '_clean_lib' failed
make: *** [_clean_lib] Error 2
Update: I changed my building environment to Fedora 28 and that problem is fixed now. But, I am getting another error I guess it is related to the source code , I found a similar issue here
Code:
[...]
CC drivers/base/module.o
CC drivers/base/soc.o
CC drivers/base/pinctrl.o
CC drivers/base/platform-msi.o
LD drivers/base/built-in.o
CC drivers/block/brd.o
CC drivers/block/loop.o
CC drivers/block/zram/zcomp_lzo.o
CC drivers/block/zram/zcomp.o
CC drivers/block/zram/zram_drv.o
CC drivers/block/zram/zcomp_lz4.o
LD drivers/block/zram/zram.o
LD drivers/block/zram/built-in.o
LD drivers/block/built-in.o
CC drivers/bluetooth/bluetooth-power.o
CC drivers/bluetooth/btfm_slim.o
drivers/bluetooth/btfm_slim.c:26:23: fatal error: btfm_slim.h: No such file or directory
#include <btfm_slim.h>
^
compilation terminated.
make[2]: *** [scripts/Makefile.build:264: drivers/bluetooth/btfm_slim.o] Error 1
make[1]: *** [scripts/Makefile.build:408: drivers/bluetooth] Error 2
make: *** [Makefile:966: drivers] Error 2
I also tried
Code:
make O=out clean
And got the same error
Update:
Possibly similar issue here
I guess it is source code related ? Any ideas how to fix that