CM10 maguro build fails on kernel? - Android Q&A, Help & Troubleshooting

If you get the error: selected processor does not support ARM mode `smc #0' when trying to compile kernel on OS X, please go to the scripts folder in the kernel source tree and change in Kbuild.include from:
Code:
/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
to:
Code:
printf "%s\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))

Related

[Q] USB HOST support SiyahKernel 3.0beta6

Dear Friends,
I have been building custom USB devices for Android as a hobby during my spare time since the end of last year. I have been succesfully using until now Siyah kernel V2.5.2-VWM + Android 2.3.5 in order to test my hardware prototypes with my SGS2. This version of Siyah kernel was compiled with some flags (CONFIG_SEC_WHITELIST=n) that disabled a white-list placed by Samsung that prevented third-party USB devices from connecting to the phone.
I updated yesterday to Siyah-v3.0b6 and CM9 and found that my USB devices are not working (OTG devices like my USB memory stick still works). I tracked the problem using the "lsusb" terminal command and the "USB Device Info" app, and I found that my devices are not enumerated correctly anymore. This is a symptom that the Samsung white-list is enabled and it is filtering USB devices that are not found in the list.
I may be wrong, but I think the workaround is only in the compilation flag above described. Does anyone of you people know of any kernel supporting ICS that is working with custom USB devices, or HID devices (joysticks, keyboards, mouse, gamepads, etc)?
I dont have enough credits to post this in the developer Forum so that Gokhanmoral can receive this feedback. I hope he may eventually read this post.
Thanks in advance for your help,
Saul
Did you try Beta 5? I had problems with Beta 6, I could not access the phone via adb or see any of the drives on my PC via MTP. Maybe there are general USB problems in that version. Going back to Beta 5 solved it.
rovo89 said:
Did you try Beta 5? I had problems with Beta 6, I could not access the phone via adb or see any of the drives on my PC via MTP. Maybe there are general USB problems in that version. Going back to Beta 5 solved it.
Click to expand...
Click to collapse
Thanks a lot for the suggestion. I am digging on this issue and found that it is more related to a compilation flag of the new kernel for ICS.
regards,
Saul
USB Host support for custom devices
Hello Saul,
I am experiencing a similar problem with my custom USB device. I have a rooted Samsung Galaxy S2 (GT-I9100) with android 4.0.3.
Did you manage to complie a kernel that works? I downloaded the GT-I9200_ICS_Opensource_Update4.zip kernel source files from opensource.samsung.com but I am not able to compile it. I got the error:
Code:
drivers/media/video/samsung/mali/linux/mali_osk_mali.c:23:98: error: arch/config.h: No such file or directory
Any ideas or guidance would be greatly appreciated.
Model: GT-I9100
Android version: 4.0.3
Baseband: I9100BULP6
Kernel: [email protected]#3
Compilation: IML74K.BULPC
Hi Saul and everybody,
I figured out what the problem was; this is just in case it's useful to someone.
It seems the "make clean" and "make mrproper" routines in the Makefile created by Samsund does not work properley and you need to unzip the entire source code again and restart the proces from scratch every time you want to change the .config and re-compile.
Afterwards, I also noticed the image won't work because I needed to exctract an initramfs for my device and to link it to the new kernel during the kernel compilation process and setting the CONFIG_INITRAMFS_SOURCE .config parameter pointing to the location where it was extracted.
In order to extract my initramfs, I applied the following script (which is an adaptation I made to this one http://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage) to a zImage kernel included in a stockrom that worked fine in my device:
Code:
#!/bin/bash
#
#Source: http://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage
#
#Extract initramfs from zImage
#
#initramfs provides the rootfs when booting a Linux kernel on a mobile device.
#Below script may be helpful if you are interested in extracting such an image from a zImage kernel file.
#Tested on Ubuntu for Samsung Galaxy S firmware. Other zImages may have different archiving options - would require a #modification to the script...
#
#After extracting the initramfs, it can be unpacked into the local directory with
#
#cpio -v -i --no-absolute-filenames < <path-to-initramfs.img>
#
zImage=$1
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================
#
# Next two lines modified by Federico Linares
#
p1=`perl -e 'print "\x1F\x8B\x08"'` # Added by Federico Liares
pos=`grep -P -a -b --only-matching $p1 $zImage | cut -f 1 -d :` # Modified by Federico Linares
echo "-I- Extracting kernel image from $zImage (start = $pos)"
#========================================================================
# the cpio archive might be gzipped too, so two gunzips could be needed:
#========================================================================
dd if=$zImage bs=1 skip=$pos | gunzip > /tmp/kernel.img
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' /tmp/kernel.img | cut -f 1 -d :`
#===========================================================================
# find start and end of the "cpio" initramfs image inside the kernel object:
# ASCII cpio header starts with '070701'
# The end of the cpio archive is marked with an empty file named TRAILER!!!
#===========================================================================
if [ ! $pos = "" ]; then
echo "-I- Extracting compressed cpio image from kernel image (start = $pos)"
dd if=/tmp/kernel.img bs=1 skip=$pos | gunzip > /tmp/cpio.img
start=`grep -a -b -m 1 --only-matching '070701' /tmp/cpio.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/cpio.img | head -1 | cut -f 1 -d :`
inputfile=/tmp/cpio.img
else
echo "-I- Already uncompressed cpio.img, not decompressing"
start=`grep -a -b -m 1 --only-matching '070701' /tmp/kernel.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/kernel.img | head -1 | cut -f 1 -d :`
inputfile=/tmp/kernel.img
fi
# 11 bytes = length of TRAILER!!! zero terminated string, fixes premature end of file warning in CPIO
end=$((end + 11))
count=$((end - start))
if (($count < 0)); then
echo "-E- Couldn't match start/end of the initramfs image."
exit
fi
echo "-I- Extracting initramfs image from $inputfile (start = $start, end = $end)"
dd if=$inputfile bs=1 skip=$start count=$count > initramfs.cpio
And that's almost all. At this point everything works fine except the Wifi. I think I have to link it to the kernel as a module, but I am not sure where to get the module from.
Any help would be greatly appreciated.
______________________________
Device: GT-I9100
Android version: 4.0.3
Baseband: I9100BULP6
Kernel: 3.0.15-I9100G
Compilation: IML74K.BULPC

