[Q]Ubuntu Touch(Cyanogenmod) debugging - Galaxy Tab 2 Q&A, Help & Troubleshooting

Hi all,
I have tried to build CM 10.1 based Ubuntu Touch for Samsung Tab 2 10.1 but all version will be boot looping only. I have not much Android background but I have read about logcat and reading last kernel messages that could reveal reasons for boot looping. Currently I can seen login screen for a few seconds.
Ubuntu Touch has a limited version of Cyanogenmod so it probably requires different ways to debug, track down the kernel fault. If you have been porting Ubuntu to some other Samsung Tablet what ways you have used? Or would you have some handy tip in your sleeve?
/data/ubuntu/var/log contains some informations but none seems to be directly relating to kernal fault.
Thank you for all suggestions how to proceed with fault determination.

simosays said:
Hi all,
I have tried to build CM 10.1 based Ubuntu Touch for Samsung Tab 2 10.1 but all version will be boot looping only. I have not much Android background but I have read about logcat and reading last kernel messages that could reveal reasons for boot looping. Currently I can seen login screen for a few seconds.
Ubuntu Touch has a limited version of Cyanogenmod so it probably requires different ways to debug, track down the kernel fault. If you have been porting Ubuntu to some other Samsung Tablet what ways you have used? Or would you have some handy tip in your sleeve?
/data/ubuntu/var/log contains some informations but none seems to be directly relating to kernal fault.
Thank you for all suggestions how to proceed with fault determination.
Click to expand...
Click to collapse
Succesfully compiled (@ the other thread), see my github for modifications (only forked 2 repos, kernel + device tree, both from Kumajaya's hub)
For the debugging things, isn't the documentation enough ? You should know how to work your way out
- https://wiki.ubuntu.com/Touch
- https://wiki.ubuntu.com/Touch/Testing
- http://developer.ubuntu.com/packaging/html/fixing-a-bug-example.html

Debugging errors in P5100
Sympnotic said:
Succesfully compiled (@ the other thread), see my github for modifications (only forked 2 repos, kernel + device tree, both from Kumajaya's hub)
For the debugging things, isn't the documentation enough ? You should know how to work your way out
- <removed>
- <removed>
- <removed>
Click to expand...
Click to collapse
Thank you Symptonic!
I am finally debugging ...would you happened to see any similar messages when making porting to other Samsung devices?
E/linker ( 690): ics/linker.c:1598| WARNING: Skipping libc.so
...
E/linker ( 690): ics/linker.c:1072| ERROR: Library 'libOpenVG.so' not found
...
E/linker ( 690): ics/linker.c:1072| ERROR: Library 'libPVROGL.so' not found
E/linker ( 690): ics/linker.c:1072| ERROR: Library 'libPVROCL.so' not found
D/libEGL ( 690): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
D/libEGL ( 690): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
Click to expand...
Click to collapse
As far as I understand that relates to device/samsung/omap4-common/ and to device (p5100) which does not support libOpenVG.so. Anyway when those errors are shown couple of times in logcat device will reboot itself see "pastebin". Would you have any suggestions how to configure device settings or track down the error?
Thank you for all comments and ideas!
Entire logcat in pastebin: /J2mNneYw

Related

[DEV] Multiboot Linux on Infinity tf700 (project closed)

Developers thread for users general.
I will post here some external links and additional information.
GitHub tf700 Repository - place for config files and step-by-step manual to create you own kernel and rootfs
GOO.IM file place
Tablet PPA for Raring
Changed packages is placed in /root/deb directory.
Known problems: (nexus7 wiki, mattfischer blog post, nexus7 bugs)
Unity has some problems with performance and ram eating - this is place for optimizations.
In-device microSD really bad works.
WiFi disabling is fail bcmdhd kernel module.
vt1-only, if you try to switch to vt* (`chvt 2`) - your device is freezes and reboot.
To use unity you need nux-tools, libnux-3.8-0 and libnux-3.8-common with version 3.8.0-0ubuntu1nexus7.1 (this packages are hold)
Sometimes I can see really bad artifacts with fonts and background on the device screen (mostly if using chromium browser). Only reboot fixes it.
Progress list:
Test Linux boot {DONE}
SDCard rootfs {DONE}
Graphical boot{DONE}
Keyboard special keys remapping (Esc, F1-12, Ins, Print, Break, Del, Home->Alt, Search->Meta4) {DONE in 0.8.0}
WiFi {DONE}
OpenGL ES {DONE}
Audio {DONE} In pavucontrol as output device selected Analog Stereo Output, in alsamixer (tegra-codec) unmute IntSpk
Video up to 1080p {DONE} (ac100 info) - Soft audio requires gstreamer0.10-plugins-*
nvgstplayer --sas="audioconvert ! pulsesink" -i <videofile> - Fullscreen mode
nvgstplayer --svs="nvxvimagesink" --sas="audioconvert ! pulsesink" -i <videofile> - Window mode
Touchscreen {DONE in 0.7.0} - used mtev one-touch driver 0.1.13 with api and 2button patches - right click by push one finger and click by second finger (thanx, cb22)
Touchpad {DONE in 0.6.1}
2 fingers scrolling {DONE}
3rd mouse button by 2 finger tap {DONE 0.6.1} - created new version of package multitouch "-swaptaps"
Updated tegra3 drivers and codecs to 16.2 {DONE in 0.6.1}
Ubuntu/Android dualboot {DONE in 0.7.0}
Initrd bootloader trying to boot sda1(dock sd cardreader or usb device), mmcblk1p1(internal microsd cardreader), sdb1 (dock sd cardreader or usb device), mmcblk0p9(inernal device), /data/media/tf700-rootfs-linux.img(in-device installed virtual disk) (0.7.0)
If it can't load linux - fallback to Android (0.7.0)
Boot android if voldown (or special, like Up key) key pressed in menu (0.7.0)
Fixed nvavp problem in android (0.7.0)
Fixed problems with Android sleeping by unbinding vtconsole before Android boot (0.7.0)
Initrd installer to mmcblk0p8 user partition and mount as loop with binding mmcblk0p8 {DONE in 0.7.0}
Fonts and cursor size {DONE in 0.8.0}
ZIP installer by Aroma {partially}
Install of boot image {DONE in 0.7.1}
Install script for SDcard-way and Virtual Disk-way {DONE in 0.8.0}
Possibility of using mmcblk0p8 /data as /home {DONE in 0.8.0}
Dynamical making of boot.blob {DONE in 0.8.1}
Select rootfs to boot {DONE in 0.8.1}
CM10.1 initrd (link) {DONE in 0.8.1}
Android boot from sdcard or virtual drive {DONE in 0.8.1}
UbuntuTouch initrd {DONE in 0.8.2}
Change boot system names {DONE in 0.8.2}
Add option to boot android by default {DONE in 0.8.2}
Check md5 of rootfs archive
Encryption for linux partition
FSCK check & fix rootfs before mounting {DONE in 0.8.2}
GPIO keys {partially in 0.8.0}
Switch rootfs to 13.4 (link) {partially}
Bluetooth
Try this: /system/bin/brcm_patchram_plus --bd_addr `cat /etc/bluetooth/bt_addr` --enable_hci --enable_lpm --no2bytes --tosleep 50000 --baudrate 4000000 --use_baudrate_for_download --patchram /lib/firmware/bcm4334.hcd --i2s=1,0,0,0 /dev/ttySAC0&
Totem and nvgst modules
Go to Wayland+Weston+libhybris to use egl android drivers
Disable speaker if headphones connected
Additional:
Ubuntu Cube Desktop {DONE in 0.6.2}
Chromium browser with egl and ffmpeg support {partially} - Youtube has problems with performance
Games & software {partially}
Duke3D {DONE}
Minecraft {partially}:
+ MCP
+ LWJGL 2.8.x (`ant jars_es && ant compile_native_es`)
+ Hands
Games and Emu (in Russian)
Xonotic
C-Dogs SDL
pcsx-rearmed (pi) (Return Fire and other good ps1 games)
Open Clonk
OpenLieroX
Blender + LuxRender
Need help:
Suspend to RAM - Not working with X (trace), without X (stop lightdm) - suspended, but not wake.
Wakelock to emmc
Wake up: echo "on" > /sys/power/state or powerbutton (maybe with kernel patching)
Totem - now is not working
gstreamer-properties and set Audio->Output=Custom, Audio->Output->Pipeline="nv_omx_audiosink" and Video->Output=Custom, Video->Output->Pipeline="nvxvimagesink"
HDMI copy of screen (any ideas?)
Xorg configuration shows blue lines on HDMI screen
Not working properly with 1920x1080: `xrandr --output LVDS-1 --auto --output HDMI-1 --mode 1920x1080` - I get "xrandr: Configure crtc 1 failed"
Tested on different display with fullhd support - seems like tegra3 drivers problem
Works ok with 1280x800:
xrandr --newmode `gtf 1280 800 60 | tail -n2 | head -n1 | sed 's/ Modeline //'`
xrandr --addmode HDMI-1 1280x800_60.00
xrandr --output LVDS-1 --auto --output HDMI-1 --auto
HDMI audio (any ideas?)
Adobe Flash player (any ideas?)
Skype (any ideas?)
List of optimizations:
ZRam {DONE}
UKSM (Ultra Kernel Samepage Merging) {DONE} (info in Russian)
CPU optimizations {partially}
Clemsyn OC 1.3 - 1.8ghz 650GPU Kernel {DONE in 0.6.2} - seems like not properly working on AndroidRoot hacked bootloader
Boot optimizations {partially}
Initrd scripts {DONE in 0.6.2}
Kernel modules upgrade from initrd {DONE in 0.7.1}
IO optimizations {partially}
Some optimizations of filesystem mounting {partially in 0.6.2}
Install to device main emmc memory {DONE in 0.7.0}
Power optimizations:
Screen off on lid
RAM Sleep
Powersave, Auto and Performance modes
Plans for the future:
Prepare common installer for any tegra3 device.
Test builds:
Nope
If you can help in development - please, write here.
This is very nice! Its certainly a good start.
There are definitely changes between your implementation and Jay's build. It would seem that after reviewing your source code that the major difference is your overall system config and choice of location of rootfs.
The kernels aren't too too different.
you are using noop vs cfq which is understandable since you are using the stock kernel vs CM10
you incorporated less debugging vs debugging (agree with your preference)
you incorporated framebuffer vs no fb
you incorporated zram vs no zram (smart move to help chromium)
your enhancements are much better IMHO.
You are not utilizing the linux for Tegra drivers. I think we could benefit by utilizing the latest version at least for sound. After reviewing the documentation and reviewing the drivers themselves I think we should integrate. That is unless you are trying to have two separate kernels instead of a monolithic kernel that can boot android and linux kind of like "Ubuntu for Android"
Since I have a working nvflash'd tf700 I am working on a dualboot kexec.
I still prefer the monolithic kernel approach for Android and Linux concept though, and make selection during boot as to which environment to go to. Essentially, it is possible to boot the kernel and run a specific environment and end that environment and switch to another environment.
As others have suggested I think we should integrate both into 1 tree and also try to get the tf300 on board because other than their kernel, specific tf700 configs/rules the rest of the rootfs and other portions should be identical.
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
quicknik said:
You are not utilizing the linux for Tegra drivers. I think we could benefit by utilizing the latest version at least for sound. After reviewing the documentation and reviewing the drivers themselves I think we should integrate. That is unless you are trying to have two separate kernels instead of a monolithic kernel that can boot android and linux kind of like "Ubuntu for Android"
Click to expand...
Click to collapse
You mean - HW sound? I have integrated drivers, because I use modified nexus7 rootfs. Maybe, I wrong...
Also, integration of kernels is too difficult task for me now...
quicknik said:
Since I have a working nvflash'd tf700 I am working on a dualboot kexec.
I still prefer the monolithic kernel approach for Android and Linux concept though, and make selection during boot as to which environment to go to. Essentially, it is possible to boot the kernel and run a specific environment and end that environment and switch to another environment.
Click to expand...
Click to collapse
I also have nvflash by wheele, but for users preparing device for this - is too difficult. Now I already prepared dualboot with same kernel through initrd menu. In 0.6.0 I will release it. I have some problems with integrated cameras, but wifi is now works in android.
I think we have some problems with non-JB androids with this dualboot... But it is simple.
quicknik said:
As others have suggested I think we should integrate both into 1 tree and also try to get the tf300 on board because other than their kernel, specific tf700 configs/rules the rest of the rootfs and other portions should be identical.
Click to expand...
Click to collapse
Applying to tf300 - is good idea. It's a part of integration all tegra3 devices in same Ubuntu installation for pads.
Sorry, guys. I found my mistake with no-dualboot initrd. Now i replaced it to true dualboot (0.6.1).
rabits said:
Developers thread for users general.
Test builds:
boot.img dualboot initrd Pre-release 0.6.1
for me dualboot nice works, but I need to change verbosity of kernel output and boot menu more user frendly. If you can try it and write your suggestions - that will be cool.
assembly of mini initrd and android JB 4.1.1 (I have CleanROM 2.4 installed on my tf700t).
wifi on android is supported (added p4p bcmdhd option), but nvavp can't load fw.
boot menu (included linux, android, initrd shell) is showing after kernel loading.
Click to expand...
Click to collapse
I am more than willing to try, but how can I dualboot that first build ? If you provide a few step by step instructions, I am sure a lot of people will try which will help the development by giving several feedbacks.
I am currently on Clean Rom Inheritance (= CROMI) 2.7.2 which is the latest update in the Clean Rom series. Since you are using 2.4, I guess the steps woul be exactly the same as for you. I am however using Clemsyn kernel. Is the stock kernel required to be able to dual boot ?
One the OP, Ubuntu seems tobe pretty stable since a lot of features ar working. Is that really the case ? Is compiz already something I could consider using at this point of the developpment or is it still a little bit early ?
I am really interested in this project and I thank you a million time for starting actively a development allowing us to dualboot Ubuntu. Keep up you awesome work !!!
singoutout said:
I am more than willing to try, but how can I dualboot that first build ? If you provide a few step by step instructions, I am sure a lot of people will try which will help the development by giving several feedbacks.
I am currently on Clean Rom Inheritance (= CROMI) 2.7.2 which is the latest update in the Clean Rom series. Since you are using 2.4, I guess the steps woul be exactly the same as for you. I am however using Clemsyn kernel. Is the stock kernel required to be able to dual boot ?
One the OP, Ubuntu seems tobe pretty stable since a lot of features ar working. Is that really the case ? Is compiz already something I could consider using at this point of the developpment or is it still a little bit early ?
I am really interested in this project and I thank you a million time for starting actively a development allowing us to dualboot Ubuntu. Keep up you awesome work !!!
Click to expand...
Click to collapse
Thanks for your support)) I think, you could use users general thread for test boot steps. The steps are the same, but with the current rootfs (0.5.0) linux in dualboot may not start. Android with CleanRom should work. Soon I will release a rootfs 0.6, which can be used with dualboot section.
rabits said:
Thanks for your support)) I think, you could use users general thread for test boot steps. The steps are the same, but with the current rootfs (0.5.0) linux in dualboot may not start. Android with CleanRom should work. Soon I will release a rootfs 0.6, which can be used with dualboot section.
Click to expand...
Click to collapse
can do for TF300 ?
tailormoon said:
can do for TF300 ?
Click to expand...
Click to collapse
I don't know - but you can try.
Hi
How is it going with the developpment? Is the dualboot working nice with Ubuntu now?
Do you think a cube desktop will ever be usable on a dualbooted Ubuntu on our device?
Thanks for the good work
Hello, I have managed to get this booting on my tf300t tablet. It is working alright and I would like to learn a bit about this area of development so I can tweak it to get it working as well as contribute to the project as a whole. So far it has bugs with wifi, bluetooth, and sound. Also, when I select shutdown from the ubuntu menu, it corrupts the image and it will boot to lightdm and then freeze. I tried compiling a kernel for it based on a tweaked tf700t 10.4.4.20 kernel that was patched by untermensch to work for the tf300t but it did not solve any issues, it pretty much performed the same. I wanted infrom everyone of the issues on the tf300t as well as ask for some guidance as to documentation for what steps I can take to fix these issues. Thanks.
keeganmccallum said:
I wanted infrom everyone of the issues on the tf300t as well as ask for some guidance as to documentation for what steps I can take to fix these issues. Thanks.
Click to expand...
Click to collapse
It seems that this is the rootfs problem. Maybe you find some info in tf300 forum or ubuntu forums, but you need try to read log files and, maybe, do hard gdb trace.
Trying it when i get home
Thanks
Sent from my GT-N7000 using xda premium
BTW happy to have CROMI involved with this
rabits said:
[*]boot.blob v0.6.2 - Anyone can try to flash it? I can't flash it by fastboot on AndroidRoot bootloader - maybe it should work on JB bootloader?
Click to expand...
Click to collapse
Your dummy signblob header is one byte too long - there is a 0a byte before "MSM-RADIO-UPDATE" that should not be there.
_that said:
Your dummy signblob header is one byte too long - there is a 0a byte before "MSM-RADIO-UPDATE" that should not be there.
Click to expand...
Click to collapse
Thanx, I missed this byte)) Damn sed. We should always use echo and cat))
Blob is updated.
rabits said:
Blob is updated.
Click to expand...
Click to collapse
Successfully flashed via fastboot and it booted my Android (still the old CleanROM 2.3) fine. The initrd menu and framebuffer console is awesome. Can't try your rootfs right now because my PC cardreader is making trouble (I hate SD cards and readers, they are unreliable sh**, or they hate me).
Only everything is very tiny (160 dpi instead of 240), and adding ro.sf.lcd_density=240 to /system/build.prop did not help. I'll have to add it to the initrd and see if it helps. Strange, because I thought newer CleanROMs also set the dpi via /system/build.prop, but who knows. Eventually I should install CRI 3.0 anyway.
Hm, while I was writing this, the TF700 spontanously rebooted... looks like problems turning off the screen. /proc/last_kmsg contained two WARNINGs with stack trace, both containing do_blank_screen (drivers/tty/vt/vt.c:3728 and vt.c:650)
I just read that this is Clemsyn's kernel - where did you find the sources for the current version and what did you modify? There are so many different binaries in that thread and so few source drops that I totally lost track.
Hi
I've just seen the cube desktop is know supported on 0.6.2. How is it performing ? Is the latest version smoother than 0.5 ?
Thanks for the great work!!! I hope our tabs will soon have a stable and smooth Ubuntu dualbootable with CROMI
_that said:
Only everything is very tiny (160 dpi instead of 240), and adding ro.sf.lcd_density=240 to /system/build.prop did not help. I'll have to add it to the initrd and see if it helps. Strange, because I thought newer CleanROMs also set the dpi via /system/build.prop, but who knows. Eventually I should install CRI 3.0 anyway.
Hm, while I was writing this, the TF700 spontanously rebooted... looks like problems turning off the screen. /proc/last_kmsg contained two WARNINGs with stack trace, both containing do_blank_screen (drivers/tty/vt/vt.c:3728 and vt.c:650)
Click to expand...
Click to collapse
Yeah, seems like too old CR version...
_that said:
I just read that this is Clemsyn's kernel - where did you find the sources for the current version and what did you modify? There are so many different binaries in that thread and so few source drops that I totally lost track.
Click to expand...
Click to collapse
You can find info about kernel here and here. I'm used this source from second link to build 0.6.2 kernel.
singoutout said:
Hi
I've just seen the cube desktop is know supported on 0.6.2. How is it performing ? Is the latest version smoother than 0.5 ?
Click to expand...
Click to collapse
I just installed extra plugins))) Currently Nexus7 is more smoothed then tf700 with unity... Cube is rotating ok, but with IO lags - sd speed so slow.
Currently I working on more basic things, like install linux in main flash drive. If you have any ideas - please, post it here.
Hi everyone,
I've been working on getting ArchLinuxArm running on the TF300 over at http://forum.xda-developers.com/showthread.php?t=1918849
Just something that might help with your touchscreen - you should be able to get basic functionality if you use the xf86-input-mtev driver (see https://aur.archlinux.org/packages/xf86-input-mtev-meego/ )
While less than ideal, it's better than nothing. We have the same issue with X segfaulting when the evdev driver is used. I actually looked into that, and it has to do with the way events are reported by the kernel driver, if I remember correctly.

Kexec-hardboot patch

In this post, I would like to explain what kexec-hardboot patch is and also bring it to light a bit more since until now, it was only burried in MultiROM thread.
@kernel developers: I would like to ask you to merge this patch to your kernels, because it is essential part of MultiROM - it allows me to boot any kernel without changing the boot partition. I realize that it is no small request, but the patch is not big, touches relatively stable parts of kernel and should not cause any problems. Thank you.
What is kexec?
It is syscall of Linux kernel, which allows you to boot another Linux kernel without restarting the device - "Linux boots itself". The functionality is equivalent to fastboot -c *cmdline* boot zImage initrd.img, but without PC and fastboot. It is fairly known thing, so more info at wikipedia and man kexec.
Standard kexec call unfortunatelly does not work on Nexus 7. It freezes somewhere, and it is very difficult to find out where - probably some of the drivers are not shut down/re-initialized properly, it is a commong thing among Android devices, which is why kexec-hardboot was made.
What is the difference between normal and hardboot exec?
Kexec-hardboot patch adds a real device restart to that process, so that all the drivers can be properly reinitialized. It stores new kernel to RAM, reboots the device as usual, and kernel from boot partition immediately jumps to the one which was stored to RAM before reboot.
Another difference is that both kernels must be patched. The "host" kernel requires a full patch, the one which is being kexecd' requires only two small compatibility patches.
To sumarize the process:
kexec --load-hardboot.... is called and kernel it loaded into RAM.
kexec -e is called. Special info is written to memory (to area which is not overwritten on reboot) and the device is rebooted.
After reboot, very early in the boot process, kernel checks if that special info is present in RAM and if so, it loads new kernel from RAM and jumps to it.
Kexecd' kernel starts and boots.
For more info, read the original thread.
Patches:
Full kernel patch: https://gist.github.com/4558647, 4.1 kernel repo, cm 10.1 kernel repo
This is the full kernel patch. Kernels with this patch can be both "host" and "guest" kernels.
Related CONFIG options:
CONFIG_KEXEC=y
CONFIG_KEXEC_HARDBOOT=y
CONFIG_ATAGS_PROC=y
CONFIG_GROUPER_HARDBOOT_RECOVERY=n
First three options must be enabled. Last one, GROUPER_HARDBOOT_RECOVERY, specifies if the kexec call should reboot to normal mode or to recovery. This can be useful if you don't have the kernel in boot partition but only as kernel in recovery partition. You usualy want to disable this option.​
Compatibility patch: https://gist.github.com/4458581
This patch only makes the kernel bootable via kexec, ie. it can't be the host kernel. This was made for Ubuntu kernel (and it was accepted), because I did not want to drag the whole patch in there. If your kernel is for Android ROMs, you should use the full patch.​
Userspace kexec binary: View attachment kexec-tools.zip
That ZIP file contains kexec source, patches and README. It is from the original patch from Mike Kasick. It also contains precompiled, statically linked kexec binary, so you probably just want to use that.​
Usage:
Once you have the kernel patches and kexec userspace binary in place, just run following command to boot into new kernel:
Code:
kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0x85000000 --command-line="$(cat /proc/cmdline)"
kexec -e
Note the command line parameter - cmdline from bootloader is not added automatically, you have to put it there by yourself.
Currently used by:
MultiROM - I use it to boot different kernels (eg. Ubuntu).
MOSLO - Part of Plasma Active for Nexus 7, also usefull tool for every N7 developer - read more: http://ruedigergad.com/2012/12/09/nexus-7-easily-flashaccess-entire-userdata-partition/
Authors:
This patch was made by Mike Kasick for Samsung Epic 4G. Since that, it was ported to several devices, one of them is Asus Transformer TF201 - I used patch from TF201 and modified it a bit (basically just changed few SoC specific constants). People at #ubuntu-arm helped me out with that, thanks.
Hi Tasssadar,
im trying to get this to work on the HOX in order to have a shot at multiboot,
the patched applied with no problem... however on compiling i gett this error
"Adress for kexec hardboot page not defined"
ask this error naturely defined to kick in with every device beside N7 i that comment completely....
and that ended up giving me an error about KEXEC_HB_PAGE_ADDR not defined,
so i readded it, but i removed the "#if defined(CONFIG_MACH_GROUPER)"
now trying to compile it, its gets pretty close to the end... but failed with unexpected string error at line OUTPUT_ARCH(arm) in file linux/arch/arm/boot/compressed/vmlinux.lds
Code:
/*
* linux/arch/arm/boot/compressed/vmlinux.lds.in
*
* Copyright (C) 2000 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
/DISCARD/ : {
*(.ARM.exidx*)
*(.ARM.extab*)
/*
* Discard any r/w data - this produces a link error if we have any,
* which is required for PIC decompression. Local data generates
* GOTOFF relocations, which prevents it being relocated independently
* of the text/got segments.
*/
*(.data)
}
. = 0;
_text = .;
.text : {
_start = .;
*(.start)
*(.text)
*(.text.*)
*(.fixup)
*(.gnu.warning)
*(.glue_7t)
*(.glue_7)
}
.rodata : {
*(.rodata)
*(.rodata.*)
}
.piggydata : {
*(.piggydata)
}
. = ALIGN(4);
_etext = .;
.got.plt : { *(.got.plt) }
_got_start = .;
.got : { *(.got) }
_got_end = .;
_edata = .;
. = ALIGN(8);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
. = ALIGN(8); /* the stack must be 64-bit aligned */
.stack : { *(.stack) }
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
}
also, im booted into windows now... so i can't provide the exact error.
I'm afraid "comment everything which doesn't work" won't work here. The KEXEC_HB_PAGE_ADDR and END_MEM is device-specific, it will most likely be different for HTC One X. You can find out what address is it supposed to be by examining /proc/iomem on your device. For example, here's memory map from grouper:
Code:
...
80000000-be9fffff : System RAM
80008000-808faba7 : Kernel text
80940000-80b8228f : Kernel data
beb00000-bebfffff : ram_console
...
So, for grouper, END_MEM is 0xbe9fffff + 1 = 0xbea00000.
KEXEC_HB_PAGE_ADDR is located 1MB before console RAM, which is in this case also immediatelly after System RAM, so for grouper, it is also 0xbea00000.
but failed with unexpected string error at line OUTPUT_ARCH(arm) in file linux/arch/arm/boot/compressed/vmlinux.lds
Click to expand...
Click to collapse
That doesn't seem to be related to this patch. Are you using correct cross-compiler?
Tasssadar said:
I'm afraid "comment everything which doesn't work" won't work here. The KEXEC_HB_PAGE_ADDR and END_MEM is device-specific, it will most likely be different for HTC One X.
Click to expand...
Click to collapse
i figured
but im walking you through what i did.
You can find out what address is it supposed to be by examining /proc/iomem on your device. For example, here's memory map from grouper:
Code:
...
80000000-be9fffff : System RAM
80008000-808faba7 : Kernel text
80940000-80b8228f : Kernel data
beb00000-bebfffff : ram_console
...
So, for grouper, END_MEM is 0xbe9fffff + 1 = 0xbea00000.
KEXEC_HB_PAGE_ADDR is located 1MB before console RAM, which is in this case also immediatelly after System RAM, so for grouper, it is also 0xbea00000.
Click to expand...
Click to collapse
Code:
7d000000-7d003fff : tegra-udc.0
7d000000-7d003fff : tegra-otg
7d000000-7d003fff : tegra-udc
7d004000-7d007fff : tegra-ehci.1
80000000-beafffff : System RAM
80008000-8094000f : Kernel text
809a8000-810b940f : Kernel data
beb00000-bebfffff : ram_console
bec00000-beffffff : fbmem
bf000000-bf7fffff : fbmem
0xbeafffff + 1 = 0xbeb00000
grrr that would put me inside the ram_console...
aaaa would it wok if i used the address before??
7d00800
Edit:
or did your ram RAM end earlier because you set you END_MEM 0xbea00000
in that case, it works out just the same with the HOX
That doesn't seem to be related to this patch. Are you using correct cross-compiler?
Click to expand...
Click to collapse
i would have guessed so, but the kernel compiled and is working before the patch.
im using the one provided by google (Android NDK r9) while it contains booth gcc 4.6/4.8 im using 4.6 (arm-linux-androideabi-)
The patch will move ram_console 1MB further, see https://gist.github.com/Tasssadar/4558647#file-n7_hardboot-diff-L387 . You'll have to modify this part of the patch, it will be in different file for your device.
Tasssadar said:
The patch will move ram_console 1MB further, see https://gist.github.com/Tasssadar/4558647#file-n7_hardboot-diff-L387 . You'll have to modify this part of the patch, it will be in different file for your device.
Click to expand...
Click to collapse
HOX is also a Tegra 3 device... so im guessing i wont need to touch a thing?
also note... that iomem provided is from an unpatched kernel (as i cant compile a patched one)
also,
im currently on freenode #htc-one-x
if you dont mind joining.
I've been looking through the kexec-hardboot patch these last few days, trying to actually understand it instead of just blindly porting it and after several hours of messing with assembler with no means to debug it, I've managed to remove the need for guest kernel to be patched. This is not really useful for grouper, since thanks to multirom and accepting kernel devs, nearly every third-party kernel has the proper patches. But, if I'll port multirom to some other device (hello, flo), it will be very useful
To know more see the changes in this commit, but you'll probably need to understand how the patch does things: https://github.com/Tasssadar/androi...mmit/2ce4130061f72430a8ddfde25346c4e528c5c30b
@mkasick: Could you please look over this? I'm afraid there's some good reason why you didn't do this in the first place, like rewriting some part of memory which shouldn't be rewritten or something like that. Thank you.
Tasssadar said:
I've been looking through the kexec-hardboot patch these last few days, trying to actually understand it instead of just blindly porting it and after several hours of messing with assembler with no means to debug it, I've managed to remove the need for guest kernel to be patched. This is not really useful for grouper, since thanks to multirom and accepting kernel devs, nearly every third-party kernel has the proper patches. But, if I'll port multirom to some other device (hello, flo), it will be very useful
To know more see the changes in this commit, but you'll probably need to understand how the patch does things: https://github.com/Tasssadar/androi...mmit/2ce4130061f72430a8ddfde25346c4e528c5c30b
@mkasick: Could you please look over this? I'm afraid there's some good reason why you didn't do this in the first place, like rewriting some part of memory which shouldn't be rewritten or something like that. Thank you.
Click to expand...
Click to collapse
Perfect timing, just finished my last exam
Edit:
Also, this applies on top of the original patch right??
Edit2:
i can't seem to get it to kexec boot, but i didn't do much testing, maybe 2morrow night!
Edit3:
fixed, it was a problem with min-addr,
changed it to 0x82000000 and it worked
One more question...
TEGRA_PMC_BASE is also device specific, ain't it???
So, for a Qualcomm device, what should I be using? I am guessing it is MSM_RPM_BASE, which I got from here: http://forum.xda-developers.com/showpost.php?p=31127486&postcount=7
Yes, it is SoC-specific. This is using some special register to reset the chip, I'm not sure if that is available on msm chips - probably yes, but in some different form. Your best chance is to examine restart sequence in arch/arm/mach-msm/restart.c and port it to assembler.
Tasssadar said:
Usage:
Once you have the kernel patches and kexec userspace binary in place, just run following command to boot into new kernel:
Code:
kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0xA0000000 --command-line="$(cat /proc/cmdline)"
kexec -e
Click to expand...
Click to collapse
The address of 0xA0000000 is not necessarily the best choice going forward. It originally made perfect sense, as it is well above everything else. But now that we can boot unpatched guest kernels, we can hit the interesting situation where the guest decompression may take a full minute. At least it's when I've seen on the Ouya game console that's running the next chip after Grouper.
When I realized what's going on, I changed to 0x8E000000, as it gets me just below the 256 MB limit of cache-enabled memory that's present on a typical guest at that early decompression stage. It's enough to hold a typical 8 MB boot image kernel/ramdisk. Now the guest kernel startup is fast in all cases.
Thank you Tasssadar for continuing your work in this area, especially with finding that way to allow unpatched guests.
Indeed, that's actually what I'm using in MultiROM for flo and mako (and grouper, but it is useless 'cause not all 3rd-party kernels have been updated), I just kinda "forgot" to update these threads.
Would it work on devices with locked bootloaders (Xperias). I mean :does the idea of this patch would also work on bootloader unlock allowed :no devices?
Sent from my LT22i using xda app-developers app
I am trying to build a kexec patched kernel integrated into a ROM. I make sure that the following code is there in the defconfig:
CONFIG_KEXEC=y
CONFIG_KEXEC_HARDBOOT=y
CONFIG_ATAGS_PROC=y
The ROM works well, except that it does not boot my secondary ROMs - kexec hardboot patch missing. I have multi ROM and TWRP recovery installed
What am I missing?
Logs or it didn't happen.
Show me dmesg from normal boot into android, with MultiROM and your kernel installed.
Code:
adb shell
su
dmesg > /data/local/tmp/dmesg.txt
exit
exit
adb pull /data/local/tmp/dmesg.txt
Porting?
Tassadar which things do I need to boot kexec kernel on my device (Motorola Electrify 2) .
@Tasssadar, Sorry for picking up this kinda "old topic" but I'm sadly experiencing some problems while trying to port kexec-hardboot to the Sony Xperia Z2 (aka sirius). I applyed all needed commits (cherry-picked from a apparently working Z1 repo for stock kernel) to my CM based custom kernel (https://github.com/Myself5/android_kernel_sony_msm8974/tree/kexec-cm-12.0) and it does not boot at all. It's stuck on the Sony Logo, and it seems like I can't get any log either. I also tryed the stock cm kernel with the patch (https://github.com/Myself5/android_kernel_sony_msm8974-kexec) cause I tought it might be some incompatibility, but sadly it wasn't. Hope you have any ideas to solve my problems, cause I'm out of ideas ATM. I also checked the kexec commits for other devices (namely the One Plus One) and it seems like I got everything needed.
Thanks in Advance
Tasssadar said:
In this post, I would like to explain what kexec-hardboot patch is and also bring it to light a bit more since until now, it was only burried in MultiROM thread.
@kernel developers: I would like to ask you to merge this patch to your kernels, because it is essential part of MultiROM - it allows me to boot any kernel without changing the boot partition. I realize that it is no small request, but the patch is not big, touches relatively stable parts of kernel and should not cause any problems. Thank you.
What is kexec?
It is syscall of Linux kernel, which allows you to boot another Linux kernel without restarting the device - "Linux boots itself". The functionality is equivalent to fastboot -c *cmdline* boot zImage initrd.img, but without PC and fastboot. It is fairly known thing, so more info at wikipedia and man kexec.
Standard kexec call unfortunatelly does not work on Nexus 7. It freezes somewhere, and it is very difficult to find out where - probably some of the drivers are not shut down/re-initialized properly, it is a commong thing among Android devices, which is why kexec-hardboot was made.
What is the difference between normal and hardboot exec?
Kexec-hardboot patch adds a real device restart to that process, so that all the drivers can be properly reinitialized. It stores new kernel to RAM, reboots the device as usual, and kernel from boot partition immediately jumps to the one which was stored to RAM before reboot.
Another difference is that both kernels must be patched. The "host" kernel requires a full patch, the one which is being kexecd' requires only two small compatibility patches.
To sumarize the process:
kexec --load-hardboot.... is called and kernel it loaded into RAM.
kexec -e is called. Special info is written to memory (to area which is not overwritten on reboot) and the device is rebooted.
After reboot, very early in the boot process, kernel checks if that special info is present in RAM and if so, it loads new kernel from RAM and jumps to it.
Kexecd' kernel starts and boots.
For more info, read the original thread.
Patches:
Full kernel patch: https://gist.github.com/4558647, 4.1 kernel repo, cm 10.1 kernel repo
This is the full kernel patch. Kernels with this patch can be both "host" and "guest" kernels.
Related CONFIG options:
CONFIG_KEXEC=y
CONFIG_KEXEC_HARDBOOT=y
CONFIG_ATAGS_PROC=y
CONFIG_GROUPER_HARDBOOT_RECOVERY=n
First three options must be enabled. Last one, GROUPER_HARDBOOT_RECOVERY, specifies if the kexec call should reboot to normal mode or to recovery. This can be useful if you don't have the kernel in boot partition but only as kernel in recovery partition. You usualy want to disable this option.​
Compatibility patch: https://gist.github.com/4458581
This patch only makes the kernel bootable via kexec, ie. it can't be the host kernel. This was made for Ubuntu kernel (and it was accepted), because I did not want to drag the whole patch in there. If your kernel is for Android ROMs, you should use the full patch.​
Userspace kexec binary: View attachment 1653562
That ZIP file contains kexec source, patches and README. It is from the original patch from Mike Kasick. It also contains precompiled, statically linked kexec binary, so you probably just want to use that.​
Usage:
Once you have the kernel patches and kexec userspace binary in place, just run following command to boot into new kernel:
Code:
kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0x85000000 --command-line="$(cat /proc/cmdline)"
kexec -e
Note the command line parameter - cmdline from bootloader is not added automatically, you have to put it there by yourself.
Currently used by:
MultiROM - I use it to boot different kernels (eg. Ubuntu).
MOSLO - Part of Plasma Active for Nexus 7, also usefull tool for every N7 developer - read more: http://ruedigergad.com/2012/12/09/nexus-7-easily-flashaccess-entire-userdata-partition/
Authors:
This patch was made by Mike Kasick for Samsung Epic 4G. Since that, it was ported to several devices, one of them is Asus Transformer TF201 - I used patch from TF201 and modified it a bit (basically just changed few SoC specific constants). People at #ubuntu-arm helped me out with that, thanks.
Click to expand...
Click to collapse
I'm sorry for picking up this older topic as well, but I always played with the thought of merging kexec support into a kernel and I'm doing one right now.. But my secondary device is a LG G2 and since the era of Lollipop began, somehow MultiBoot just stopped working and nobody can figure out why. I think they even started to build some new concept now.. So before I spark a heated debated by Note 4 users I'd love to know if you have any idea if this patch is still applicable? Altough the only way to find out is to probably just try it lol.
Tasssadar said:
In this post, ....
Click to expand...
Click to collapse
Bro can you please mention on your wiki that kexec isnt supported for x64 devices? It will be great help and save developers hours! I was porting for oneplus 2 when a dev told me that kexec isnt there for x64. I was shocked
Is any alternative available for that? Please reply! Thanks.
All other devs, who cant make multirom to work (lollipop is the x64 era) stop working. Kexec isnt supported for x64. Find an alternative for it.
Can Anyone help me to port this? Here is my patched kernel (ignore arch/arm64) and this is /proc/iomem.
Code:
80000000-854fffff : System RAM
80008000-80fa43ef : Kernel code
81112000-817bf797 : Kernel data
8cb00000-9fefffff : System RAM
9ff00000-9ff3ffff : persistent_ram
9ff40000-9ff7ffff : persistent_ram
9ff80000-9fffffff : persistent_ram
a0000000-ffffefff : System RAM
For kexec_hb_page_addr the value i inseted is 85500000 coz as tasssadar said 884fffff + 1 = 85500000, but I don't know what value add for
Code:
#elif defined(CONFIG_ARCH_MSM8916)
/* Restart using the PMIC chip, see mach-msm/restart.c */
ldr r0, =MSM8916_HARDBOOT
mov r1, #0
str r1, [r0, #0]
loop: b loop
MSM8916_HARDBOOT, and if I compile the kernel it stucks on samsung logo.

[Q] Porting HTC linux 3.4.10 kernel to CM10.1

I am trying to figure out how to port the recently released 3.4.10 kernel to CM10.1 for our device (One XL evita). I am able to build CM10.1 from source and I am able to build standalone kernels.
So far I've build CM10.1 with the HTC linux 3.4.10 kernel sources in place of the CM10.1 kernel sources at kernel/htc/msm8960 and the build completed with no errors but the device won't boot. The screen won't even turn on. I knew it obviously wasn't going to be this simple but I am stuck on how to proceed.
The CyanogenMod "porting intro"
http://wiki.cyanogenmod.org/w/Doc:_porting_intro
seems to indicate that you should be able to get CM up and running with any kernel. Can anyone give me some pointers on what the basic requirements are for a kernel to boot?
vanja_z said:
I am trying to figure out how to port the recently released 3.4.10 kernel to CM10.1 for our device (One XL evita). I am able to build CM10.1 from source and I am able to build standalone kernels.
So far I've build CM10.1 with the HTC linux 3.4.10 kernel sources in place of the CM10.1 kernel sources at kernel/htc/msm8960 and the build completed with no errors but the device won't boot. The screen won't even turn on. I knew it obviously wasn't going to be this simple but I am stuck on how to proceed.
The CyanogenMod "porting intro"
http://wiki.cyanogenmod.org/w/Doc:_porting_intro
seems to indicate that you should be able to get CM up and running with any kernel. Can anyone give me some pointers on what the basic requirements are for a kernel to boot?
Click to expand...
Click to collapse
We're already working on it....
h8rift said:
We're already working on it....
Click to expand...
Click to collapse
H8 I know you guys are always hard at work on the ROM but I'm trying to learn about the process by having a go myself. You never know, If I get up to speed I may be able to help you guys out. I'm not expecting to just get a perfect kernel up and running, I'm just hoping to build something that I can boot and play around with.
Do you have any advice? Is there a set pathway to getting a kernel up and running or a checklist of things that need to be in place? Is there any way to debug the kernel when it won't boot?
So the kernel is booting but not turning the screen on. I've attached the last_kmsg.
This is a summary of the errors that I've found.
Code:
pm8xxx-regulator pm8xxx-regulator.5: Failed to find supply ext_5v
Failed to create debugfs directory
pm8xxx_vreg_probe: regulator_register failed: 8921_usb_otg, rc=-517
pm8xxx_vreg_probe: error for 8921_usb_otg, rc=-517
pm8xxx_vreg_probe: regulator_register failed: 8921_hdmi_mvs, rc=-517
pm8xxx_vreg_probe: error for 8921_hdmi_mvs, rc=-517
LED trigger bkl_trigger failed to register (-17)
fail to get slimbus logical address -6
pm_qos_param: network_latency setup failed
[BATT][BMS] r_sense=10,i_test=0,v[failure=2000
[SMD][PKT] smd_pkt_open: DATA5_CNTL open failed -19
smem_alloc failed ch=34
smem_alloc failed ch=35
...
binder: t->buffer binder_alloc_buf fail
binder: 157:544 transaction failed 29201, size 80-4
mdp4_mixer_blend_setup: Error: no bg_pipe at mixer=0
Warning: unable to open an initial console.
Code:
WARNING: at /scr1/cm/system/kernel/htã/msm8960/fs/proc/generic.c:493 proc_register+0x148/0x1a8()
proc_dir_entry '/proc/emmc' already rdgistered
WARNING: at /scr1/cm/system/kernel/htc/msm8960/arch/arm/mach-msm/clock.c:185 clk_enable+0x58/0x210()
dsi1_s_p_clk: Don't call enable on unprepared clocks
WARNING: at /scr1/cm/system/kernel/htc/msm8960/arch/arm/mach-msm/clock-local.c:313 __branch_disable_reg+0x120/0x138()
dsi1_byte_clk status stuck at 'on'
WARNING: at /scr1/cm/system/kernel/htc/msm8960/fs/sysfs/dir.c:368 sysfs_add_one+0x7c/0x9c()
sysfs: cannot create duplicate filename '/dev/char/10:1'
WARNING: at /scr1/cm/system/kernel/htc/msm8960/arch/arm/mach-msm/clock-local.c:313 __branch_disable_reg+0x120/0x138()
dsi1_byte_clk status stuck at 'on'

Requesting Repository Forks

If you wish to request omni forks a repository from AOSP, in order to implement a patch into omni, please post this request here. Eventually this will be carried out via jira (http://jira.omnirom.org)
When posting, please give the path to the repository, and a link to what you want to merge, or a description.
For example if you wish to cherry pick a patch into it, a link to the patch and brief description of the reason for the patch.
We'll then have that repository forked and made available on github and gerrit, permitting you to submit your change.
Before you request, please check on github to ensure it isn't already forked!
For example :
frameworks/base - Needing forked so I can introduce multi window functionality (link here to information)
hardware/broadcom/libbt - Mainly for board-specific configurations (link), but newer CM commits also look promising.
If new device bringups aren't planned yet, ignore the followings:
device/lge/p880 and kernel/lge/p880 - Device bringup (kernel has a non-standard naming at CM repo, it should be android_kernel_lge_x3 (x3 is the board name))
vendor/lge (maybe Omni should create one from scratch)
Adam77Root said:
hardware/broadcom/libbt - Mainly for board-specific configurations (link), but newer CM commits also look promising.
If new device bringups aren't planned yet, ignore the followings:
device/lge/p880 and kernel/lge/p880 - Device bringup (kernel has a non-standard naming at CM repo, it should be android_kernel_lge_x3 (x3 is the board name))
vendor/lge (maybe Omni should create one from scratch)
Click to expand...
Click to collapse
We do have a vendor/lge with just mako, although I'm not sure if its current location.
Vendor blob repos are a legal mess, which is why CM kept them at TheMuppets. We'll likely do something similar if we haven't already (I haven't synced since coming home.) Among other reasons to keep them separate is in the case of a DMCA takedown - usually that happens only to a single repo (see the HTC vendor repos earlier this year) but there's always the risk that damage might be more widespread.
android_external_clang
http://review.cyanogenmod.org/#/c/29799/2
Needed for building my msm8960 device (Motorola Photon Q, xt897c).
arrrghhh said:
android_external_clang
http://review.cyanogenmod.org/#/c/29799/2
Needed for building my msm8960 device (Motorola Photon Q, xt897c).
Click to expand...
Click to collapse
CM bootable recovery and some commits over system core
Black_Prince said:
CM bootable recovery and some commits over system core
Click to expand...
Click to collapse
No for CWM - We're working on forking TWRP in, but some fixes still need to be made to allow it to work on devices with unified recovery/boot image. (Probably one of the biggest holdups for the exynos 4210 family - Sonys with unified boot/recovery can at least use Dees_Troy's FOTAKernel trick).
Getting CWM to build in a tree requires hacks all over the tree in multiple repositories. TWRP is much more self-contained, but needs some tweaks to the build system in order to get it to build properly on a userdebug (as opposed to eng) build.
Entropy512 said:
No for CWM - We're working on forking TWRP in, but some fixes still need to be made to allow it to work on devices with unified recovery/boot image. (Probably one of the biggest holdups for the exynos 4210 family - Sonys with unified boot/recovery can at least use Dees_Troy's FOTAKernel trick).
Getting CWM to build in a tree requires hacks all over the tree in multiple repositories. TWRP is much more self-contained, but needs some tweaks to the build system in order to get it to build properly on a userdebug (as opposed to eng) build.
Click to expand...
Click to collapse
Hmm but until the twrp is ported should i test build for some galaxy devices like SG S2 note 1 with cwm ?
It will make me to push changes to git in device tree ... and will be easy to add support
Black_Prince said:
Hmm but until the twrp is ported should i test build for some galaxy devices like SG S2 note 1 with cwm ?
It will make me to push changes to git in device tree ... and will be easy to add support
Click to expand...
Click to collapse
I'll pull up a remote to use for bootable/recovery until we fork (unless plodey already forked it) from TWRP, won't be able to provide it until tonight.
However, right now, it will only build a working recovery if you do an eng build instead of userdebug. If Dees_Troy's talk at BABBQ is ever posted, that's what I was talking about when I trolled him at the end.
Something like:
Code:
. build/envsetup.sh && brunch custom_n7000-eng
or something like that.
Old
def WriteRawImage(self, mount_point, fn):
"""Write the given package file into the partition for the given
mount point."""
fstab = self.info["fstab"]
if fstab:
p = fstab[mount_point]
partition_type = common.PARTITION_TYPES[p.fs_type]
args = {'device': p.device, 'fn': fn}
if partition_type == "MTD":
self.script.append(
'write_raw_image(package_extract_file("%(fn)s"), "%(device)s");'
% args)
elif partition_type == "EMMC":
self.script.append(
'package_extract_file("%(fn)s", "%(device)s");' % args)
Requested
def WriteRawImage(self, mount_point, fn):
"""Write the given package file into the partition for the given
mount point."""
fstab = self.info["fstab"]
if fstab:
p = fstab[mount_point]
partition_type = common.PARTITION_TYPES[p.fs_type]
args = {'device': p.device, 'fn': fn}
if partition_type == "MTD":
self.script.append(
'package_extract_file("%(fn)s", "/tmp/boot.img");'
'write_raw_image("/tmp/boot.img", "%(device)s");' % args
% args)
elif partition_type == "EMMC":
self.script.append(
'package_extract_file("%(fn)s", "%(device)s");' % args)
elif partition_type == "BML":
self.script.append(
('assert(package_extract_file("%(fn)s", "/tmp/%(device)s.img"),\n'
' write_raw_image("/tmp/%(device)s.img", "%(device)s"),\n'
' delete("/tmp/%(device)s.img"));') % args)
else:
raise ValueError("don't know how to write \"%s\" partitions" % (p.fs_type,))
Flash error in write raw image ...
Also can u cherry pick these commits https://github.com/CyanogenMod/android_system_core/commits/cm-10.2/mkbootimg/unpackbootimg.c
My internal SD card isnt got recognsied , there must be some commits missing in vold ...
I dont even know it got formatted or what in flashing ...
All things working WIFI BLUTOOTH TETHERING CALL DATA MSG MMS OMNITORCH
Also u may have look over https://github.com/CyanogenMod/andr...mmit/f22626cdbecfe27c96f205710173458eab14e1a1
and https://github.com/CyanogenMod/andr...mmit/aee5f78ddec238cec016849acaf1d3007b8b1507
https://android.googlesource.com/platform/hardware/broadcom/libbt
Must haz patch:
https://github.com/CyanogenMod/andr...mmit/4028192a4fe8289bf9b7fb202a2bb2c0d85d98c3
//edit: xplod sorted it out already.
android_packages_apps_PackageInstaller
For
HALO and a feat which enables us to see version of the installed and gonna install app
I need this to make it work with my Samsung galaxy s4
I'm not sure if this is the correct thread, but the following two would be great for i9305 support
smdk4412-qcom-common -> needed for i9305 and t0lte (EDIT: I see this one has now been added)
Thanks!
Hey @pulser_g2,
wondering if i could have the following repositories added in for jf devices,
all features are fully functional with these repositories : branch: cm-10.2 for all
device_samsung_jf-common
android_device_samsung_jflteatt
android_kernel_samsung_jf
CyanogenMod/android_hardware_samsung
CyanogenMod/android_device_samsung_msm8960-common
CyanogenMod/android_device_samsung_qcom-common
@pulser_g2
I just talked to @maxwen and he told me i should post here the needed stuff:
I managed to fix the radio issues today on m7, but i need additionally these commits:
https://github.com/TheMuppets/proprietary_vendor_htc/commit/7bbbe83823525090e7d94c47b439c09a254b380f
https://github.com/TheMuppets/proprietary_vendor_htc/commit/19ed957678d13b489da78d704b27811030688078
https://github.com/TheMuppets/proprietary_vendor_htc/commit/51b006bc8f05757c7dd82361ce6d985e996af360
and please DO NOT merge this: https://github.com/TheMuppets/proprietary_vendor_htc/commit/2b86687a460030199fa42d49207957ce285c1a53
as its not needed and breaks build (I allready have everything in m7-common so no need for vendor)
Thanks in advance
@pulser_g2
we dont need to update anything, please forget my post above, i managed to get it working without all these commits and the right vendor
hardware/qcom/gps - Needing forked so I can build the needed GPS module into my Omnirom build.
The link to this repository is: https://github.com/CyanogenMod/android_hardware_qcom_gps/tree/cm-10.2
I hope it gets included, this saves me a ton of time pulling stuff from other repositories.
Greetings PsychoGame
Galaxy S I9000 (galaxysmtd)
@pulser_g2 Device repos are already forked. Kernel is missing: https://github.com/OmniGalaxyS/android_kernel_samsung_aries
It has android-4.3 and android-4.4 branches up.
Device rocking with Omni!
See you!
Fail
PsychoGame said:
hardware/qcom/gps - Needing forked so I can build the needed GPS module into my Omnirom build.
The link to this repository is: https://github.com/CyanogenMod/android_hardware_qcom_gps/tree/cm-10.2
I hope it gets included, this saves me a ton of time pulling stuff from other repositories.
Greetings PsychoGame
Click to expand...
Click to collapse
I also need android_hardware_qcom_gps (probably best from https://github.com/markcs/android_hardware_qcom_gps/tree/cm-11.0)

Building kernel from Xiaomi's source for cereus (probably, cactus too)

Since Xiaomi released source code for kernel, I tried to build it.
https://github.com/Dhoine/android_kernel_cereus
Current status of this - it compiles, boots, but unusable.
Bugs:
Broken bluetooth
Broken wifi
Soft-reboots after some time
Propably, more bugs that remained undiscovered because of reboots.
Tested with miui 9 on cereus 3/32.
--------
You can test builded kernel using this:
GDrive
Use Carliv image Kitchen to repack your rom's boot.img, then flash it via fastboot (UNLOCKED BOOTLOADER REQUIRED). To restore working state after testing, flash stock boot image again.
WARNING
Our kernel uses android regular boot.img format, not MTK.
---------
If you want to build this, any manual for building kernel will fit. I used google's android arm eabi 4.9 toolchain, our arch is arm, defconfig is cereus_defconfig.
For now, I don't have enough time to take a closer look at this (work, university exams), so, any help (last_kmsg, dmesg, pull requests) will be appreciated.
Wait seriously? Does that mean that i can buil LOS rom now? I have my UbuntuVM with whole LOS source code downloaded but i got stuck at no kernel found for cereus. So it might work now(Im extremely new to linux) I'll try to build the rom asap
TanRayCz said:
Wait seriously? Does that mean that i can buil LOS rom now? I have my UbuntuVM with whole LOS source code downloaded but i got stuck at no kernel found for cereus. So it might work now(Im extremely new to linux) I'll try to build the rom asap
Click to expand...
Click to collapse
This kernel for now won't really help with building los. I haven't find any device tree for our SoC (or close). MTK always requre a ton of patches to android sources. But i have reference MTK 9.0 android sources for this SoC - ALPS (can't share, it's probably illegal, but you can find them on 4pda.ru, if you want). It builds on almost unmodified reference device tree, but i haven't tested it on device. First, we need to make this kernel usable.
[email protected] said:
This kernel for now won't really help with building los. I haven't find any device tree for our SoC (or close). MTK always requre a ton of patches to android sources. But i have reference MTK 9.0 android sources for this SoC - ALPS (can't share, it's probably illegal, but you can find them on 4pda.ru, if you want). It builds on almost unmodified reference device tree, but i haven't tested it on device. First, we need to make this kernel usable.
Click to expand...
Click to collapse
This may not really help, but can you try that kernel again after upgrading to MIUI 10.2.4 ?
EDIT : See https://www.kimovil.com/en/list-smartphones-by-processor/mediatek-helio-p22-mt6762 for a list of devices with MT6762. Probably we can check out their trees?
EDIT 2 : It seems like our Redmi 6 is the only device with available kernel source in that list.
EDIT 3 : Try this?
minhducsun2002 said:
EDIT : See https://www.kimovil.com/en/list-smar...lio-p22-mt6762 for a list of devices with MT6762. Probably we can check out their trees?
EDIT 2 : It seems like our Redmi 6 is the only device with available kernel source in that list.
Click to expand...
Click to collapse
Maybe them exists, but I haven't found them.
minhducsun2002 said:
This may not really help, but can you try that kernel again after upgrading to MIUI 10.2.4 ?
---------------------
EDIT 3 : Try this?
Click to expand...
Click to collapse
I finally finished my university exams, so now I have some free time to play with it.
The kernel you link is just forked xiaomi sources merged to linux 4.9 kernel. It shouldn't be buildable at all, since there is the same problem in sources I "fixed" with this.
Probably, this too.
[email protected] said:
I finally finished my university exams, so now I have some free time to play with it.
The kernel you link is just forked xiaomi sources merged to linux 4.9 kernel. It shouldn't be buildable at all, since there is the same problem in sources I "fixed" with this.
Probably, this too.
Click to expand...
Click to collapse
[email protected] said:
Maybe them exists, but I haven't found them.
Click to expand...
Click to collapse
You're right, they're identical.
By the way, I couldn't find any implementation available for our Helio P22; the chipset itself is fairly new, thus not many devices have the source code available.
minhducsun2002 said:
This may not really help, but can you try that kernel again after upgrading to MIUI 10.2.4 ?
Click to expand...
Click to collapse
Ok, i've tested it on latest GS. It seems to work a way better. At least, it doesnt reboot after few seconds of usage. It makes things a lot easier.
Tested a few more things:
-sound - works
-camera (both photo and video) - works
- mobile data - works
- phone calls - work
- dual sim -works
- all sensors work
The only thing i was unable to test is gps. It didn't worked for me, but i was inside 9-floor building near the window to inner corner of building... So idk.
And usb otg - since i don't have adapder.
After this I can tell, that there are only 2 major bugs - wifi and bluetooth.
Maybe gps, fm radio and exfat too. This is modules loading problem, I think (though, there shouldn't be any modules, drivers are marked as built-in in config, but .ko files for them exist in /vendor/lib/modules)
[email protected] said:
Ok, i've tested it on latest GS. It seems to work a way better. At least, it doesnt reboot after few seconds of usage. It makes things a lot easier.
Tested a few more things:
-sound - works
-camera (both photo and video) - works
- mobile data - works
- phone calls - work
- dual sim -works
- all sensors work
The only thing i was unable to test is gps. It didn't worked for me, but i was inside 9-floor building near the window to inner corner of building... So idk.
And usb otg - since i don't have adapder.
After this I can tell, that there are only 2 major bugs - wifi and bluetooth.
Maybe gps, fm radio and exfat too. This is modules loading problem, I think (though, there shouldn't be any modules, drivers are marked as built-in in config, but .ko files for them exist in /vendor/lib/modules)
Click to expand...
Click to collapse
Yeah, Treble definitely makes things easier.
Nevertheless I'm trying to integrate those kernel modules into the compiled zImage - there's no modprobe in Android, sadly.
Adding modules support and disabling modules versions check in config didn't help.
I can't find any source files in kernel sources, from which these modules can be built. Maybe, they are built from separate platform code (they are placed in vendor, so...) Need to download ALPS (brrr, around 50 gb of tar.bz2 archives) to check it.
I've looked into reference mediatek 4.9 kernel sources and found this:
Code:
# Do build-in for Makefile checking
# export CONFIG_WLAN_DRV_BUILD_IN=y
ifeq ($(CONFIG_WLAN_DRV_BUILD_IN),y)
PATH_TO_WMT_DRV = vendor/mediatek/kernel_modules/connectivity/common
PATH_TO_WLAN_CHR_DRV = vendor/mediatek/kernel_modules/connectivity/wlan/adaptor
PATH_TO_WLAN_DRV = vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m
ABS_PATH_TO_WMT_DRV = $(srctree)/../$(PATH_TO_WMT_DRV)
ABS_PATH_TO_WLAN_CHR_DRV = $(srctree)/../$(PATH_TO_WLAN_CHR_DRV)
ABS_PATH_TO_WLAN_DRV = $(srctree)/../$(PATH_TO_WLAN_DRV)
# check wlan driver folder
ifeq (,$(wildcard $(ABS_PATH_TO_WMT_DRV)))
$(error $(ABS_PATH_TO_WMT_DRV) is not existed)
endif
ifeq (,$(wildcard $(ABS_PATH_TO_WLAN_CHR_DRV)))
$(error $(ABS_PATH_TO_WLAN_CHR_DRV) is not existed)
endif
ifeq (,$(wildcard $(ABS_PATH_TO_WLAN_DRV)))
$(error $(ABS_PATH_TO_WLAN_DRV) is not existed)
endif
$(warning symbolic link to $(PATH_TO_WMT_DRV))
$(warning symbolic link to $(PATH_TO_WLAN_CHR_DRV))
$(warning symbolic link to $(PATH_TO_WLAN_DRV))
$(shell unlink $(srctree)/$(src)/wmt_drv)
$(shell unlink $(srctree)/$(src)/wmt_chrdev_wifi)
$(shell unlink $(srctree)/$(src)/wlan_drv_gen4m)
$(shell ln -s $(ABS_PATH_TO_WMT_DRV) $(srctree)/$(src)/wmt_drv)
$(shell ln -s $(ABS_PATH_TO_WLAN_CHR_DRV) $(srctree)/$(src)/wmt_chrdev_wifi)
$(shell ln -s $(ABS_PATH_TO_WLAN_DRV) $(srctree)/$(src)/wlan_drv_gen4m)
# for gen4m options
export CONFIG_MTK_COMBO_WIFI_HIF=axi
export MTK_COMBO_CHIP=CONNAC
export WLAN_CHIP_ID=6765
export MTK_ANDROID_WMT=y
# Do build-in for xxx.c checking
subdir-ccflags-y += -D MTK_WCN_REMOVE_KERNEL_MODULE
subdir-ccflags-y += -D MTK_WCN_BUILT_IN_DRIVER
obj-y += wmt_drv/
obj-y += wmt_chrdev_wifi/
obj-y += wlan_drv_gen4m/
endif
No such code in xiaomi's source. And this prooves my words: these modules CAN BE BUILT IN and SOURCES FOR THEM ARE IN ALPS. I have to download this ton of ****...
-------
I tried to backpors drivers from 9.0 - no success. It compiles,but doesn't boot. I tried to hack modules loading - no success too.
[email protected] said:
Adding modules support and disabling modules versions check in config didn't help.
I can't find any source files in kernel sources, from which these modules can be built. Maybe, they are built from separate platform code (they are placed in vendor, so...) Need to download ALPS (brrr, around 50 gb of tar.bz2 archives) to check it.
Click to expand...
Click to collapse
Most of the time those binaries are not open-source (you probably know vendor blobs for Google devices are too, but that is a different story). Nevertheless I don't really get why kernel modules are placed in
Code:
/vendor
- after all, mobile devices don't have hot-plugging hardware that requires dynamic LKM loading, why do they separate them out?
I'll attempt to crawl the web for those sources while waiting for Mi Unlock to allow my device being unlocked (the waiting period sucks).
[email protected] said:
I've looked into reference mediatek 4.9 kernel sources and found this:
No such code in xiaomi's source. And this prooves my words: these modules CAN BE BUILT IN and SOURCES FOR THEM ARE IN ALPS. I have to download this ton of ****...
-------
I tried to backpors drivers from 9.0 - no success. It compiles,but doesn't boot. I tried to hack modules loading - no success too.
Click to expand...
Click to collapse
1. Backports? How?
2. In which file did you got those lines?
3. Indeed those modules' source are removed from our tree - if you have the link, I don't really mind having another 50GB occupied on my PC to get those source code.
minhducsun2002 said:
1. Backports? How?
2. Indeed those modules' source are removed from our tree - if you have the link, I don't really mind having another 50GB occupied on my PC to get those source code.
Because attached below is the existence of the modules. /shrug
Click to expand...
Click to collapse
I already said that i have leaked mtk alps 9.0 sources These modules have sources, they are not prebuilt. I managed to built in them, but kernel doesn't boot at all after that. And i can't take any logs because the system dies before adb init.
Ok, after one little, but very cruel hack modules are fixed. Enjoy testing the kernel.
https://drive.google.com/open?id=1Z3p2fAWOZFyp045QMNV6vhLZvj9ZZPSY
[email protected] said:
Ok, after one little, but very cruel hack modules are fixed. Enjoy testing the kernel.
Click to expand...
Click to collapse
does it work well?
Lonewolf_1210 said:
does it work well?
Click to expand...
Click to collapse
Users from 4pda reported it fully working.
---------------------
Soon will be build with usb network adapters support enabled (requested by romanxdream from 4pda).
P.S. I'm not adding everything requested to kernel. But this was only config modification.
-------
I don't check xda often, so there can be a huge delay in my responses.
[email protected] said:
Users from 4pda reported it fully working.
---------------------
Soon will be build with usb network adapters support enabled (requested by romanxdream from 4pda).
P.S. I'm not adding everything requested to kernel. But this was only config modification.
-------
I don't check xda often, so there can be a huge delay in my responses.
Click to expand...
Click to collapse
Great job then, hope for a custom rom coming soon
Ok, download link to all versions. I'll edit the first post later.
https://drive.google.com/open?id=1yEZRS8L8bPgkk58tT5Uv2b-vsLqk7aql
Should we make a telegram group for this?

Categories

Resources