[Dev]kexec - Acer Iconia A500

Okay, let's get the ball rollin on kexec!
I've taken most of the module from the milestone kexec project. I only did some slight tweaks to get it to compile right.
Attached is a kexec module, the source to said module, a patched kexec-tools, and the bin kexec from said patched kexec-tools.
I built this against one of the OC'd transformer kernels. I cheated a bit and changed the .4 to a .3 in Kconfig for the kernel. Other than that, it should be stock. The bottom of the first post here, http://forum.xda-developers.com/showthread.php?t=1095269 , has the source.
I've only tried booting transformer kernels, as I don't really know much about building kernels. I've gotten 3 responses from them, immediate hang (failing on the OC in them?), power down, and reboot(prolly kernel panic on host kernel).
I'm not 100% sure where to go from here.
kexec-mod.zip has the module and the source I used to compile it.
kexec-tools.zip has kexec tools. I didn't clean it before zipping, so it should have the bins still.
Also, I'm using backtrack to compile and run these, so kexec-tools may fail outside of it.
Edit: Please view THIS POST for the latest kexec-mod.

Nice.... I'm with you in the hopes that someone will pick up the ball and start runnin with this....

great step forward....tnx

yess! finally we are one big step closer

I'd really like to try booting the Iconia's kernel, just to see if kexec works right.
Has anyone managed to get inside the boot.img?

heres perl script to unpack the boot.img
Code:
#!/usr/bin/perl -W
use strict;
use bytes;
use File::Path;
die "did not specify boot img file\n" unless $ARGV[0];
my $bootimgfile = $ARGV[0];
my $slurpvar = $/;
undef $/;
open (BOOTIMGFILE, "$bootimgfile") or die "could not open boot img file: $bootimgfile\n";
my $bootimg = <BOOTIMGFILE>;
close BOOTIMGFILE;
$/ = $slurpvar;
# chop off the header
$bootimg = substr($bootimg,2048);
# we'll check how many ramdisks are embedded in this image
my $numfiles = 0;
# we look for the hex 00 00 00 00 1F 8B because we expect some trailing padding zeroes from the kernel or previous ramdisk, followed by 1F 8B (the gzip magic number)
while ($bootimg =~ m/\x00\x00\x00\x00\x1F\x8B/g) {
$numfiles++;
}
if ($numfiles == 0) {
die "Could not find any embedded ramdisk images. Are you sure this is a full boot image?\n";
} elsif ($numfiles > 1) {
die "Found a secondary file after the ramdisk image. According to the spec (mkbootimg.h) this file can exist, but this script is not designed to deal with this scenario.\n";
}
$bootimg =~ /(.*\x00\x00\x00\x00)(\x1F\x8B.*)/s;
my $kernel = $1;
my $ramdisk = $2;
open (KERNELFILE, ">$ARGV[0]-kernel.gz");
print KERNELFILE $kernel or die;
close KERNELFILE;
open (RAMDISKFILE, ">$ARGV[0]-ramdisk.cpio.gz");
print RAMDISKFILE $ramdisk or die;
close RAMDISKFILE;
print "\nkernel written to $ARGV[0]-kernel.gz\nramdisk written to $ARGV[0]-ramdisk.cpio.gz\n";
if (-e "$ARGV[0]-ramdisk") {
rmtree "$ARGV[0]-ramdisk";
print "\nremoved old directory $ARGV[0]-ramdisk\n";
}
mkdir "$ARGV[0]-ramdisk" or die;
chdir "$ARGV[0]-ramdisk" or die;
system ("gunzip -c ../$ARGV[0]-ramdisk.cpio.gz | cpio -i");
print "\nextracted ramdisk contents to directory $ARGV[0]-ramdisk/\n";

