[Q] Nexus S kernel compile and kernel serial console output tracking - Nexus S Q&A, Help & Troubleshooting

Hi,
I am one of those who want to upload custom kernel in my Nexus S (SHW-M200K which is for Korean). When I updated my android by the methods in android source. It worked.
I also downloaded android kernel by using following commands.
$ git clone samsung.git kernel
$ git branch -a
$ git checkout remotes/origin/android-samsung-2.6.35-gingerbread
And, configured the kernel using herring_defconfig without any modification. The compilation was okay, but the device cannot be booted. I used fastboot to flash my new kernel into the device.
I am wondering if I know how to make the device booted with my new kernel.
Second, I want to see the kernel bootlog, the device is not working with my kernel, so I cannot use adb shell dmesg. Is there a way to see device's serial out? and is there a way to configure the kernel to make it show kernel logs to microUSB port?
I googled and found some links, unfortunately I cannot pase the url because I am newbie , but I did not work in my environment. The contents of the link uses 150k resistor to link ID and GND of microUSB ports and links D+/D- to UART port.
I also found some threads about Nexus S's kernel console out, but they have a little message which makes me confused.
I also found microUSB to serial cable, which is named as FlexSerial™ Serial (RS232) Data Cable for Samsung Nexus S, I cannot also attach url links, and you can easily found the module by using google. But I am not sure it will work or not. Is there anybody used this device?
Finally, I will also wonder if I know a specific configuration in kernel to see kernel's serial out?
It would be very nice if you let me know how to do or give me useful links.
Thanks in advance.

Related

Ubuntu 11.04 nauty running on Gtab