No Internet connection in emulator ARM

Hi,
I build a goldfish Android arm, but when I launch the emulator with the command:
Code:
$ ./emulator -avd myavd_arm -kernel ~/goldfish/arch/arm/boot/zImage -wipe-data -verbose -debug init -dns-server 10.0.0.1 -memory 1024
there is no connection internet on the emulator.
I build the kernel using the commands:
Code:
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git checkout remotes/origin/android-goldfish-3.18 -b 3.18
$ make ARCH=arm CROSS_COMPILE=/opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- ranchu_defconfig
$ make ARCH=arm CROSS_COMPILE=/opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- -j32
Can anyone help please
Thank you

[HELP!] Lineageos 15.1 build fails with "ninja failed with: exit status 1"

Hi everyone!
I'm trying to build LineageOS 15.1 for my Samsung Galaxy S5 - klte. Everything is good until I start compiling and then the build fails with an error "ninja failed with: exit status 1".
I've gone through the output from the build, but I can't find anything that sticks out. I also have tried Googling the problem, but I can't find anything that matches my problem. Here are my build steps:
## Create the directories
mkdir -p ~/bin
mkdir -p ~/android/lineage
## Install the repo
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
## Put the ~/bin directory in my path
nano ~/.profile
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
source ~/.profile
## Initialize the source repository
cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
## Download the source code
repo sync -f --force-sync -j8 -c
source build/envsetup.sh
breakfast klte
cd ~/android/lineage/device/samsung/klte
./extract-files.sh
cd ~/android/lineage
export USE_CCACHE=1
./prebuilts/sdk/tools/jack-admin kill-server
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx15g"
./prebuilts/sdk/tools/jack-admin start-server
## Prepare the device-specific code
source build/envsetup.sh
breakfast klte
## Start the build
croot
brunch klte
Here is a link for the output from the build:
http://www.ohsmeg.com/bill/projects/android/lineageos/ninja_error.html
My build machine is an i7-950 with 16gb of memory, running Ubuntu 16.04 headless.
Any suggestions?
Thanks!
zog

Help Building CarbonROM 7.0 (kernel problem)

I'm trying to build CarbonROM 7.0 for the Samsung T580 device and I'm getting the following error.
Code:
FAILED: /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/soong/build.ninja
/mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/soong/.bootstrap/bin/soong_build -t -l /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/.module_paths/Android.bp.list -b /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/soong -n /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out -d /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/soong/build.ninja.d -o /mnt/UserData/Projects/Android-Source/CarbonRom-7.0/out/soong/build.ninja Android.bp
(0x8fdf20,0xc4201110e0)error: vendor/carbon/build/soong/Android.bp:31:8: module "generated_kernel_includes": cmd: unknown variable '$(KERNEL_MAKE_FLAGS)'
I'm using the command "make carbon -j4" to build the rom. Am I using he wrong command? If so what is the right command? Does CarbonROM only support building GSI roms? The only articles I can find in my search has to do with project treble.
Thanks

[HOW TO] Extract DTS from running OS

Build dtc (Device Tree Compiler) from AOSP (external/dtc/)
- Get Android sources (AOSP., LineageOS, OmniRom or whatever you want)
- Modify external/dtc/Android.mk
- Replace
Code:
include $(BUILD_HOST_EXECUTABLE)
with
Code:
include $(BUILD_EXECUTABLE)
- . build/envsetup.sh && lunch aosp_yourdevice-userdebug
- mka dtc
Run dtc on your device
- Root your device
- Remount system
- push dtc binary to /system/bin/
Code:
adb root
adb shell
Code:
setenforce 0
dtc -I fs -O dts -o /sdcard/extracted.dts /proc/device-tree
exit
Code:
adb pull /sdcard/extracted.dts
Open extracted.dts with your favourite text editor.
Attached dtc binaries:
dtc.zip - Android P
dtc-n.zip - Android N

Categories

Resources