yashsingh1/xdaforums huggingface dataset:
[Atrix 4G Android Development] h8rift:
Isn't the bootstrap recovery from Tenfar already leveraging 2nd init? Aren't the changes to check for AC power to boot into recovery done in init?
[Atrix 4G Android Development] Immix:
We need Da_G on this. Bring him back from the dead!! Where has he been?
[Atrix 4G Android Development] PixoNova:
+1. I have no clue where he went. I think his twitter hasn't been updated either.

http://twitter.com/#!/Da_GNARF Nothing since the 14th of March :/
[Atrix 4G Android Development] Deleted member 2488575:
This seems very promising but I doubt it would work.

mainly because of the Tegra 2 processor.
[Atrix 4G Android Development] ceo.mtcl:
DG is gone for good. He's never returning back to atrix now. If it wasn't for this dual core beast, I would have exchanged it for nexus s already.
[Atrix 4G Android Development] Sogarth:
Da_G and designgears aren't the same people. The former is technical. The latter is not.
[Atrix 4G Android Development] h8rift:
Amen, DG is a tool. But moving on....

Was my question valid?
[Atrix 4G Android Development] PixoNova:
Valid question. I don't believe it's 2nd init. Or at least not like the 2nd init on the Defy.
[Atrix 4G Android Development] BravoMotorola:
BTW guys, I tried the Defy 2nd init bootmenu (decided to use the apk that installs it all automatically) aaanndd..it bricked my phone. An sbf flash fixed it though.

So anyways, it is now known for sure that this needs to be ported in order to work. Someone PLEASE look into this. I am almost positive that this IS the method that will be used to install custom ROMs on the Atrix in the future. The actual bootloader has no chance of being cracked IMO. But we can get almost the same results with this.
[Atrix 4G Android Development] xepter:
not nearly the same result i was on the sony x10 before i got the atrix and this is exactly how it was when the bootloader was locked we could flash custom roms but all it did was add new simple features. fps caps overclock and many other goodies are kernal related.

BUT i guess having this would be better than nothing at all just dont get overexcited then be dissappointed. also i believe its harder to develop like this than with an open bootloader.
[Atrix 4G Android Development] BravoMotorola:
No, this is quite different from what you are thinking of. It does allow custom kernels. The Defy has FULL cm7.
[Atrix 4G Android Development] D_one:
Right, in a nutshell, it should dump the current kernel and allow a second one to load.

Stock Bell Atrix on Rogers with updated radio, Rooted, deodexed, Honeycomb theme, and frozen!
[Atrix 4G Android Development] BravoMotorola:
Yep. It's great and somewhat easy to understand. This needs to catch someones attention.
[Atrix 4G Android Development] dLo GSR:
i'm guessing if someone hasn't already jumped on this, it's because it won't work.
[Atrix 4G Android Development] Sogarth:
I'm fairly certain it'll work, actually, although it might require some tweaking. But, at the same time, I'm fairly certain it'll break webtop. To me, webtop >>> CM. I'm sure others feel differently. But you'll need one of those other people to work on this, because otherwise, 2nd Init ends up pretty low on my priority list.
[Atrix 4G Android Development] bearsfan172:
So basically we need someone who wants CM or something else on their atrix, and doesn't care about webtop. Or we need to be willing to put up a big enough donation for someone that doesn't want to use it to dev it. Any guess on how much time this guy might take for a talented dev?

To me, it seems that this is our gateway to higher level roms in lieu of an unlocked bootloader. It would be great if someone could pick it up...
[Atrix 4G Android Development] PixoNova:
There's always that bootloader bounty :)

Swyped from my Motorola Atrix 4g using XDA Premium App
[Atrix 4G Android Development] Sogarth:
Yeah, but that's where it gets complicated. Working around the bootloader isn't actually hacking the bootloader, so I'm not sure how many people would actually follow through on payment. :rolleyes:
[Atrix 4G Android Development] BravoMotorola:
Who cares? If it gives the same results does it really matter?
[Atrix 4G Android Development] tsouza:
Agreed.

I really don't care about what needs to be done (unlocking bl or 2nd init) as long as I get a working CM7 on my Atrix....
[Atrix 4G Android Development] Sogarth:
If people refuse to pay because it's "not unlocking the bootloader," yeah, it matters. Cheapskates will be cheapskates, lawyers will be lawyers. ;)
[Atrix 4G Android Development] dLo GSR:
not everyone just wants CM7, though.
[Atrix 4G Android Development] D_one:
I think this is the way to custom kernels, a working port on another Motorola with a signed bootloader? How much closer can we get. Sogarth, I agree that webtop is something special but would we not be able to take the current kernel and compoBentsen to webtop and tweak things like oc'ing to get an even more functional webtop? I mean, we should be able to load the roms we have now from 2nd init, no?