SUCCESS. I now have Ubuntu 11.04 booting on the Gtab. Using Pershoots kernel and files from the Vega folks, we now have touch screen working. Wireless is not up yet, and have not tested sound.
Thread from the Vegan folks:
http://android.modaco.com/content/a...-com/332887/ubuntu-linux-11-04-natty-on-vega/
From vega get the boot intrd image and the vegan root files.
http://www.adebenham.com/vega/
Follow the instructions to copy and build Pershoots kernel. Edit drivers/video/console/fbcon.c and searching for 'navy' and uncomment the line. This will give you the boot messages on the screen.
Formant the card to ext3. Unzip the vega_root file to an micro sd card of 4GB or better. use unzip -vxf vega_root.tgz
This will take awhile.
Edit /etc/fstab on the card and change mmcblk3p2 to mmcblk2p1
Copy the following files from the staging directory that you made after building Pershoots kernel:
sudo cp location-of-staging-dir location-sd/boot
sudo cp -Rp location-of-staging-dir/system/lib/modules/ location-sd/lib/modules/
Command to build the boot image:
./mkbootimg --kernel zImage --ramdisk initrd.img-2.6.32-custom --cmdline "root=/dev/mmcblk2p1 rootdelay=5 [email protected] [email protected] vmalloc=192M video=tegrafb console=tty0,115200 fbcon=rotate:1 fbcon=font:VGA8x8 usbcore.old_scheme_first=1 cpuid=200102 devicetype=1002 btmac=9c5ed6131a00 tegraboot=nand mtdparts=tegra_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](bootbmp),[email protected](logodata)" -o boot.img
Once you have the boot image, grab a copy of the boot-karmac.zip file. Replace boot.img in the zip file with the one that you created and rename the zip file.
Power down the Gtab, if need be. Put your micro sd card in that has the ubuntu files. Boot into CWM and go to mounts and mount the usbdrive, and connect to your computer. Copy the zip file that you made to the root of the usbdrive. Unmount the usbdrive from your computer and then umount in CWM. Now use CWM to zip the file into the Gtab and reboot.
You should see text scroll by and and it should boot into Ubuntu.
If you do the updates, it will cause problems with libgc. If you do the updates, then log into a terminal window and do sudo dpkg -i /root/glibc/*.deb
This will restore the glibc files needed.
3-23-11 Update
The latest image from the Vega folks fails due to nvrm_daemon. It causes you to loose the external sd card that your booting from. I'm using the first version that they posted.
I've gotten wireless to see AP's. I had to use the bcm4329 driver from Chenglu.
http://forum.xda-developers.com/showthread.php?t=892308
The Gnome nm-applet does not run, as it has issues with libappmenu.so, so I've not been able to test using it to connect to any AP.
Slow headway.
NMCBR600 said:
SUCCESS. I now have Ubuntu 11.04 booting on the Gtab. Using Pershoots kernel and files from the Vega folks, we now have touch screen working. Wireless is not up yet, and have not tested sound.
Click to expand...
Click to collapse
Interesting! Could you please clarify one thing:
> Unzip the vega_root file to an micro sd card of 4GB or better. Formant the card to ext3. use unzip -vxf vega_root.tgz
Do you reformat the sdcard before or after unzip the files to the card? (I thought formating would destory all content of the card)
THANKS!
Format before unzipping the files.
Awesome
Thanks for the great work
obviously we would need wireless (wifi) to make it all useful but the touch screen working is awesome
do you know if this will be able to run or support any of the following: Now or in the Future
1 usb dvd or cd drives- will they be able to be mounted and or even read/writable
2 flash- will flash video be able to be played in browser etc.
3 wine- would wine be able to be installed and used
I do not know how much of these are possible or impossible but all of them would be great
Thanks again
I'm new to the G tab and haven't had any experience at all with ubuntu, but I always want the latest and greatest thing in terms of tech.
Having said that I'm wondering just what are the possibilities of having ubuntu on the G tab, what can be done with it, how will it effect what I can do with the tablet once it is complete?
Thanks in advance.
doihaveto said:
Thanks for the great work
obviously we would need wireless (wifi) to make it all useful but the touch screen working is awesome
do you know if this will be able to run or support any of the following: Now or in the Future
1 usb dvd or cd drives- will they be able to be mounted and or even read/writable
2 flash- will flash video be able to be played in browser etc.
3 wine- would wine be able to be installed and used
I do not know how much of these are possible or impossible but all of them would be great
Thanks again
Click to expand...
Click to collapse
To add cdrom support, you need to add the modules to the kernel. The cdrom drive will need external power as the usb port does not supply enough power to run external hd or cd drives.
Flash -- if there is an arm version for linux
wine -- would have to compile the source code for arm
Roxxas049 said:
I'm new to the G tab and haven't had any experience at all with ubuntu, but I always want the latest and greatest thing in terms of tech.
Having said that I'm wondering just what are the possibilities of having ubuntu on the G tab, what can be done with it, how will it effect what I can do with the tablet once it is complete?
Thanks in advance.
Click to expand...
Click to collapse
Limited by your imagination and needs.
will wicd work for wireless
in this post about ubuntu on the gtablet
http://forum.xda-developers.com/showthread.php?t=894960
the wireless works only with wicd
would this maybe allow wireless to work in this port
At this time, the driver is not coming up. Running ifconfig does not show wlan0 at all, so I know I have an issue with driver. It does see my Verizon usb modem and my usb ethernet unit. With the ethernet unit, I can get online and surf. Currently, openoffice/librioffice are not available as there are dependencies between the two that cannot be resolved due to missing modules. The camera is not seen and I do not have any audio or power management.
I'll be working on this as I can over the weekend.
Using a 2.6.32 kernel with natty might not be the best idea.. 2.6.38 also has broadcom drivers.. this is great and all. but whats preventing us from stepping away from the android kernel? In specific if you can..
I've pulled the nvida 2.6.36 tree but if fails to compile. Complaints about asm using odd registers cause the compile to fail. At this time, 2.6.32 tree has drivers for the hardware. If I can get the 2.6.36 to compile, I'll try it.
Right now, sound, battery monitoring, camera are not working. Buttons on the side and the volume up/down are also not working. This is a starting point.
Forget about wine. Wine is an API translation layer, program loader plus libraries, it does not emulate x86, you are supposed to have it in the hardware. Wine on Gtab with ARM CPU will not do you any good, unless your windows applications are already compiled under ARM. And for that to happen you will have to wait until Microsoft comes up with windows on ARM first
Try the latest git commit of 2.6.38 - its on rc8 fwiw.. I run it on my server (heh).. I also compiled it using a modded pershoot defconfig (in a silly attempt to see if I could be cooler than 2.6.36 xoom folk - and to get the new cpu stuff)
It did not boot android.... but it did compile with no errors. I think I disabled wifi tho.. so yeah, disable as much as you can... get a basic system running on 2.6.38, then start building up
is there any progress here
just checking to see if there is any progress with wireless and or the kernel and drivers being used, is anyone trying this yet themselves besides op
i find this topic very interesting. I'd love to have this fully functional
I have not had luck with wireless. It looks like there is something missing the the vega image. I have gotten the wireless driver to load, but iwlist scan does not return any AP's. I pulled one of the 11.04 arm images for TI boards and tried to use the kernel that I built. I do not get a graphical screen and I cannot log in at a command prompt as I do not have a root password for that load. I've just built a generic 2.6.38 kernel to test on that image to see what happens.
I'm watching the vega forum on what they are doing.
I'm finding moving from working on x86 processors to arm interesting. As I get more information, I'll update the instructions. I want to get this running so I can use this on at a meeting in the first part of April.
get this running and expect a donate from me! i love android but compared to ubuntu it just doesnt cut it. i know you are using 11.04, but what ever happened to the ubuntu/kubuntu 9.04 (i think) MID Edition? Wasnt it made for arm? Did they stop development on this version?
Also, this may be a bit much to ask but could we get a pre-made image so we can test progress so far?
You guys are great! Keep up the good work!
edit: fixed my grammer
At this time I don't have a site to upload images to. I'm wanting to get the wireless sorted out, but as I make headway, I'll update the information that I posted on the first page. The vegan folks updated their vega image, but I cannot get it to boot. I get errors about inode from the sd card, but I know that the sd card checks out fine with fsck, so I've dropped back to their first image. I'm beginning to think that part of the problem is the modified driver for our wireless chip is different from the stock b43 driver in linux.
Headway
Update at the bottom of post #1. Wireless is working. Also, I tested an external CD drive and it was seen. The usb port did not supply enough power to spin the disk in the drive and I did not have an external power supply with me.
This is great,but....
I am in no way knowledgeable of how to compile all this together, can we get more intensive instruction on how to get this running or can anyone get this done in a way that we can simply get it going by the same methods it takes to get this version running:
http://forum.xda-developers.com/showthread.php?t=894960
download the two files extract files to the sd card and flash the kernel that easy.
if not I may never get this up, I would appreciate it greatly
I could provide a drop box account to share the files if it is needed to get them available online just let me know
thanks

[Q] Help please compiling kernel with initramfs support

Hi my name is ashy and I need some help regarding building a kernel from source for an ongoing project called H1droid here: h**p://samsungi8320.freeforums.org/portal.php
Basically I am just getting into this kind of stuff and at best Iam a hacker and a modder not a developer, so Linux is pretty new to me. However I learn fast and have a good grasp on what's what.
I am trying to build the Kernel for this project from this source h**p://samsungi8320.freeforums.org/onenand-mtd-multiboot-recovery-cm7-2rc1-t765.html
These sources were created originally by R3D4 who doesn't come to our fourms any more, so I am here to ask for help.
In a nut shell I am trying to build the kernel from R3D4's sources. I have Ubuntu, the tool chains, cloned the source and have managed to build the kernel. The problem is that the kernel requires to be in uImage format with built in ramdisk, however for the life of me I can't figure out how to create the valid boot.img..
I have pulled the config file from the device to use as the default .config, and haven't changed anything in menuconfig when compiling.
I have tried flashing the resulting image to the device, but it doesn't boot at all. It seems that there is no ramdisk to boot a rootfs.
I notice in .config it expects an initramfs to be in a specified directory, however my problem is I have no idea how to create the initramfs to build into the kernel when compiling.
This is probably something easy, but I have searched and searched and can't figure it out, so I am asking here for someone who has the knowledge if they can guide me in the right direction as to how to build the initramfs into the kernel and then compile it as a boot.img to flash via recovery.
I appreciate any and all help.
Thanks, ashy
Please help!
Update: I have managed to compile the kernel with built in initramfs, however the phone still doesn't boot.
Can anybody help here I'm stumped. Iam using Ubuntu 11.10 in VMware and these are the steps I have taken:
1. Clone sources as in first post
2. copy initramfs files into directory specified in config file: CONFIG_INITRAMFS_SOURCE="../out/target/product/nowplus/root"
2. Open terminal in Kernel directory
3. use command: make ARCH=arm nowplus_defconfig (this is the config file from the phone)
4. start the build of the kernel: make ARCH=arm CROSS_COMPILE=/home/user/cm7/arm-2012.03/bin/arm-none-eabi- uImage
During the compile there are warnings regarding unused variables or something, but believe these are normal. However at the end of the build modpost reports: WARNING: modpost: Found 2 section mismatch(es).
Is this significant?
Could really do with some help here, I am new at this stuff and getting really frustrated as I've been at it for 2 weeks now. I have searched and searched the whole internet for an answer.
ashyx said:
Update: I have managed to compile the kernel with built in initramfs, however the phone still doesn't boot.
Can anybody help here I'm stumped. Iam using Ubuntu 11.10 in VMware and these are the steps I have taken:
1. Clone sources as in first post
2. copy initramfs files into directory specified in config file: CONFIG_INITRAMFS_SOURCE="../out/target/product/nowplus/root"
2. Open terminal in Kernel directory
3. use command: make ARCH=arm nowplus_defconfig (this is the config file from the phone)
4. start the build of the kernel: make ARCH=arm CROSS_COMPILE=/home/user/cm7/arm-2012.03/bin/arm-none-eabi- uImage
During the compile there are warnings regarding unused variables or something, but believe these are normal. However at the end of the build modpost reports: WARNING: modpost: Found 2 section mismatch(es).
Is this significant?
Could really do with some help here, I am new at this stuff and getting really frustrated as I've been at it for 2 weeks now. I have searched and searched the whole internet for an answer.
Click to expand...
Click to collapse
Ok have managed to make a little progress, it seems the rootfs is loading as it boots up to a screen with blue A N D R O I D text and then changes to a flashing cursor in the top left of the screen. I guess this means the kernel isn't booting.
Still looking for pointers out there on this, can nobody give me a hint or a way to debug this problem?
ashyx said:
Ok have managed to make a little progress, it seems the rootfs is loading as it boots up to a screen with blue A N D R O I D text and then changes to a flashing cursor in the top left of the screen. I guess this means the kernel isn't booting.
Still looking for pointers out there on this, can nobody give me a hint or a way to debug this problem?
Click to expand...
Click to collapse
Hey, like you i'm an user which enjoy to experiment stuff with linux, so, i want just thank you to share your experience, it helped me

How to build your own custom Galaxy Camera kernel

Hey guys, Samsung's repository at opensource.samsung.com is fubar. Team "Hey, just got up" would like to make building a kernel easier for you.
Introduction
Elite Recognized Developer Rebellos and myself decided to make an easy-to-work-with repository. We've applied several changes which result in no fuss with making kernel. It is our hope that this increases development on the Samsung Galaxy Camera. Feel free to fork this repository and build your own with tweaks!
Getting Started
Prerequisites: You will need an Ubuntu desktop/laptop computer. You can get Ubuntu here: http://www.ubuntu.com/download/desktop
Installing Software Essentials
First, you will want to install a couple of packages from the terminal. These packages are the build essentials and git, as well as abootimg for packaging.
Code:
sudo apt-get install build-essential git abootimg
Now you need the source code. Download the source code with this command:
Code:
git clone https://github.com/adamoutler/EK-GC100_Galaxy_Camera.git
Building the Kernel
Run the following commands to build the kernel and package it into Odin and Heimdall flashable formats.
Code:
cd EK-GC100_Galaxy_Camera
make gc1pq_00_defconfig; make -j8;
abootimg --create boot.img -f tools/testing/bootimgpack/bootimg.cfg -r tools/testing/bootimgpack/initrd.img -k arch/arm/boot/zImage
tar -H ustar -c boot.img >boot.tar; md5sum boot.tar >> boot.tar;mv boot.tar boot.tar.md5; gzip boot.tar.md5 -c -v > boot.tar.md5.gz
Congratulations! You've built a Heimdall-flashable boot.bin and a Odin-flashable boot.tar.md5.gz . This file will boot your device into Linux and Android. It's that simple.
Source
Change Logs are available here: https://github.com/adamoutler/EK-GC100_Galaxy_Camera/commits/master
All source code is available here: https://github.com/adamoutler/EK-GC100_Galaxy_Camera
Thanks
To Elite Recognized Developer Chainfire for sharing his knowledge about Samsung Kernels and their problems https://plus.google.com/104711040110222472212/posts/2JRZQsqhDSc
To Elite Recognized Developers Rebellos and Entropy512 for helping me to learn git. I usually work with Subversion. This was my first time with Git.
Downloads
As of 9JAN2012 the only changes we have made to the source are to make the build process work and turn on UART logging for Open Galaxy Bootloader debugging. These are the resulting files as of today's build.
Heimdall flashable boot.img: http://d-h.st/x2X
Odin flashable boot.tar.md5.gz: http://d-h.st/jPz
Couple additional tips (for all, I've already given you these on gtalk...)
Keep initramfs in a second repo
Git doesn't like empty directories but initramfs needs them. Some people use .gitignore but this is less obvious than putting in a file called EMPTY_DIRECTORY - This strategy comes from LinuxBozo, who is an utterly awesome developer and honestly a lot of the stuff I know I learned from him. As a result, I call setting up initramfs this way "LinuxBozoizing the directory strategy"
See https://github.com/Entropy512/kernel_n8013_ics/blob/master/build_kernel_n8013.sh for an example of a file that autobuilds the kernel and pulls in the initramfs from another repo. Inspiration for that comes from multiple sources - LinuxBozo, h8rift, and gtg465x for some of the initial concepts, and gokhanmoral for how to do Exynos 4412 boot images. You can probably replace mkbootimg with abootimg though - good idea there!
So is this the first step toward getting a 4.2 Android on here?
Thanks foy you!
Can you make an CWM too???
hi adam, do you think we can activate smart dock mode by adding a 40.2k ohm resistor on a usb otg id pin. I Want to use otg and charging at the same time for my gcam, i read in s3 forum that they were able to do it and since gcam and s3 has identical specs.
I checked your source and found under \drivers\misc\max77693-muic.c it has these option, i dunno if it was compiled in the stock rom, is this kernel related?
Thanks
Sent from my GT-I9100 using xda app-developers app
fatbuccha said:
hi adam, do you think we can activate smart dock mode by adding a 40.2k ohm resistor on a usb otg id pin. I Want to use otg and charging at the same time for my gcam, i read in s3 forum that they were able to do it and since gcam and s3 has identical specs.
I checked your source and found under \drivers\misc\max77693-muic.c it has these option, i dunno if it was compiled in the stock rom, is this kernel related?
Thanks
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
USB and charging should be 100% kernel.
@adam thanks, i tried making the cable with the resistors, but it didn't work. It said unsupported ADC 0X10 and this should be the smart dock mode on your source.
Is your source for 4.1.1 or 4.1.2? Coz maybe i need to update to 4.1.2, i am still on 4.1.1
Already tried 4x10k ohm and 1x39k + 1x1.2k still wont work. If i connect the resistors, it will charge the phone but loose Otg and if no resistor only otg mode... any idea why this is happening?
Sent from my GT-I9100 using xda app-developers app
would this work ? http://www.ebay.com/itm/Micro-USB-H...224134?pt=PDA_Accessories&hash=item1e77e08e86
---------- Post added at 01:23 PM ---------- Previous post was at 01:20 PM ----------
or this http://www.ebay.com/itm/Micro-USB-B..._USB_Cables_Hubs_Adapters&hash=item19d97a5182
or this
http://www.ebay.com/itm/Micro-USB-H...645937?pt=PDA_Accessories&hash=item3ccf669b71
@pileiba sad to say it doesnt work, already bought one of those but it only provides power on the usb device connected not charging the phone, i hope mr adam can comment on this, really want this to work...
Sent from my GT-I9100 using xda app-developers app
I take it this was the site u got the idea for the resistor ? http://forum.xda-developers.com/showthread.php?t=1953061 ? here is a s3 kernel for reference https://github.com/gokhanmoral/siyahkernel-sgs3 P.S. does it charge the phone if no usb device is connected.
If i add a 40.2k resistors, it does charge the phone but lose OTG function. Check the log and i think it did detect the 40.2k resistor but it is unsupported. Wierd part is, the source from adam has a support for this resistor, thanks for the link, will try to find some clues there
Sent from my GT-I9100 using xda app-developers app
Edit: Nevermind. I found it after searching some other devices. I get the feeling this was abandoned.
Hi, noob here.
We want to get a 120 fps preview stream from the camera (S6 or any other device with a camera capable
of high frame rate) and do processing on this stream. It doesnt need to go to the screen for display.
Is this tutorial relevant for that kind of process? Any idea how we would go about getting the data rate
we are looking for?

Infinity JB 10.4.4.23 Compat-Wireless Drivers for RTL8187 Cards Inside

I posted a question earlier that got no traction regarding compiling the RTL8187 drivers for the infinity for use in backtrack for ARM.
I have since completed the compile and have successfully used the adapter I bought on the tablet with them. What is attached are the compiled compat-wireless drivers, specifically: compat-wireless-3.6.8-1-snpc.tar.bz2
They include the "mac80211.compat08082009.wl_frag+ack_v1.patch" and the "channel-negative-one-maxim.patch"
I am attaching them for those interested or who have a similar need. I am not interested in being bombarded with questions/complaints about it not working for them or whatever. I may post a tutorial later with the problems I ran across and how I compiled these drivers that may help others with different chipsets.
These drivers work successfully with BT5 for ARM on my infinity and an ebay RTL8187L chipset external USB wireless device. To see more ID's they might work check here for RTL8187 PCI ID's that compat-wireless drivers might work for: http://linuxwireless.org/en/users/Drivers/rtl8187
Once in backtrack you will need to MAKE SURE the built in wireless is turned off on the tablet then in terminal with SU:
rmmod bcmdhd.ko
You will have to have the compat-wireless package I referenced above downloaded and uncompress and run: make wlunload in the folder you uncompress it to.
This will get rid of cfg80211.ko rmmod would probably work for that too but I know this works.
Now insmod in the following order:
insmod eeprom_93cx6.ko
insmod compat.ko
insmod cfg80211.ko
insmod mac80211.ko
insmod rtl8187.ko
It can all be scripted, feel free to do so.
With your wireless device plugged in to USB run airmon-ng and you should see your card in the list.
You will have to of course reboot to re-enable the built-in wireless.
Enjoy!
If you ever get the time I would appreciate a brief tutorial on the steps you took to build the modules. I've been struggling with doing this on the nexus 7 for a few days now and don't seem to be making much headway.
Nexus 7
Hi,
Yes please post a tutorial as I'm using a Nexus 7 also.
I already use a modified kernel on my Galaxy Nexus where I don't need to do those modification it's all built in the kernel (http://www.kernel-xp.net/index.php/en/) and would like the same but I would also take your procedure
Thank you!
I am also working on this and need help, to install the compat drivers i need the source code for my kernel but i dont know where or how to unpack the source code so that compat wireless will recognize it, i think it said in /lib/modules/*mykernelsource* if anyone is reading this and can help please reply with instructions thank you
compiling and building modules
alexcass4 said:
I am also working on this and need help, to install the compat drivers i need the source code for my kernel but i dont know where or how to unpack the source code so that compat wireless will recognize it, i think it said in /lib/modules/*mykernelsource* if anyone is reading this and can help please reply with instructions thank you
Click to expand...
Click to collapse
This is something that I am also struggling with. Any help or direction would be much appreciated.

Kernel compilation/booting troubleshooting for beginners

I've only recently after lot of struggle compiled my first kernel. While the information is still fresh in my mind, I want to share all the problems I encountered and what to do if you are in the same situation.
This guide is mainly for Linux users since that is what I am familiar with.
I've used this amazing guide to learn the basics. If you haven't yet, read it first.
Errors from scripts/gcc-wrapper.py
Open the file and change the first line from
Code:
#! /usr/bin/env python
to
Code:
#! /usr/bin/env python2
Kernel won't compile
* Did you forget to set and export the variables ARCH and CROSS_COMPILE?
* Do you have the right .config file present?
Try extracting the .config file from the original boot kernel and use it instead
* Are you sure you are in the correct branch?
Run git branch inside kernel's source code to verify that
* Are you using a very recent or very old version of the compiler? Some old kernels for example would only compile with gcc-4 but not gcc-7 or 8. Most kernels - at the time of writing - won't compile with gcc-8
Kernel compiles fine but won't boot
* Are you using wrong kernel configuration (.config) ?
* Try different compiler or different compiler version.
I've tried to compile my current with Android's prebuild gcc 4 compiler and it wouldn't boot, switched to gcc 7 and it booted perfectly fine.
Kernel starts but system crashes somewhere during boot
You can enable adb during boot so that you can see what causes the error.
Find this file in your extracted boot image ramdisk/default.prop
Set or update the following values
Code:
ro.adb.secure=0
ro.secure=0
persist.sys.usb.config=adb
Then you can do adb shell logcat or adb shell dmesg to see what is going on
My phone won't boot after flashing my new kernel, how do I boot to recovery?
First of all, you shouldn't have! You should test your new kernel without flashing it using fastboot.
Simply reboot to bootloader then run the command
Code:
fastboot boot /path/to/my/new-image
So what can I do now? Try to reach bootloader screen. the method differs from device to device but it involve pushing certain physical phone buttons while turning on the phone.
Once you are in the bootloader screen, you can do adb fastboot /path/to/twrp-recovery.img or even path to original boot image if you kept a backup.
ramast_ said:
I've only recently after lot of struggle compiled my first kernel. While the information is still fresh in my mind, I want to share all the problems I encountered and what to do if you are in the same situation.
This guide is mainly for Linux users since that is what I am familiar with.
I've used this amazing guide to learn the basics. If you haven't yet, read it first.
Errors from scripts/gcc-wrapper.py
Open the file and change the first line from
Code:
#! /usr/bin/env python
to
Code:
#! /usr/bin/env python2
Kernel won't compile
* Did you forget to set and export the variables ARCH and CROSS_COMPILE?
* Do you have the right .config file present?
Try extracting the .config file from the original boot kernel and use it instead
* Are you sure you are in the correct branch?
Run git branch inside kernel's source code to verify that
* Are you using a very recent or very old version of the compiler? Some old kernels for example would only compile with gcc-4 but not gcc-7 or 8. Most kernels - at the time of writing - won't compile with gcc-8
Kernel compiles fine but won't boot
* Are you using wrong kernel configuration (.config) ?
* Try different compiler or different compiler version.
I've tried to compile my current with Android's prebuild gcc 4 compiler and it wouldn't boot, switched to gcc 7 and it booted perfectly fine.
Kernel starts but system crashes somewhere during boot
You can enable adb during boot so that you can see what causes the error.
Find this file in your extracted boot image ramdisk/default.prop
Set or update the following values
Code:
ro.adb.secure=0
ro.secure=0
persist.sys.usb.config=adb
Then you can do adb shell logcat or adb shell dmesg to see what is going on
My phone won't boot after flashing my new kernel, how do I boot to recovery?
First of all, you shouldn't have! You should test your new kernel without flashing it using fastboot.
Simply reboot to bootloader then run the command
Code:
fastboot boot /path/to/my/new-image
So what can I do now? Try to reach bootloader screen. the method differs from device to device but it involve pushing certain physical phone buttons while turning on the phone.
Once you are in the bootloader screen, you can do adb fastboot /path/to/twrp-recovery.img or even path to original boot image if you kept a backup.
Click to expand...
Click to collapse
good job!
Do you have any general tutorials on kernel optimization?
wangyiling said:
good job!
Do you have any general tutorials on kernel optimization?
Click to expand...
Click to collapse
I am afraid not, sorry. I am just a beginner
@ramast_
The information you provided has solved pretty much all of the problems I was having. We need more content like this. Everything I find about kernel building explains things like you're a Linux expert, where as your post is much more layman friendly. I can't thank you enough for this.
Quick question; which version of Linux do you use?
You are very welcome, happy someone found it useful.
By Linux version I suppose you mean Linux distro (distribution).
I use Gentoo which is certainly not for beginners.
I'd suggest Ubuntu for beginners. Not because it's the best but because it has a very big community and you are more likely to find help when facing any problem.
This article explain how to cross compile arm code (how to compile code so that it can run on an arm device). Should get you started.
Best of luck
Spaceminer said:
@ramast_ I can't thank you enough for this.
Quick question; which version of Linux do you use?
Click to expand...
Click to collapse
ramast_ said:
You are very welcome, happy someone found it useful.
By Linux version I suppose you mean Linux distro (distribution).
I use Gentoo which is certainly not for beginners.
I'd suggest Ubuntu for beginners. Not because it's the best but because it has a very big community and you are more likely to find help when facing any problem.
This article explain how to cross compile arm code (how to compile code so that it can run on an arm device). Should get you started.
Best of luck
Click to expand...
Click to collapse
Thanks again. Distro is what I meant. I was thinking I should use Ubuntu, but I wanted to see what you had to say about it.

Categories

Resources