Kexec for MS2? (Diagnosis needed) - Milestone 2 General

Alright, so I bought my Milestone II then realized what MOTO had done. What a shame.
So after looking around, I found Freemymoto.com. Droid X kexec module based off MS1 kexec code (look on google, the original is still available).
So this got me thinking and working. I got a development suite on to my MS2. (Debian chroot with Sid and GCC 4.2.1) Pulled the kernel sources from MOTO GPL and went to work. After a couple of mins, its clear the Droid X and MS2 kernel code bases are slightly different.
So after an hour of modifying the code for the MS2, I have been able to compile a kexec module and kexec-tools, insert the module and load the the "new" (from GPL sources) kernel in to the kernel space...
This is where I need some help/advise from the experts.
I get an /proc/atags not found. (not a huge deal just means I should not get bootargs, can work on that later with my setup) But when I go to hit the kexec -e to execute the new kernel, the usb disconnects and the screen freezes for 20 seconds or so. Then it takes me back to the moto bootloader and boots in to the standard kernel.
Bummer.
So any advice on catching the kernel panic and subsequent reboot in logs or serial? I'm not sure how to diagnose the problem. The problem compounds itself since I don't even know if I am producing a functional kernel.
I am pretty new at kernel hacking but amateur programming for years. Not to mention, I've only have had an android phone for about 2 months now.
Thanks
PizzaRoll

There there are not many (or not even a single) dev on this forum, you should take a look at the IRC of And-Developers: irc.freenode.net #milestone-modding
Scrylax_CZ (cant rly spell his name) hes a dev i believe
89% of them are MS1 modders, but they work on the MS2 aswell (just not that much) but still, they are good as i noticed, just try asking in their channel
PS: also visit and-developers.com

Thanks, I'll have a look.
Sent from my MotoA953 using XDA App

PizzaRoll,
I don't know if this will be of any help, but I think you can apply the 2ndinit + sh hijack technique to have some logs stored in /data. I was able to apply this on the Motorola Stock ROM, so I can Overclock and Undervolt my Milestone2 at boot time. The binaries from Milestone1 works quite well on my Milestone2, even the overclocking modules.
I was also trying to Port MIUI for Milestone2 and used the 2ndinit technique to be able to read the logcat after the system failed reboot.
What I've done:
- Installed Droid2 Bootstrap: to have custom recovery and to be able to boot into this recovery mode after the system crashes.
- Installed 2ndinit and sh hijack manually.
- Copied original logwrapper binary to mylogwrapper and modified the init.rc in /system/etc/rootfs. This was needed because Droid2 Bootstrapper conflicts with sh hijack technique.
- In init.rc, after mounting /data and after booting or not into clockwork recovery I added a line like this: exec /log-init.sh. Where log-init.sh just runs "/system/bin/logcat >> /data/logcat.log &"
If you need more detailed info I can provide that later. I will need to review my steps.
Also, I too am a developer skilled in C/C++ and linux, but I have no experience at all in kernel development. Also I an quite busy, but I may be able to provide some help

r2beta0 said:
PizzaRoll,
I don't know if this will be of any help, but I think you can apply the 2ndinit + sh hijack technique to have some logs stored in /data. I was able to apply this on the Motorola Stock ROM, so I can Overclock and Undervolt my Milestone2 at boot time. The binaries from Milestone1 works quite well on my Milestone2, even the overclocking modules.
I was also trying to Port MIUI for Milestone2 and used the 2ndinit technique to be able to read the logcat after the system failed reboot.
What I've done:
- Installed Droid2 Bootstrap: to have custom recovery and to be able to boot into this recovery mode after the system crashes.
- Installed 2ndinit and sh hijack manually.
- Copied original logwrapper binary to mylogwrapper and modified the init.rc in /system/etc/rootfs. This was needed because Droid2 Bootstrapper conflicts with sh hijack technique.
- In init.rc, after mounting /data and after booting or not into clockwork recovery I added a line like this: exec /log-init.sh. Where log-init.sh just runs "/system/bin/logcat >> /data/logcat.log &"
If you need more detailed info I can provide that later. I will need to review my steps.
Also, I too am a developer skilled in C/C++ and linux, but I have no experience at all in kernel development. Also I an quite busy, but I may be able to provide some help
Click to expand...
Click to collapse
would it be possible to port MIUI for the MS2? that would be awesome

Bigdaddy168 said:
would it be possible to port MIUI for the MS2? that would be awesome
Click to expand...
Click to collapse
Without the sources, I don't think so.
I was trying to Merge the Milestone1 MIUI version into the Milestone2 Stock ROM, but my efforts were not able to produce a stable version. It consisted into disassembling both frameworks and adding into MIUI's support for the Native methods required by motorola proprietary libs. I was able to boot into MIUI, but not for long. The system crashed a few moments after booting due to invalid calls to the graphics library. I was stuck at that point and gave up due to a lack of time. But the experience was good to increase my knowledge about android inner structure

Unfortunately, I haven't had much time this week to playground with 2ndboot and the sh hack. I like the idea. Im still working on what the problem is exactly.
The old saying is true. Defining your problem (root cause) is the most difficult part.
Sent from my MotoA953 using XDA App

oh rad, 2ndinit works on MS2? that's helpful to know

smacky_wolf said:
oh rad, 2ndinit works on MS2? that's helpful to know
Click to expand...
Click to collapse
Yeps, it works on mine. I'll take some time to write a guide from the scratch and post it here on XDA. I'm also trying to help santiemanuel to get it to work on his ROM, but I may be missing some detail.