Stock Bell Atrix on Rogers with updated radio, Rooted, deodexed, Honeycomb theme, and frozen!
[Atrix 4G Android Development] garekinokami:
I am willing to pay $50 to add to the bounty.

This phone needs to be stripped of all the Blur garbage and brought up to date.
[Atrix 4G Android Development] co.ag.2005:
exactly.....
[Atrix 4G Android Development] D_one:
Will this not allow any custom rom?

Stock Bell Atrix on Rogers with updated radio, Rooted, deodexed, Honeycomb theme, and frozen!
[Atrix 4G Android Development] BravoMotorola:
Yea? Idk what the guys "not everyone wants CM7" point is. Any ROM you can port is the only limitation. This will work. Someone has to care enough to try this and also know what they are doing and we'll get this running. And hopefully that guy will get a ton of cash for all his work...I don't know who would donate for an unlocked bootloader (for custom ROMs and kernels) and not donate for 2nd init boot menu (for custom ROMs and kernels). It matters not the method, but as the goal is achieved. Custom ROMs and kernels.
[Atrix 4G Android Development] D_one:
I'm in;)

$20 for getting a custom rom via 2nd init, and if you crack the bootloader, I guess you can have it anyway:-P

I think Development efforts here and overclocking would satisfy our needs;-)

Stock Bell Atrix on Rogers with updated radio, Rooted, deodexed, Honeycomb theme, and frozen!
[Atrix 4G Android Development] tsouza:
Yeh, I wanted to reply that to them, but I'm too lazy :P
[Atrix 4G Android Development] BravoMotorola:
Well looks like this thread is going under. Good sailing with you lol. I really wanted a dev to come on here and explain some stuff to my noob brain but I guess that won't happen...:( This 'ought to get thought up later though. Is this not the easiest method to get what we want? Absolutely NO Motorola devices have had their bootloader cracked and had a custom ROM and kernel installed on them while the Defy, which is in the same situation as the Atrix, has been able to load custom ROMs and kernel through this '2nd init' junk. But whatever, ignore it!

LOL at least I have Kholk coming back tomorrow to look forward to...I want to overclock this and he might not mind looking into what I have if I pm him maybe.
[Atrix 4G Android Development] h8rift:
Im doing some more reading and have sent a PM to Quarx. Can't make any promises, but let me see what I can do!

Thanks!

-h8
[Atrix 4G Android Development] BravoMotorola:
Thanks! Anythings good as long as it's effort imo. I just hope someone tries to do something with what we have.
[Atrix 4G Android Development] h8rift:
Well, assuming Quarx contacts me back...I can get something started.
[Atrix 4G Android Development] ceo.mtcl:
Count me in. $25 for this project from my side.
[Atrix 4G Android Development] on21st:
I am in the process of rewriting the scripts found in the boot menu here http://xdaforums.com/showthread.php?t=1026853. But i have no promises it will make it work but maybe if we are lucky it just needs to be tweaked a little bit.
[Atrix 4G Android Development] UncleCemka:
Sounds cool... Any idea how to test it without an actual custom ROM? I started looking over those scripts as well and it looks totally doable. I am not sure about the binaries it comes with, but if those work on the atrix, could work.
[Atrix 4G Android Development] BravoMotorola:
Yep..we'll probably have something very soon. BTW, These are the install scripts, are they not?

#!/system/bin/sh

/system/bin/mount -o remount,rw rootfs /
/system/bin/cp /sdcard/bootmenu/busybox /busybox
/system/bin/chmod 755 /busybox

/busybox echo 'Install now....'
/busybox mkdir /bootmenu
/busybox cp /sdcard/bootmenu/bootmenu* /bootmenu
/busybox mount -o remount,rw /dev/block/mmcblk1p21 /system

/busybox mkdir /system/bootmenu
/busybox cp /system/bin/mount_ext3.sh /system/bootmenu/mount_ext3.sh.bak

/busybox tar xvzpf /bootmenu/bootmenu*.tar.gz -C /

/busybox cp /system/bootmenu/mount_ext3.sh /system/bin/mount_ext3.sh

