yashsingh1/xdaforums huggingface dataset:
[Droid 2 Android Development] Jewremy:
Uploading it to Dropbox now.
[Droid 2 Android Development] wsfanatic:
Multiupload link:

http://www.multiupload.com/621EJ15TWQ
[Droid 2 Android Development] Seanydizzley:
This is good news! Has anyone gotten it to boot up? I'm at work and won't be able to SBF if anything were to go wrong.
[Droid 2 Android Development] Jewremy:
http://dl.dropbox.com/u/3821270/miui-d2-alpha3-signed.zip

Failed on chmod/chown of system/bin/busybox, line 27. Going to attempt to fix the .zip and flash again. Hopefully didn't brick.

EDIT: Looks like it was just named busybox2 instead of busybox. Good news is I avoided a brick.

EDIT2: Failed on line 28, busybox2 doesn't exist. What the hell?
[Droid 2 Android Development] ljbaumer:
Multiupload downloading now......
[Droid 2 Android Development] Jewremy:
It won't install. See above.

Busybox and busybox2 are the same, right? Just a renamed file? I've never heard of busybox2...Just copied the busybox2 in /system/bin to /system/bin/busybox
[Droid 2 Android Development] Jewremy:
Don't mean to spam, but booting it now...

Stuck on the moto logo, it seems.

Yup. Frick. Stuck.
[Droid 2 Android Development] Phoible:
Is this using the stock Droid 2 kernel, or another kernel? I thought that the MIUI ROM required a custom kernel to function? The bootloader on the D2 is keyed to the kernel signature, so you can't run a custom kernel unless you figure out a way to work around that.
[Droid 2 Android Development] ljbaumer:
Ok here are the answers to a few questions and problems you guys are having.

1) there are ways to work around the kernel problem, using the 2nd_init hack you can sorta cheat to make it work, I don't know a lot about the hack I just know that if you use it correctly you can run any android based operating system on almost any android phone. for example we could run sense or touchwiz

2) The reason this rom is not working at the moment is because the meta-inf folder is not arranged correctly so it cannot flash in the right way. I am going to help the developer arrange it in the right way so that droid 2 and droid x's can flash it.

3) Yes this is going to be an amazing rom

4) Yes you should click the thanks button on this post ;)

Thanks,

ljbaumer
[Droid 2 Android Development] rusty815:
is there any way we can get this to work on the d2g? im not much of an android developer, i did a lot of developing for linux though, so im not that new to this, i can provide any information or help that i can to get this to work.
[Droid 2 Android Development] jw4duke:
getting it to work on this is a good start

:D
[Droid 2 Android Development] ljbaumer:
Well, once I finish the meta-inf folder (which I will start once I get home later today) and we start sorting out bugs you could start a d2g port.... I don't really know what's different between the d2 and d2g in terms of rom making but if someone could write up a list of things that are different between the two phones then I might be able to make a port.
[Droid 2 Android Development] jw4duke:
not trying to spam or anything but on a scale to 1-10 how hard is it to port a rom?

i would really like to figure out the basics of porting
[Droid 2 Android Development] ljbaumer:
You don't have to say "not trying to spam or anything" before each one of your posts lol ;)

It is hard to port a rom between 2 phones that have different kernels or when you have to port it to a phone with a locked bootloader, porting a rom from the d2 to dx is pretty simple and i'm not sure about d2 to d2g but it would be easier then nexus one to d2 or something like that.

I just got home right now so i'll probably get started on a fix for this rom in a few minutes.
[Droid 2 Android Development] papi92:
This is amazing.
[Droid 2 Android Development] ljbaumer:
Ok so quick update. I think I fixed it all except my build makes you have to sbf....

the meta-inf should be perfect so I think there may be a problem with the system or something.

Anyways if someone could look over my build and tell me what they think is wrong that would be great.

Here is the link: http://www.multiupload.com/RGI5UV6M0B

DO NOT FLASH THE ZIP FILE!!!! IT WILL BRICK YOUR PHONE!!! I THINK I BRICKED MY PHONE

Did you get it to work?
[Droid 2 Android Development] papi92:
Nope i mean the idea.
[Droid 2 Android Development] whezzel:
i get an error saying

Copying files...

E:can't chown/mod /system/bin/busybox

(no such file or directory)

E:Failure at line 27:

set_perm 0 0 06755 SYSTEM:bin/busybox