r2beta0 said:
Yeps, it works on mine. I'll take some time to write a guide from the scratch and post it here on XDA. I'm also trying to help santiemanuel to get it to work on his ROM, but I may be missing some detail.
Click to expand...
Click to collapse
I just got the MS2 a couple days ago, so I'm really interested in custom ROMs for it, but I'm a total n00b when it comes to xda and custom ROMS, only having the experience of downloading and flashing ROMs for other phones in the past. With that said, I'd be VERY intersted in a guide for the MS2. Please let us know when its up! Thanks

PizzaRoll said:
Unfortunately, I haven't had much time this week to playground with 2ndboot and the sh hack. I like the idea. Im still working on what the problem is exactly.
The old saying is true. Defining your problem (root cause) is the most difficult part.
Sent from my MotoA953 using XDA App
Click to expand...
Click to collapse
I've just finished my guide on how to enable 2nd-init on MS2. You can check it out here. Maybe this can help you into defining the root cause of the problem, as you can add logcat and dmesg to custom init before calling the kexec. I store my logs at /data so I can read them on the next reboot (getting into clockwork recovery and being able to use adb shell).

Related

[Q] A call out to the Galaxy S ROM delevopers, help needed!

Well hello everyone.
I am an application development student from Belgium.
I am proficient in Java, VB.NET, some c/c++ and also PHP/JS/HTML/CSS
Anyways, my recent interest has been going out to creating custom roms for the galaxy S!
The problem now is though, I was able to find some guides and such, but most were incomplete, and for HTC(and other) devices.
I have no idea what is different between making a ROM for galaxy S or a ROM for an HTC device.
If anyone would like to link me to some good resources that can help me on my way, or would like to collaborate (and in the meanwhile teach me a bit) I would be more than happy! (I am open for collaboration as I am pretty proficient in Java and I'm always happy to code and learn more about coding!)
I think the question is really want you want to do!
Custom ROMs for Android are as simple as using recovery console to replace files on the system with your own versions.
ie. Replace the framework.apk which contains all theme images with your own modified one, which you can use to skin the device. Same for replacing other system apps.
Unfortunately, most of these apps are closed source, so modifying them is difficult. The stock android system has open source versions of most of them though, and you can modify those and build them, and then replace the ones on the device. I'm not entirely sure how to build them up though, but it probably isn't too hard.
Then there are custom kernels, which let you actually change the underlying linux system underneath android - Samsung has an open source version of the kernel available that you can compile, and then flash to your phone using Odin or other tools. Compiling the kernel is pretty tricky though.
Well i'm really talking about stuff like SamSet, MoDaCo, Doc's ROM and others.
I'm not saying I want to create a pro ROM in a day or anything, but i'd really love to learn more to get better (always looking for more stuff to put on the resume, I guess?!)
Thanks a lot,
Kenny
Bump for some help
(sorry for the double post but i'm really eager to learn)
I don't have time to give a detailed response right now. However you will want to read up on yaffs (file system) and odexing/deodexing ROMs.
Thank you I will definately do that,
I am following a guide now to start out creating custom ROMs for android, however it was written for Motorola Droid and I have no idea what you have to do different for a samsung galaxy s.
I am a good coder, even though I say so myself, with a lot of experience. I also have a lot of linux experience, you name it
Only the problem is the old, and much known "where do I get started?"
So if anyone can point me out in the right direction on that, tell me how/where you started out, I would appreciate it greatly!
Thanks!
Very sorry to bump again
I set up my environment in ubuntu today to get started (just gotta fix a few errors, didn't know android wouldn't compile on java 1.6, only on 1.5)
Anyways, still need some help here! thanks!
Again I am awefully sorry for the bump here but i'd really like some help.
Note that i'm not a newbie at coding whatsoever and i'm not unfamiliar with some hardcore java, c/c++ and other languages, I'm just having trouble getting started when it comes to modding an existing android release (there are tutorials on HTC and other devices but some methods do not apply to the galaxy S)
If you're trying to create a ROM from scratch then unfortunately you're out of luck at the moment. No one has really managed to do so yet. By "from scratch" I mean the Android Open Source Project (i.e. official Android git repository).
What you can do is grab an existing firmware. Extract the contents, de-odex the apks, modify them or add new apks, optionally you can also compile a custom SGS kernel using Samsung's kernel source. Then you can re-odex the ROM, pack it back up and distribute it.
There's no real "starting place" as such and you won't yet find any tutorials about how to create SGS ROMs. Just give it a go and see where you get.
Yes, I do mean creating a ROM from stock samsung firmware, of course.
So my next logical question would be now:
How do I go over extracting contents from the existing samsung firmware, de-odexing and so on?
Any links/guides/tips are greatly appreciated, as long as they are applicable to this cell phone and not totally crap, thanks!
Samsung uses rfs, I think you should know. There is a thread somewhere in this forum regarding extracting .rfs file. Understood you need Debian though.
For some readup, go search for a famous guy named JesusFreke. Tons of materials...
Hope that from here onwards, this can lead you on, and to find out more. Google is your friend too...
I'm afraid my biggest problems already occur in setting up the environment, so it's really the very beginning that gets me stuck, i'm sure coding would be a bikeride compared to setting up the environment for me (i'm no hero in linux,not at all, i'm afraid)
How the hell do I get from point A (being downloading the full source) to point B (starting to create a custom ROM?)
thanks
of course if anyone has the time, and wants to, you can PM me your msn or something, if anyone is up to it
Raykoid666 said:
I'm afraid my biggest problems already occur in setting up the environment, so it's really the very beginning that gets me stuck, i'm sure coding would be a bikeride compared to setting up the environment for me (i'm no hero in linux,not at all, i'm afraid)
How the hell do I get from point A (being downloading the full source) to point B (starting to create a custom ROM?)
thanks
of course if anyone has the time, and wants to, you can PM me your msn or something, if anyone is up to it
Click to expand...
Click to collapse
Agreed completely! Getting a full cross-compilation to Samsung's Android going is seriously difficult! There have been some promises for tutorials and guides for setting things up though, but none have appeared yet. Probably because it's hard!
Well thank you for agreeing with me on that.
I am really hoping for anyone that can help me out here, either on here or in private, and give some detailed instructions on how to get started.
Hell there is enough information on creating roms alread, deodexing, adding/removing apps etc etc etc... The real problem lies in setting everything up properly.
I think I have gotten to the point where I'm compiling the android source (without samsung specific files)
note i'm saying "i think i am compiling" because i'm hoping it won't error out on me again after an hour of compiling!
But once that is done... I have no idea where to go next, where to get the samsung specific files, or what to do with them whatsoever once i have them
thanks!
Android generic source won't actually help you much. Samsung has made a huge number of changes to it, and while it is all open source, backporting their changes to get your stock source running on the phone is a major undertaking. I believe cyanogenmod was actually working on this, but it seems without much success so far.
What the other rom makers you see are doing is taking a snapshot of a running rom, copying over all of the APKs and the files on a running device, and then tweaking those. ie. Opening up framework-res.apk and changing the image files inside.
The update.zip roms that are what most people are doing are really just using the Android recovery to replace files on the phone with their own versions. Since the underlying system is linux, and everything is a file, this actually works pretty well.
The kernel development effort is completely separate from the rest of the system though, and Samsung has provided the entire source tree that just has to be compiled. I'm a bit stumped myself on all the details of setting it up, but I have seen some threads on this forum about it, and it didn't seem too bad to set up. Apparently you shouldn't use the codesourcery toolchain though, or something. Not too clued up on it, sorry. Hopefully someone with the details can chime in, or give us a link to the old post on it (I'm failing to find it using the search function! )
Alright sounds good!
So these recovery files you are talking about (the contents of /system) how do i retrieve those from a base ROM such as JM7 or the likes after a clean flash?)
Raykoid666 said:
Alright sounds good!
So these recovery files you are talking about (the contents of /system) how do i retrieve those from a base ROM such as JM7 or the likes after a clean flash?)
Click to expand...
Click to collapse
Root your phone, zip them up onto the sdcard, and then copy them off.
There are probably better methods, but this works fine.
Also, with credits to Unhelpful, he has told me that the correct toolchain to be using is 'uClibc or eglibc toolchain with ct-ng'. I have no idea what to do with that yet, but it's a start.
RyanZA said:
Root your phone, zip them up onto the sdcard, and then copy them off.
There are probably better methods, but this works fine.
Also, with credits to Unhelpful, he has told me that the correct toolchain to be using is 'uClibc or eglibc toolchain with ct-ng'. I have no idea what to do with that yet, but it's a start.
Click to expand...
Click to collapse
You don't even need to root your phone to pull /system Ryan
adb pull /system <random folder>
is all you need ^^
Alright thank you, I managed to get all the /system files using abd pull /system
now next thing up would be de-odexing right, before I go editing stuff?
Now before I go de-odexing. Can anyone tell me what exactly de-odexing is and why I need it?
and what do I need to do to create an update.zip again?
thanks a lot all!
Tayutama said:
You don't even need to root your phone to pull /system Ryan
adb pull /system <random folder>
is all you need ^^
Click to expand...
Click to collapse
Haha cool, didn't know you could pull whole folders!
Raykoid666 said:
Alright thank you, I managed to get all the /system files using abd pull /system
now next thing up would be de-odexing right, before I go editing stuff?
Now before I go de-odexing. Can anyone tell me what exactly de-odexing is and why I need it?
and what do I need to do to create an update.zip again?
thanks a lot all!
Click to expand...
Click to collapse
The apk files in Android are odexed - that means they have a special index applied for dalvik that speeds them up somehow! I don't know how, I haven't checked how it actually works.
The important point is though:
odexed is faster, but you can't edit it because of signatures or something technical
deodexed means you can change it however you want
More useful info can be found from google - lots of it!
update.zip is easy - it's a zip file in a special format that can be understood by Android's recovery console. The easiest way to do it is to grab an existing update.zip and modify it as needed. Tayutama has millions of em around, so use his!
Then you need to sign it once you're finished with it so that the SGS will accept it. Samsung made a boo-boo and didn't disable the test keys for the 2.1 SGS firmwares. That makes it easy!
http://www.londatiga.net/it/how-to-sign-apk-zip-files/
Just use the test keys to sign it, and then copy it to /sdcard/update.zip and reboot into recovery and it'll work.

