[Q] [KERNEL] How to build boot.img from custom zImage on Galaxy S I9000 (galaxysmtd)? - Galaxy S I9000 Q&A, Help & Troubleshooting

Hello,
I try to port bcmon to CyanogenMod 11, by building the custom bcmon (bcm4329) kernel module for CM11. As modules are very dependent on the kernel version and configuration (unknown symbol errors even when compiled on the same exact kernel version), I have no other choice but to build the full CM11 kernel.
So I've built a CyanogenMod 11 kernel directly from the kernel source (ARIES kernel), NOT from the full CyanoGenMod system source (which is about 20GB source files, much more for built files, and takes hours to build [tutorial here]).
After some debugs, I managed to get the kernel zImage and .ko modules.
- fbmem.c has an issue with relative samsung/s3cfb.h path: make it absolute
- other bugs listed here (post end)
I also managed to build a ramdisk (initramfs) by manually builing it from the source files in aries usr/galaxysmtd_initramfs_files folder.
I used boot.img "kitchen" tool.
Code:
./repack_ramdisk galaxysmtd_initramfs_files ramdisk.gz
Still, I can't manage to build a proper boot.img with these files. Of course, building a boot.img file "works":
Code:
mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel zImage --ramdisk ramdisk.gz -o boot-new.img
Indeed I feel this file is gonna screw up my device boot (at least there will still be the recovery...).
Why? Because I believe Galaxy S boot.img is different than from other devices. And that seems to be an issue for other developers as well:
didhiy said:
Since I don't know how to unpack & repack boot.img on cm-10.1, I use stratosk ramdisk with some modification to suite my needs.
Click to expand...
Click to collapse
From this thread @ ubuntu-phone team mailing list archive:
Alistair Buxton said:
from http://wiki.sourcemage.org/HowTo(2f)Initramfs.html and http://comments.gmane.org/gmane.linux.kernel/1027539 this does indeed appear to be a built in initramfs inside the zImage. This is different to the way most android devices use mkbootimg to combine a zImage and ramdisk. In a real CyanogenMod rom for galaxysmtd, boot.img is not a mkbootimg image, nor is it it my earlier ubuntu-touch port. The offsets in System.map seem to be before compression, so perhaps this isn't the whole story, but for sure both kernels have an initramfs with different contents, and nothing else gets added later.
Click to expand...
Click to collapse
Kitchen tools and unpack-bootimg.pl just don't understand how boot.img file is structured for galaxy S1.
Tried to split the existing device boot.img from /dev/mtd/mtd2... (400MB)
Code:
[email protected]:$ adb shell
[email protected]:/ $ su
[email protected]:/ # cat /dev/mtd/mtd2 > /sdcard/mtd2.img
[email protected]:/ # exit
[email protected]:/ $ exit
[email protected]:$ adb pull /sdcard/mtd2.img
[email protected]:$ ./boot_info mtd2.img
PAGE SIZE: 1278632501
BASE ADDRESS: 0x65640000
RAMDISK ADDRESS: 0x78773241
CMDLINE: 'BA...[output omitted here]
[email protected]:$ ./split_boot mtd2.img
Android Magic not found in mtd2.img. Giving up.
[email protected]:~/Documents/android/kernel/aries_output$ ./unpack_bootimg.pl mtd2.img
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.
Tried to split the existing device boot.img from CWM full backup... (7MB)
Code:
$ adb pull /storage/sdcard1/clockworkmod/backup/.../boot.img
$ ./boot_info boot.img
PAGE SIZE: 24061976
BASE ADDRESS: 0xe1a00000
RAMDISK ADDRESS: 0xe1a00000
CMDLINE: '_wl
dwl'
$ ./split_boot boot.img
Android Magic not found in boot.img. Giving up.
$ ./unpack_bootimg.pl boot.img
Could not find any embedded ramdisk images. Are you sure this is a full boot image?
So how do you exactly create a boot.img from a kernel zImage on Galaxy S1?
Without letting the CyanogenMod magic works with the hassle of compiling the whole CyanogenMod android system files...
NB: By the way, I try to just compile the kernel from full CM system source as per official instructions... and of course it failed.
Code:
$ make -j8 out/target/product/galaxysmtd/boot.img
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
CM_VERSION=11-20140126-UNOFFICIAL-galaxysmtd
TARGET_PRODUCT=cm_galaxysmtd
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a8
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-15-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KOT49H
OUT_DIR=/.../cm/out
============================================
/.../cm/out/target/product/galaxysmtd/obj/APPS/SignatureTest_intermediates
find: "src": Aucun fichier ou dossier de ce type
build/core/Makefile:44: attention : écrasement des commandes pour la cible « /.../cm/out/target/product/galaxysmtd/system/etc/permissions/android.software.live_wallpaper.xml »
build/core/base_rules.mk:529: attention : anciennes commandes ignorées pour la cible « /.../cm/out/target/product/galaxysmtd/system/etc/permissions/android.software.live_wallpaper.xml »
build/core/Makefile:44: attention : écrasement des commandes pour la cible « /.../cm/out/target/product/galaxysmtd/system/etc/permissions/android.software.live_wallpaper.xml »
build/core/Makefile:44: attention : anciennes commandes ignorées pour la cible « /.../cm/out/target/product/galaxysmtd/system/etc/permissions/android.software.live_wallpaper.xml »
build/core/Makefile:44: attention : écrasement des commandes pour la cible « /.../cm/out/target/product/galaxysmtd/system/lib/libril.so »
build/core/base_rules.mk:529: attention : anciennes commandes ignorées pour la cible « /.../cm/out/target/product/galaxysmtd/system/lib/libril.so »
build/core/Makefile:44: attention : écrasement des commandes pour la cible « /.../cm/out/target/product/galaxysmtd/system/bin/rild »
build/core/base_rules.mk:529: attention : anciennes commandes ignorées pour la cible « /.../cm/out/target/product/galaxysmtd/system/bin/rild »
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
PRODUCT_COPY_FILES device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml ignored.
PRODUCT_COPY_FILES device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml ignored.
PRODUCT_COPY_FILES hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf ignored.
No private recovery resources for TARGET_DEVICE galaxysmtd
make: *** Pas de règle pour fabriquer la cible « out/target/product/galaxysmtd/boot.img ». Arrêt.