Installation aborted
[Droid 2 Android Development] cspanick:
I will love you if you can get this to work!!
[Droid 2 Android Development] Seanydizzley:
Does anyone know how long was the OP working on this before they brought it to the public? Seems pretty well produced for just throwing it out there like that as a first port. I'd imagine that had to have a lot of downtime and research? Then again I don't know the first thing about ports.

Either way. Everyone working on this, keep it up. Progress appears to be moving rather fast!
[Droid 2 Android Development] ljbaumer:
THANK YOU SOOOOO MUCH!!!!

If this is what I think it is then we can fix this pretty easily!!!

That means there is an error with line 27 on the updater-script.

I'll try and fix this tonight but if not I will try it tomorrow, I am trying to un-brick my phone right now but ATM nothing is working, not even sbf's. I may have to use some secret commands and run an update.zip.....

Oh and also we have been working on this port for maybe 2 weeks or so before it went public, we didn't do any testing though which is why we are running into these problems.

Thanks,

ljbaumer
[Droid 2 Android Development] Jewremy:
Easiest way to unbrick a D2 is to use Linux. PM me if you need instruction. There's a thread somewhere in this forum that has what you need.
[Droid 2 Android Development] whezzel:
i went into the zip file and renamed the busybox binary file from busybox2 to busybox and now i get the same error except it says error at line 28 instead of 27

ps. hope we can get this working. havent had my phone for the past 4 hours cuz of sbfing and what not. good thing i dont really need my phone right now though
[Droid 2 Android Development] casacristo:
That is a good question...

There are several considerations

1) HDPI - High DPI (dots per inch - a measure of screen pixel density)

MDPI - Medium DPI

If the rom to be ported is from a HDPI device and you want to port it to a MDPI device (generally older phones) then all the graphics need to be rescaled (so it is very, very time consuming)

2) source code or no source code

If you have no source code for the rom (as it is the case with MIUI) then you need binaries for the same processor architecture or you will at best get lots of FCs (hence I chose to port from Droid1 to Droid2 to start with)

3) Kernel porting can be a nightmare to debug
[Droid 2 Android Development] Jewremy:
Go look at my post a few pages back. Already did that, still can't get it to boot. I think busybody and busybox2 are the same thing.
[Droid 2 Android Development] casacristo:
Ok, found the bug

line 27 of the script should be:

set_perm 0 0 06755 SYSTEM:xbin/busybox

instead of

set_perm 0 0 06755 SYSTEM:bin/busybox

(line 28 should still be

set_perm 0 0 06755 SYSTEM:bin/busybox2

)

by the way guys, I encourage you to give donations so I can get a droid2 as I would obviously be able to do a much better and faster job!

Of course if you have a droid2 or droid 2g phone to donate even if it is full of scratches or has a cracked screen it would still help tremendously!
[Droid 2 Android Development] whezzel:
i just got an installation complete message. lets see if it boots
[Droid 2 Android Development] casacristo:
D2G is next on the pipeline

In short first you grab unyaffs and go and extract system.img from the donor rom (for the d2g I would suggest a millestone1 donor rom)

use vi to look at /system/bin/sh and note the name of the second script it calls

check that one too

you will have to do the same on a working modern d2g system.img

so if you know how to unpack the system.img nandroid with unyaffs, look at

> the "/system/bin/sh" and follow the link.

> there is a sh.bin and a sh.sh script and to different /system/sbin/sh and

> /system/sbin2/sh you need to use too.

> the whole trick is that the first sh bind mount the different /system/sbin2