/busybox chmod 755 /system/bin/mount_ext3.sh
/system/bin/chown root.root /system/bin/mount_ext3.sh
/busybox chmod 755 /system/bootmenu/*
/system/bin/chown root.root /system/bootmenu/*

/busybox rm -r /bootmenu

/busybox sync

/busybox echo
/busybox echo 'Install complate....'
/busybox echo 'Plz.. Reboot now....'

/system/bin/rm /busybox

/system/bin/mount -o remount,ro /dev/block/mmcblk1p21 /system
/system/bin/mount -o remount,ro rootfs /
[Atrix 4G Android Development] on21st:
Yes it is but there are also some other scripts that would have to be reworked as well. Also I replaced the recovery program files with the one tenfar wrote for our device. The binaries all appear to be generic and not designed for any specific phone. Well at least the ones I found source code for.

I have no idea how to test it but i haven't gotten that far yet anyway so I guess I will worry about it later.
[Atrix 4G Android Development] fcoco32:
I have 50 no matter what method we use to get custom roms.
[Atrix 4G Android Development] garekinokami:
I think we already have a bounty thread somewhere - it was up to $3100. Take a look around for it.

I hate to add unnecessarily, but my God, I think we're all anxious.

Found it: http://xdaforums.com/showthread.php?t=1004208&highlight=bounty
[Atrix 4G Android Development] BravoMotorola:
Ah, so are you using Tenfar's recovery as an example for everything that must be rewritten? Or do you have to go off on your own quite a ways rewriting everything according to the phone?

And to install, wouldn't you just use the instructions he has on there already?
[Atrix 4G Android Development] UncleCemka:
I noticed all of the code to install busybox can just go away, since we already have busybox by default.
[Atrix 4G Android Development] on21st:
Well the defy boot menu included tenfars recovery for the defy. I just replaced those files with the one he wrote for us. So that has already been ported. At this stage im not sure of what exactly will have to be rewritten but I have tomorrow free so I will sit down and work on it then.
[Atrix 4G Android Development] diedemus:
down for testing
[Atrix 4G Android Development] BravoMotorola:
Down for testing too. Hope it works out good.
[Atrix 4G Android Development] UncleCemka:
My main concern is the busybox stuff all over the place, the soft links in the pre-boot script (the ones that supposedly hosed things after SuperOneClick) and the use of /sbin, which actually links to osh, and I think controls Webtop. Are you trying to rework those at all, or just try it as is?
[Atrix 4G Android Development] on21st:
Yeah that is where I am at right now. I wish we could see the source on the bootmenu binary though.
[Atrix 4G Android Development] UncleCemka:
I wonder if that came from the Korean dev's from the Defy thread. Perhaps, we can ask to get the source.
[Atrix 4G Android Development] anupash:
2nd Init from Milestone 2

Hi,

There was a post in milestone 2 dev forum, somebody had ported 2nd Init on it. He lists out the process extensively. You might find it useful.

http://xdaforums.com/showthread.php?t=998425

cheers
[Atrix 4G Android Development] natboy:
oooohh that's a good link! I might have to try it, but I thought Tenfar said in his CWM thread for the Atrix that he still needed to get adb and umts working. I don't know what umts does though, so not sure if that matters, but without adb in the recovery menu, won't be able to push some of the last changes.
[Atrix 4G Android Development] NFHimself:
Few ideas..

So 2nd Init is doing a system unmount to stop android from booting. What I have tried sucessfully is a trap of app_process, I replaced it with a sh script that did my stuff then called the original app_process with the same args captured from init.rc.

App_process is what starts all the zygote stuff in init.rc, pre and post, etc, so it is called before android starts. Now since I was in a sh script, that wouldn't be helpful as such if you want to unmount system, since sh is running from system and the nature of sh is that is runs it's commands from /system/bin or wherever in the path, so what you can do instead is have a app_process script that creates a tmp filesystem off of /mnt, copies busybox there (or perhaps preinstall/something, some ext3 partition on external sdcard), installs it or does a bunch of manual soft links, and then calls a script from there. That way you could unmount everything, flash whatever. The point being to be running your linux outside of the usual android space.

Only thing about that is that whatever you flash needs to have the same setup or you lose your hack, if you are replacing log_wrapper or charge_only.bin, or whatever, then flashing system with something that has the original file in bin means you lose your ability to recover. And obviously all the partition checks happen prior to this.

Cheers!
[Atrix 4G Android Development] BravoMotorola:
How the heck do you know all of this so perfectly? I get the idea, but not the whole entire process! Excellent explanation.
[Atrix 4G Android Development] natboy:
Maybe I don't full understand it, but I thought the point was the you don't have to necessarily flash anything but mount the new OS as you were saying from a different mount point. Out of curiosity, what did you get your sh script to do?
[Atrix 4G Android Development] NFHimself:
Oh, it was just "hello world" type stuff, to see if it would work, then I saw the reference to tcmd.suspend and went that route instead for what I was doing. :)

The thing about a hack from system/bin is you need system/bin to remain the same, so that means no custom firmware that replaces system/bin's contents for the next boot. What could be done, as has been done in the past for things like data2ext, is to have a copy of system on external sdcard, do a mount -move for the old system, and another to mount your external sdcard as system, assuming it's formatted as ext3 and has all the right files and right permissions. Only problem is the contents of / remain the same (ramdisk), your kernel remains the same. So you might want another partition on your sdcard for boot, run init from there, kill the old init, and take it from there. But the kernel remains the same, how to swap that out at run time I haven't done before. Maybe it's just a call like any other program, have a copy of the kernel, and run it with args.

I have created recovery partitions/custom firmware for the Archos A7HT, so I am familiar with the android recovery process in general. What would be ideal in this situation is to run a recovery partition off an external sdcard. Adding a new partition to the internal memory could likely cause problems. The difference between the tablet and android phones is the combined kernal and ramdisk format, on the tablet the kernel was on it's own partition, boot and recovery were basically different ramdisks (cramfs). One possibility on the tablet side was to edit the command line used to start the kernel, you could boot from the sdcard and use that instead of internal memory for everything.

This is ours:

cat /proc/cmdline

mem=320M@0M nvmem=192M@320M mem=512M@512M vmalloc=320M video=tegrafb c
l usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=mbr:d00:100:800
00:400:800 security=tomoyo mot_prod=1 androidboot.serialno=TA2070A6EM

So, if you could edit that to say tegraboot=something else, you could possibly have some way of doing a custom boot. Still after the partition checks though, most likely.

Cheers!
[Atrix 4G Android Development] natboy:
Does Android then work like Linux where you boot off of an initial ramdisk that loads the real OS? People are saying Tenfer is suppose to be back soon (didn't know he was gone) but one way around it seems to be what he's doing, and that is load a standalone bin. I'm assuming his CWM is standalone as it replaces the battery charging gui. That being the case, one could make a bin that calls it's own init scripts. I'm not familiar with what checks the phone is doing. Are they checks to see if the partitions/mounts are there and checksummed?

A new mount on top of existing partitions sound good to me as then you could use any slow memory card. Is the internal 14Gb storage partition available at that point?

Edit: I looked up GRUB here: http://www.linuxselfhelp.com/gnu/grub/html_chapter/grub_4.html that talks about chaining bootloaders, but again, I'm not sure how the Android loads.

2nd Edit: I realize I'm talking to myself here, but the bootloader is locked on the Atrix, hence all this hackery. I guess I answered my own question.
[Atrix 4G Android Development] NFHimself:
CWM is using /preinstall and /sbin, which points to the webtop partition (osh). He replaces charge_only_mode.bin in /system/bin/ with his hijack binary. This runs hijack_all script to kill processes in an effort to stop android, not sure what else it's doing. I seems to be a kind of mini busybox itself going by the script. It is basically taking an android boot and trying to convert it into something more like a recovery boot on the fly.

I would wedge in via app_process to avoid phone charging issues, but it would still be as limited. If you flash a full system partition, your wedge is gone. I suppose the recovery script for CWM could auto reapply the charge_only_mode.bin substitution after every update.zip applied, that's one way to keep it running for a full system update, but that's not a full rom, and doesn't have anything to do with running a different kernel.

Cheers!
[Atrix 4G Android Development] sifon187:
security=tomoyo mot_prod=1 androidboot.serialno=TA2070A6EM

In this part of the code you posted, is it where the bootloader ensures the rom is correct?
[Atrix 4G Android Development] natboy:
Reading the link above about the defy port, I think I read they are using the stock kernel and running cm 7 on top of that. It would take some more compiling/hacking but an option once we got the 2nd init working.
[Atrix 4G Android Development] BravoMotorola:
Cyanogenmod requires a custom kernal. That is why the original Motorola Droid doesn't actually have cm7.
[Atrix 4G Android Development] PixoNova:
The OG droid? Thought that was completely unlocked?

Either way, the CM7 on the Defy seems like it's so... hacky. Like, is it completely stable?
[Atrix 4G Android Development] Squeak22:
The Verizon OG droid is, but the Milestone is not.
[Atrix 4G Android Development] @ns:
milestone is doing the same.. i'm using milestone and now on CM7 2.3.4 .. :)

checkout the milestone dev section.. http://xdaforums.com/showthread.php?t=941346

u guys can try contacting kabaldan if he can help..
[Atrix 4G Android Development] NFHimself:
Your guess is as good as mine. That isn't code though, just what gets passed to the kernel when it's loaded.

Cheers!
[Atrix 4G Android Development] natboy:
I looks like it requires a special recovery that you flash a sbf for. Is the Milestone bootlocked/signed? I think that's the problem with the Atrix is that it's signed so you couldn't replace it. Other people would know about it then me though.
[Atrix 4G Android Development] anupash:
I dont think motorola has ever released an android phone without a signed bootloader, same as in Atrix. What these guys at Defy dev forum have done is that, they have ported CM7 for defy. So as per my understanding the kernel is the same as the stock, only the Application layer (whatever u wanna call that) has been compiled for Defy and ported to it.

They have not yet been able to get A-GPS and few other things working on the current version of port.

This way of porting CM7 and other roms over the stock kernel has been a way for many bootloader locked devices like Milestone, Xperia X10 etc. I believe Milestone 2 is going to have CM6 ported to it soon, as there is a guy who is putting a lot of effort on it.

I was just having a look at the benchmark results for Defy with the CM7 port, it was just astonishing at 2500 for quadrant benchmark.

I just hope some gentleman here in Atrix dev forum can take the burden for porting CM7 for us naive users, because everybody knows this beast(Atrix) can deliver some really awestrucking performance.

Ya, there are many people who are not so enthusiastic about the CM7 port because it can't get rid of more than 2 touch, fps and many more such limitations. And moreover it will break Webtop and other hacks. But let's face it how many guys have webtop and should it be a kill to have a much more integrated experience of Gingerbread over the froyo kernel rather than a skinned/themed version of motoblur.
[Atrix 4G Android Development] NFHimself:
I'd take the quadrant scores with a load of salt, just moving data to an sdcard can double your scores in that. :)
[Atrix 4G Android Development] Exador:
I'm not a big fan of CM and I don't understand why people like it so much, but if this leads to a way around the locked bootloader then I'm all for it. Good luck.
[Atrix 4G Android Development] Squeak22:
This is incorrect. The OG droid on Verizon was an unlocked bootloader because it was an Android Experience Device.
[Atrix 4G Android Development] mafiaboy01:
It was locked but they didn't put it into HS (high security) mode so it was easy to unlock.

Sent from Motorola Atrix on TELUS.
[Atrix 4G Android Development] BravoMotorola:
I might of been wrong about the OG Droid. It seems it does support CM7 (With Gingerbread 2.3.2)

Anyways is there any progress on the porting of 2nd init? (asking 'on21st', or anybody else that is trying to port it)
[Atrix 4G Android Development] on21st:
Im still working but I have several midterms this week so I won't be able to do much until this weekend. But I will keep eveyone posted on any progress I make.
[Atrix 4G Android Development] BravoMotorola:
As long as someone is trying I could wait months:D
[Atrix 4G Android Development] s1mpd1ddy:
I can wait until July.. ? lol
[Atrix 4G Android Development] playin4sheezy:
I have been working on it as well... Today is my free day so I will finally get the chance to start disecting and testing different things
[Atrix 4G Android Development] ceo.mtcl:
I'm a professional java and j2ee developer. If you need any services in coding something abstruse then lemme know. New to android development but I got fast learning curve.
[Atrix 4G Android Development] rjayflo:
Man this is getting exciting! :D
[Atrix 4G Android Development] playin4sheezy:
I will definitely need some help with the java coding as that isn't my cup of tea lol. Does anyone know if there is a irc channel i can jump in and get a little help with some things?

Anybody on here know which files are loaded to start recovery with ac charger plugged in? I'm trying to map everything together so recovery is initiated when volume key presses when blue led lights. Thanks in advance
[Atrix 4G Android Development] bearsfan172:
#moto-atrix
[Atrix 4G Android Development] BravoMotorola:
Yea but it is a cup of coffee:D

And I wish you luck
[Atrix 4G Android Development] playin4sheezy:
Ha! Thanks man. No luck so far but I ain't giving up