LolBoot xD SGS2 dualboot - NEW 12.12.11: Easy-Setup App v2.51

(I wasn't really sure if this might fit into "Development", so I put it here, maybe a mod will move it, if it's a dev topic )
Anyways, here we go, I DUALBOOTED two different, independant ROMs on the S2
Video of dualboot in action: http://www.youtube.com/watch?v=l9-V_6Ua_D0
** THIS IS NOT (YET) COMPATIBLE **
** WITH ICS (ANDROID 4.0.x) ROMS! **
-- this goes for custom ROMs as well as stock ROMs --
Icey Sammich compatibility will be added once Sammy released their ICS kernel sources.​
!!! There now is an app for more convinient and easy setup of the dualboot !!!
(04.11.2011) DualBoot setup app v2.00: http://forum.xda-developers.com/showpost.php?p=19049047&postcount=94
(12.12.2011) App has been updated to 2.51, lot's of good new stuff! >> Free Version -- Donate Version <<
Click to expand...
Click to collapse
First off:
This is only a little experiment I did like "c'mon, has to be possible" - this is NOT (at least yet) tweaked for usability and anything the like, just a humble experiment.
That said, don't flame me if things are rather complexicated to do this ATM.
Maybe I'll come up with a more userfriendly way of setting this up, maybe someone else does, maybe no one does.
Also now that I found a base on what to do, there might be different ways (more easy ones maybe) to set this up, I'll keep toying around with it.
But let's cut to the chase, shall we
So, how was this set up? I'll give a brief rundown of what I did:
I edited a few .rc files in the initramfs of the kernel to make it actually perform a full boot when recovery mode was triggered and to fire up recovery mode when in battery-charging mode.
I also edited a few mounts in the boot .rc for the 2nd OS (in "recovery" mode) to use different partitions for /system and /data, so that we'd end up with really independant installs.
What partitions did I missuse for that:
partition 12 (mostly unused, only when installing a stock ROM AFAIK) for /system - that's a neat choice IMO as p12 is 512MB in size, just as p9 where /system usually sits on
partition 7 (which is usually /cache) for /data
gives us only 100MB of user data space, but for now that's OK, as said, it's only an experiment on how such a thing could be done.
with the original partition for /cache "gone", I mounted a tmpfs for it.
So the OS still has a usable /cache
Then I set up the two OSes:
(dualboot kernel not yet flashed)
Launchprep part 1:
I made a CWM backup of my normal installation I was running (stock XXKG6 at the time).
I installed DevNull-Test AOSP as to it's instructions
Some su'ed voodoo via a terminal while having the 2nd OS (the DevNull AOSP one, in this case) installed - best done in recovery mode via ADB:
rm -Rf /cache/*
cp -Rp /data/* /cache/
dd if=/dev/block/mmcblk0p9 of=/dev/block/mmcblk0p12 bs=4096
That did "set up" the 2nd OS to where it's supposed to go.
Launchprep part 2:
Then, "advanced restore" of the backup made a few minutes earlier:
- boot
- system
- data
Reboot
At this point OS #1 is running again and OS #2 is sitting in hiding, prepared to roll - so, let's roll:
Flashed the modified "dualboot kernel" (via an App or Odin or magic, doesn't matter).
---> DONE <---
reached the point to where everything works as shown in the video.
As said above already, yes it needs some manual work to set it up, yes there's a lot of things that might not work, yes there are other/better ways to set it up.
It's only a humble experiment - lot's of space for improvement.
Maybe you like it - for those who do, I wanted to share this
Attached to this post you find the modified kernel I used, it's based on my v1.20 custom kernel (see sig) but with the above mentioned changes.
I've seen the video m8, this is totally different approach, ur giving this device a new dimension. love u "in a straight way" hahaa
there currently an app called Bootmanager which also handle up to quadruple booting. But sadly currently only support HTC phones.
http://www.appbrain.com/app/bootmanager/com.drx2.bootmanager
well, one can hope!
Thanks OP this is an awesome concept! Very happy to see you posted it with a video! and nice boot animation!
sunwee said:
there currently an app called Bootmanager which also handle up to quadruple booting. But sadly currently only support HTC phones.
Click to expand...
Click to collapse
Yeah, that's the thing.... that app is HTC only.... but we have Samsung S-II and want dualboot as well.
I'm already brainstorming on how to enhance the actual usability of this, i.e. flashing a 2nd OS directely to it's place instead of first installing it to the main system partition. But there is problems when /data is not mounted to the original partition, at least stock doesn't like it on initial boot.... well, well....
That is great. Going to use this for sure. This should be in development for sure.
Congratulations already.
Sent from my GT-I9100 using Tapatalk
This is impressive bro sure will use it
but i want to ask one thing
SD card needed for this or not ?
That would be really cool (and definitely should goes to original development). Does it work with CM7/MIUI + custom rom?
vikas776 said:
SD card needed for this or not ?
Click to expand...
Click to collapse
No, so far this completely works with all internal storage.
But I have a few ideas I have yet to try to get mounted from other places - like images in /sdcard for example (I *so* hope that'll work.... )
Hi
Does this kernel include any of the Hellcat kernel tweaks or are they work in progress.
Sent from my GT-I9100 using Tapatalk
Tricky103 said:
Does this kernel include any of the Hellcat kernel tweaks or are they work in progress.
Click to expand...
Click to collapse
I made this build based on my v1.20 custom kernel, so it has everthing that one has - plus the touchfix already
exactly what i was hoping for.
great job - pls continue your work
Hi i tried this with instanity rom last night. When I use the three buttons to boot it just sits there not booting. My guess is the kernel is not compatible. Unless I made a mistake somewhere.
Sent from my GT-I9100 using Tapatalk
Hm, yah, might be that the kernel isn't fully compatible with that ROM, what kernel does the ROM usually use?
Did you boot it up fully at least once before copying /data to /cache ?
Yes I did fully boot up. But his kernel didn't have advanced activated in recovery so I flashed your kernel and moved the cache okay. But it said /data not found when I ran the 2nd command line.
I will flash aosp later. I like that rom.
I am not sure what kernel nitr8 uses. I think it is his own, Insane.tar would you like it to see if they can work together.
Sent from my GT-I9100 using Tapatalk
Tricky103 said:
But it said /data not found when I ran the 2nd command line.
Click to expand...
Click to collapse
Hm, yeah, that sounds like something didn't work.... make sure you run those commands as root, i.e. "su" as very first command (I'll add that to the first post).
Give me a direct link to the ROM and I'll try it.
Make take a few days though as I'm away from my computer a lot because of work the next two days, but I'll try once time permits.
Well yeah, and this still is in highly experimental stage, if I (or someone else) should ever get this to more stable and reliable state, I'll make an easy to use installer/setup tool
But I got a few other ideas on setting it up I have to try first....
http://goo.gl/2uZCh
This is the complete rom. Only 47mb. I thought you would like the whole rom
Tricky103 said:
Hi
Does this kernel include any of the Hellcat kernel tweaks or are they work in progress.
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
May be someday WINDOWS Mo 7 and Android on our sweet beast
Hi
I tried again with Aosp Dev-null. I still get this error "cp: can't stat '/data/*': No such file or directory "
after running this command line " cp -Rp /data/* /cache/ "
Any Ideas ?
It still doesn't boot if I press 3 button it brings up the boot logo and then black screens until it boots to the 1st partition.
Thanks for the link, will download and try as soon as time permits.
Also, try this command sequence, I got an idea what the issue maybe might be, give it a shot:
Code:
su
rm -Rf /cache/*
busybox cp -Rp /data/* /cache/
dd if=/dev/block/mmcblk0p9 of=/dev/block/mmcblk0p12 bs=4096
(use "busybox cp" instead of plain "cp", maybe it helps)
And some update on my ongoing thoughts for those interested:
- got an idea on how to make a more easy to use App for prepping and setting up the dualboot environment
- managed to do a neat thing I didn't really think it would work: issued a "mount" command and the OS thought it was mounting a partition of the internal flash (/dev/block/mmcblk0p12 in this test, but was testing for later on actually doing it with p9 - you might see where I'm headed here ) but instead of the partition it actually mounted from an .img file! (loopback)
i.e. "mount /dev/block/mmcblk0p12 /somedir" actually mounted "/somepath/someimage.img" to "/somedir" instead of the partition from /dev/block/... (you just gotta love Linux and it's flexible way of handling things....)
NOW, imagine /dev/block/mmcblk0p9 (the partition carrying the system) and p10 (data) being (kinda) transparently mounted from an IMAGE FILE
I "only" have to find a way to sneak this in before init starts mounting stuff.
If there's a way to do THAT.... unlimited multiboot from OS images, anyone?
(so far this is kinda dreaming, but would be cool to get it working )

[Q] flashing script on MIUI

Kinda sucks for a first post but I had to do it someday. Been browsing this place for more than a year.
I'm on a Canadian carrier (Videotron) and many of you know that with some phones, like the MT4G (Panache) un less you use a sense ROM, you will have issues with the VM notification (MIUI and some others). The bug is simple if you look at the system info, the field ''my phone number'' is unknown instead of displaying your actual number. On the CM7 builds the issue is the same but it can be fixed manually. But some ROMS like MIUI, you are unable to get this damn thing to work.
I found a fix that I would love to try but unfortunately, I have no clue how to flash it. I went trough so many treads and pages and never read anything on how to fix it. there are tons on unanswered question.
The big question is : how can I flash this on MIUI? http:..review.cyanogenmod.com/#change,11318
It's a script to *fix* the VM notification. I tried installing the zip trough recovery but it failed. I tried running the java script trough ''Script Manager'' but it fails (Syntax error). Both attempts are from the SD card.
This is no script. This is a Java source file fix, which requires recompilation of telephony service, which lies inside the framework - so the whole framework needs to be recompiled.
You have 2 ways of achieving it:
1) Recompile MIUI source code.
2) Decompile MIUI framework, convert the fix code into smali format and merge into decompiled framework, recompile the framework.
ouch. Sounds prety much out of my league for now. Got a lot of reading to do before I'm able to do that lol.
You could open a bug to MIUI team, asking them to integrate support, and point them to CM git that you posted. I believe they'll integrate in sooner or later.
Thnx for the advice. I will give it a shot
Sent from my HTC Glacier using XDA

[GPS][Fix] Automate long term orbit data download

I have been looking into slow "cold-start" gps locks & in some peoples cases, complete lack of gps.
In testing, everything I've found so far, seems to be pointing at the lack of Broadcom's proprietary long term orbit data (lto.dat) used by the GPS Daemon on our devices...
These chips are in the a500/a200/a100 devices (101 & 501 devices use an ericsson GPS)
For the sake of not regurgitating a whole heap of info, you can read more about the lto.dat file in plenty of places across the web.
pacificwing recently bought this up in crypted's aGPS patch thread, some discussion on the subject starts around page 30.
The attached, recovery flashable zip will patch your system with a *workaround* to automate the download & update of lto.dat...
It is derived from past work in CyanogenMod for the aries (& other) devices.
It should be compatible with most ROM's, but may need adjusting if your busybox wget applet can't resolve dns. (see notes in the script)
What it does:
Installs the script "get-gps-lto" to /system/bin
Creates a service entry in the init.<boardname>.rc file which runs the script on a semi regular basis. (triggered by network connectivity)
The script is tunable by a number of variables, modify as you see fit.
Or, flash & forget... messages are sent to logcat so you can check up on it easily.
This zip has only been tested on a500, cm9, ics bootloader & cwm recovery.
Mileage may vary on other combinations, the zip patches your boot.img so please make a nandroid backup to be safe. (only need to restore /boot if there's a problem)
Installation problem? please let me know & provide a recovery.log so I can make adjustments to the zip if need be.
Standard disclaimers apply, flash at your own risk.
Oh nice I can build in my rom and the kernel before I release it.
Thanks in advance! I'll flash it in a bit!
civato said:
Oh nice I can build in my rom and the kernel before I release it.
Click to expand...
Click to collapse
Not a problem, you'll be sure to test it before releasing the rom I hope?
Anyone has this working yet? Btw, thank you waydownsouth
waydownsouth said:
Not a problem, you'll be sure to test it before releasing the rom I hope?
Click to expand...
Click to collapse
No
waydownsouth said:
The attached zip will patch your system with a *workaround* to automate the download & update of lto.dat...
It is derived from past work in CyanogenMod for the aries (& other) devices.
It should be compatible with most ROM's, but may need adjusting if your busybox wget applet can't resolve dns. (see notes in the script)
> Download here <
Click to expand...
Click to collapse
So that explains why I could never get my wget script to work....
Sent from my A500 using XDA Premium HD app
would it be possible to port this to another device? nice job by the way
waydownsouth said:
It should be compatible with most ROM's, but may need adjusting if your busybox wget applet can't resolve dns. (see notes in the script)
Click to expand...
Click to collapse
Other than hard coding the IP address (which worked for me by the way) is there a better solution to fixing the busybox DNS problem? I've read that putting a resolve.conf file in /system/etc that contains the Google DNS nameservers should work but I tried it and no luck.
Also, any reason you're not using the 30 day file rather than the 7 day? With the 30 day you wouldn't have to run the script all that often... Is the 30 day less accurate or something?
In any event, thanks.
Sent from my A500 using XDA Premium HD app
I build in my kernel for RF1
civato said:
No
Click to expand...
Click to collapse
azoller1 said:
would it be possible to port this to another device? nice job by the way
Click to expand...
Click to collapse
possible, yes... the installer zip will only work for the picasso, picasso_e & vangogh devices... I could add more devices to the installer if need be?
Only thing I could see being a problem is the where the service entries get written to in the init.<boardname>.rc
The device would need to use a boot.img for it's ramdisk too... Most Samsungs are very different in that regard
BakaNeko59 said:
Other than hard coding the IP address (which worked for me by the way) is there a better solution to fixing the busybox DNS problem? I've read that putting a resolve.conf file in /system/etc that contains the Google DNS nameservers should work but I tried it and no luck.
Also, any reason you're not using the 30 day file rather than the 7 day? With the 30 day you wouldn't have to run the script all that often... Is the 30 day less accurate or something?
Click to expand...
Click to collapse
Most statically compiled generic busyboxes will be like that on android, in the case of CyanogenMod, the busybox has been compiled against the android bionic lib & has a number of modifications for Android compatibility.
I stuck to the 7day data so it will stay a bit fresher... I figured that 60kb isn't much to download every few days.
It's easy enough to change those parameters in the script to point to the 30day
Also, haven't yet had time to test how effective the 30day data is after 20 + days... since I only made this yesterday.
What has been your experience?
waydownsouth said:
possible, yes... the installer zip will only work for the picasso, picasso_e & vangogh devices... I could add more devices to the installer if need be?
Only thing I could see being a problem is the where the service entries get written to in the init.<boardname>.rc
The device would need to use a boot.img for it's ramdisk too... Most Samsungs are very different in that regard
Most statically compiled generic busyboxes will be like that on android, in the case of CyanogenMod, the busybox has been compiled against the android bionic lib & has a number of modifications for Android compatibility.
I stuck to the 7day data so it will stay a bit fresher... I figured that 60kb isn't much to download every few days.
It's easy enough to change those parameters in the script to point to the 30day
Also, haven't yet had time to test how effective the 30day data is after 20 + days... since I only made this yesterday.
What has been your experience?
Click to expand...
Click to collapse
it actually is a samsung, the galaxy player 5.0 so you dont have to do it you could pm me a short tut.
i
This works great! Thanks!
waydownsouth said:
Most statically compiled generic busyboxes will be like that on android, in the case of CyanogenMod, the busybox has been compiled against the android bionic lib & has a number of modifications for Android compatibility.
I stuck to the 7day data so it will stay a bit fresher... I figured that 60kb isn't much to download every few days.
It's easy enough to change those parameters in the script to point to the 30day
Also, haven't yet had time to test how effective the 30day data is after 20 + days... since I only made this yesterday.
What has been your experience?
Click to expand...
Click to collapse
Well,since I've never gotten my sManager script method to work I've just been manually downloading the 30 day one every every now and then. I haven't actually been using my GPS much so I can't say how good it's been.
Is there a busybox installer on the market that you think would be better than the generic one? Or is it possible the CM one would work with Flexreaper?
Sent from my A500 using XDA Premium HD app
BakaNeko59 said:
Well,since I've never gotten my sManager script method to work I've just been manually downloading the 30 day one every every now and then. I haven't actually been using my GPS much so I can't say how good it's been.
Is there a busybox installer on the market that you think would be better than the generic one? Or is it possible the CM one would work with Flexreaper?
Sent from my A500 using XDA Premium HD app
Click to expand...
Click to collapse
I build IT in flexreaper RF1 and the kernel of RF1. Release maybe tomorrow.
BakaNeko59 said:
Is there a busybox installer on the market that you think would be better than the generic one? Or is it possible the CM one would work with Flexreaper?
Click to expand...
Click to collapse
I think all the busybox installers have generic, compiled for arm versions, they will likely have the same problem.
The cm/bionic one is dynamically linked, so depends on some libs in the rom. You could compile a static version against the android source (or ndk), but probably won't work on different versions of android.
Other option, there are real wget binaries compiled for android floating about which aren't neutered like the busybox version... they have no problems resolving dns.
delete the busybox wget symlink & drop in the binary...
waydownsouth said:
I think all the busybox installers have generic, compiled for arm versions, they will likely have the same problem.
The cm/bionic one is dynamically linked, so depends on some libs in the rom. You could compile a static version against the android source (or ndk), but probably won't work on different versions of android.
Other option, there are real wget binaries compiled for android floating about which aren't neutered like the busybox version... they have no problems resolving dns.
delete the busybox wget symlink & drop in the binary...
Click to expand...
Click to collapse
Well, in my 53 years of existence I've grown lazy. I think I'll just use your solution and stop worrying about my own since yours works like a charm.
Sent from my A500 using XDA Premium HD app
I think that gpsfix needs some more fixing comparing with manually downloading lto.dat and copying it at system/gpsconfig file..lr data/gps file..........
mine wouldn't find location at all before on cm9 but with this, after initial long lock, other locks only took ~5 secs. thanks!
drharisis said:
I think that gpsfix needs some more fixing comparing with manually downloading lto.dat and copying it at system/gpsconfig file..lr data/gps file..........
Click to expand...
Click to collapse
This downloads the lto.dat file to the default location /data/gps/
If your gpsconfig.xml file has been modified to point to /system rather than /data, then it won't work.
You could modify the script to point to /system, but, you would also need to include code to mount /system rw before attempting to update.
I think that's what your post was about?

My setup with Ubuntu and a custom permissive Kernel

Hey everyone. I bought this device specifically because I do a lot of work on linux in command line world and I though it would be the perfect device when combined with the Logitech Pro keyboard and Complete Linux Installer (it's an app on Google Play). It turned out to be quite a bit of work getting everything working because of Knox and SELinux. Eventually I got a custom kernel working that allows me to toggle SELinux between permissive and enforcing.
I attached an Odin flashable tar that works on the SM-P900 (wifi version). I am on the North American version, so I have no idea whether it will work in other regions. If you flash this kernel then there are a few things you need to know:
I'm assuming you already have root on your device.
When you boot it will still be in "Enforcing" mode. This change simply allows you to use the "setenforce" terminal command or any of the apps on Google Play that do this for you.
You might experience some wifi weirdness after you flash the kernel. You just need to open up /system/build.prop and change ro.securestorage.support from true to false and then reboot to resolve the issue.
If you have a different version of the device or want to compile it yourself for any reason I wrote an article describing how I compiled it here:
http://graemehill.ca/compiling-permissive-android-kernel/
I also did a few other things to fix the keyboard and get linux running properly, so if you're interested in that I described my setup in more detail here:
http://graemehill.ca/turning-a-galaxy-note-pro-into-a-linux-laptop/
Thank you for this!
Sent from my SM-P900 using Tapatalk
trying to build kernel
I'm trying to follow your guide to compile a kernel from source. I have installed (on my Win 8.1_64 PC) Android SDK/NDK. GnuWin32, JavaJRE, and downloaded SM-P900 kernel source.
I'm getting errors at "Apply Kernel Config" step.
here's the output: http://pastebin.com/yFqDrNY8
Thanks for your help
Don :good:
dodo99x said:
I'm trying to follow your guide to compile a kernel from source. I have installed (on my Win 8.1_64 PC) Android SDK/NDK. GnuWin32, JavaJRE, and downloaded SM-P900 kernel source.
I'm getting errors at "Apply Kernel Config" step.
here's the output: http://pastebin.com/yFqDrNY8
Thanks for your help
Don :good:
Click to expand...
Click to collapse
It looks like you're in Windows. To my knowledge it is not possible to compile a Linux kernel in windows. I would recommend downloading virtual box and installing some Linux distro in there. This is what I was talking about in the "environment" section at the top of the article.
For android development I find that you need access to a lot of tools where some are only available on Windows and others are only available on Linux so a Windows PC with a Linux VM is ideal in my opinion.
Oh ok, no problem. I just misread the guide. I've setup a build environment in a vm before to compile aosp for my Nexus 10. Shouldn't be too hard to do it again. I recently rebuilt my pc so the vm I had got nuked.
Sent from my SM-P900 using Tapatalk
ok I got my Ubuntu VM up and running using this guide
http://forum.xda-developers.com/showpost.php?p=50748836&postcount=25
installed android NDK to ~android/NDK, and unzipped the kernel source to ~android/kernel
followed your guide to build a SELinux permissive kernel but i'm getting some errors when trying to compile. here's the output:
http://pastebin.com/Npdu7J5h
EDIT: retried doing the EXPORT command and now it seems to be compiling
dodo99x said:
EDIT: retried doing the EXPORT command and now it seems to be compiling
Click to expand...
Click to collapse
When you export a variable in the terminal it only exists for that one session, so if you open a new terminal instance you need to run the command again. If you want to set it permanently normally you can just put the export command into ~/.bashrc
Oh I see. I'll give that a try. I was able to create a new boot.img following the rest of your guide. I have yet to try flashing it though. Will have to find some info about all the kernel options that can be set. Hopefully be able to integrate HMP to get all eight cores running at the same time.
Sent from my SM-P900 using Tapatalk
Cool, let us know how that goes. I wonder how much it would affect battery life.
Graeme H said:
Hey everyone. I bought this device specifically because I do a lot of work on linux in command line world and I though it would be the perfect device when combined with the Logitech Pro keyboard and Complete Linux Installer (it's an app on Google Play). It turned out to be quite a bit of work getting everything working because of Knox and SELinux. Eventually I got a custom kernel working that allows me to toggle SELinux between permissive and enforcing.
I attached an Odin flashable tar that works on the SM-P900 (wifi version). I am on the North American version, so I have no idea whether it will work in other regions. If you flash this kernel then there are a few things you need to know:
I'm assuming you already have root on your device.
When you boot it will still be in "Enforcing" mode. This change simply allows you to use the "setenforce" terminal command or any of the apps on Google Play that do this for you.
You might experience some wifi weirdness after you flash the kernel. You just need to open up /system/build.prop and change ro.securestorage.support from true to false and then reboot to resolve the issue.
If you have a different version of the device or want to compile it yourself for any reason I wrote an article describing how I compiled it here:
http://graemehill.ca/compiling-permissive-android-kernel/
I also did a few other things to fix the keyboard and get linux running properly, so if you're interested in that I described my setup in more detail here:
http://graemehill.ca/turning-a-galaxy-note-pro-into-a-linux-laptop/
Click to expand...
Click to collapse
I tried to install this using VBox Odin and I couldnt get it to work. Tried using BOOTLOADER and also PDA. Not sure the correct one but neither worked for me. Also, Moblie ODin hasnt yet worked but when it does, things will be much easier for me at least.
I have a newly rooted SM-900. I will have to find time someday to compile the kernel against what I have. Must be a slightly newer version than the one you posted. That is only thing I can think since I just got my 12.2. Thanks for the detailed info.
Camera?
Hey, thanks for the great kernel. It's working as expected to enable permissive mode, but I'm having one issue with it. When I use your kernel, the camera is disabled (says something like "Camera Failed"), and it won't work even when trying different software besides stock, like Google Camera. Anyway, clearing cache, etc. doesn't do anything, but the camera works again when I flash the stock kernel. Is this related to permissive mode or something else with the settings?
aarstar said:
Hey, thanks for the great kernel. It's working as expected to enable permissive mode, but I'm having one issue with it. When I use your kernel, the camera is disabled (says something like "Camera Failed"), and it won't work even when trying different software besides stock, like Google Camera. Anyway, clearing cache, etc. doesn't do anything, but the camera works again when I flash the stock kernel. Is this related to permissive mode or something else with the settings?
Click to expand...
Click to collapse
The camera fails for me too. I dumped a logcat and isolated the issue here:
W/ActivityManager( 2746): Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
V/ApplicationPolicy( 2746): isApplicationStateBlocked userId 0 pkgname com.google.android.GoogleCamera
But... the camera is not a huge deal. It did, however, break wifi. I did not get a logcat of that yet, but I would assume it is also a permission issue.
Wifi works for me using the fix mentioned in the OP. Also, thanks for looking into the camera issue. I agree it's not a big deal, and it's easily fixed by flashing the stock kernel, until someone figures out a proper fix.
aarstar said:
Wifi works for me using the fix mentioned in the OP. Also, thanks for looking into the camera issue. I agree it's not a big deal, and it's easily fixed by flashing the stock kernel, until someone figures out a proper fix.
Click to expand...
Click to collapse
Wow, I totally missed that entire line in the OP... You literally just made my whole day. I fought this all day long, desperate to get ubuntu working. Thank you for pointing that out.
I get "xt_mark.h" is missing (no such file or directory) error. Any idea why that may be?
I'm using the source for p900 international hoping that I may sidestep the camera issue that way (by enabling permissive to the international kernel I mean), but as it stands it does not compile.
I've googled it but until now it was/is to no avail...
Graeme H said:
Hey everyone. I bought this device specifically because I do a lot of work on linux in command line world and I though it would be the perfect device when combined with the Logitech Pro keyboard and Complete Linux Installer (it's an app on Google Play).
Click to expand...
Click to collapse
Hey Graeme H,
we both have the same intention. I am downloading the international Kernel at the moment and will compile it again for you guys. The download takes a little longer as I am at vacations.
I am going this route: doviak.net/debian-kit/debian-kit_p00.html . In the future I would like to have arch linux running on this device but a customized debian would be okay for the beginning, too.
Eventually I will try to use framebuffer instead of vnc or something like that. I would love to use sublime-text and dwm on that device with that resolution
Good luck guys. I will try to update.
Edit: hehe I have dwm in front of me now and the resolution is so high that I am barely able to read
Compiled the kernel and flashed in on my device but my camera is still not working. Maybe we need to edit the config:
# Camera sensor devices
#
# CONFIG_VIDEO_OV7670 is not set
# CONFIG_VIDEO_VS6624 is not set
# CONFIG_VIDEO_MT9M032 is not set
# CONFIG_VIDEO_MT9P031 is not set
# CONFIG_VIDEO_MT9T001 is not set
# CONFIG_VIDEO_MT9V011 is not set
# CONFIG_VIDEO_MT9V032 is not set
# CONFIG_VIDEO_TCM825X is not set
# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_NOON010PC30 is not set
CONFIG_VIDEO_S5K6B2=y
# CONFIG_S5K6B2_CSI_C is not set
CONFIG_S5K6B2_CSI_D=y
CONFIG_S5K6B2_POSITION_FRONT=y
# CONFIG_S5K6B2_POSITION_REAR is not set
CONFIG_VISION_MODE=y
# CONFIG_VIDEO_M5MOLS is not set
# CONFIG_VIDEO_S5K6AA is not set
Click to expand...
Click to collapse
Rather than each people compiles its kernel, could someone put a link to download the international kernel compiled? I think this would allow more people to get this kernel. Thank
PHP:
smylion said:
Rather than each people compiles its kernel, could someone put a link to download the international kernel compiled? I think this would allow more people to get this kernel. Thank
Click to expand...
Click to collapse
Compiled from Kitkat source. [ur#l]erhan.es/upload/sm-p900-permissive-intl.tar[/url] (odin)
Thank you but the link does not work
smylion said:
Thank you but the link does not work
Click to expand...
Click to collapse
Sorry, it is erhan.es/upload/sm-p900-intl-permissive.tar

Categories

Resources