> folder as /system/sbin so it see the real sh at next use..
[Droid 2 Android Development] whezzel:
didnt boot. stuck at m logo. gotta sbf again :( could u by anychance upload a zip with the updated script and everything in it so i can see if it works. for some reason i cant edit it on my comp. its odd school and breaking :(
[Droid 2 Android Development] casacristo:
not a good idea to rename busybox2, a few miui scripts call it later on...

there is xbin/busybox

and bin/busybox2

Just edit line 27... to reflex xbin/busybox
[Droid 2 Android Development] casacristo:
Where did you get your updater-script from?

It has for example a line:

set_perm_recursive(0, 0, 0755, 0755, "/system/xbin/overclock.sh");

but xbin/overclock.sh does not exist in this rom
[Droid 2 Android Development] whezzel:
thanks. that helps. i dont no to much about developing or anything like that. could u send me the updated script. i can edit mine for some reason
[Droid 2 Android Development] casacristo:
alpha4 ready, see the first post for the download link

(You should not need to edit update-script in alpha4, already done that!)
[Droid 2 Android Development] whezzel:
will try as soon as i get my new phone later today. my battery died during an sbf so now i cant charge it or anything :(
[Droid 2 Android Development] miketoasty:
Tried the alpha 4 and got stuck at the M logo. SBF fixed it but still no luck booting up.
[Droid 2 Android Development] casacristo:
to debug the error (at this stage)

type adb logcat

(from a terminal)

and send me the output (it will consists of lots of text)
[Droid 2 Android Development] miketoasty:
Tried but all it said was -Waiting for phone-. Any ideas?
[Droid 2 Android Development] casacristo:
apply the following patch (should enable debugging)

http://www.ziddu.com/download/14227752/debug-signed.zip.html

try the following things:

1) check the content of /sdcard/clockworkmod/recovery.log

2) adb -d logcat

3) db -s ? bugreport

Get me the resulting output logs... (under /sdcard/clockworkmod/ )
[Droid 2 Android Development] miketoasty:
Checked the recovery.log and only found things from Februaryish. Nothing referring to MIUI either.
[Droid 2 Android Development] casacristo:
Please follow the steps on the first post to gather debug logs
[Droid 2 Android Development] ljbaumer:
Hey I got my phone stuck on the moto logo also with my version which I posted up and said not to flash.... but I can't sbf because my phone ran out of battery and I can't charge it because it is stuck on the moto logo.

I found a way to get it to the backup android recovery and I could flash an update.zip through that but I can't find a working update.zip file to flash.... does anyone know of a file I could flash?

NOTE: I used the fission updater-script on my version. I doubted that it would work but I thought that I would give it a try...

Also I think the reason it doesn't b00t (your version) is because there isn't an update-binary file which is included in all other roms for the D2 and DX.

Just download any other rom for the D2 and you can see that it is included in the meta-inf folder.
[Droid 2 Android Development] jj702561:
lol

thats why i invested in one of these http://www.cellphoneshop.net/a855charger.html
[Droid 2 Android Development] casacristo:
You could edit the updater-script in your version to make sure all the files you refer to actually exist in the rom (as I pointed out to you there was a reference there to a non-existing overclock.sh, there might be others)

And then try to flash your own rom (and let us know how it works)
[Droid 2 Android Development] ljbaumer:
Whatever JJ, be a showoff then :P

lol jk, I should get one of those...

I am horrible at editing the updater script lol, I never know what to edit. Feel free to edit it yourself and then by the time that is done I'l probably have fixed my phone (hopefully).
[Droid 2 Android Development] jw4duke:
does anyone else get stuck on bootlogo after install???
[Droid 2 Android Development] ljbaumer:
Everyone else does.... have you read anything in the thread? Learn to read dude.
[Droid 2 Android Development] JonandRoid:
Well this is great news and thank you so much developers for helping to get this rom up and running and trying to diagnose what's wrong. Id like to help but I don't really feel like going through the hastle of sbfing and re applying my current rom but I am very excited to see what will come from this and once again thanks for an exciting new rom like no others from the droid 2 rom family. Like fission when it first came out, I donated towards the cause of awesome development and will throw a few bucks your way if you can get this up and running, but right now, honestly its not looking too likely at the moment BUT I have hope and trust in the developers to solve this one, hopefully :)..thanks again
[Droid 2 Android Development] ljbaumer:
Well I wish I could do some more work on this except it seriously f'ed up my phone so I think I am going on temporary retirement from this project.
[Droid 2 Android Development] jamezelle:
ill take a look at this when i get home.....
[Droid 2 Android Development] tbaker077:
Maybe we can ask the DeFused team for some help if they already aren't? So, does this mean we get a full 2.3.x rom and an unlocked boot loader or will our boot loader still be locked?
[Droid 2 Android Development] casacristo:
They are pretty similar...

The d2g has a sim card slot and support GSM as well as CDMA (so it works in Europe as well as in the states)

If somebody gives me a system.img backup of ideally the same rom, (one for the d2g and one for the d2) then I can check what files are actually different and come up with a patch so when the d2 image eventually works it can work as well for the d2g (applying the patch)
[Droid 2 Android Development] zibrah3ed:
Before you put too much effort into making a patch script to make the usable version of this rom work on the D2G look at this thread http://www.droidforums.net/forum/get-r-done/124823-rom-tools-team-get-r-done-d2g-rom-er-tool-tool-convert-d2-roms-use-d2g.html