/proc/last_kmsg said:
[ $336.932146] -------%----[ cut here ]------------
[ 36.932255]$WARNINGz at /home/amy_chiU/quuofuild/a500omdrr/androiD/{ernel/driv ers/base/core.c:10 deviae_releaqe+0x70/0x84()
[ 336.932419] Device %(null) does not have a releaseh) functikn, iu is broken a nd must be fiXed.
[ s36.932580] Modules linkEd in: iexec_,oaD bcm4329
[ $3s6.932927] [<c0356ec>] (unwind_backtrace+0x0/1xf0) from [<c0067fac>] (warN_s lowpath_commmn+1p4c/0x¶4)
[ 336.933094] [<c0067fac>] (warn_slowpath]com}on+0x4c/0x64) from [4c0068044>] ( warn_slovpauh_fmt+0x2c/0x1c9
[! 336.¹33262U [|c0068044>] (warn_slowp!th_fmt+0x2c/0x3c) from [<c0!f08âc>] (dev ice_rElease+0x70/0X84)
[ $33v.937434]$[,c01æ08bc>] (device_remease+0x70¯0x84) from [=c01a65dc>] (kobjeC t_reluase+px5c?x70)
[ 33.9s76°u] [<c01a65dc~] (kobject_release+0x5c/0x70) from [<k01a74d4.] (kref_p ut+0x44/0X74)
[ 336.933711] [<C01a54d4>] (kref_pud+0|64/0h74) from [<bf044490>] (device_shuTd own+0x28/0x8c`[kexec_loadU)
[ 336.933887] Y<cf044490>U (device_shuTdown+0x28/0x8c [kexec_loadU- from [<bf04 4458>]!(kernel_resta2t_prepare+1x44/0x54(Skexec_load])
[( 336.934085] [<bf04$48>] (kernel_restert_prepare+0x/0x54 [kexea_load]9 from [< bF043098>] (kernel_kexec+0x38/0x68 [kexec_load])
[ 336.934262] [<"f043098>] (kernel_kexec+0x38/0x68 [kexec_load]) from [<bf0443b 8>] (reboot+0x74/0xd0 [kexec_load])
[ 336.934438] [<bf0443b8>] (reboot+0x75/0xe0([kexec_load]) from [<c0032060>] (r et_fast_syscAll+0x0/0x30)
[ efd tsace 237c2b25b258a813 ]---
[ 336.938148] StaRting new Kurjel
[ 336.938356] Bye!
147 Corrected bytes, 167 unrecoverable blocks
Click to expand...
Click to collapse
Damn kurjels.
But, it seems to be trying to boot it. I've updated my kexec to actually use the files it should use(as in, a kernel source that was made in the last 3 years).

How do you repackage the kernel and the initfs in order to kexec it?

huxflux2003 said:
How do you repackage the kernel and the initfs in order to kexec it?
Click to expand...
Click to collapse
Good question. That's what I was hoping I could get some help with. The kernel is still closed-source(illegally, I might add), so it's going to be difficult to get a new one built, and I can almost guarantee that it's outside of my knowledge.
If anyone can come up with anything for me to try booting, I'm all ears.

heres repack script...
DONT TRY TO FLASH IT BACK INTO THE BOOT PARTITION IT WILL BRICK
Code:
#!/usr/bin/perl -W
use strict;
use Cwd;
my $dir = getcwd;
my $usage = "repack-bootimg.pl <kernel> <ramdisk-directory> <outfile>\n";
die $usage unless $ARGV[0] && $ARGV[1] && $ARGV[2];
chdir $ARGV[1] or die "$ARGV[1] $!";
system ("find . | cpio -o -H newc | gzip > $dir/ramdisk-repack.cpio.gz");
chdir $dir or die "$ARGV[1] $!";;
system ("mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel $ARGV[0] --ramdisk ramdisk-repack.cpio.gz -o $ARGV[2]");
unlink("ramdisk-repack.cpio.gz") or die $!;
print "\nrepacked boot image written at $ARGV[1]-repack.img\n";

thanks thor, but i think that since the bootloader is locked what we need is a zimage with init that can be used with kexec, correct?

huxflux2003 said:
thanks thor, but i think that since the bootloader is locked what we need is a zimage with init that can be used with kexec, correct?
Click to expand...
Click to collapse
yes zimage with init script

thor2002ro said:
yes zimage with init script
Click to expand...
Click to collapse
is this possible?
(noobalarm)

yea, but we need some people who know about this stuff to help.

Ok, here is my kexec sources based on 2.6.36
http://www.mediafire.com/?zdzpaui7dd8d6e9
still didn't manage to boot a kexec'ed kernel. Well, a couple times i got it to reboot to a regular kernel from mmc (did watchdog kill us?) but mostly it just freezes.
take a look here - http://wiki.meego.com/ARM/N900/Install/kexec
you need at least http://wiki.meego.com/images/0003-ARM-5886-1-arm-Fix-cpu_proc_fin-for-proc-v7.S-and-ma.patch to make it work.
Also, note the discussion here - ttp://comments.gmane.org/gmane.linux.ports.arm.kernel/75711
looks like we need a different cache invalidation for SMP (multi-processor cpu).
Anyways, I'm gonna make away with iconia and get myself an ac100 or asus xformer.. Partly due to Acer's hostility, partly because life without keyboard sucks.. My plan now is to write a custom implementation of sth like kexec for tegra (like splboot for xperia) from scratch because debugging kexec is quite annoying without a hardware debugger.. Basically it should be as easy as disabling mmu and dcache, but.. Well, need to lurk through the A9 assembly manual.

Related

[Q] compile own kernel? configuration

I used rotohammer's method for backing up the AT&T Galaxy Tab and it worked wonderfully. I compiled the GT-P1000_Kernel patched with SGH-I987_Kernel and did a standard make and then flashed the zImage onto the galaxy. It resulted in kernel panic. Does anyone know what parameters to use with make or configuration changes that need to be made?
Thanks
ps. when I used heimdall, I only "heimdall flash --kernel zImage".
I also couldn't find a config.gz in the /proc dir. Does anybody know why it is missing and what has taken its place?
success at last
Yay, it works now! thanks roto for the initramfs tip.
what kind of modification did u make to the kernel? do you mind sharing?
[Q] how did you compile your own kernel?
Hi,
I'm in disperate need to do this. I have downloaded the sources from samsung opensource -> followed the instruction in the README.txt -> compiled the kernel and the modules successfully -> used the initramfs from the stock zImage -> but when I flash the zImage (Size ~ 432 KB) I get kernel panic.
I do not think it is possible to boot in verbose mode or have a serial port console log.
letolkki: please share with us how you did it? how did you compile a zImage which boots.??????
share with us please!
I used make menuconfig to specify the location of the initramfs (compression to none). Do not use the build script above the root as that seemed to mess things up for me. The size of my kernel is approx ~5meg with the initramfs included and ~3 without. Then used Heimdall to push it on.
I didn't make any mods as of yet. Just a quest for knowledge and tinkering. Just making sure I can when I need to.
What exactly did you modify? Here's my config, as related to INITRAMFS:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
My kernel size is only 2.9 megs. What else did you specify that has your kernel at 5 megs?
Thanks
you don't have the initramfs source file specified. Put the complete path to the initramfs in the config.
Even when I specified the file location generated during the compile, it still didn't work...size only 3 meg. Are you using the ramdisk.img generated and output into Android/out/target/product/...? Or, did you pull boot.img from the device and split ramdisk.img from the kernel?
chuckbeasley said:
Even when I specified the file location generated during the compile, it still didn't work...size only 3 meg. Are you using the ramdisk.img generated and output into Android/out/target/product/...? Or, did you pull boot.img from the device and split ramdisk.img from the kernel?
Click to expand...
Click to collapse
yep, i pulled it from the device
Would you please tell me how you did it exactly? I've been attempting over the past several hours and haven't been able to find a tool that would split boot.img. They keep telling me that it's not a valid image, but I pulled it from the device.
chuckbeasley said:
Would you please tell me how you did it exactly? I've been attempting over the past several hours and haven't been able to find a tool that would split boot.img. They keep telling me that it's not a valid image, but I pulled it from the device.
Click to expand...
Click to collapse
I used the script from
http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
to get the initramfs from the zImage pulled from the device.
Much appreciated! I'll try this later tonight. Right now, I need a break...
I used verizon_zImage from ClockworkMod, but it fails the extraction with a gzip invalid compressed data--format violated error. How can I pull the zImage directly from the phone? It seems that boot.img doesn't work either.
Thanks
Here are the error messages I'm receiving for both verizon_zImage and boot.img, which I pulled from the GT:
[email protected]:~/ramdisk$ ./extract_initramfs verizon_zImage
-I- Extracting kernel image from verizon_zImage (start = 13117)
gzip: stdin: decompression OK, trailing garbage ignored
5979431+0 records in
5979431+0 records out
5979431 bytes (6.0 MB) copied, 195.453 s, 30.6 kB/s
-I- Extracting compressed cpio image from kernel image (start = 5410216)
gzip: stdin: invalid compressed data--format violated
-I- Extracting initramfs image from /tmp/cpio.img (start = , end = 11)
dd: invalid number `'
[email protected]:~/ramdisk$ ./extract_initramfs boot.img
-I- Extracting kernel image from boot.img (start = 13117)
gzip: stdin: decompression OK, trailing garbage ignored
-I- Extracting compressed cpio image from kernel image (start = 5410216)
gzip: stdin: invalid compressed data--format violated
-I- Extracting initramfs image from /tmp/cpio.img (start = , end = 11)
dd: invalid number `'
Looks like the script had a bug and has been updated. Here's the link: http://forum.xda-developers.com/showthread.php?p=8679959
Here's the updated script that allowed me to extract initramfs.cpio from boot.img:
#!/bin/sh
# This is an update version of the script found at
# http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
#
# The problem with that script is that the gzip magic number occasionally occur
# naturally, meaning that some non-compressed files get uncompressed.
zImage=$1
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' $zImage | cut -f 1 -d :`
echo -n "-I- Extracting kernel image from $zImage (start = $pos)"
dd if=$zImage bs=1 skip=$pos | gunzip > /tmp/kernel.img
#==========================================================================
# 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!!!
#==========================================================================
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 :`
if [ $start = "" || $end = "" ]; then
#========================================================================
# the cpio archive must be archived
#========================================================================
echo "-I- Extracting compressed cpio image from kernel image (start = $pos)"
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' /tmp/kernel.img | cut -f 1 -d :`
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 -n "-I- Already uncompressed cpio.img, not decompressing"
inputfile=/tmp/kernel.img
fi
end=$((end + 10))
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
chuckbeasley said:
I used verizon_zImage from ClockworkMod, but it fails the extraction with a gzip invalid compressed data--format violated error. How can I pull the zImage directly from the phone? It seems that boot.img doesn't work either.
Thanks
Click to expand...
Click to collapse
I used rotohammer's backup method to pull the zImage from the device.
http://forum.xda-developers.com/showthread.php?t=850359&highlight=backup+install+kernel
So do you guys have working kernels ?
I know from my Nexus days that custom kernels can made a massive difference to performance on the beast, so I am looking forward to seeing what people can do with the TAB
Keep up the good work !
I've built my own kernel to see if I could work around the dialing limitation on my VZW tab. Right now, it crashes randomly, but it does boot! I'm looking into the difference between the international version of Onedram and Verizon's version and why Verizon includes a OnedramRecovery unit. My kernel doesn't reference OnedramRecovery and I made more mods. So, I haven't isolated what is causing the instability. Right now, I'm back to Koush's kernel. I'll keep you informed on my progress.
Sent from my SCH-I800 using XDA App

[HELP]Re-create bootable blob with init.rc changes

Good evening all!!
Well after two days of hitting my head against the wall I decided to ask for help.. typical guy here!!
Problem: when using the blobtools to create a boot blob it soft bricks my transformer. No idea why.
Objective: Create a bootable boot blob with init.rc changes
Steps token to create the boot blob:
::Tools Used::
- BlobTools created by RaYmAn
- BootTools created by RaYmAn
::Blob used:: Stock kernel provided by clemsyn ( h t t p : / / w w w . megaupload.com/?d=GSIHUPJ6 ) kernelblob
1. After compiling blobtools I used "blobunpack" to unpack my blob
Code:
./blobunpack /home/mike/Android/kernelblob
Once done it produced "kernelblob.HEADER" and "kernelblob.LNX"
2. After compiling boottools I used "bootunpack" to unpack "kernelblob.LNX"
Code:
./bootunpack /home/mike/Android/kernelblob.LNX
Which produced "kernelblob.LNX-kernel.gz" and "kernelblob.LNX-ramdisk.cpio.gz"
3. Then I uncompressed "kernelblob.LNX-ramdisk.cpio.gz"
Code:
gunzip -c /home/mike/Android/kernelblob.LNX-ramdisk.cpio.gz | cpio -i
Which produced the initramfs. Made my changes to init.rc
4. Re-created ramdisk using this command
Code:
find . | cpio -o -H newc | gzip > ../newkernelblob.LNX-ramdisk.cpio.gz
5. Then re-create kernelblob.LNX (boot.img) with mkbootimg
Code:
mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel kernelblob.LNX-kernel.gz --ramdisk newkernelblob.LNX-ramdisk.cpio.gz -o newkernelblob.LNX
6. re-created blob using blobpack
Code:
./blobpack kernelblob.HEADER boot_blob LNX newkernelblob.LNX
Example provided by RaYmAn
Code:
./blobpack blobname.HEADER outputfile LNX boot.img
Then I try to flash the new boot_blob but after I reboot it just gets stuck on the ASUS screen...
Thanks for taking the time to read this and help me!!!! Hope this will help others
Just to note:: Even if I do not make changes to init.rc it still does not boot which tells me it might have something to do with the way I'm repacking the blob..... Thanks again for anyones help!!!
Anyone?????
trying to keep the thread alive.... I've tried with the offical blob too. No luck!
I am running ubuntu 64-bit with jdk installed!
The problem is the fact that you pass a cmdline to the mkbootimg command.
On most tegra2 based devices, the cmdline is passed by the bootloader UNLESS the boot.img has a cmdline. Your cmdline is obviously wrong for a tegra2 device, so it never boots.

[Android] TouchPad Android kernel mini howto

It seems there is little information on the internet regarding how to compile the kernel and how to convert to the correct image format so the boot loader will recognise and how to transfer it over to the touchpad. I ended up spent a few hours and finally figured out. I hope this will be useful for someone. I will try to make it concise as this is mainly aimed for developers.
What you will need
A linux development machine with uboot mkimage tool installed.
Sourcery G++ Lite 2010q1-188 for ARM EABI cross compile tool chain
https://sourcery.mentor.com/sgpp/lite/arm/portal/release1294
Touchpad kernel source
https://github.com/CyanogenMod/hp-kernel-tenderloin
CM7 Alpha 3 image (zip file)
http://goo-inside.me/roms/cmtouchpad/alpha3/update-cm-7.1.0-tenderloin-a3-fullofbugs-signed.zip
Prepare
Download CM7 Alpha 3 image and extract the boot.img to a temporary place.
Download Sourcery G++ Lite and install it. Add the G++ Lite tool chain binaray path to the PATH env variable. Get the kernel source from git hub and extract to local disk and change directory to the kernel source.
Compile the kernel
Still in the kernel source directory run
Code:
make ARCH=arm CROSS_COMPILE=arm-none-eabi- tenderloin_android_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage
Prepare the initramfs U-boot image
Extract the initramfs from the boot.img saved in temporary folder and convert it to uboot-image format
Code:
dd if=boot.img bs=1 skip=3577748 of=img.gz
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ./img.gz arch/arm/boot/uRamdisk
(The dd offset for alpha 2.1 image is 3561152)
Combine the kernel and initramfs into a single U-boot image
Create a combined U-boot image (kernel and initramfs)
Code:
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d arch/arm/boot/uImage:arch/arm/boot/uRamdisk uImage.CyanogenMod.new
Transfer it to the device
Boot your touchpad into recovery mode and run
Code:
adb shell mount /dev/block/mmcblk0p13 /boot
adb push uImage.CyanogenMod.new /boot/uImage.CyanogenMod.new
adb shell umount /boot
adb shell reboot
After it reboot you should be able to see a new CyanogenMod.new item from the boot menu.
That's it!
Optimisation
For those who wants to experiment with GCC build options you can update the entry "arch-$(CONFIG_CPU_32v7" in file arch/arm/Makefile and I set mine to
Code:
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -O2 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
Warning
Please be aware you are working on the bleeding edge kernel for touchpad and there is no guarantee that the latest git version will work for you. Please try an earlier version if that's the case.
As of 2011-11-23 you will need the latest kernel source to build kernel for alpha 3. Please do not mix the kernel with an initramfs from a different version, i.e. don't use initramfs extracted from alpha 2.1 and use it with alpha3.
Thanks for this. Last weekend spent a while trying to figure this out.
Sent from my HP Touchpad using Tapatalk
x2. Huge thanks
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Divine_Madcat said:
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Click to expand...
Click to collapse
As long as the mkimage can generate a standard U-boot image it should be fine.
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes. As long as you keep the original image files (UImage.*) untouched I don't think you can brick it even if you want to.
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Divine_Madcat said:
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Click to expand...
Click to collapse
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
s7mx1 said:
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
Click to expand...
Click to collapse
I will give it a check; just in case, know where to get a newer mkimage?
Thanks so much for this guide
s7mx1 said:
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes.
Click to expand...
Click to collapse
It feels like 10 mins.. doesn't it
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
myn said:
x2. Huge thanks
Click to expand...
Click to collapse
Myn, do you have a touchpad???!!!? God I hope so!
vinscuzzy said:
Myn, do you have a touchpad???!!!? God I hope so!
Click to expand...
Click to collapse
He does
Sent from my PG86100 using Tapatalk
Divine_Madcat said:
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
Click to expand...
Click to collapse
That's because dalingrin has updated the default configuration to use the HIGHMEM which seems to kill all the apps. The latest git actually works if you disable all the HIGHMEM related stuff.
decalex said:
Thanks so much for this guide
It feels like 10 mins.. doesn't it
Click to expand...
Click to collapse
Absolutely
I just hope there is a rest button as the touchscreen occasionally will not respond at all after wake up and I have to reboot to webos and then reboot back to get the touchscreen back.
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
crimsonredmk said:
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
Click to expand...
Click to collapse
The root parameter (root=/dev/ram0) that passed to kernel is not useful to you. The root / is mere extracted initramfs in memory. I assume you are looking for system, data partitions etc. With TP we have LVM partitions which you can do really fancy stuff with. The actual mount device and mount point is defined (hard coded) in file init.tenderloin.rc which you can find in the initramfs (i.e. the img.gz which is a gzipped cpio file). You can extract all the contents out from img.gz and modify init.tenderloin.rc to suit your need and then create an updated initramfs file to go with the kernel.
Since Android (at least CM7 on TP) does not use pivot_root any changes made to the initramfs will appear automatically when you boot up the device.
You can google if you are not sure how to work with initramfs file.

[Guide] How to build kernel from source

Build-kernel​
Building Kernel only from Oppo Source​
"Official Oppo Find 5 kernel source":https://github.com/oppo-source/Find5-Kernel-Source
EDIT: the 12025_release_defconfig doesn't work for me (touchscreen doesn't respond). Most likely a change needs to be made here
Code:
446,447c436,437
< CONFIG_TOUCHSCREEN_MELFAS=y
< CONFIG_TOUCHSCREEN_SYNAPTICS_S3202_I2C_RMI=y
---
> CONFIG_TOUCHSCREEN_ATMEL_MXT=y
> CONFIG_TOUCHSCREEN_CYTTSP_I2C_QC=y
Check out the source code
Code:
git clone git://github.com/oppo-source/Find5-Kernel-Source.git
Using +12025_debug_defconfig+ as config. You can use +12025_release_defconfig+ , with some modifications to the source to make it work properly
Code:
cd Find5-Kernel-Source
make ARCH=arm clean
make ARCH=arm 12025_debug_defconfig
edit include/config/kernel.release
if you want to modify the kernel version numbering
Build
Code:
make -j4 ARCH=arm CROSS_COMPILE=arm-eabi-
or use this following (uses as many cores as your computer has
Code:
make -j$(grep -c ^processor /proc/cpuinfo) ARCH=arm CROSS_COMPILE=arm-eabi-
\n if you want to use the +12025_release_defconfig+, there are some config problems. I have fixed them in my github
My github (use the branch [*]config-fixes): https://github.com/ngvincent/android-kernel-oppo-find5
The end, you'll get two files (Image and zImage) inside arch/arm/boot
Image = full kernel image, zImage = compressed version
*_The boot partition has ~10MB of space(see bottom of page for details). Make sure your kernel+ramdisk doesn't exceed this_*
Make boot.img file (need to add ramdisk)​
Copy the ramdisk from existing device or ROM. "Here":https://git.ngvincent.com/attachments/download/5/ramdisk.gz is one I extracted from the X909EN_13_130307 rom
Extracting kernel from device​
Code:
adb shell
su
dd if=/dev/block/mmcblk0p18 of=/sdcard/boot.img
exit
adb pull /sdcard/boot.img
Extracting from boot.img​
Code:
abootimg -x boot.img
Making boot.img​
Copy the stuff below into a file called bootimg.cfg (gives the configuration for abootimg to create the img properly)
Code:
bootsize =
pagesize = 0x800
kerneladdr = 0x80208000
ramdiskaddr = 0x82200000
secondaddr = 0x81100000
tagsaddr = 0x80200100
name =
cmdline = console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Code:
abootimg --create bootimage.img -f bootimg.cfg -k zImage -r ramdisk.gz
Flash kernel onto device​
You'll need to use fastboot to do it. I need to sudo as root for fastboot to work properly
Code:
adb reboot bootloader
sudo -s
fastboot devices
fastboot flash boot bootimage.img
fastboot reboot
verify​
Code:
adb shell
cat /proc/version
Linux version 3.4.0-perf-g5d91181 ([email protected]) (gcc version 4.4.3 (GCC) ) [*]1 SMP PREEMPT Sat Mar 16 13:29:19 EDT 2013
partition space on the device​
Code:
adb shell
cat /proc/partitions
Code:
179 18 10240 mmcblk0p18
Code:
[email protected]:/dev/block/platform/msm_sdcc.1/by-name $ ls -la
lrwxrwxrwx root root 1970-01-16 12:58 DDR -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-16 12:58 aboot -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-16 12:58 boot -> /dev/block/mmcblk0p18
Looks like there's plenty of space for the kernel/boot.img - 10240 kilobytes
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Coreym said:
just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
are you planning on making nightlies for the oppo ?
CoopZor said:
are you planning on making nightlies for the oppo ?
Click to expand...
Click to collapse
I think kAmMa is working on CM right now? So hopefully we will have the CM Rom to install on the Find 5 in the near future. I know he said that he almost had it complete but was having problems with the drivers for the display and needed the drivers from the source code. Now that the source code has been released we might see something good soon. I don't know if his CM will be the official CM release though. We do need an official CM for the Find 5 though.
Personally, I would like to see Paranoid Android 3+ on the Find 5 as its my favorite rom, and it would be amazing on the Find 5. I use it as my daily on my Nexus 4 and 7 and both run great!
This is out of my league also, I wish I could build some good kernels and Roms. I will beta test Roms and Kernels if anyone needs me too though.
Coreym said:
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
once you get the hang of linux build tools, the next part is rather easy
I'm porting over the changes that faux123 made in his kernel for the Nexus 4 (same Qualcomm S4Pro APQ8064 processor+SoC)...
finished reading his mods for voltage control, i'll probably slicing in the code tomorrow...
I'm not touching CM10 (or AOKP/Paranoid...) porting yet... had some experience with kernel development a few years ago, but not for android porting...
error when run Command
I got error when run Command : make ARCH=arm clean , how can I fix it?
PHP:
[email protected]:~/aosp/kernel/Find5-4.2-kernel-source-master$ make ARCH=arm clean
scripts/Makefile.clean:17: /home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile'. Stop.
make[1]: *** [drivers/networkpmsmodule] Error 2
make: *** [_clean_drivers] Error 2
#### make failed to build some targets (1 seconds) ####

[GUIDE] Build AOSP ROMs and Kernels for the Note Edge.

Below are some guides on how to build your very own ROMs and Kernels for the Samsung Galaxy Note Edge gsm versions.
XDA is a great community that has taught me so much that I want to share what little I know with you, so you may also build roms and kernels on your own. As a long time follower of XDA, last year I decided to gen an account so I could start contributing and also so I could start thanking people for thier great work.
I started out on the Motorola Flipside, and quickly moved on to the Samsung Captivate Glide, where guys like @bubor and @steadfasterX were not only doing great work, but were willing to share thier knowledge. By God's grace, I made some roms and kernels for the Samsung Galaxy S4, and now for the Note Edge.
All of my work can also be seen in more detail at https://thealaskalinuxuser.wordpress.com/
These guides are specifically built for the Note Edge, but in principle are applicable in any phone/rom/kernel.
In this guide, I am using Ubuntu 14.04. You can use virtual box, virtual machine, or any other method, but I used it installed on the computer.
Post #1. Introduction and table of contents.
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Post #3. Rom - How to add apps to your rom.
Post #4. Rom - How to change the default background in your source.
Post #5. kernel - How to build just a kernel from a rom source.
Post #6. kernel - How to build just a kernel stand alone.
Post #7. Kernel - How to break down and make boot images.
Post #8. kernel - How to add CPU/GPU Governors.
Post #9. kernel - How to Overclock/Undervolt.
Post #10. kernel - "How to" on special projects like sound mods.
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Step by step instructions for building AOKP 6.0 for the international variant of the Samsung Galaxy Note Edge
This is adapted from my previous writeup on building AOKP 6.0 for the T-Mobile variant of the Samsung Galaxy S4:
http://forum.xda-developers.com/gal...uide-step-step-instructions-building-t3402637
I have noticed that the build instructions on the AOKP website are a bit outdated. They date back to JellyBean. I would like to encourage other users to build more custom roms, and I thought that it would help if I show how to build one of the roms wich compiled successfully for me (Praise God!). It is my hope that these instructions are clear and easy to follow. Hey, if I can do it, anybody can do it!
<<<<< Step 1: Setup your system. >>>>>​
To be honest, this can be the most daunting part, because if you do not set this up properly, it just will not work. I use Ubuntu 14.04 on a HP Compaq 6715b laptop. I know, not a very ideal compiler, but it is what I've got. Here are the suggested packages, just open a terminal and paste this in:
Code:
$ sudo apt-get install bison build-essential bzip2 curl dpkg-dev flex g++-multilib git git-review gnupg gperf lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev openjdk-7-jdk libbz2-1.0 libbz2-dev libc6-dev libghc-bzlib-dev libgl1-mesa-dev libgl1-mesa-glx:i386 libncurses5-dev libreadline6-dev libreadline6-dev:i386 libx11-dev:i386 libxml2-utils lzop maven pngcrush pngquant python-markdown schedtool squashfs-tools tofrodos x11proto-core-dev xsltproc zip zlib1g-dev zlib1g-dev:i386
This will take a while. Once it is done, do this:
Code:
$ mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
$ gedit ~/.bashrc
Now you should see gedit open up your .bashrc file, to which you should add this at the very end, and save it:
Code:
export PATH=~/bin:$PATH
Now you need to close your terminal and open a new one to get the PATH variables to stick. Actually, it wouldn't hurt to reboot your system after installing all of those programs we just installed. Your computer should now be primed and ready to go.
<<<<< Step 2: Download the source. >>>>>​
Here is a very short project for you that takes the computer a long time to complete. Open a terminal and start typing:
Code:
$ cd ~
$ mkdir aokp6
$ cd aokp6
$ repo init -u https://github.com/AOKP/platform_manifest.git -b mm
$ repo sync
You can now go outside, play with the kids, phone a friend, and then go to bed. When you awake the next morning, this might be done, depending on your internet connection!
<<<<< Step 3: Adding the device, kernel, and vendor trees. >>>>>​
In some cases, you can simply type the command
Code:
$ breakfast
and just choose your device, but at this time, the AOKP repository did not include a current device tree for the TBLTEXX phone, so we need to download one. Later, perhaps we can learn about adding them as dependencies or in your manifests, but for now, here are the links to download them, which will help you understand how this works, follow the link, and click the download button to download the zips. Yes some of these are from AOKP for other files you need. Be sure to grap the MM branch for this guide. There are now newer Nougat branches, which works the same as well, but this guide was written from MM.
https://github.com/alaskalinuxuser/device_samsung_tbltexx
https://github.com/alaskalinuxuser/kernel_samsung_tblte
https://github.com/alaskalinuxuser/device_samsung_tblte-common
https://github.com/alaskalinuxuser/device_samsung_qcom-common
https://github.com/AOKP/device_qcom_common
https://github.com/alaskalinuxuser/tblte_vendor_samsung
Once you have downloaded them, unzip each one and rename them:
aokp_device_samsung_tbltexx --> "tbltexx" (Place in aokp/device/samsung/ )
aokp_device_samsung_tblte-common --> "tblte-common" (Place in aokp/device/samsung/ )
aokp_device_samsung_qcom-common --> "qcom-common" (Place in aokp/device/samsung/ )
device_qcom_common --> "common" (Place in aokp/device/qcom/ )
tblte_vendor_samsung --> "samsung" (Place in aokp/device/samsung/ )
kernel_samsung_tblte --> "tblte" (Place in aokp/kernel/samsung/ )
You may have to make the folders that they go into.
Now you should probably take a break before going on to the next step!
<<<<< Step 4: Editing the device, kernel, and vendor trees. >>>>>​
Now, go to the device/samsung/tblte-common folder and make any edits you want. It should work just the way that it is currently. This is where you could add apps, change features of your phone, etc. See the following posts for guides on doing that.
Note: Because repositories are constantly updated, I can only garuntee that this will work based on the files as they were the day of this writing. However, with all of this in place, if you follow this guide, it should work realatively the same as it did for me.
Now that all of the hard work is done, it is time to actually build something!
<<<<< Step 5: Start your build! >>>>>​
Phew! You have invested a lot of hours into this project, now it is time to actually put those files and time to use! Open up a terminal in your aokp6 folder and start typing:
Code:
$ . build/envsetup.sh
Which will output something like this:
Code:
including vendor/aokp/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/aokp/bash_completion/git.bash
including vendor/aokp/bash_completion/repo.bash
Now type:
Code:
$ brunch tbltexx
Which will start the long build process, it will output this:
Code:
including vendor/aokp/vendorsetup.sh
Got local manifest
Got local manifest
Checked dependency tree over :
NO_DEPS: device/*/tbltexx
============================================
PLATFORM_VERSION_CODENAME = REL
PLATFORM_VERSION = 6.0.1
AOKP_VERSION = aokp_tbltexx_mm_unofficial_2016-10-27_1015
TARGET_PRODUCT = aokp_tbltexx
TARGET_BUILD_VARIANT = userdebug
TARGET_BUILD_TYPE = release
TARGET_BUILD_APPS =
TARGET_ARCH = arm
TARGET_ARCH_VARIANT = armv7-a-neon
TARGET_CPU_VARIANT = krait
TARGET_2ND_ARCH =
TARGET_2ND_ARCH_VARIANT =
TARGET_2ND_CPU_VARIANT =
HOST_ARCH = x86_64
HOST_OS = linux
HOST_OS_EXTRA = Linux-3.16.0-73-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE = release
BUILD_ID = MOB30J
OUT_DIR = /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out
============================================
And this:
Code:
.....edited for space.....
Import includes file: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/import_includes
host C: libhost <= build/libs/host/CopyFile.c
build/libs/host/CopyFile.c:86:43: warning: unused parameter 'pSrcStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:86:72: warning: unused parameter 'pDstStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:104:42: warning: unused parameter 'src' [-Wunused-parameter]
static void printNotNewerMsg(const char* src, const char* dst, unsigned int options)
^
build/libs/host/CopyFile.c:531:69: warning: unused parameter 'isCmdLine' [-Wunused-parameter]
static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options)
.....edited for space..... Stuff like this will scroll by .....
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_LOG.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MASQUERADE.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MIRROR.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_NETMAP.c
target StaticLib: libip4tc (/home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libip4tc_intermediates/libip4tc.a)
target thumb C++: keystore <= system/security/keystore/keystore.cpp
target thumb C++: keystore <= system/security/keystore/keyblob_utils.cpp
target thumb C++: keystore <= system/security/keystore/operation.cpp
.....edited for space.....
Notice that there were some "warning" flags in there. Warnings are not all bad, but they can be. In this case it works out okay. Hopefully, after many hours, you should see this:
Code:
______ _____ __ __ _____
/\ _ \/\ __`\/\ \/\ \ /\ _ `\
\ \ \L\ \ \ \/\ \ \ \/'/'\ \ \L\ \
\ \ __ \ \ \ \ \ \ , < \ \ ,__/
\ \ \/\ \ \ \_\ \ \ \\`\ \ \ \/
\ \_\ \_\ \_____\ \_\ \_\\ \_\
\/_/\/_/\/_____/\/_/\/_/ \/_/
===========-Package complete-===========
zip: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/aokp_tbltexx_mm_unofficial_2016-10-27_0149.zip
md5: 46bc18249c61988e75aba813464692a3
size: 324M
========================================
Success! Praise God! Now you can put this on your phone and test it out! Hopefully everything will be working! For future use, now you can start making changes or edits, from backgrounds to kernels! Have fun and make lots of backups. Remember, sometimes it is really hard to undo a change that you make.
Hopefully we learned how to set up our system, get the source, add devices and kernels that are not in the source, and run the compiler. Like I said, this works on my machine, as of this writing. You may notice, that if you make this build, it will not be identical to the one that I have posted on XDA. That is because I have made a few edits, additions, and/or subtractions here and there. That is the great thing about Android and open source! It is now up to you to make it better, to make it unique, or to make it you. Good luck with those builds, and be sure to share and help the next guy or gal with their projects too!
Post #3. Rom - How to add apps to your rom.
Post #3. Rom - How to add apps to your rom.
Here is the commit for when I did this to aokp_device_samsung_tblte-common:
https://github.com/alaskalinuxuser/...mmit/1ee34d6a1d5323a5ffb83eeeae7a87625f0eb130
I like to add the Kernel Adiutor app to my TBLTE (Samsung Galaxy Note Edge) builds. I used to put it in the vendor directory. What I realized though, is that I can simply add it to my tblte-common repository under the devices. For my device, I have a tbltexx repository, which essentially sets a few flags and passes the buck to the tblte-common repository for building. So, I actually added the app to my tblte-common repository. Now, when I sync, it updates my tblte-common directory, and keeps my prebuilt app!
Here is what I did.
Added some folders:
In my tblte-common repository (dev/samsung/tblte-common) I added a directory called "prebuilt". In keeping with Android's common structures, I then created these two folders: "common" and in that folder, one called "app".
When you are done making directories, it should have a path like this:
Code:
tblte-common/prebuilt/common/app
Now, in the "app" folder, I placed my prebuilt app, the Kernel Adiutor app, which I named "ka.apk". I then made an Android.mk file in the "prebuilt" folder that looks like this:
Code:
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := $(call my-dir)
#
# Prebuilt APKs
#
include $(CLEAR_VARS)
LOCAL_MODULE := ka
LOCAL_MODULE_OWNER := aokp
LOCAL_SRC_FILES := common/app/$(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
You can add as many prebuilt apps as you want this way, just make the above block for each app. Then you simply add them to your tblte.mk file in the tblte-common directory. You can substitute your device name here, it should work the same. Notice that the lines which have more than one app have the "" denoting that there are more files to add. Then the last app line does not have a "". Pretty simple, right?
Code:
# WJH adding kernel adiutor apk and selinux plugin apk.
# These are found in tblte-common/prebuilt/common/app
PRODUCT_PACKAGES += \
ka \
selinuxplugin
Now, when you run your build, it will include the apps that you have added to the list and placed in your folder!
Post #4. Rom - How to change the default background in your source.
Post #4. Rom - How to change the default background in your source.
Sometimes you just want to change the background. So, download a custom background and edit the jpg until it was the right shape and size. I typically use Gimp for that. Then:
After making the jpg into a 1920x1280 jpg file, I then used my home built script to make all of the "default_wallpaper.jpg" files. Here is the script:
Code:
#!/bin/bash
echo "Changing name of jpg file."
mv *.jpg 1920x1280.jpg
echo "Converting to 1080x960"
convert -resize 1080x960 1920x1280.jpg 1080x960.jpg
echo "Converting to 960x800"
convert -resize 960x800 1920x1280.jpg 960x800.jpg
echo "Converting to 1440x1280"
convert -resize 1440x1280 1920x1280.jpg 1440x1280.jpg
echo "Converting to 2160x1920"
convert -resize 2160x1920 1920x1280.jpg 2160x1920.jpg
echo "Converting to 2880x2560"
convert -resize 2880x2560 1920x1280.jpg 2880x2560.jpg
echo "making folders"
mkdir ./drawable-hdpi
mkdir ./drawable-nodpi
mkdir ./drawable-sw600dp-nodpi
mkdir ./drawable-sw720dp-nodpi
mkdir ./drawable-xhdpi
mkdir ./drawable-xxhdpi
mkdir ./drawable-xxxhdpi
echo "copying and renaming pictures"
cp ./1080x960.jpg ./drawable-hdpi/default_wallpaper.jpg
cp ./960x800.jpg ./drawable-nodpi/default_wallpaper.jpg
cp ./1920x1280.jpg ./drawable-sw600dp-nodpi/default_wallpaper.jpg
cp ./1920x1280.jpg ./drawable-sw720dp-nodpi/default_wallpaper.jpg
cp ./1440x1280.jpg ./drawable-xhdpi/default_wallpaper.jpg
cp ./2160x1920.jpg ./drawable-xxhdpi/default_wallpaper.jpg
cp ./2880x2560.jpg ./drawable-xxxhdpi/default_wallpaper.jpg
echo "Complete."
echo "Move the drawable* folders to 'vendor/pac/overlay/common/frameworks/base/core/res/res' folder."
You have to have imagemagic installed on your machine to use this script. Then, simply place your jpg file in a folder by itself, and then put this script into the folder, and run it! Here is the output:
Code:
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls
aokp.jpg picscriptphones.sh
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ./picscriptphones.sh
Changing name of jpg file.
Converting to 1080x960
Converting to 960x800
Converting to 1440x1280
Converting to 2160x1920
Converting to 2880x2560
making folders
copying and renaming pictures
Complete.
Move the drawable* folders to 'vendor/aokp/overlay/common/frameworks/base/core/res/res' folder.
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls
1080x960.jpg 2160x1920.jpg drawable-hdpi drawable-sw720dp-nodpi drawable-xxxhdpi
1440x1280.jpg 2880x2560.jpg drawable-nodpi drawable-xhdpi picscriptphones.sh
1920x1280.jpg 960x800.jpg drawable-sw600dp-nodpi drawable-xxhdpi
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls drawable-hdpi/
default_wallpaper.jpg
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$
Once I moved the drawable folders to the vendor/aokp/overlay/common/frameworks/base/core/res/res folder mentioned above, I simply re-ran the compiler. Viola! Changed default background!
Post #5. kernel - How to build just a kernel from a rom source.
Post #5. kernel - How to build just a kernel from a rom source.
This is the easiest way to build a kernel for your roms, as it will create the bootimage file for you after making the kernel.
Make the kernel and boot image:
If you followed Post #2 to download all of the source, and even built a rom from it, you can now build just the kernel very quickly with only a few commands.
You can go to the aokp/kernel/samsung/tblte/arch/arm/config folder and edit your defconfig, in this case apq8084_sec_defconfig and apq8084_sec_tblte_eur_defconfig to make changes if needed.
Then, go to your aokp folder and open a terminal:
Code:
$ . build/envsetup
$ breakfast tbltexx
$ make clean
$ mka bootimage
Each one of those commands will create a lot of output, but the mka bootimage command will run the compiler, make your kernel, and your boot image. Now they are in the aokp/out/target/product/tbltexx/ folder as kernel and boot.img.
Make it a flashable zip:
Make a new folder and put this file in it:
http://www.mediafire.com/file/x3cn41c1ucjs33x/makekernelzip.zip
Unzip that file and you will have everything you need. Simply put your boot.img file in this folder, and follow the included instructions to run zip.sh and make your boot.img flashable on any tblte phone.
Post #6. kernel - How to build just a kernel stand alone.
Post #6. kernel - How to build just a kernel stand alone, without Rom source...
For the record, I do not recommend building kernels this way, I recommend that you build them within your ROM source. This method will work, but is far more labor intensive.
Part 1 - The setup:
Go to
Code:
$ sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2 git make -y
This will take a while. Then:
Code:
$ cd ~
$ mkdir playground
$ cd playground/
$ mkdir toolchain
$ cd toolchain
Now type this for 4.9:
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
OR this for 4.8, but for this I recommend 4.8.
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8
The output either way should look like this:
Code:
Cloning into 'arm-linux-androideabi-4.8'...
remote: Sending approximately 170.26 MiB ...
remote: Counting objects: 124, done
remote: Finding sources: 100% (124/124)
.........EDITED FOR SPACE..................
Resolving deltas: 100% (652/652), done.
Checking connectivity... done.
That will take a few minutes. Then:
Code:
$ mkdir kernel
$ cd kernel
$ git clone https://github.com/alaskalinuxuser/kernel_samsung_tblte.git
Cloning into 'kernel_samsung_tblte'...
remote: Counting objects: 49082, done.
remote: Compressing objects: 100% (32/32), done.
.........EDITED FOR SPACE..................
Checking connectivity... done.
Checking out files: 100% (46422/46422), done.
This will take another few minutes, maybe longer, depending on your internet connection.
Part 2 - The kernel modifications
Before going further, this is when you can edit the files of the kernel, add things, remove things from the kernel itself. See the other posts here for how to do that. When you are ready, you can move onto the build.
Part 3 - The build
Open ~/playground/toolchain/kernel/kernel_samsung_tblte/Makefile, and go to line 195, it should say ARCH, edit it as such:
Code:
ARCH =arm
CROSS_COMPILE =/home/{YOURUSERNAME}/playground/toolchain/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-
Code:
$ cd ~/playground/toolchain/kernel/kernel_samsung_tblte/
$ make clean
$ make mrproper
You will likely see an error about TARGET, that is okay, just ignore it.
Code:
$ make menuconfig apq8084_sec_defconfig
OR
Code:
$ make menuconfig apq8084_sec_tblte_eur_defconfig
After some scrolling text, you will see a menu option. Use the arrow keys and the space bar to make selections. Make any changes you want. Remember, not all changes are good. With this setup, you will need to make changes to make this function.
Once you are done, select exit. Then select yes to save your config.
Now that you are back at the command line, all you have to do is type one more command:
Code:
$ make
You will see a lot of scrolling text, like this:
Code:
arch/arm/kernel/return_address.c:63:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp]
#warning "TODO: return_address should use unwind tables"
^
CC arch/arm/kernel/sched_clock.o
CC arch/arm/kernel/setup.o
CC arch/arm/kernel/signal.o
CC arch/arm/kernel/stacktrace.o
CC arch/arm/kernel/sys_arm.o
CC arch/arm/kernel/time.o
CC arch/arm/kernel/traps.o
CC arch/arm/kernel/atags_parse.o
CC arch/arm/kernel/cpuidle.o
This is good. Make is making your kernel.
If you are good, or lucky, then it will compile successfully, if not, it will error. Check your changes and use Google to search for errors if you need help. Again, I recommend to build kernels within the backdrop of ROM source, as I mentioned in the other post, it is much, much easier. This method will work, but you may have to add or change a lot of options in your config to make it happen.
Good luck!
Make it a flashable zip:
You will need to follow Post #7 and break down another boot image, insert your kernel, then re-pack that boot image with all of the proper arguments. This is the main reason I do not recommend building a kernel for Android outside of rom source.
Post #7. Kernel - How to break down and make boot images.
Post #7. Kernel - How to break down and make boot images.
Breaking down a boot image:
Okay, so first things first, STEP 1: downloads!
Download these things:
http://www.mediafire.com/download/zl80gh0t310trla/unpack-bootimg.pl
http://www.mediafire.com/download/xdmd278n17gm58h/unmkbootimg
http://www.mediafire.com/download/byf0tw4ga2mqtw0/repack-bootimg.pl
http://www.mediafire.com/download/7cmi548pzetc6c4/mkbootimg
And download your boot image that you want to break down, if you have not already.
I am using Linux, Ubuntu 14.04. I did this previously from Debian Wheezy, so any Linux should work. You can also use a VM, virtualbox, etc. if you are on a Windows computer.
STEP 2: Unzip!
Go ahead and unzip the zipfile if you are breaking down a flashable kernel zip that you downloaded. Preferably in its very own folder. For my work, I made a folder called "playground" in my home directory to play around in. I will reference the "playground" meaning the main folder with everything in it. Now, in the playground, make a new folder called "bootimage". In the playground folder, copy the boot.img file to the bootimage folder.
STEP 3: Tools setup!
Copy the downloaded above tools into a new folder called "tools" in the playground folder. Open a terminal here and give these files executable permissions and copy them again to the bootimage folder:
Code:
$ cd ~/playground/tools
$ chmod 777 ./*
$ cp ./ ../bootimage
We copy this twice so we have backups of the tools in case we delete them accidentally.
STEP 4: Unpack the boot image!
Open a terminal and go to the bootimage folder, and start typing:
Code:
$ cd ~/playground/boot.img
$ ./unmkbootimg ./boot.img
You will see some output in the terminal that looks *kind of* like this:
Code:
$ ./unmkbootimg ./boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 2992704
Kernel address 0x10008000
Ramdisk size 2196028
Ramdisk address 0x11000000
Secondary size 0
Secondary address 0x10f00000
Kernel tags address 0x10000100
Flash page size 2048
Board name is ""
Command line ""
This image is built using standard mkbootimg
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz -o new_boot.img
---------------
Whatever it says, copy and paste it, hand type it, screenshot, whatever it takes, write the output down, because this is the key to re-making your boot image!
Then, you can unpack it like so:
Code:
$ ./unpack-bootimg.pl ./boot.img
You should see something *like* this:
Code:
$ ./unpack-bootimg.pl ./boot.img
kernel written to ./boot.img-kernel.gz
ramdisk written to ./boot.img-ramdisk.cpio.gz
7607 blocks
extracted ramdisk contents to directory ./boot.img-ramdisk/
You will now have folders and files to play with!
Make changes to your boot image:
Now is the time to change any files you want, such as delete the kernel and put yours in instead, etc. I can not tell you much about this, since I don't know what you are doing in your boot image. Here is an example of me turning a Captivate glide cell phone into a Debian "laptop":
http://forum.xda-developers.com/cap...msung-captivate-glide-debian-chatter-t3233807
Re-pack the boot.img:
Okay, so you have made your changes, now it is time to put it back together. Go back to your playground folder.
Code:
$ cd ~/playground/bootimage
$ rm initramfs.cpio.gz
$ cd ./boot.img-ramdisk/
$ sudo su
<enter your password>
# find . | cpio --quiet -H newc -o | gzip > ../initramfs.cpio.gz
# cd ..
# mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyS1,115200n8 androidboot.selinux=permissive' -o new_boot.img
Note that the last part, "mkbootimg" needs to be all the stuff I told you to write down when you broke down your boot image, or it needs to be the new command line you want your boot image to use. The new_boot.img is your newly created boot image file, which you should rename boot.img, after you remove your old boot.img file from the folder.
-With heimdall, heimdall-frontend, or Odin, flash the new_boot.img to the boot partition of your phone, or make it flashable per Post #5 or Post #6.
Post #8. kernel - How to add CPU/GPU Governors.
Post #8. kernel - How to add CPU/GPU Governors.
Where to get CPU and GPU governors:
That is a really great question. Essentially, for CPU governors, you can pull them from any kernel by searching github. However, I recommend you pull from a kernel from either the same phone and/or kernel version. If you are using 3.10.40, but you pull from a kernel that is 3.10.84, there may be dependencies that are missing from your older kernel. In the case of the Nightmare example, I had to edit the governor itself to make it work with the kernel I was using.
For sure, if you follow this guide, you can always borrow mine
https://github.com/alaskalinuxuser/kernel_samsung_tblte
They will come from the drivers/cpufreq/ folder, and should be named cpufreq_{governor_name.c}. So, if you are looking for Nightmare, you can search github for cpufreq_nightmare.c, or use Google with "github cpufreq_nightmare.c".
GPU governors are a bit more complicated, see below for how to implement one, and then you can better see where to get one.
The non-technical guide to understanding CPU/GPU governors:
http://forum.xda-developers.com/gal...technical-guide-to-understanding-cpu-t3440156
Adding CPU Governors:
Adding a kernel governor can be a Nightmare!
You can read the commit here: https://github.com/alaskalinuxuser/...mmit/19ba1b4f94d04877a5a783843a01c2494ecb1d5c
Okay, so a little play on words, especially since I am adding the Nightmare governor to the kernel, but it did turn out to be a bit of a problem child, fortunately, it was quickly corrected. As you can see, I did the standard additions, as well as adding the cpufreq_nightmare.c file: https://github.com/alaskalinuxuser/...94ecb1d5c/drivers/cpufreq/cpufreq_nightmare.c You can download it there.
The CPU Governor files are in the drivers/cpufreq/ folder, and all start with cpufreq_{DRIVERNAME}.
Added to drivers/cpufreq/Makefile, where the other cpufreq_*'s are:
Code:
.............EDITED FOR SPACE.......................
obj-$(CONFIG_CPU_FREQ_GOV_NIGHTMARE) += cpufreq_nightmare.o
.............EDITED FOR SPACE.......................
Added to drivers/cpufreq/Kconfig, where the other CPU_FREQ_DEFAULT_GOV_*'s are:
Code:
.............EDITED FOR SPACE.......................
config CPU_FREQ_DEFAULT_GOV_NIGHTMARE
bool "nightmare"
select CPU_FREQ_GOV_NIGHTMARE
help
Use the CPUFreq governor 'nightmare' as default. -WJH
Also added to drivers/cpufreq/Kconfig, where the other CPU_FREQ_GOV_*'s are:
Code:
.............EDITED FOR SPACE.......................
config CPU_FREQ_GOV_NIGHTMARE
tristate "'nightmare' cpufreq policy governor"
help
'nightmare' - This driver is a modified PegasusQ.
To compile this driver as a module, choose M here: the
module will be called cpufreq_nightmare.
For details, take a look at linux/Documentation/cpu-freq.
If in doubt, say N. -WJH
.............EDITED FOR SPACE.......................
Added to include/linux/cpufreq.h, right where the other CONFIG_CPU_FREQ_DEFAULT_GOV_*'s were :
Code:
.............EDITED FOR SPACE.......................
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_NIGHTMARE)
extern struct cpufreq_governor cpufreq_gov_nightmare;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_nightmare)
.............EDITED FOR SPACE.......................
Added to arch/arm/configs/apq8084_sec_defconfig, right under "CONFIG_CPU_FREQ_GOV_POWERSAVE":
Code:
.............EDITED FOR SPACE.......................
CONFIG_CPU_FREQ_GOV_NIGHTMARE=y
.............EDITED FOR SPACE.......................
Adding GPU governors:
Comming soon.
Post #9. kernel - How to Overclock/Undervolt.
Post #9. kernel - How to Overclock/Undervolt.
Overclock an apq8084 Samsung Galaxy Note Edge!
You can see the commit on github here:
https://github.com/alaskalinuxuser/...mmit/9bb23d0d9cc805bf7e1b8e3fe829fcbb0542af31
In my continuing quest to make a better kernel for the Samsung Galaxy Note Edge (TBLTE, N915T), I decided to tackle overclocking the kernel. There are already some overclocked kernels out there, but I decided to do something slightly different with mine. The distinguishing feature of my overclocked kernel is that it doesn't use any more power than it did before, and to God be the glory, it worked!
I also feel that when you overclock a chip, you are increasing the rate of failure, and the induced heat load. So I like to keep my overclocking light, less than 10% of the overall capacity that the chip was designed for. It is my hope that this will reduce wear and tear on the device while still providing superior performance.
Editing the tables for this chip was a lot simpler than for other chips I have worked on.
It all took place within the kernel/samsung/tblte/arch/arm/boot/dts/qcom/apq8084.dtsi file. Here is how it used to look:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2649600000 1150000 886 >;
And here was my change, from 2649600000 to 2688000000:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2688000000 1150000 886 >;
That's right, I only made a 39MHz change. I feel this was appropriate to keep the device cool and continue to use the same voltages. So it is essentially a 39MHz boost with no noticable consequences. Of course, I had to do the above to each speed and pvs table in that file.
Then, I needed to edit this portion:
Code:
.............EDITED FOR SPACE................
qcom,[email protected] {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
qcom,cpu-mem-ports = <1 512>;
qcom,cpufreq-table =
< 300000 300000 1144 800 >,
< 422400 422400 2288 800 >,
.............EDITED FOR SPACE................
< 2572800 1728000 16250 10101 >,
< 2649600 1728000 16250 10101 >;
.............EDITED FOR SPACE................
To this:
Code:
.............EDITED FOR SPACE................
qcom,[email protected] {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
qcom,cpu-mem-ports = <1 512>;
qcom,cpufreq-table =
< 300000 300000 1144 800 >,
< 422400 422400 2288 800 >,
.............EDITED FOR SPACE................
< 2572800 1728000 16250 10101 >,
< 2688000 1728000 16250 10101 >;
.............EDITED FOR SPACE................
It actually was the only time I have overclocked a kernel on the second try. Don't think too highly of me, though, I spent hours reviewing kernel edits for overclocking by various other kernel developers on GitHub. If you are looking to do the same, you should spend some time looking at working code for others, and then make your own tables.
If you try this on your own, you may have multiple tries where the phone will not even boot, or crashes while you use it, so be careful, make small changes, and be courageous, because this is usually not a simple one stop process.
If you were to compare my tables with everyone elses, you would see that I have done it differently than my contemporaries, even though we reached similar, or in some cases, identical results. I like to keep the code clean, short, and sweet. Often when overclocking, most kernel developers will add more lines to the tables. I have found that while that may be the best to maximize use, my method is much simpler and easy to implement, as well as follow, and that is what Linux should be all about, keeping it simple. It also makes it easier for "stock" kernel hot-plug controllers like MPDecision.
Under-volt a Samsung Galaxy Note Edge:
So, back to our ealier example of the overclocked chip, now we want to change the voltage. Doing that is easy, getting viable, stable, working results is much harder. Consider our code from the kernel/samsung/tblte/arch/arm/boot/dts/qcom/apq8084.dtsi file:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2649600000 1150000 886 >;
To change the voltage, one only has to edit these multiple pvs trees.
Consider this line:
Code:
< 2572800000 1135000 849 >
It means:
Code:
< Frequency Voltage Amperage (? or cycles) >
So, in the above table, the 2572 MHz frequency uses 113.5 mv.
And, in the above table, the 2649 MHz frequency uses 115 mv.
So, to under-volt you could edit it like so:
Code:
< 2572800000 1120000 849 >,
< 2649600000 1135000 886 >;
This would cut down the voltage used on each of these frequencies. The problem is, however, if you go too low, you may cause the kernel to crash. Notice that in my overclocked kernel, I under-volted it to the same as the 2649 MHz frequency, even though I am using it at 2688 MHz. So, use with caution, and have fun making adjustments! I recommend only small changes or even only one change at a time.
Post #10. kernel - "How to" on special projects like sound mods and I/O schedulers.
Post #10. kernel - "How to" on special projects like sound mods and I/O schedulers.
How to add an I/O Scheduler to your kernel:
Praise God, another great addition to the TBLTE kernel was that of adding the FIOPS I/O scheduler to the kernel. What is an I/O scheduler? Well it is the part of the kernel that handles, or schedules, input and output. Particularly, this has to do with writing and reading to and from media, like your hard drive, flash drive, etc.
So, how do we do that? How do we add I/O schedulers to our kernel?
Well, for the TBLTE kernel, I will show you what I did, and you can add to your kernel similarly.
Go to the block folder in your kernel source. The first thing that you need to do is add the fiops-iosched.c file. Whatever I/O scheduler you want to add will be named like this: {NAME-iosched.c} you can search Google or github for them, or take them from my source if you would like.
Once you put your fiops-iosched.c file in your kernel's ./block/ folder, you can now edit two other files in that folder. You need to add the new scheduler to the make file, so it knows to make it, you can do that like so:
Open ./block/Makefile and add this line after the other *-iosched.o lines:
Code:
obj-$(CONFIG_IOSCHED_FIOPS) += fiops-iosched.o
Notice that it just uses the name of the iosched file, but with an ".o" extension instead of a ".c" extension. The ".c" file you added earlier will create a ".o" (object) file that the Kernel needs to use to "make" the kernel.
Now edit the ./block/Kconfig.iosched file like so:
Code:
config IOSCHED_FIOPS
tristate "FIOPS I/O scheduler"
default y
---help---
The FIOPS I/O scheduler. WJH.
This way, when you are moddifying your configuration, you can select to build it. Notice that it is a "default y", essentially, I am telling the config file creator to allways assume I want to build this, unless I choose not to. You can also eddit the "---help---" portion to say anything you want. I put my initials in there so I can find it easily with the search tool.
Now open your configuration file. For the stock builds, that would be ./arch/arm/configs/ap88084_sec_defconfig, and add this line:
Code:
CONFIG_IOSCHED_FIOPS=y
Note that you could also do this through
Code:
$ make menuconfig
.
You may also note, since we gave it a "default y" in the Kconfig.iosched file, we don't actually need to add this to our configs, as it will be built by default, but I like to declare what I am building in my configs so I remember what I am doing.
There you go! Now when you build your kernel again, the FIOPS I/O scheduler will be added in. It is remarkably simple, just the way I like it. You can read the commit here: https://github.com/alaskalinuxuser/...mmit/f80320a895612bd1379ca789f88f1d6dfd6e68f9
@DaKillaz98
I will teach you to build Nougat roms here also, if you are interested.
@AlaskaLinuxUser
I appreciate the help with teaching me what I need to do with our Note Edge. As far as I know, I need Linux, latest OpenJDK for building with Nougat and beyond. I have read up some basics, but I don't know all the particulars that go into the Note Edge.
---------- Post added at 07:18 PM ---------- Previous post was at 07:12 PM ----------
[/COLOR @AlaskaLinuxUser
I would also like to ask, you mentioned earlier in the guide that you had an HP Compaq 6715b. How long were compile times? I have an HP Elitebook 8540w with an Intel i5 520m, so I am assuming that compile would probably take about 6 hours?
DaKillaz98 said:
I appreciate the help with teaching me what I need to do with our Note Edge. As far as I know, I need Linux, latest OpenJDK for building with Nougat and beyond. I have read up some basics, but I don't know all the particulars that go into the Note Edge.
I would also like to ask, you mentioned earlier in the guide that you had an HP Compaq 6715b. How long were compile times? I have an HP Elitebook 8540w with an Intel i5 520m, so I am assuming that compile would probably take about 6 hours?
Click to expand...
Click to collapse
No problem.
Your laptop should work. It took me 11 hours to compile on my old laptop. Now I use a server with 24 GB of ram, 8 cores (2x4 core 2.0 GHz) and it takes 3 hours to compile. I can only guess, but it will likely take 6 hours on your machine. The great thing is, starting with Nougat, the builds now use Ninja, so you can see the progress in percentage. Before, in MM and down, we just had to wait, without knowing how far along it was. We could guess by looking at the files, but it is not always built in the same order.
Okay, to get started. If that laptop is your machine, you can't set up a virtual box, because you need all 8 GB of ram (unless you have more than that). So, I recommend installing Ubuntu 14.04, 64 bit. 14.04 is still Google's preferred OS for building Android, but you can do it on other systems. I recommend for now that you do install 14.04 or 16.04 as your build environment. Once you get good at the builds, then you can experiment with other OS' for the builds.
After you install that, follow post #2, with these changes for Nougat:
I am only listing the changes, otherwise, follow the steps as is.
<<<<< Step 1: Setup your system. >>>>>
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip bzip2 dpkg-dev git git-review lib32readline-gplv2-dev lib32z1-dev libbz2-1.0 libbz2-dev libghc-bzlib-dev libncurses5-dev libreadline6-dev lzop maven pngcrush pngquant python-markdown schedtool squashfs-tools tofrodos
After you install that, but before you install the "curl repo" part, install openjdk-8-jdk per here:
https://source.android.com/source/initializing#installing-the-jdk
Now continue by curling the repo per the instructions.
<<<<< Step 2: Download the source. >>>>>
Code:
$ cd ~
$ mkdir aokp7
$ cd aokp7
$ repo init -u https://github.com/AOKP/platform_manifest.git -b nougat
$ repo sync
<<<<< Step 3: Adding the device, kernel, and vendor trees. >>>>>
For each of these download links (t-mobile added and links updated):
https://github.com/alaskalinuxuser/device_samsung_tbltexx/tree/AOKP_N
https://github.com/alaskalinuxuser/kernel_samsung_tblte/tree/NOUGAT
https://github.com/alaskalinuxuser/device_samsung_tblte-common/tree/AOKP_N
https://github.com/alaskalinuxuser/device_samsung_qcom-common/tree/AOKP_N
https://github.com/AOKP/device_qcom_common --> Yes, this is a little old, but so is your phone.
https://github.com/alaskalinuxuser/tblte_vendor_samsung/tree/Nougat
https://github.com/alaskalinuxuser/device_samsung_tbltetmo/tree/AOKP_N
And the only change for renaming:
aokp_device_samsung_tbltetmo --> "tbltetmo" (Place in aokp7/device/samsung/ )
<<<<< Step 4: Editing the device, kernel, and vendor trees. >>>>>
No changes.
<<<<< Step 5: Start your build! >>>>>
No changes. But....
Not required, but if you want the capacitive buttons to work correctly, before you compile, do this from the aokp7 directory:
$ sh device/samsung/tblte-common/run_before_compiling.sh
It runs a little script that overwrites the generic keyboard layout.
Now you can continue with the
$ . build/envsetup.sh
When you get to brunch tbltexx:
$ brunch tbltexx
-- OR --
$ brunch tbltetmo
To build for the international or T-mobile versions.
Okay, that should get you started. I will gladly assist once you get rolling.
I guess I should have asked: Are you planning to build MM or Nougat? I figured Nougat, so do the above to build Nougat. For learning purposes, you could follow the guide as written to build MM instead.
@AlaskaLinuxUser
For some reason, my post didn't go through. Anyways, I tried to mention I am building Nougat, and waiting until I go up to my Grandparents where they have an HP Workstation with an Intel Core 2 Quad q9600 and 6gb ram, their computer is more dedicated for the job. But for bow, I have been running new LineageOS builds with Micky387's RR kernel and his Key Layout files, so I may build kernels only on my laptop. If will probably post up a zip including the keylayout files and my own built lineageos kernel for now so people can have new builds until I start building explicitly for the Note Edge.
DaKillaz98 said:
@AlaskaLinuxUser
For some reason, my post didn't go through. Anyways, I tried to mention I am building Nougat, and waiting until I go up to my Grandparents where they have an HP Workstation with an Intel Core 2 Quad q9600 and 6gb ram, their computer is more dedicated for the job. But for bow, I have been running new LineageOS builds with Micky387's RR kernel and his Key Layout files, so I may build kernels only on my laptop. If will probably post up a zip including the keylayout files and my own built lineageos kernel for now so people can have new builds until I start building explicitly for the Note Edge.
Click to expand...
Click to collapse
Sure. Good luck.
Sent from my LG-H811 using XDA-Developers Legacy app
@AlaskaLinuxUser
Thanks for the help and support on this. It is highly appreciated.
AlaskaLinuxUser said:
Sure. Good luck.
Sent from my LG-H811 using XDA-Developers Legacy app
Click to expand...
Click to collapse
Sorry about my large absence from this ROM build. My computer had broken down, so I worked on fixing it, also found a cheap PC on eBay which will serve builds much better. Intel i5 2400 with 8gb ram and 500gb hdd, so I should have a lot more room and power for builds. I had also started my own TouchWiz project called Slaughtered ROM and was busy with that, I will soon set up the build environment and get that going, thank you again for the guide and sorry for how long I had been busy.
I will start with AOKP, but probably push towards Resurrection Remix and possibly seeing if I can build AOSP O on the Edge.
DaKillaz98 said:
Sorry about my large absence from this ROM build. My computer had broken down, so I worked on fixing it, also found a cheap PC on eBay which will serve builds much better. Intel i5 2400 with 8gb ram and 500gb hdd, so I should have a lot more room and power for builds. I had also started my own TouchWiz project called Slaughtered ROM and was busy with that, I will soon set up the build environment and get that going, thank you again for the guide and sorry for how long I had been busy.
I will start with AOKP, but probably push towards Resurrection Remix and possibly seeing if I can build AOSP O on the Edge.
Click to expand...
Click to collapse
No problem, I hope the guide will help you as you get started. I can't answer every question, but if you have problems let me know, I'd be glad to help if I can.
Sent from my LG-H811 using XDA-Developers Legacy app
AlaskaLinuxUser said:
No problem, I hope the guide will help you as you get started. I can't answer every question, but if you have problems let me know, I'd be glad to help if I can.
Sent from my LG-H811 using XDA-Developers Legacy app
Click to expand...
Click to collapse
Thanks for your help! I have synced RR repo's, I wanted to try building RR, and am in the process of setting it up with the device-specific stuff, afterwards I will start building.

Categories

Resources