edit:
You missed this part from my sc02b thread
>> Stock cm-10.1 kernel
file: cm-10.1-sc02b-kernel-yyyymmdd.zip
Finally (May 2013) I found proper way to unpack stock kernel using this kernel-repack and repack again using a part of script from here
Click to expand...
Click to collapse
check this:
https://github.com/didhiy/ramdisk-aries
I use a script for i9100 from chirayudesai github (already deleted), it works for extracting i9000 boot.img
unfortunately in newer lzma version (I'm on ubuntu precise), the script failed
my way to solve the problem is use lzma binary from older version (natty)
the newer version of lzma only soft linked to xz binary, so I removed lzma, lzmainfo & unlzma from /usr/bin/
put lzma & lzmainfo binaries from natty, last create unlzma softlink to lzma binary

Thanks didhiy.
Finally I abandoned the idea to build the kernel alone, this is deprecated by CyanogenMod since CM9.
But CyanogenMod IRC users gave me the following tip to avoid the long android system build. Instead of brunch'ing CM, we can just compile the kernel boot.img directly from source by using the following command (after having setup the whole CM build environment etc.).
Code:
mka bootimage
I've edited the CyanogenMod wiki to explain all this in details:
CyanogenMod wiki: Integrated Kernel Building

i have the same exact problem for a while!
hi,
im happy ive found this topic,but sad to find out u abandoned the idea
my problem is,i dont have enough hard drive on system,(beside the awful internet speed), so i dont want to download the whole 20GB!...
so i preferred to download just some of dependencies which is described in an xml file...
so,all in all,do u know which packages is needed to compile just the boot.img,and not the whole rom zip file?

Related

Building AOSP Gingerbread for Droid

(I would post this in the developer forum, but I don't have 10 posts)
I'm working on building Gingerbread from AOSP for Droid. I was hoping to gather information here on how to do this should someone want to build a rom in the future.
So far, I've followed the steps at http://source.android.com/source/download.html to fetch android-2.3.3_r1 (FWIW, I'm running OS X). For the droid, I also needed to clone these git repositories (mostly CM7 fixes) into the associated folder:
https://github.com/koush/proprietary_vendor_motorola - into vendor/motorola. When running git clone, be sure to add "-b gingerbread" to get the latest version. These are the binary blobs that one would normally get by running extract-files.sh.
https://github.com/CyanogenMod/android_device_motorola_sholes - into device/motorola/sholes. This is Droid-specific device information.
https://github.com/CyanogenMod/android_system_wlan_ti - into system/wlan/ti. This is the wifi driver.
https://github.com/CyanogenMod/android_hardware_ti_omap3 - into hardware/ti/omap3. These are other hardware drivers.
https://github.com/CyanogenMod/android_hardware_libhardware_legacy - into hardware/libhardware_legacy. More hardware libraries.
Additional fixes needed to complete build:
In device/motorola/sholes/overlay/frameworks/base/core/res/res/values/config.xml, comment out the line containing "config_flashlight_affects_lightsensor". This is part of CM7 code which disables the light sensor when the flashlight is on; an alternative fix would be to port this code into your tree.
Perform the two fixes at the bottom of the OP in http://forum.xda-developers.com/showthread.php?t=899674 - RGB_565 and Camera. Camera is definitely necessary for building - I believe the RGB_565 fix is necessary for Live Wallpapers.
Take the changes from https://github.com/CyanogenMod/andr...mmit/29f40ea86fe96f66b5a22c7a2bb84055c73e99be - this will prevent Launcher from crashing on boot. Thanks to PeterAlfonso for this fix!
Once the source tree is set up as described, you can run:
Code:
source build/envsetup.sh
lunch (select generic_sholes-userdebug)
make -j 4 otapackage
to start building Android, which will take a while depending on the speed of your machine.
This will create a file named out/target/product/sholes/generic_sholes-ota-eng.*username*.zip - this can be applied as an update.zip in the usual fashion. However, it contains the stock recovery files, which will overwrite the recovery partition you have. So, using any program which can modify zip files, delete the recovery/ folder.
At this point, you should have a flashable, Gingerbread, AOSP rom for droid!
Peter Alfonso (author of a great stock rooted Gingerbread rom for Droid) pointed out a fix for the launcher issues I was having, and I've updated the OP to reflect this. Compiling the changes now - hopefully the rom will boot, and this will represent a full set of instructions for compiling a vanilla gingerbread Droid rom!
I'm trying to compile it, but I'm getting this error:
Code:
Nathan-Camposs-MacBook-Pro:AOSP Nathan$ lunch generic_sholes-userdebug
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
build/core/product_config.mk:194: *** _nic.PRODUCTS.[[device/motorola/sholes/sholes.mk]]: "build/target/product/small_base.mk" does not exist. Stop.
** Don't have a product spec for: 'generic_sholes'
** Do you have the right repo manifest?
Nathan-Camposs-MacBook-Pro:AOSP Nathan$
Could you help me?

[KERNEL]Build Galaxy Tab 2 JB kernel from source

Building kernel
1. Download Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux from https://sourcery.mentor.com/GNUToolchain/release1293?lite=arm, direct link https://sourcery.mentor.com/GNUTool...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 and save it in $HOME/android directory, extract it to /opt/toolchains/
Code:
$ sudo mkdir -p /opt/toolchains/
$ cd /opt/toolchains/
$ sudo tar -xjvf $HOME/android/arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
2. Add /opt/toolchains/arm-2010q1/bin as your search PATH. Logout and back login to your desktop to activate your new search PATH
Code:
$ echo $'\nPATH=\"/opt/toolchains/arm-2010q1/bin:$PATH\"' >> $HOME/.profile
3. Download 3.0.31 kernel source for JB P3110 from http://opensource.samsung.com/ and save it in $HOME/android/espresso directory and extract it
Code:
$ mkdir -p $HOME/android/espresso/kernel
$ cd $HOME/android/espresso/
$ unzip P3110_JB_Opensource.zip Kernel.tar.gz
$ cd kernel
$ tar -xvzf ../Kernel.tar.gz
$ make mrproper
4. Apply all my patch and then load kernel config file
Code:
$ patch -p1 < ../01-configs.patch
$ patch -p1 < ../02-debug-info.patch
$ patch -p1 < ../03-graphics.patch
$ patch -p1 < ../04-governor.patch
$ patch -p1 < ../05-scheduler.patch
$ patch -p1 < ../06-overclock.patch
$ patch -p1 < ../07-exfat.patch
$ make ARCH=arm android_espresso_omap4430_r04_blackhawk_defconfig
5. If you want to change kernel config, download libncurses5-dev
Code:
$ sudo apt-get install libncurses5-dev
$ make ARCH=arm menuconfig
6. Build the kernel
Code:
$ make -j4 ARCH=arm
7. Save kernel and modules
Code:
$ mkdir ../espresso-kernel
$ cp arch/arm/boot/zImage ../espresso-kernel
$ find . -type f -name *.ko -exec cp {} ../espresso-kernel \;
Building PowerVR SGX 540 kernel modules
1. Download the sources
Code:
$ sudo apt-get install git-core
$ git clone git://git.omapzoom.org/repo/graphics/omaplfb.git -b omaplfb-1.9 --depth 1
$ git clone git://git.omapzoom.org/device/ti/proprietary-open.git -b d-jb-mr1-release --depth 1
2. Build pvrsrvkm kernel module
Code:
$ tar -xvzf proprietary-open/omap4/sgx_src/eurasia_km.tgz
$ rm -rf eurasia_km/eurasiacon/binary*
$ export KERNELDIR=$HOME/android/espresso/kernel
$ cd eurasia_km/eurasiacon/build/linux2/omap4430_android/
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=540 PLATFORM_VERSION=4.0
$ cp ../../../binary2_540_120_omap4430_android_release/target/pvrsrvkm_sgx540_120.ko ../../../../../espresso-kernel/
3. Build omaplfb kernel module Not needed, omaplfb now integrated into kernel by 03-graphics.patch
Code:
cd ../../../../../omaplfb/omaplfb_linux
export TARGET=omap4460
export PVRKMDIR=$HOME/android/espresso/
make clean
make
cp omaplfb_sgx540_120.ko ../../espresso-kernel/
cd ../../
4. Strip all kernel modules if needed
Code:
$ arm-none-linux-gnueabi-strip --strip-unneeded espresso-kernel/*.ko
Credits:
Linux, Google, Samsung, omapzoom.org, gokhanmoral, codeworkx, cmenard
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Leave this 3.0.8 kernel info just for historical purpose:
I try to build Galaxy Tab 2 kernel from source for stock 4.0.4 firmware but no luck so far.
Source from http://opensource.samsung.com/ without modification, using the latest Sourcery G++ Lite: boot failed!
Souce from Samsung without modification, using Sourcery G++ Lite 2010q1-202: kernel boot but no hardware accelerated video, camera and video not working!
Source from codeworkx without modification: kernel boot but incompatible pvr driver, stuck on Samsung logo!
Source from codeworkx without modification, vendor blob updated: kernel boot but unstable graphics, gallery, camera and video not working!
Source from codeworkx, pvr driver revert back to Samsung source: kernel boot but no hardware accelerated video, camera and video not working!
Source from codeworkx, pvr driver revert back to tuna ICS source, using tuna ICS vendor blob: kernel boot but no hardware accelerated video, camera and video not working! Better 3D graphics performance.
UPDATE:
Soft decoding video player (MoboPlayer) work.
UPDATE 2:
Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.
Click to expand...
Click to collapse
When you compile a kernel, some drivers should have also been compiled and their locations should have been displayed on the console. You should copy those drivers to a proper location, I copied those .ko files to /lib/modules of the ramdisk when compiling a P3110 kernel.
Sent from my GT-P3110
heihei_ivan said:
When you compile a kernel, some drivers should have also been compiled and their locations should have been displayed on the console. You should copy those drivers to a proper location, I copied those .ko files to /lib/modules of the ramdisk when compiling a P3110 kernel.
Sent from my GT-P3110
Click to expand...
Click to collapse
Yes.
Conclusion:
Using Galaxy Nexus PowerVR kernel driver and blob build [email protected], we got better 3D performance on stock 4.0.4 firmware but lost hardware accelerated video (base on Antutu result: 3D = ~1030, fps 40-50). Video failed to play, camera failed to open. So, the best kernel for user experience (slower 3D but smooth 2D) is 3.0.8 from 4.0.4 firmware for now.
Now I'm sure, Samsung has been making changes in the 3.0.8 kernel for ICS 4.0.4 but have not released it to the public. Please help me to write a petition for Samsung since my English not good enough :crying:
Last night I tried to rebuild the kernel from source (again) and this time set the kernel version exactly same as stock 4.0.4 kernel (3.0.8-583493-user). Using kernel source from Samsung, codeworkx's patch applied except tuna pvr driver patch. Keep the stock kernel 3.0.8-583493-user modules in /lib/modules and then rebuild the boot image. Damn Samsung, hardware accelerated video still does not work! 3D performance slower than tuna ICS pvr driver but 2D experience as smooth as stock 4.0.4 firmware.
/system/vendor/firmware/ducati-m3.bin not loaded properly by the kernel. No rpmsg-omx0 and rpmsg-omx1 inside /dev .
Code:
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 100 (High), level = 32
E/OMXCodec( 2293): set buffer size variable to : 1572864
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 1280 x 720
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 1280 x 720 @ (0, 0)
I/OMXCodec( 2293): !! Change the I/P buffer size to 1572864 !!
D/DOMX ( 2293): ERROR: userspace cachable mapping of ION buffers returned error
E/OMXNodeInstance( 2293): OMX_AllocateBuffer failed with error -2147479552 (0x80001000)
E/OMXCodec( 2293): allocate_buffer_with_backup failed
D/DOMX ( 2293): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001011 - Error returned from OMX API in ducati
D/DOMX ( 2293): ERROR: Error From ComponentDeInit..
ketut.kumajaya said:
Now I'm sure, Samsung has been making changes in the 3.0.8 kernel for ICS 4.0.4 but have not released it to the public. Please help me to write a petition for Samsung since my English not good enough :crying:
Click to expand...
Click to collapse
already done yesterday
Samsung response said:
SAMSUNG OSRC COMMENTS DELIVERY NOTIFICATION]
♦ classification : Mobile Phone ♦
♦ model name : GT-P5100 ♦
Dear Customer,
Thank you for your interest in our product.
We are now in the process of reviewing your inquiry.
We will let you know a reply to this issue soon.
Sincerely yours,
----- Original Message -----
Hello Sir/Madam,
You have kindly supplied the kernel/software sources for the P31xx/P51xx series, but with the latest software update to 4.0.4 we cannot use this source to compile kernels for our devices.
Please supply me/us (|reply will, if you give permission therefor, be published on the XDA forums to help other developers with the same issue)| with instructions how to compile for 4.0.4/updated sources.
Thanks in advance for your reply,
John Simons
Samsung Open Source Release Center
http://opensource.samsung.com
Click to expand...
Click to collapse
Solved!
Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.
ketut.kumajaya said:
Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.
Click to expand...
Click to collapse
so you gonna release the kernel?
gabriel1997 said:
so you gonna release the kernel?
Click to expand...
Click to collapse
When it's ready. I will share 2 or 3 boot image with different setup.
gabriel1997 said:
so you gonna release the kernel?
Click to expand...
Click to collapse
I've shared my work on http://forum.xda-developers.com/showthread.php?t=1855700 .
4.0.4 sources available at OSRC.
Firts post updated. The sort stories how to build JB 4.1.1 3.0.31 kernel!
Build JB 3.0.31 kernel instructions in the first post updated.
First post updated!
R: [KERNEL]Build Galaxy Tab 2 JB kernel from source
ketut.kumajaya said:
First post updated!
Click to expand...
Click to collapse
You really did an excellent job with TW kernel.
Is it possible for you to compile an updated kernel for CM10.1?
Stock CM10.1 kernel does not support overclock.
cmenard AOKP kernel works well with CM10.1, and it supports both CPU and GPU OC, but it is based on the old source, with 690mb available, compiled for 4.1.2
It would be awesome if you could update one of those 2 kernels.
First page updated, including the patch!
- omaplfb now integrated into kernel
- overclock code updated, lock CPU @ 1.008GHz on boot
Hey guys are there some existing cisf module to mount cifs and nfs partition on the Galaxy Tab 2 3110?
I would like to mount my share (not for copy) but for directly playing movies. I did with some old pads but i don't know if this module are available for the Tab 2
Monfro said:
You really did an excellent job with TW kernel.
Is it possible for you to compile an updated kernel for CM10.1?
Stock CM10.1 kernel does not support overclock.
cmenard AOKP kernel works well with CM10.1, and it supports both CPU and GPU OC, but it is based on the old source, with 690mb available, compiled for 4.1.2
It would be awesome if you could update one of those 2 kernels.
Click to expand...
Click to collapse
May be after my not started yet dual boot system finish
pecana said:
Hey guys are there some existing cisf module to mount cifs and nfs partition on the Galaxy Tab 2 3110?
I would like to mount my share (not for copy) but for directly playing movies. I did with some old pads but i don't know if this module are available for the Tab 2
Click to expand...
Click to collapse
KK-Boot has it.
First page updated, kernel source and patch.

CM 9/10: Checking graphics lib versions on black screen on boot

A black screen on boot (or just the backlight coming on, but no animation) is sometimes caused by mismatched kernel and vendor graphics driver-related blobs, assuming you are building your own kernel. Here's how to check (I'm putting this here because I'm not yet allowed to post in the dev thread):
Assuming your source is in ~/android/system :
1) Determine the vendor blob version:
cd ~/android/system/vendor/bn/encore/proprietary/lib/egl
strings lib* | grep build;
You should see something like : OpeGL ES 2.0 build [email protected]
2) Now determine the version the kernel expects:
cd ~/android/system/kernel/bn/encore/drivers/gpu/pvr
grep PVRVERSION_BUILD pvrversion.h
You should see something like : #define PVRVERSION_BUILD 789263
If you see a number other than 789263, your vendor blobs do not match the kernel you are using.
In my case, this was caused by me extracting the blobs from my Nook when it was running CM7,
and trying to use them to build CM10.
Check eyeballer's github to get the right vendor blobs.
Hope this helps someone (thanks would be appreciated ). I got this info with the help of Steven676, Krylon360 and others.

[KERNEL] [UNIFIED] Anykernel

ANYKERNEL
espressowifi / espresso3g
Please respect the following 2 points
No feature requests!
Overclocked Kernel can be found here
NOTE:
This product is provided "as is" without any warranty. Use on your own risk.
I am not responsible for burned CPU or GPU.
Any kind of OC is really dangerous on Galaxy Tab2. While OMAP 4460 has a built-in temperature sensor, OMAP 4430 doesn't have one. Nothing stops it from overheating...
If you don't read and respect the OP, you accept to make a donation of 50$ to a charity of your choice!
​ [#WARRANTY]
It is difficult to update all Roms frequently, and it does not always makes sense to compile, download and flash a whole rom, if only some kernel changes are applied.
This kernel will include changes before i add them official to our kernel source (most of the time security bugfixes)!
Android 5.1 and Android 6.0
This Kernel works on all Android 5.1 and Android 6.0 Roms for espressowifi and espresso3g.
Android 4.4
On Android 4.4 we need a different kernel, 4.4 Kernel includes "KitKat" tag on zip name.
What else to say
Kernel compiled using GCC 4.8
Anykernel based on Anykernel2 by @osm0sis ( https://github.com/osm0sis/AnyKernel2 ) - it will dump your boot.img and replace the zImage and add proper kernel modules.
Roms with default libion
LineageOS (unofficial)
espresso3g
lineage-11-20180131-2053-UNOFFICIAL-espresso3g.zip and newer
lineage-13.0_espresso3g-6.0.1-20180130-2211.zip and newer
lineage-14.1_espresso3g-7.1.2-20180131-1859.zip and newer
espressowifi
lineage-11-20180131-2033-UNOFFICIAL-espressowifi.zip and newer
lineage-13.0_espressowifi-6.0.1-20180130-2146.zip and newer
lineage-14.1_espressowifi-7.1.2-20180131-1818.zip and newer
OmniRom (unofficial)
espresso3g
omni_espresso3g-4.4.4-20180127-2337.zip and newer
omni_espresso3g-6.0.1-20180128-0312.zip and newer
omni_espresso3g-7.1.2-20180128-1319.zip and newer
espressowifi
omni_espressowifi-4.4.4-20180127-2310.zip and newer
omni_espressowifi-6.0.1-20180128-0251.zip and newer
omni_espressowifi-7.1.2-20180128-1254.zip and newer
SlimRoms (unofficial)
espresso3g
Slim-espresso3g-4.4.4.build.9.15-UNOFFICIAL-20180128-0125.zip and newer
Slim_espresso3g-6.0.1-20180128-2332.zip and newer
Slim_espresso3g-7.1.2-20180131-1617.zip and newer
espressowifi
Slim-espressowifi-4.4.4.build.9.15-UNOFFICIAL-20180128-0028.zip and newer
Slim_espressowifi-6.0.1-20180128-2308.zip and newer
Slim_espressowifi-7.1.2-20180131-1555.zip and newer
Unlegacy-Android:
All official Unlegacy-Android builds starting on 15th feburary use the default libion
Roms with new DDK
Slim6 , Slim7, OmniROM4, OmniROM 6, OmniROM 7 and LineageOS 11, LineageOS 13 and LineageOS 14.1 compiled after 01.03.2019
[#DONATETOME]
XDA:DevDB Information
(unified) Anykernel, Kernel for the Samsung Galaxy Tab 2
Contributors
Android-Andi, Ziyan
Source Code: https://github.com/Unlegacy-Android/android_kernel_ti_omap4/commits/3.0/common
Kernel Special Features: Testing before applying on our source official, CVE fixes
Version Information
Status: Testing
Created 2016-10-21
Last Updated 2020-05-02
Reserved
As requested, here's my setup to compile espresso kernel.
01.05.2020
Follow https://github.com/andi34/android_build-bot/blob/manifest/README.md and https://github.com/andi34/android_build-bot/blob/kernelcompile/README.md
What do you need
Kernel Source (you can get our latest kernel source on SlimRoms, OmniRoms or CyanogenMods github, "espresso10 kernel")
GCC ( https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 )
pvr source, added to omap4-common device repo and hardware_ti_omap4 repo (can be found on SlimRoms, OmniRoms or CyanogenMods github)
you can use my scripts put below (update some paths, marked red )
AnyKernel2 Source from osm0sis (see 1. post, update for your tab2 needed)
build-gcc4.8.env:
Code:
[COLOR="Red"]export CROSS_COMPILE='/android/kernelcompile/arm-eabi-4.8/bin/arm-eabi-'[/COLOR]
export LDFLAGS=''
export CFLAGS=''
export SUBARCH=arm
export ARCH=arm
[COLOR="Red"]export STRIP=/android/kernelcompile/arm-eabi-4.8/bin/arm-eabi-strip[/COLOR]
alias 'stm'='$STRIP --strip-unneeded *.ko'
compile-espresso.sh
Code:
#!/bin/bash
readonly red=$(tput setaf 1) # red
readonly grn=$(tput setaf 2) # green
readonly ylw=$(tput setaf 3) # yellow
readonly blu=$(tput setaf 4) # blue
readonly cya=$(tput setaf 6) # cyan
readonly txtbld=$(tput bold) # Bold
readonly bldred=$txtbld$red # red
readonly bldgrn=$txtbld$grn # green
readonly bldylw=$txtbld$ylw # yellow
readonly bldblu=$txtbld$blu # blue
readonly bldcya=$txtbld$cya # cyan
readonly txtrst=$(tput sgr0) # Reset
err() {
echo "$txtrst${red}$*$txtrst" >&2
}
warn() {
echo "$txtrst${ylw}$*$txtrst" >&2
}
info() {
echo "$txtrst${grn}$*$txtrst"
}
setbuildjobs() {
# Set build jobs
JOBS=$(expr 0 + $(grep -c ^processor /proc/cpuinfo))
info "Set build jobs to $JOBS"
}
info "Kernel source path: $KERNELSOURCE"
info "PVR Source path: $PVRSAUCE"
info "Working directory: $WORKINGDIR"
info "resulting zImage and modules stored at: $WORKINGOUTDIR"
setbuildjobs
info "Moving to kernel source"
cd $KERNELSOURCE
info "Import toolchain environment setup"
info "Toolchain: $TOOLCHAIN"
source $SAUCE/build-$TOOLCHAIN.env
info "Create a buid directory, known as KERNEL_OUT directory"
# then always use "O=$SAUCE/espresso" in kernel compilation
info "create working directory"
mkdir -p $WORKINGDIR
warn "Make sure the kernel source clean on first compilation"
make O=$WORKINGDIR mrproper
warn "Rebuild the kernel after a change, maybe we want to reset the compilation counter"
echo 0 > $WORKINGDIR/.version
if [ "$VARIANTDEFCONFIG" = "*p*" ]; then
info "Import kernel config file: $DEFCONFIGNAME"
info "Import variant config file: $VARIANTDEFCONFIGNAME"
make O=$WORKINGDIR VARIANT_DEFCONFIG=$VARIANTDEFCONFIG $DEFCONFIGNAME
info "Change kernel configuration if needed using:"
info " make O=$WORKINGDIR menuconfig "
VARIANTDEFCONFIG=
else
info "Import kernel config file: $DEFCONFIGNAME"
make O=$WORKINGDIR $DEFCONFIGNAME
info "Change kernel configuration if needed using:"
info " make O=$WORKINGDIR menuconfig "
fi
info "lets build the kernel"
make -j$JOBS O=$WORKINGDIR
if [ -f $WORKINGDIR/arch/arm/boot/zImage ]; then
info "Copying the resulting zImage and modules to: $WORKINGOUTDIR"
info "Creating directory..."
mkdir -p $WORKINGOUTDIR
mkdir -p $WORKINGOUTDIR/modules/system/lib/modules
cp $WORKINGDIR/arch/arm/boot/zImage $WORKINGOUTDIR/
find $WORKINGDIR/ -type f -name *.ko -exec cp {} $WORKINGOUTDIR/modules/system/lib/modules/ \;
info "Files moved!"
info "Pointing KERNELDIR to KERNEL_OUT directory"
export KERNELDIR=$WORKINGDIR
warn "Make sure the PVR source clean."
warn "Running 'make clean'..."
make clean -C $PVRSAUCE/build/linux2/omap4430_android
info "Building the PVR module..."
# we now use the default libion, our kernel was updated
make -j8 -C $PVRSAUCE/build/linux2/omap4430_android TARGET_PRODUCT="blaze_tablet" BOARD_USE_TI_LIBION=false BUILD=release TARGET_SGX=540 PLATFORM_VERSION=4.1
info "Copying the resulting PVR module to: $WORKINGOUTDIR"
cp -fr $PVRSAUCE/binary2_omap4430_android_release/target/pvrsrvkm.ko $WORKINGOUTDIR/modules/system/lib/modules/pvrsrvkm_sgx540_120.ko
mv $PVRSAUCE/binary2_omap4430_android_release/target/pvrsrvkm.ko $WORKINGOUTDIR/modules/system/lib/modules/
warn "Don't leave any module objects in PVR source!"
warn "Running 'make clean'..."
make clean -C $PVRSAUCE/build/linux2/omap4430_android
info "Properly stripping the kernel modules for smaller size (implified as stm command inside build.env)..."
cd $WORKINGOUTDIR/modules/system/lib/modules
stm
info "####################"
info "# Done! #"
info "####################"
else
warn "####################"
warn "# FAILED! #"
warn "####################"
fi
cd $SAUCE
espresso-m.sh
Code:
#!/bin/bash
[COLOR="Red"]SAUCE=~/android2/kernelcompile
PVRSAUCE=~/android2/official/omap4/stable/pvr-source/eurasiacon
KERNELSOURCE=~/android2/official/kernel/android_kernel_ti_omap4[/COLOR]
TOOLCHAIN="gcc4.8"
DEFCONFIGNAME=espresso_defconfig
WORKINGDIR=$SAUCE/out/$DEFCONFIGNAME
WORKINGOUTDIR=$SAUCE/$DEFCONFIGNAME-bin
. `dirname $0`/compile-espresso.sh
espresso-k.sh
Code:
#!/bin/bash
[COLOR="Red"]SAUCE=~/android2/kernelcompile
PVRSAUCE=~/android2/official/omap4/stable/pvr-source/eurasiacon
KERNELSOURCE=~/android2/official/kernel/android_kernel_ti_omap4[/COLOR]
TOOLCHAIN="gcc4.8"
DEFCONFIGNAME=espresso_kitkat_defconfig
WORKINGDIR=$SAUCE/espresso-kitkat
WORKINGOUTDIR=$WORKINGDIR-bin
. `dirname $0`/compile-espresso.sh
Reserved
DEVICE SPECIFIC ANYKERNEL
Edit 02.05.2020
Latest device specific AnyKernel-Zip can be found here:
https://forum.xda-developers.com/showpost.php?p=79259009&postcount=204
Please note: our kernel detects your Tab2 variant at boot and chooses the right driver and config for your device! In some cases (e.g. if the mainboard or the screen got replaced) your device variant isn't detected right and it will use wrong driver!
I am not sure how many user are affected, but in such case we can skip the intelligent board detection and hardcode the variant.
Attached device specific kernel should work on all unified espresso/espressowifi & espresso3g roms from Android 5 up to Android 7, for Android 4 Roms please use the "kitkat" version.
Feel free to buy me a coconut water if it helped you to keep your Tab still, after many years, almost up to date.
UPDATE AnyKernel-2016-10-21
- Update the ext-csd.rev check for eMMC5.1 (fixes emmc detection for some tab2)
- CVE-2016-5195
- CVE-2016-6828
- CVE-2016-7042
thanks andi.
working nice on my own builded aosp-6.0 10/16
Some more CVE fixes applied on top of previous kernel:
CVE-2014-8173
CVE-2014-7970
CVE-2014-5206
CVE-2016-0819
CVE-2015-8830
CVE-2014-9715
I added a CVE overview on 2nd post.
Edit:
Added a KitKat version
Hi Android-Andi.
Has this kernel the OPTION (or plan to enable) to overclock ?
Thanks.
galoneta said:
Hi Android-Andi.
Has this kernel the OPTION (or plan to enable) to overclock ?
Thanks.
Click to expand...
Click to collapse
No as mentioned in first post! Move out of this thread if you are not able to read first post.
~ All my work, news etc. on http://andi34.github.io ~
Guys, if you don't read the OP the thread will be closed and you can take care about a security patched kernel yourself.
Source is available on github, add everything you miss by your own and stop spamming this thread!
Edit: everyone not accepting the forum rules will be reported!
Edit2: Thanks @ Moderator for the post remove / thread clean
~ All my work, news etc. on http://andi34.github.io ~
SORRY!
I know its off topic but you should read this
http://www.xda-developers.com/9-yea...-dirty-cow-can-root-every-version-of-android/
Emo Darkemotion said:
SORRY!
I know its off topic but you should read this
http://www.xda-developers.com/9-yea...-dirty-cow-can-root-every-version-of-android/
Click to expand...
Click to collapse
OP states that its already patched
Android-Andi said:
"CVE-2016-5195" https://github.com/Unlegacy-Android/...b19311a9089b77
Click to expand...
Click to collapse
Emo Darkemotion said:
SORRY!
I know its off topic but you should read this
http://www.xda-developers.com/9-yea...-dirty-cow-can-root-every-version-of-android/
Click to expand...
Click to collapse
It is quite funny making noise about a bug which existed 9 years now.
1. It is fixed on my kernel as mentioned on 2nd post (wonder why i spend time doing it)
2. I don't see an issue on custom roms (can be fixed within 2 minutes), i would worry about android by your Manufacturer (on all devices).
On android we change the wheel: no central updates like on linux or windows - it is up to your manufacturer to update your device and there's a lot of security issues fixed by google on android every month (and sure, some kernel side too). How many stock updates you get? 1, maybe 2 within 1 year and support drops after that.
To be true: i am not sure if my next device is an android device:
On my g4 i am on stock rom and LG cares 0 about it (Security patch level 2016-07-01... I waited 6 or 7 month to get that update and it was already 1 month behind).
If manufacturer don't care about theire flagships, what else can we do? Flashing custom roms? Right works, but on my daylie driver i don't like to be a flashahollic... I am more thinking about using a different OS.
You should think about my words and don't care about a already fixed security issue
~ All my work, news etc. on http://andi34.github.io ~
Hi Andy,
First of all, many thanks for all your work! I´m using your ROMs and kernels since Slimkat and all are great!
I also do my best colaborating with the translating team of CyanogenMod and SlimRoms (Brazilian Portuguese).
But now I would like to compile a kernel bymyself, to patch the CVEs, changes I like, etc.
If you have time, can you post here the steps you do to compile the Anykernel?
Don´t need to waste time explaining the things, just post the step-by-step commands (git clone, makes, ADBs, etc) and I will do my research, ok?
Thanks in advance and greetings from Brazil!
AranhaEscarlate said:
Hi Andy,
First of all, many thanks for all your work! I´m using your ROMs and kernels since Slimkat and all are great!
I also do my best colaborating with the translating team of CyanogenMod and SlimRoms (Brazilian Portuguese).
But now I would like to compile a kernel bymyself, to patch the CVEs, changes I like, etc.
If you have time, can you post here the steps you do to compile the Anykernel?
Don´t need to waste time explaining the things, just post the step-by-step commands (git clone, makes, ADBs, etc) and I will do my research, ok?
Thanks in advance and greetings from Brazil!
Click to expand...
Click to collapse
Sure, i have nothing to hide i can upload my script next days. Busy on other stuff atm maybe send a small reminder if the script isn't added on 3rd post of this thread end of next week.
~ All my work, news etc. on http://andi34.github.io ~
Android-Andi said:
Sure, i have nothing to hide i can upload my script next days. Busy on other stuff atm maybe send a small reminder if the script isn't added on 3rd post of this thread end of next week.
~ All my work, news etc. on http://andi34.github.io ~
Click to expand...
Click to collapse
Oh and @Android-Andi just a small request , change the color of the text for ""CVE-XXXXXYYYY" DOES NOT AFFECT" because This colour is hard to read on the screen .
AranhaEscarlate said:
(...)
If you have time, can you post here the steps you do to compile the Anykernel?
Don´t need to waste time explaining the things, just post the step-by-step commands (git clone, makes, ADBs, etc) and I will do my research, ok?
(...)
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=69241933&postcount=3
Must be enough, everything else you need to read / find out yourself
iamashwin said:
Oh and @Android-Andi just a small request , change the color of the text for ""CVE-XXXXXYYYY" DOES NOT AFFECT" because This colour is hard to read on the screen .
Click to expand...
Click to collapse
Done, should be better now.
Android-Andi said:
http://forum.xda-developers.com/showpost.php?p=69241933&postcount=3
Must be enough, everything else you need to read / find out yourself
Click to expand...
Click to collapse
Thank you very much, Andy!!!
It´s more than enough!
Everything else, I will read documentation at the Internet, but this is a great starting point for me.
What kind ANY KERNEL is important when you can not clocked CPU and graphics
Kutuzov666 said:
What kind ANY KERNEL is important when you can not clocked CPU and graphics
Click to expand...
Click to collapse
Dont use it if you dont want it!
It is for the kind of people who want a secure kernel ... more secure than the one given by samsung (I dont remember the last time they sent us a patched kernel update ...or did they !)
Nearly all the device I own are waaaay too insecure (be it my router (its also a linux system) , phone Landline TV ...) except for my 4 year old tab all thanks to Andi ! Respect it
Besides OP is doing all this as a hobby and not for your or my benefit.
Stop spaming this thread ! Please READ
Please respect the following 2 points
No feature requests!
Overclocking will never be added here!
If you don't read and respect the OP, you accept to make a donation of 50$ to a charity of your choice!
Click to expand...
Click to collapse
PSS If you are satisfied with the answer please delete the message and so will I .Lets keep this thread clean.

[REFERENCE] OnePlus 6 kernel source with linux-stable (4.9.135)

Introduction
Hello everyone, this is a thread to introduce both users and kernel developers to the concept of linux-stable as well as give developers some tips and a tree to either merge into their own, use as a base, or just as a reference. Feel free to ask questions and enjoy!
What is it?
linux-stable is, as the name implies, the stable branch of the Linux kernel, the base of Android. The phone could not run without the Linux kernel (at least not without reworking a lot of stuff). The Android kernels are based on the longterm stable trees:
Longterm
There are usually several "longterm maintenance" kernel releases provided for the purposes of backporting bugfixes for older kernel trees. Only important bugfixes are applied to such kernels and they don't usually see very frequent releases, especially for older trees.
Click to expand...
Click to collapse
Source: https://www.kernel.org/category/releases.html
All Linux development happens on the master branch, which is governed by Linus Torvalds. When issues are discovered there, the fixes are applied then backported to these various stable trees for consumption. It is not uncommon for a fix to need to go back a few years.
There is a LOT more information available in the notes repo in the android-linux-stable organization if you care to learn more in-depth: https://github.com/android-linux-stable/notes
What does this mean for me?
If you are a developer, this means you should be merging these changes into your own tree. These are vetted, stable fixes to real world problems and they are being handed out for free. It does not take long to get up to date (as you can just merge this tree directly into your own or do it yourself using the tree as a reference) and once you are up to date, there is usually a release once every two weeks, give or take. I provide a rebuttal to a lot of various complaints here. If you still feel like there is a good reason not to do this, please let me know, I'll be happy to try and debate on it!
If you are a user, it means that you should be looking for and using kernels that have these fixes, as it shows the developers care for your security and stability. The current version for this device is 4.9.65 on OxygenOS 5.x and 4.9.106 on OxygenOS 9.0/Open Beta while the current version upstream is 4.9.135 so all you need to do is go into Settings > About phone and look at the kernel version to know if you are up to date.
How do I use?
If you are a developer, the reference tree is located in the android-linux-stable organization: https://github.com/android-linux-stable/op6
This can either be merged into your existing kernel tree if you have one or be used as a fresh base. You do not need my permission to use it nor do you need to give me credit (although it would be appreciated).
If you are a user, use a kernel that has the changes added in!
Getting notified about updates
There are a few ways to get notified of linux-stable updates:
The linux-kernel-announce mailing list: http://vger.kernel.org/vger-lists.html#linux-kernel-announce
The android-linux-stable Telegram channel: https://t.me/alsupdates
Subscribe to this thread
Follow me on Google+ or Twitter
Getting help
If you have any issues with getting these changes into your tree or want to ask a question, there are a few different ways to do it:
Post in this thread
Join the linux-stable support chat on Telegram: https://t.me/joinchat/C1UAJ1EMSX31PCFdwLnOSg
File an issue either in the android-linux-stable notes repo or the android-linux-stable repo for this device
When requesting help, please give some solid details as to what you are struggling with, as I am happy to provide assistant and clarity but not to do something for you (unless I screwed up).
God damn ! You here ! I'm feeling lucky ! Nexus 6P, Oneplus 5 and now Oneplus 6 damn :')
Thanks for your hard work !
Yea boiii
Imma flashing it rn <3
Thanks
Thank you @nathanchance for your efforts. Much needed for the new 4.9 kernel.
Nice one man!!
Sent from my OnePlus6 using XDA Labs
Who got 1 star ? really ?
btw, @nathanchance you have 5 star from me, good work ,and it is nice to see you here.
As always, good job with informing users , waiting for your kernel
Thanks a lot! :good:
marko94 said:
Who got 1 star ? really ?
btw, @nathanchance you have 5 star from me, good work ,and it is nice to see you here.
As always, good job with informing users , waiting for your kernel
Click to expand...
Click to collapse
Ratings mean absolutely nothing and I feel sorry for anyone who puts any stock in them but thanks
My kernel should be out tonight.
Hey, can you explain me we can install upper kernel version on the last firmware? And how to do it if we can?
Thank and good thread!
Devices : OnePlus 6
4.9.108 has been merged in.
black_file said:
Hey, can you explain me we can install upper kernel version on the last firmware? And how to do it if we can?
Thank and good thread!
Devices : OnePlus 6
Click to expand...
Click to collapse
Flash a kernel that has these changes. At this moment, I am the only one who has done so: https://forum.xda-developers.com/oneplus-6/development/op6-flash-kernel-1-00-t3801652
4.9.109 has been merged in.
Could you please provide instructions on how to flash a kernel?
Earlier, I could just extract the boot.img file from one of the ROM images and then extract+repackage with my built Image.gz-dtb using mkbootimg.
The newer Android ROMs seem to only contain a package.bin file instead.
phenoxis said:
Could you please provide instructions on how to flash a kernel?
Earlier, I could just extract the boot.img file from one of the ROM images and then extract+repackage with my built Image.gz-dtb using mkbootimg.
The newer Android ROMs seem to only contain a package.bin file instead.
Click to expand...
Click to collapse
Easiest way is to temporarily boot TWRP on stock then run
Code:
adb shell dd if=/dev/block/bootdevice/by-name/boot$(getprop ro.boot.slot_suffix) of=/tmp/boot.img
adb pull /tmp/boot.img .
then just unpack like you have before.
Sent from my Pixel 2 XL using XDA Labs
nathanchance said:
Easiest way is to temporarily boot TWRP on stock then run
Code:
adb shell dd if=/dev/block/bootdevice/by-name/boot$(getprop ro.boot.slot_suffix) of=/tmp/boot.img
adb pull /tmp/boot.img .
then just unpack like you have before.
Click to expand...
Click to collapse
I followed your advice with both the original OnePlus 6 kernel source and your android-linux-stable repo. I was able to build the kernel, repack it and flash it, but with both repos, the device is sitting with the bootanimation for about half hour or so. Do both repositories need additional work before it can boot?
I packaged boot.img with the following command:
Code:
mkbootimg --base 0 --pagesize 4096 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000
--second_offset 0x00f00000 --tags_offset 0x00000100
--cmdline 'androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000
msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048
androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 buildvariant=user' --kernel kernel --ramdisk ramdisk -o boot_1.img
phenoxis said:
I followed your advice with both the original OnePlus 6 kernel source and your android-linux-stable repo. I was able to build the kernel, repack it and flash it, but with both repos, the device is sitting with the bootanimation for about half hour or so. Do both repositories need additional work before it can boot?
I packaged boot.img with the following command:
Code:
mkbootimg --base 0 --pagesize 4096 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000
--second_offset 0x00f00000 --tags_offset 0x00000100
--cmdline 'androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000
msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048
androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 buildvariant=user' --kernel kernel --ramdisk ramdisk -o boot_1.img
Click to expand...
Click to collapse
They shouldn't... Did you use Image.gz-dtb as the kernel?
nathanchance said:
They shouldn't... Did you use Image.gz-dtb as the kernel?
Click to expand...
Click to collapse
Yes, I'm certain I did.
My full script is:
Code:
unmkbootimg --kernel kernel --ramdisk ramdisk -i boot.img.bk #This is what I obtained from your dd if=... of=/tmp/boot.img command
cp /android/kernel/opo6-stable/arch/arm64/boot/Image.gz-dtb kernel
mkbootimg --base 0 --pagesize 4096 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000
--second_offset 0x00f00000 --tags_offset 0x00000100
--cmdline 'androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000
msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048
androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 buildvariant=user'
--kernel kernel --ramdisk ramdisk -o boot_1.img
fastboot flash boot boot_1.img
phenoxis said:
Yes, I'm certain I did.
My full script is:
Code:
unmkbootimg --kernel kernel --ramdisk ramdisk -i boot.img.bk #This is what I obtained from your dd if=... of=/tmp/boot.img command
cp /android/kernel/opo6-stable/arch/arm64/boot/Image.gz-dtb kernel
mkbootimg --base 0 --pagesize 4096 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000
--second_offset 0x00f00000 --tags_offset 0x00000100
--cmdline 'androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000
msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048
androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 buildvariant=user'
--kernel kernel --ramdisk ramdisk -o boot_1.img
fastboot flash boot boot_1.img
Click to expand...
Click to collapse
Try using this boot image: https://nathanchance.me/downloads/kernels/op6/stock/oos-5.1.8-boot.img
You may also check out Android Image Kitchen too, that's what I used before TWRP.
First, thanks a ton for taking the time to help me out.
I tried unpacking/repacking with your boot.img file, and that didn't work either. However, your boot.img itself works just fine.
I just realized that my build produces a ton of warnings.
Code:
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
...
This is probably why my kernels are failing to boot. I'm essentially following the instructions you laid out on the github issue for this kernel.
Code:
export ARCH=arm64
export CROSS_COMPILE=/android/projects/cross-compile/aarch64-linux-android-4.9/bin/aarch64-linux-android-
make O=out sdm845-perf_defconfig
./scripts/config --file ./out/.config -e BUILD_ARM64_DT_OVERLAY
make O=out olddefconfig
make O=out DTC_EXT=dtc -j16
Following the comments in that issue, I'm running archlinux with the following software versions:
gcc
Code:
[email protected]:/android/kernel/opo6-stable$ gcc --version
gcc (GCC) 8.1.1 20180531
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dtc
Code:
[email protected]:/android/kernel/opo6-stable$ dtc --version
Version: DTC 1.4.6
phenoxis said:
First, thanks a ton for taking the time to help me out.
I tried unpacking/repacking with your boot.img file, and that didn't work either. However, your boot.img itself works just fine.
I just realized that my build produces a ton of warnings.
Code:
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/enchilada-evb-overlay.dtbo: Warning (reg_format): "reg" property in /[email protected]/__overlay__/[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
...
This is probably why my kernels are failing to boot. I'm essentially following the instructions you laid out on the github issue for this kernel.
Code:
export ARCH=arm64
export CROSS_COMPILE=/android/projects/cross-compile/aarch64-linux-android-4.9/bin/aarch64-linux-android-
make O=out sdm845-perf_defconfig
./scripts/config --file ./out/.config -e BUILD_ARM64_DT_OVERLAY
make O=out olddefconfig
make O=out DTC_EXT=dtc -j16
Following the comments in that issue, I'm running archlinux with the following software versions:
gcc
Code:
[email protected]:/android/kernel/opo6-stable$ gcc --version
gcc (GCC) 8.1.1 20180531
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dtc
Code:
[email protected]:/android/kernel/opo6-stable$ dtc --version
Version: DTC 1.4.6
Click to expand...
Click to collapse
That's normal, I've hidden all of the warnings.
https://github.com/nathanchance/op6/commits/1d0f0ea36c0814efa36ef8b5c0c1ad9cb74cfe81
Those were the commits I used for my first boot. There is nothing in there that should be necessary to boot, just to make certain things work.
4.9.110 has been merged in.

Categories

Resources