Alas all of the talk of getting this running on the D2G is jumping the gun since it does not boot yet on the D2.
[Droid 2 Android Development] casacristo:
Thanks, indeed it would have been re-inventing the wheel.

It seems that unless we find more info on this 2nd_init hack for the droid2 or somebody can get me adb logcat logs; we are stuck
[Droid 2 Android Development] ljbaumer:
I just sent you an email with a ****load of info on the 2nd_init hack.

Also once I fix up my phone I can get you a logcat, the problem is that logcat doesn't work unless you get to the bootanimation at least....
[Droid 2 Android Development] manchucka:
Exciting stuff, indeed. Might I suggest that in the future such preliminary concerns be worked out before announcing the ROM's availability?

I will certainly donate when appropriate. On a related note: I find it poor form to announce that one is accepting donations before demonstrating good faith and competence. By all means ask for donations once you have established these, but not before you have done so.

Best of luck! We're behind you and willing to offer our financial support for your efforts.

Sent from my mind using magic.
[Droid 2 Android Development] ljbaumer:
1) The developer thought the rom would work right when he released it, I did not do any development on this until it was released but I talked to the developer right around the time he started work on this. So he had no idea that there would be a ton of bugs and that the major thing didn't really work, how could he? He doesn't have a D2.

2) I did not ask for any donations in money or anything I just said it would be cool if you could check out my website and follow me on twitter @ljbaumer99

3) It is appreciated if you don't criticize how we make roms, it doesn't exactly make us want to keep making roms for you guys :\

4) thank you for wanting to donate to the cause.

5) I will continue working on this project once I fix my phone or get a replacement

6) the other dev will most likely keep working on this right now

Thanks a bunch,

ljbaumer
[Droid 2 Android Development] xjhkang:
Very excite!

dude i can not wait for this!

will WILL will donate for this.
[Droid 2 Android Development] casacristo:
Thanks for your feedback, I have accordingly renamed the title of this thread.

I have indeed being a bit optimistic with my initial posting but I did this because I have ported roms to other android devices successfully ( GM DSTL1, htc kaiser, desire)

Obviously this mysterious 2nd-hack init in the D2 is a show stopper (for now)
[Droid 2 Android Development] ljbaumer:
~ is what http://and-developers.com/2ndinit defines the 2nd_init hack to be.

Hope this will help at least a little...
[Droid 2 Android Development] casacristo:
I wonder if we are chasing the wrong horse here...

in the D1-MIUI rom, there is indeed a 2nd_init and sh_hijack.sh

/system/bin/2nd-init (it is a binary)

/system/bin/sh_hijack.sh

and this is the content of sh_hijack.sh

