Hi all,
there's some fantastic stuff on your forum and I would like to thank you all for work being done here!
Now, to my point. I need kernel source (or update.zip or zImage or boot.img or whatever ) that can support systemd so I can run Fedora 17 arm on my Toshiba Folio 100.
I tried using kernel 3.1 form DerArtem (the guy who has done amazing work with folio) but it has no framebuffer console. I tried adding support for this myself (following this guide: kernel.org/doc/Documentation/fb/fbcon.txt) but it didn't work. There's no surprise there as I am newbie when it comes to compiling kernel and changing its options.
I succeeded in starting Fedora 12 arm with older kernel using this guide (lguegan.free.fr/article.php3?id_article=29) which is inspired by you guys. It worked all right, but I didn't want to go deeper with it because F12 arm didn't have LibreOffice (or OpenOffice) in its repos and Fedora 17 did. Also, Fedora 17 has core support for multi-touch - apps do need to implement this feature though, but the funcionality is there.
And if there is someone who can help me, I can point you in a few directions:
Kernel source for 3.1: github.com/DerArtem/android_kernel_toshiba_betelgeuse
Fedora 17 arm rootfs: fr2.rpmfind.net/linux/fedora-secondary/releases/17/Images/
I am not sure which image you should use SFP or HFP as I don't know what kind of floating point Folio uses.
I am making boot.img with this command:
Code:
#mkbootimg --kernel arch/arm/boot/zImage --cmdline "[email protected] [email protected] vmalloc=192M video=tegrafb usbcore.old_scheme_first=1 tegrapart=recovery:122000:a00:800,linux:a0e00:1000:800,loader:300:400:800,mbr:700:200:800,system:900:20000:800,cache:20900:80000:800,misc:a0900:400:800,userdata:a1f00:80000:800 boardtype=PR root=/dev/mmcblk1p1 init=/sbin/init usb-storage.delay_use=0 rootdelay=10" -o boot.img --ramdisk boot.img-ramdisk.gz
maybe there is something wrong right there, but I don't know what half of these kernel parameters do
Also, maybe I am using wrong config file: arch/arm/configs/tegra_betelgeuse_android_defconfig, please do correct me.
Now that I think, I just need config file for this 3.1 kernel, so basicaly that's the help I need.
Thanks in advance and again thank you for all the good stuff here
Momcilo
Hmmm interesting project. Mabey some day you can tell us how you got Fedora 12 to work. I saw that DerArtem is working on a kernel over on his github page: https://github.com/DerArtem/, mabey it will work with your build?
Did you also read through the linux post in the general section? (link)
Hi friend!
Well, getting Fedora 12 arm to work was fairly easy. Just flashed with kernel from that page you posted and copied Fedora 12 rootfs to an mmc and it booted with console. X was not even installed in rootfs so before I tried to make it work I realized that there was no office for that version of Fedora arm so I dropped it.
Reason I can't use kernel from that page you posted is: it's too old. Fedora 17 uses systemd which requires newer kernel. That's why I came here, to try and contact DerArtem to see if his new kernel 3 for Folio could be configured to boot up other OSes, because I tried reconfiguring myself but got stuck.
Thanks for your interest in this
Its been a while since i build my own kernel, but it seems to me that you need to have a F17 build system and then build the kernel with the config for the Folio 100 (Fedora arm Kernel building)
I'm currently trying to get Archlinux working on my folio (Still i know).
I don't have problem building a kernel. It builds just fine, and I do get zImage and I can flash my Folio with it and it boots up. Only problem I have at the moment is that I can't seem to get framebuffer console working so I can debug booting Fedora from MMC.
and then build the kernel with the config for the Folio 100
Click to expand...
Click to collapse
Yeah, that's what I am missing
The config for the kernel is in:
arch/arm/configs/tegra_betelgeuse_android_defconfig
You will have to enable the framebuffer console as it is disabled it the kernel.
Hi DerArtem,
thanks for taking time to look at my work.
I think there was a mistake in my earlier efforts that I didn't realize, because now I did it from start and framebuffer works like a charm. I also added support for systemd (devtmpfs, cgroups, etc...) and now my Fedora 17 arm boots to console.
I am so happy right now I can't even try to debug why X doesn't work, but I'll get there.
If I make this work completely I will make a guide and post it here.
Thanks guys!
May I suggest u post your issues here, perhaps we can help you with these ?
thanks
P.S. Fedora is not really my distribution of choice(prefer debian or arch), but nevertheless make it working is a great advance
Thanks sader0!
I will need help with this.
Here are the logs:
dmesg - dm.txt
lsusb - lsusb.txt
/var/log/messages - messages.txt
Xorg -configure - Xorg.0.txt
lspci - doesn't produce anything.
And another thing, I didn't copy anything from kernel tree after compiling. I noticed during kernel build that something compiles as module but I had trouble finding any modules.
Is there anything I should copy to filesystem from kernel tree?
Best regards,
Momcilo.
Related
This is a basic kernel build guide, to help those that keep coming into IRC asking for help.
If you follow this, you should have a working kernel that will work with ext4 or RFS.
NOTE::I wrote this at 1am, when Im kinda falling asleep, so there might be errors. Please let me know, and Ill fix it up
What you need:
A Linux system, with about 2gb free (This is written for 32bit systems, 64bit will need a compatible toolchain)
Development libraries
The kernel source
An ARM toolchain
An initramfs from an existing kernel
Downloads
EB13 source - search for D700 under mobile phone
Code Sourcery 2009q3 ARM toolchain
Daemon's Ext4/RFS Initramfs
Steps:
Set up the build environment
The first thing you need to do is set up the build environment.
For Ubuntu or other Debian-based system, you need the build-essential package and libncurses.
You can install this by running this command:
Code:
sudo apt-get install build-essential libncurses5-dev
If your not running Ubuntu/Debian, the packages are gcc, g++, libc-dev, and make.
Next, your going to need a directory for all your kernel build. You can't have spaces in any folder name. Im going to use /home/tortel/build/ for the rest of this guide.
Now you need to extract the kernel source to your directory. In the Samsung source file, its SPH-D700_kernel.tar
Next, extract the ARM toolchain into your build directory.
Last, extract your initramfs into the directory.
After this, your build directory should contain 4 things:
Code:
arm-2009q3/
eb13init/
Kernel/
build.sh
For this guide, Im not going to use the build.sh. If you want to, you'll need to configure that yourself.
Configure your kernel
Now the fun begins.
You need to edit the Kernel/Makefile file, and change line 184 to match where your toolchain is. My line 184:
Code:
CROSS_COMPILE ?= /home/tortel/build/arm2009q3/bin/arm-none-linux-gnueabi-
Now you need to configure the kernel.
The kernel configuration file is called .config, which is hidden by default (Ctrl+H shows hidden files in GNOME). You need to set lines 81-91, so it uses your initramfs. My lines:
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="/home/tortel/kernel/eb13init/"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
CONFIG_INITRAMFS_COMPRESSION_GZIP=y
# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
This will build your initramfs into the kernel image.
Now, your set to build.
Build the kernel
This is the easy part. Open a terminal, cd to build/Kernel and run make.
The commands:
Code:
cd build/Kernel/
make
If you have more than one core, you should add -j {1+ # of CPU cores} to make so it finishes faster. It only takes about 5min on my 2ghz C2D laptop.
Make it flashable!
Congrats, its built!
The file you want is Kernel/arch/arm/boot/zImage in your kernel source directory. After make finishes, run:
Code:
cp arch/arm/boot/zImage ..
This copies your kernel image file into your main build directory. Now, you need to put it into a flashable zip. To make it easy, here. Just throw the zImage into the root of that zip, put it on your SD card, and flash it.
Might want later
Advanced config stuff to come
Might want this too
Thank you for this, I'm glad too see this and others who have contributed great guides like this.
sent from "The Other Woman"
I was one of those people who kept bothering lol. I learned how to compile a kernal in two day though, now im on my way making a OC/UV Voodoo color kernal (coming soon) :]
Thanks alot
globalninja said:
I was one of those people who kept bothering lol. I learned how to compile a kernal in two day though, now im on my way making a OC/UV Voodoo color kernal (coming soon) :]
Thanks alot
Click to expand...
Click to collapse
what should I look into for making the changes necessary for an overclocking kernel?
Thanks for this helpful thread, and I had a question previously, that someone pm'ed me for. OP, please remove this reply if you feel inclined to. I had a question about the initramfs because my computer was having problems loading the page for the link.
Hey guys, kindof a noob to this.
How can I get an initramfs for DI18? Ideally, I could just use the one in the stock ROM unmodified, but I have no idea how to obtain it.
I figured it out! Used the scripts here to extract it from zImage:
http://forum.xda-developers.com/showthread.php?t=901152
Hello. I am trying to compile and boot a Cyanogenmod-7 kernel for the HTC Desire HD. My first attempt was from a Debian chroot running on the phone. I managed to compile the kernel, but was unable to boot it. For testing, I unpacked boot.img, and repacked it with the original files and kernel, and was able to boot that... this confirmed the problem was the kernel, and nothing else. I believe I tried the Kali- and Cyanogenmod-msm7x30 sources.
Realizing that compiling on the phone was impractical, I decided to buy a Trim Slice embedded system (an A9 cpu, 1gb memory, 500gb storage). I also realize that Android kernels are cross compiled, but I preferred native architecture because there are some advantages (regression tests). This Trim Slice runs Ubuntu Natty, with GCC Linaro 4.5.2.
I can not cross compile from my workstation because it is OpenBSD, and does not do such things.
Now, more carefully, I downloaded the Cyangenmod 7 kernel sources, with the same git pull version as the shipped kernel. /proc/config.gz and cyanogen_msm7230_defconfig are identical. I made no changes to the config. I used 'make CROSS_COMPILE='. I compiled mkbootimg natively, and did flash_image on the phone, rebooted, and same thing... the HTC screen for infinity.
So then I built GNU Patch-2.7 statically linked (it's a balance between a complex program and a simple program), and copied it to the phone, and './patch --version' works fine. So my compiler is fine... it is compiling for the correct platform.
What could be going wrong with my kernels? Is my GCC version to blame?.. /proc/version says the phone's kernel was built with gcc-4.4.3.
Is there a boot loader that can turn my phone's usb port into a serial port/console so I can see what is going on?
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
I read a while back about an open source driver for the tegra 2. If I remember correctly it first became mainline in 3.16. I've installed Ubuntu 14.04 on a TF101 using a 3.1 kernel, but there are problems, mainly sleep doesn't work. So, I wanted to try a newer kernel with the open source driver. It looks like the default kernel for 14.04 is 3.13, but there is a 3.16 kernel available. I installed it, now I am trying to create a kernel blob that will boot.
The thing is, I can not successfully repack the original. The problem apears to be with abootimg process. If I just blobunpack and blobpack, it works. But, if I extract the LNX and recreate it using the same files, boot fails.
Has anyone else tried this?
Well, I figured out the issue with my repacks not working. Nothing to do with abootimg. The DE was automounting the boot partition, which silently broke the dd of the blob to the partition in most cases.
Still no luck with a new kernel though. It just hangs on the eeepc splash. I did find that the ubuntu kernel uses a different kernel compression. Looks like gzip vs. lzma. Not sure if that is the issue, or the kernel is failing to load for some other reason.
Same problem with a 4.0.x kernel.
However, same splash was seen when I've tried to cross-breed Ubuntu with Katkernel with a disabled android GUI. It still displayed splash, but ubuntu was up and running.
It may be possible than something wrong with framebuffer driver and/or mmc (tegrapart?) simultaneously.
I think I have discovered the root problem. There is some code in arch/arm/mach-tegra that would either need to be ported, and/or, a flattened device tree would need to be created and appended to the kernel. Since FDT support was added to obsolete the need for machine specific code, that is probably all that is needed. This is all initial discovery to me though and I have not yet found if there is an easy way to generate a table, or if we can use something that is already out in the wild.
I did find that the compiler is available via apt-get install device-tree-compiler, and that the compiled file can be appended to the kernel image via CONFIG_ARM_APPENDED_DTB (under Boot Options). There is a lot of documentation in Documentation/devicetree/usage-model.txt
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.