#!/system/bin/sh
/system/xbin/mount -o remount,rw rootfs /
/system/xbin/rmdir /config
/system/xbin/rmdir /sdcard
/system/xbin/cp -fr /etc/rootfs/* /
# echo "-16" > /proc/$$/oom_adj
/system/xbin/umount /dev/cpuctl
/system/xbin/umount /sqlite_stmt_journals
/system/xbin/umount /dev/pts

exec /system/bin/2nd-init

But in the two D2 roms I have looked into (Liberty and Fabulous Apex) have no such files
[Droid 2 Android Development] ljbaumer:
You may be correct.....

I talked to a bunch of MIUI developers who have ported it to other phones before and they all said I should use the 2nd_init hack when porting it over....

Maybe we have to rebuild the hack from source and not use pre-built files?

Also the thing about fission and liberty and apex is that they all contain a little bit of motoblur so they can still run on the stock D2 kernels, in fission (and maybe liberty) you cannot see the blur except there are still blur files in the rom itself.

Either way, I'll ask AngDroid to look over this also...
[Droid 2 Android Development] gammaxgoblin:
i am by no means a developer or can even begin to write code. i was under the impression that it had been established that since the d2/x bootloader is locked that no other kernel can run on these devices unless you crack the bootloader. in which case, are you trying to port a rom that doesnt use the stock kernel? im probably missing something tho, so forgive me lol
[Droid 2 Android Development] microsnook:
Really, really exciting news!

I am so amped I hope you all are able to get this rom up and running!

Thanks for the hard work
[Droid 2 Android Development] Phoible:
The Milestone has a locked bootloader, but people have managed to get custom kernels working with the 2nd_init hack. I think the theory is that it might be possible to get this working on the Droid 2 as well...
[Droid 2 Android Development] casacristo:
I replaced all the .so modules from the d1-MIUI rom with the D2 native ones
[Droid 2 Android Development] ZeroBarrier:
But did you replace the kernel included in the D1-MIUI ROM with a kernel the D2 can/will run? The .so files aren't the only device specific files included in a D1-MIUI ROM.

The D1-MIUI ROM that Jamezelle and now tp4Bama ports from the Milestone build to the Droid includes a custom kernel/ramdisk (boot.img in the root of the zip), so unless you replaced that with a signed kernel the D2 will run, then you would effectively be trying to run a D1 kernel on the D2 which just won't work.

I believe the official Chinese Milestone version includes a stock Milestone kernel as that device also has a locked bootloader preventing the use of custom kernels. And it's safe to assume that if the Milestone with a locked bootloader runs an official MIUI ROM that you can safely make a port for the D2 which is a similar device with a similar locked bootloader.
[Droid 2 Android Development] casacristo:
The boot.img from the D1 I simply removed the file (and the references to it in update-script)

The D2 roms I looked at did not contain a boot.img so they must be using the stock kernel just as I tried to do.

So the idea is that the D2 stock kernel is not affected by flashing this rom and since the .so files are the ones matching the stock kernel (not the ones from the D1 rom) then they should load.

I also edited the init scripts so I am at a loss as to what is missing and without debugging logs...

So you are suggesting to start again the porting effort taking the Milestone MIUI rom as a base instead of the D1? It is lots of hours of work...
[Droid 2 Android Development] ZeroBarrier:
I would suggest contacting the current D1-MIUI developer, tp4Bama; he most likely can help you out in this regard. He could explain to you exactly what changes he does to the Milestone version to port it to the D1. I know he uses CM 6.1.2 (for the D1 of course) resources for those files in the Milestone version that need to be changed out.

You could then perhaps use the same method starting with the Milestone version and using a D2 AOSP ROM or something as close to AOSP as you can get for resources. Just a thought.

One thing I did notice after having downloaded your port is that it seems you used the exact same framework-res.apk from the D1 port; is that even possible? To run a D1 framework-res.apk on the D2? I know the framework-res.apk from the D1 port isn't the same as the Milestone one (official Chinese version) nor is it the same as say the Evo 4G port (based on the N1 official Chinese port).
[Droid 2 Android Development] microsnook:
AOSP rom.

There is I believe ONE AOSP rom, and that rom is Cobalt. It is also conveniently located here on the XDA forum. Should be under D2 dev thread. Download it and then you might be able to get some help from that if you are looking for AOSP!

EDIT: here is the link if it helps... http://xdaforums.com/showthread.php?t=874220

I wanna help where I can!

You need more debugging logs?
[Droid 2 Android Development] ljbaumer:
Cobalt actually should be able to help....

We need A debugging log. Instructions are on the first post, please read them really carefully and then post what you get here or send me a PM or something.

Thanks,

ljbaumer
[Droid 2 Android Development] microsnook:
Awesome! I edited my post and included the link to the rom.

If I get around to it later today, Ill flash this and try to get some debug logs.

Or if this horse is dead we should fix the issues that are currently on the Cobalt rom! :)

EDIT: It seems the link for Cobalt download is no longer good :(. I posted asking if anyone has it. Ill also look around on my harddrive to see if it is on there.

EDIT2: Found it on my HD, uploading it to mediafire. http://www.mediafire.com/?7ksd4du2c984vw9
[Droid 2 Android Development] casacristo:
Thanks for the Cobalt link! (downloading already)

I will take the Cobalt as a base and try to blend MIUI in

BTW How stable is the Cobalt ROM to start with?

I have a full time job (like most I guess) so progress can be irregular
[Droid 2 Android Development] ljbaumer:
Cobalt is 95% stable, there are a few random reboots occasionally but most of the time it is great, the problem is it just doesn't look that great and there aren't themes for it so people just use fission (because there are a ****load of themes and other things for it) and liberty (because it looks great but isn't very special). Cobalt is AOSP (complete AOSP) and has a ton of features it just doesn't have themes and looks like froyo so not a lot of people use it.

Hope you can fix this up,

ljbaumer

Just send me a message if you need any help.