[Q] Loading a custom kernel - GT540 Optimus Android Development

Hi All
So, I am a little confused about how to replace my kernel. My mate has a nexus one, and his boot loader allows him to load a kernel from USB into ram to test it which is pretty sweet. If its broken, just power cycle and it gone.
I have managed to compile a gt540 kernel from the sources provided by LG, with some extra modules - hid bluez, iptables, cifs and usb host. But I am at a loss as to how to test this.
From what I can gather, the boot loader is separate from the internal file system. Obviously the nexus one has an awesome boot loader already, but I can't make my gt540 load a boot loader screen.
I had a look at (but didn't install) ClockworkMod Recovery but that doesn't look like it will help me either. I don't want to just replace the zImage kernel file on the filesystem with my new built one by hand, and reboot - if it goes wrong how do I get the old one back?
Is there anyway to have both the kernels on the device, and choose which on to load just like a big-boy computer? I am currently running Quarx 2.1 Black Edition ROM.
Sorry if this has been answered elsewhere, I had a pretty good look and couldn't find anything.
My whole goal is to be able to get some hardware buttons talking to my phone so I can play snes If I can't get an hid bluetooth profile going so i can use a bluetooth keyboard, I'll use usb host mode with a hacked up joypad with batteries inside (if the usb port doesn't supply power).

I think that it would have to be on like a memory card. Maybe some software that when you boot your phone, it will give you the option to boot from phone or memory card. That would be good! Like a bootable dvd in a computer, gives you the option to boot from it or not.
Sent from my GT540 using XDA App

Right, I worked it out. I didn't realise what "fastboot" mode was for. The rom I have installed has a fastboot already, so I turned the phone off and held volume up, search, and power all at once until the fastboot screen appeared.
Then, I plugged in my phone to usb and waited a few seconds running "./fastboot devices" - the fastboot command comes from somewhere, I am not sure where.
The output was :
Code:
[email protected]:~/android-sdk-linux_x86/tools$ ./fastboot devices
???????????? fastboot
[email protected]:~/android-sdk-linux_x86/tools$
Then, I ran the command:
Code:
[email protected]:~/android-sdk-linux_x86/tools$./fastboot boot ~/android-ndk-r4b/GT540_OpenSource_V2.1/kernel/arch/arm/boot/zImage
and it appeared to boot the kernel I built
I haven't confirmed that the kernel is the correct one, but at least I have a process that /should/ work. I need to recompile the kernel with a different version.

Related

[Newbie Guide] adb/fastboot/bootloader/android 101

The purpose of this document is to clarify a few basics about HTC Android Phones and basic commands to interface with the phones. Think of this as a beginner's guides to the Android device from a non-traditional user's point of view. I'll keep it simple and plain as much as I can for the new users. I'll also try to keep all the technical aspects true as much as I can while keeping it simple.
Before you go on, please read this and understand the basic concepts and how and why following commands are being used. Do not follow anyone's instructions/tutorials/guides without prior basic understanding of what each command do. I do want to believe it's humans visiting this forum and not lemmings. If you do not understand, feel free to ask here. I will or someone else also knowledgeable will answer your questions. DO NOT QUOTE THIS AS A WHOLE. My pet peeves and a complete waste of screen space.
Sometime, depending on your OS, command names may change (e.g: mouse / mouse.exe / mouse-linux / mouse-mac). For general purpose, we'll use mouse instead of an OS specific commands in this instructions.
So to repeat myself, if you understood the concepts of the commands, and you are on a linux system and someone's guide says touch index.php, you will automatically type touch-linux or whatever the name of your executable is on your system.
​
We shall assume you know how to install needed drivers and where to get android sdk and put the sdk binaries (executables) in the system path. If we need to expend this let me know and I'll expend this here.
Further, if I get any parts wrong, PM me and I'll get those parts corrected.
Android Partition, SPL etc.
Partitions:
Followings are a list of partitions on your android phone.
misc - misc partition -
recovery - Recovery Partition - This is where the original HTC recovery or Amon Ra's recovery or any other Recovery would go. Basically if you reboot into recovery it'll boot from here.
boot - This is your boot partition
system - This is where all your system information (ROM resides)
cache - cache (When you factory reset the phone, this area is wiped)
userdata - user data (like your login, your user settings etc) When you factory reset the phone, this area is wiped)
So, if you replace the recovery image, you are pretty much set for updates provided here at XDA. Note: By replacing your recovery image, you may not be able to have OTA updates.
ROM images will normally replace boot and system images at the same time and often time, userdata and cache too; reseting the phone completely.
SPL/Bootloader/Radio/Bricking Phones:
SPL / Bootloader is like BIOS on a computer. At least I think of it that way. SPL can be updated! SPL comes as either Security-On of Security-Off (S-ON/S-OFF).
Note: It is my understanding that radio will boot first, followed by other systems. So it is IMPORTANT that your radio image/version will work with your SPL image/version. This is the one and only reason for phones being bricked. You can not brick your phone by flashing a ROM or Boot image or recovery image. Once you flash the wrong radio for the SPL, the only known method of recovery is to send the phone back into HTC for repair.
How do I know the phone is bricked? A bricked phone can not boot into bootloader, recovery, or into normal operation modes. You can not connect to a bricked phone via adb or fastboot. You can only see one screen on the phone and it will be the first splash screen.
Commands:
adb - Android Debug Bridge - One of the two things you'll need to know if you ever want to do anything non-conventional on your android based phone.
List of commands that can be used by adb can be prompted by typing adb at the system shell (command prompt or terminal)
Notable adb commands:
adb devices - If you don't know anything, this is the ONE thing you have to know.
adb devices will give you a list of devices connected to the computer. This is also a good way to make sure that your phone is actually connected to the computer.
adb reboot (bootloader|recovery)
adb reboot - this will reboot your phone normally.
adb reboot bootloader - this will reboot your phone back into the bootloader (white screen with the android on wheels)
adb reboot recovery - this will reboot your phone back into recovery console (either default or amon_ra's recovery).
adb shell - this will shell into the phone and you can now explore the phone. Remember phone's native backend os is linux so know your linux commands.
adb remount - remounts the system partition on the phone so you can you read/write to it.
adb push xxx yyy - will push xxx file from computer into yyy location/file on phone (needs rooted access)
adb pull xxx yyy - will pull xxx file from phone into yyy location/file on computer (needs rooted access)
Fastboot is protocol used to update the flash filesystem in Android devices from a host over USB. It allows flashing of unsigned partition images.
Notable fastboot commands:
fastboot devices - If you don't know anything, this is the ONE thing you have to know.
fastboot devices will give you a list of devices connected to the computer. This is also a good way to make sure that your phone is actually connected to the computer.
fastboot reboot - this will reboot your phone normally
fastboot oem unlock - this will unlock your bootloader - NOTE THIS WILL VOID YOUR NEXUS ONE WARRANTY
fastboot erase XXX - Will erase the partition XXX (such as userdata, cache) - mainly used for resetting phone and clearing userdata / factory settings.
fastboot flash XXX YYY - This will flash XXX partitionn with YYY image.
e.g: fastboot flash system system_update.img will flash/update your system partition with an image called system_update
If anyone needs me to dig deep into using anything else, please PM me. I'll add it on here. Hopefully this will help all newbies about the basic commands and what they do.
FAQs (UPDATED Feb 09, 2010)
Q: One question about the Android SDK. Do I need it to flash my N1 or just to program new apps? Where can I get it?
A: Android SDK is not entirely needed to flash the N1. However, there are tools in there that you need. Adb / Fastboot etc. Although they can be downloaded by themselves, the windows version of the SDK also have the Drivers that are needed for android devices for USB connection. So, it is recommended to get it. You can get it from developer.android.com
Q:I have never experienced anything like this when I did a hard-spl on my winmo phone. Radio versions are included with SPL's, right?
A: Official packages from HTC did come with nbh packaging, meaning it is a all in one upgrader that will update Radio, ROM, System etc, it is very much common for active development area here at XDA to get the radio or SPL or ROM separately and independently of one another. And as such, you will most likely flash them seperately (who wants to wait 6-8 months). Also, since this phone is released by google, HTC will most likely not update any major Radios. However, it is very likely that we will be hacking in Radio updates or any other "updates" from HTC from their new device - HTC Bravo.
Q: Is there a guide for snow leopard? I'm kind of stuck.
A: I personally ran android SDK and aforementioned executable on both MAC OS 10.5 and 10.6. Like I posted, the commands and the executable names may be slightly different. I may call adb and you may find it as adb-mac. I am not going to write 3 separate documents for 3 separate OSes. You have to know that adb=adb-mac (on your mac), adb-linux (for linux) etc. And yes the above guide will work universally.
Q: Can i replace the splash image..?? (unlocking related)
A: As of the above date (next to the FAQ) no you can not. Issue is probably a few folds. One of them is that splash1.img is not going in due to security lock. Remember, you unlocked the phone. HTC will not like it. Anyhow, I like the current quad color X. If you are thinking of getting rid of the lock logo, good luck. Even if you can get rid of it, you will still have to overcome the pink text that says ***UNLOCKED*** on your bootloader.
Q: Can you run Windows Mobile on Android Phones?
A: With enough resources given, sure. Will it ever happen? No. Why? Windows mobile compiler and builder cost $. As a matter of fact, as of version 5, it was going to cost me $75 per device. That's one of the reasons why handset makers went to Android open platform. Android is free and universal so as long as you use certain chipsets and certain items, you are good to go. Can it ever be ported? Sure. With right amount of time and money anything can be done. But at this point, it's cheaper for you to go buy a windows mobile smartphone.
Q: How do I know the phone is bricked?
A: You can not brick a phone unless you are flashing Radio/SPL packages. Make sure if you are doing that, you follow directions VERY CAREFULLY. A bricked phone can not boot into bootloader, recovery, or into normal operation modes. You can not connect to a bricked phone via adb or fastboot. You can only see one screen on the phone and it will be the first splash screen.
Q: I have installed the Android SDK however, i cannot seem to get the laptop to detect the nexus. What have i left out?
A: Most common item that people forget to enable is USB Debugging. Settings => Applications => Development => USB debugging [checked]
Q: I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
A: You still have the stock (shipping) recovery. If you want a different recovery (Amon RA's), download it, the from fastboot, run fastboot flash recovery downloaded_recovery.img
Q: Which step of the rooting / recovery procedure does it give root?
A: Root and Recovery are two totally different things. Recovery is a partition that contain recovery information. Stock recovery is what allows OTA updates etc. Normally it will search for update.zip in the root folder of the SD card. Amon_RA's Recovery or any other recovery images are there to enhance the traditional stock recovery. Amon Ra's Recovery for example, contains thing such as ability to update from different zip files, and backup/restore of your data/system.
Rooting is not done by recovery but is a kernel level access (simply put) that will give root or "SU". It is done by patching the boot partition of the your android device.
Q: What are the differences, advantages, disadvantages of the different ROM's?
A: They are all different. Some have some features, some are plain stock, some are made for bleeding edge kernel etc. You'll have to try them out and figure out yourself. I may make a chart of what they are (see the bottom at my signature - wiki) but with too many android devices, I will need some major help. One person alone will not have total knowledge of all the ROM releases. There are just way too many devices and ROMs.
Q: Which ROM will allow OTA updates?
A: Stock ROM WITH Stock Recovery.
Q: If the phone is SIM/carrier unlocked and you root do you have to SIM unlock again?
A: SIM/Carrier unlock has nothing to do with rooting your phone. You can still have root and still be carrier locked. Nexus One comes carrier unlocked from factory.
Q: How much space is there for apps? is using the sd card really necessary? (on Nexus One)
A: Search google? The phone has 512MB or space. That SHOULD be more than enough for you. If not, you have some serious issues. I do not believe you will not App2SD for Nexus One. Google did say during the release conference that they will update Android/N1 so that apps can be run/installed to SD but that requires some system and security changes (mainly to prevent pirated software - Yes if I write something, I deserve to get paid for it).
Q: When you do "flash zip from sdcard" or "fastboot flash image" does this merge and overwrite the files in to the partition?
A: When you update a software (via recovery), software my be merged. However, if you fastboot flash, just like the word flash says, it will flash and overwrite the partition.
Q: Which partition does "flash zip from sdcard" affect?
A: Depends on what you are flashing. It could be any or all of the partitions such as SPL, Boot, System, Recovery, Radio. You should study first before randomly flashing things.
sorry, got it!
blakestimac said:
i apologize if this is the wrong place for this but, but i have adb setup perfectly, but fastboot is not recognized at all. could i have missed something?
Click to expand...
Click to collapse
I need your system info.
What os are you running? where did you get fastboot? what are you trying to do?
Don't forget fastboot boot for testing images. My most used command
I still have no idea how to use or setup adb i have downloaded the sdk and used fastboot and superboot to root my phone and am currently running the cm 5.0 beta 2 rom and want to learn how to use adb so i can enable the ram. Thanks, Joe
really a noob question here.....it wa easier with Hero.
i have installed the Android SDK
however, i cannot seem to get the laptop to detect the nexus.
what have i left out?
wishmaker738 said:
really a noob question here.....it wa easier with Hero.
i have installed the Android SDK
however, i cannot seem to get the laptop to detect the nexus.
what have i left out?
Click to expand...
Click to collapse
Check the FAQ.
dylanfan424 said:
I still have no idea how to use or setup adb i have downloaded the sdk and used fastboot and superboot to root my phone and am currently running the cm 5.0 beta 2 rom and want to learn how to use adb so i can enable the ram. Thanks, Joe
Click to expand...
Click to collapse
Ok. I need to know what you actually did. I am not understanding what you are trying to do.
Can't run adb commands - device not found
Thanks for the info. I am having an issue with running adb commands. My phone is rooted via superboot and I tested it with Nexus Torch which works. Now I am trying to install the new kernel so I can run the wireless tether app... but I can't get any of the adb commands to recognize the phone. I boot the phone by holding the trackball and power button. I am in USB debugging mode. When I run fastboot devices, the phone serial number shows up. When I run adb devices, it says no device detected. And when I try to run any other adb commands they do not work, even though fastboot commands work. Any ideas? Thanks.
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
dylanfan424 said:
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
Click to expand...
Click to collapse
I'm a noob so can't offer much help...but I would make sure the usb drivers are installed if you're using windows....this probably should have happened when you installed the sdk, but you can also install it through the device manager and point it to the folder where the usb drivers are located. Also make sure the phone is in USB debugging mode. also you may need to reboot your pc. Make sure you have setup running when you run the adb commands. you need to be in the same directory as the adb file, or in the case of the superboot pack you need to type "adb-windows" not just "adb". you may also need to put .exe, ie adb-windows.exe.
pwnvds said:
Thanks for the info. I am having an issue with running adb commands. My phone is rooted via superboot and I tested it with Nexus Torch which works. Now I am trying to install the new kernel so I can run the wireless tether app... but I can't get any of the adb commands to recognize the phone. I boot the phone by holding the trackball and power button. I am in USB debugging mode. When I run fastboot devices, the phone serial number shows up. When I run adb devices, it says no device detected. And when I try to run any other adb commands they do not work, even though fastboot commands work. Any ideas? Thanks.
Click to expand...
Click to collapse
You run fastboot from the white screen. Android on non-white screen. It's one or the other. It's ADB or Fastboot (depending on the mode of the phone).
dylanfan424 said:
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
Click to expand...
Click to collapse
Is the directory where ADB/fastboot (SDK) is installled in your system path?
I am guessing it's not. If it was, just by typing adb alone (without commands), it'll give you a list of commands. Click here if you want to know how to change your system path to include a particular folder.
We're now in the age of nintendo pilots and point and click OS that no one knows how to use command lines and system paths anymore.
recovery
I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
umplarry said:
I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
Click to expand...
Click to collapse
Answered in FAQ area.
seraph1024 said:
Answered in FAQ area.
Click to expand...
Click to collapse
I tried that before I posted. I searched the FAQ again. Maybe I am a complete DA, but still can't find answer. I don't mind searching, it will help me to learn, but could you point me in the right direction in FAQ?
umplarry said:
I tried that before I posted. I searched the FAQ again. Maybe I am a complete DA, but still can't find answer. I don't mind searching, it will help me to learn, but could you point me in the right direction in FAQ?
Click to expand...
Click to collapse
Q: I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
A: You still have the stock (shipping) recovery. If you want a different recovery (Amon RA's), download it, the from fastboot, run fastboot flash recovery downloaded_recovery.img
Click to expand...
Click to collapse
There you go.
seraph1024 said:
There you go.
[/B]
Click to expand...
Click to collapse
Thanks for your help
seraph1024 said:
There you go.
[/B]
Click to expand...
Click to collapse
I had it downloaded, just had not flashed it
I've been looking all over, but I probably need to check the HTC Dream forum or something.
How do I install a custom ROM? I know you have to adb push update.zip somewhere, but I can't find any info about this. Please help.

UART and bootloader strap pinouts for recovery

I started looking into bootloader-level recovery tonight before messing with the file system too much and potentially getting into a bad state. I couldn't find this information anywhere else.
UART pinout
J3 - 4 pin unpopulated header on the front of the board near the LED
Pin 1: 3.3v
Pin 2: TX
Pin 3: RX
Pin 4: GND
Bootloader and kernel console output comes out this port, but android doesn't start a shell.
Bootloader strap
On the back of the board in the center, there is an unpopulated button (U33). When jumped while the power button is pressed, this appears to put the bootloader into USB recovery mode. It enumerates with an nvidia vendor id. Presumably nvflash or tegrarcm could be used to unbrick the device.
I haven't done anything with the bootloader recovery since I haven't yet made a backup. I'm not sure how much of the functionality is allowed given the state of the production fuse, but I would think we could use this to at least get back to a stock state.
I had posted pretty much the same thing a few hours earlier over on the ouya forums - https://forums.ouya.tv/discussion/comment/11742/#Comment_11742
The good news about the bootloader is that none of the android partitions have any sort of signature, which means that the bootloader is effectively "unlocked", you can even do a "fastboot boot". The bad news is that there doesn't seem to be any sort of hotkey to enter the bootloader or recovery mode, although I did find that you could usually get into recovery with the sysrq, just press alt-sysrq-i a few times at bootup to crash the processes spawned by init and eventually it will reboot into recovery -- obviously this won't work if your ouya doesn't even boot that far, so be careful.
The button at u33 does get you into nvflash mode, but from what I can tell it's entirely useless since every command will return a 0x4; we'll need the secure boot key to actually get this working.
As far as backups, the OTA download contains an entire copy of the system and boot partitions, this can be flashed from recovery using adb sideload; rayman has posted a link to all the known OTA downloads over on this thread - http://forum.xda-developers.com/showthread.php?t=2266629
tylerwhall said:
I started looking into bootloader-level recovery tonight before messing with the file system too much and potentially getting into a bad state. I couldn't find this information anywhere else.
UART pinout
J3 - 4 pin unpopulated header on the front of the board near the LED
Pin 1: 3.3v
Pin 2: TX
Pin 3: RX
Pin 4: GND
Bootloader and kernel console output comes out this port, but android doesn't start a shell.
Bootloader strap
On the back of the board in the center, there is an unpopulated button (U33). When jumped while the power button is pressed, this appears to put the bootloader into USB recovery mode. It enumerates with an nvidia vendor id. Presumably nvflash or tegrarcm could be used to unbrick the device.
I haven't done anything with the bootloader recovery since I haven't yet made a backup. I'm not sure how much of the functionality is allowed given the state of the production fuse, but I would think we could use this to at least get back to a stock state.
Click to expand...
Click to collapse
Sadly, no. The way nvidia does security means that you need to know the Secure Boot key (if set - but it is set on ouya) to even be able to communicate with the device through APX/nvflash.
As embeem mentions, it will return 0x4, which essentially means "go away, i don't know you" after which it goes into an almost turned off state where it refuses to do anything but restart. The SBK is an AES-128 key so it's essentially impossible (inpractical) to bruteforce it.
rayman said:
Sadly, no. The way nvidia does security means that you need to know the Secure Boot key (if set - but it is set on ouya) to even be able to communicate with the device through APX/nvflash.
As embeem mentions, it will return 0x4, which essentially means "go away, i don't know you" after which it goes into an almost turned off state where it refuses to do anything but restart. The SBK is an AES-128 key so it's essentially impossible (inpractical) to bruteforce it.
Click to expand...
Click to collapse
So what was the trick that you used/developed to bypass the encryption on TF101 B80+ / TF201 / TF701 ? As far as I know their bootloaders also required SBK, nevertheless you published tool that works with them even though SBK remain unknown, or am I wrong and misread something?
Cheers
wolf849 said:
So what was the trick that you used/developed to bypass the encryption on TF101 B80+ / TF201 / TF701 ? As far as I know their bootloaders also required SBK, nevertheless you published tool that works with them even though SBK remain unknown, or am I wrong and misread something?
Cheers
Click to expand...
Click to collapse
Black magic.
Well, not much capable in nvflash mode, can't get anything to work properly.
UART lets me see it boot up, and fail miserably. Sadly, nothing doing there either. Nothing I send to it seems to affect it.
Back story: I broke init. The sysrq trick doesn't work unless you're getting to init.
Boot log via UART:
http://pastebin.com/ENQYQbTS
It still responds to sysrq, but nothing I'm doing seems to do much. I can dump the memory, crash the system, reboot it, shut it down, all kinds of things. Here's the HELP for sysrq:
Code:
[ 66.672046] SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) thaw-filesystems(J) show-backtrace-all-active-cpus(L) show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) Sync show-task-states(T) Unmount show-blocked-tasks(W) dump-ftrace-buffer(Z)
an easier list of sysrq commands:
Code:
alt + sysrq + [0-9] - set log level (doesn't seem to work)
alt + sysrq + B - reboot
alt + sysrq + C - crash
alt + sysrq + E - terminate-all-tasks
alt + sysrq + F - memory-full-oom
alt + sysrq + I - kill-all-tasks
alt + sysrq + J - thaw-filesystems
alt + sysrq + L - show-backtrace-all-active-cpus
alt + sysrq + M - show-memory-usage
alt + sysrq + N - nice-all-RT-tasks
alt + sysrq + O - poweroff
alt + sysrq + P - show-registers
alt + sysrq + Q - show-all-timers
alt + sysrq + S - sync
alt + sysrq + T - show-task-states
alt + sysrq + U - unmount
alt + sysrq + W - show-blocked-tasks
alt + sysrq + Z - dump-ftrace-buffer
Some more detailed information on what these are: http://en.wikipedia.org/wiki/Magic_SysRq_key
Open to ideas!
This reminds me of the old Droid X I had years back, which had a locked bootloader.
Because of this, there had to be a special "boot to recovery" boot strapper installed onto the system.
We have full RW access to the Ouya's filesystem and software, so it would seem like the first thing the community should do is develop some sort of "successfully booted" flagging to make the system try to automatically drop into CWM in the event that it looks like the OS is broken.
Couldn't such a thing live in the boot.img, and thus be available even if some silly person formats their /system partition? (This has happened already, and so the guy pretty much bricked his Ouya)
DivinityCycle said:
This reminds me of the old Droid X I had years back, which had a locked bootloader.
Because of this, there had to be a special "boot to recovery" boot strapper installed onto the system.
We have full RW access to the Ouya's filesystem and software, so it would seem like the first thing the community should do is develop some sort of "successfully booted" flagging to make the system try to automatically drop into CWM in the event that it looks like the OS is broken.
Couldn't such a thing live in the boot.img, and thus be available even if some silly person formats their /system partition? (This has happened already, and so the guy pretty much bricked his Ouya)
Click to expand...
Click to collapse
My plan is to develop a sysrq key to write the appropriate bit(s) to SCRATCH0 and reboot. This would allow us to get into recovery via a simple keystroke. I've actually got it written but need to test it. Testing it would not be dangerous as it would normally boot the stock kernel/init.
Next week when I'm home I'll try to find a tester since I cannot test it (can't write anything to my mmcblk0)
This shouldn't be dangerous to test.
Sent from my SCH-I545 using Tapatalk 4 Beta
Any news on uart? I guess I bricked my ouya.
I was testing my custom kernel, did forget to use fastboot boot instead of flash and now have nothing but a black screen. My linux machine doesn't recognize my ouya and I can't go to recovery. So at least knowing what is causing the issue would be helpful.
Do you mind giving me a short intro on uart?
I guess I need a usb/uart adapter? If yes, which one should I get?
Thanks in advance
Gesendet von meinem HTC One X+ mit Tapatalk 2
anyone already saw this: http://forum.xda-developers.com/showthread.php?t=2071626
did only have time to skimm it but might be useful to people with still working devices
aim is to get the sbk which should be - if i have understood it the right way - unique for each device as long as the company didn't burn in a fix sbk.
so maybe this will help us to save people from further bricks...as long as nvflash is usable via usb
Has anyone tested in on ouya ?
Sent from my iPad using Tapatalk - now Free
Not yet i think...i know i won't be testing it on my OUYA no time soon, i don't feel like having my box BRICKED like nchantmnt does, screw this, it's too early to test this , i wont even risk it, i dont feel like buying another OUYA for testing this...
Hey... no pain no gain
Gesendet von meinem HTC One X+ mit Tapatalk 2
I have an idea for a small usb device that could force the ouya into recovery mode using the keyboard combination mentioned below:
http://ouyabrew.com/how-to-put-ouya-in-recovery-mode/
Essentially my idea is to have a little usb circuit board with a micro controller that is smart enough to simulate a keyboard periodically sending the specified keypresses. When the ouya goes into recovery you would just yank out the dongle. I don't have any background technical knowledge in this stuff but this sounds like something Ben Heck could whip up (he is a legend).
Update: Looks like these are already a thing! this looks promising:
http://www.irongeek.com/i.php?page=...ke-dongle#So,_why_would_a_pen-tester_want_one
zondajag said:
I have an idea for a small usb device that could force the ouya into recovery mode using the keyboard combination mentioned below:
http://ouyabrew.com/how-to-put-ouya-in-recovery-mode/
Essentially my idea is to have a little usb circuit board with a micro controller that is smart enough to simulate a keyboard periodically sending the specified keypresses. When the ouya goes into recovery you would just yank out the dongle. I don't have any background technical knowledge in this stuff but this sounds like something Ben Heck could whip up (he is a legend).
Update: Looks like these are already a thing! this looks promising:
http://www.irongeek.com/i.php?page=...ke-dongle#So,_why_would_a_pen-tester_want_one
Click to expand...
Click to collapse
this is a sweet idea, i wasn't aware of a programmable HID USB keystroke dongle...This would make things easier...i hope someone makes something out of this, this will solve the booting into recovery bigtime!!!
zondajag said:
I have an idea for a small usb device that could force the ouya into recovery mode using the keyboard combination mentioned below:
http://ouyabrew.com/how-to-put-ouya-in-recovery-mode/
Essentially my idea is to have a little usb circuit board with a micro controller that is smart enough to simulate a keyboard periodically sending the specified keypresses. When the ouya goes into recovery you would just yank out the dongle. I don't have any background technical knowledge in this stuff but this sounds like something Ben Heck could whip up (he is a legend).
Update: Looks like these are already a thing! this looks promising:
http://www.irongeek.com/i.php?page=...ke-dongle#So,_why_would_a_pen-tester_want_one
Click to expand...
Click to collapse
This would only work if the stock kernal is installed and the recovery partition is intact. If you lose you recovery partition you won't be able to boot recovery and get adb working, and if the kernel isn't the stock kernel the keyboard combo won't work.
Also no use for broken init
Gesendet von meinem HTC One X+ mit Tapatalk 2
cronikman84 said:
Not yet i think...i know i won't be testing it on my OUYA no time soon, i don't feel like having my box BRICKED like nchantmnt does, screw this, it's too early to test this , i wont even risk it, i dont feel like buying another OUYA for testing this...
Click to expand...
Click to collapse
I don't think that this necessarily means bricking your device.
You could always try fastboot boot patched kernel and then try reading fuse values.
I was playing with this method to run Debian:
http://tuomas.kulve.fi/blog/2013/09/12/debian-on-ouya-all-systems-go/
It is an easy procedure and I've got it running. Unfortunately my USB hub is not working correctly with ouya (it's passive so voltage on USB can be low), so I didnt login into it, but you could use this method to try to extract sbk keys.
Sent from my iPad using Tapatalk - now Free
nvflash
How About this : http://forum.xda-developers.com/showthread.php?t=2455927 ????
we first need to know if we do have a "masker sbk" or a device specific sbk.
for device-specific sbk this methode should work but only with a wheelie-enabled recovery for our device
don't try to flash any other recovery to your device or you're in danger of bricking it.
if you have access to the source and can add the required option for generating blob files to a working recovery image, then this should work for device specific sbks.
then you can use any uart-adapter/raspberry pi/etc. to connect to your device and make backup and flash partitions.
(NOTE: DO NOT USE YOUR PCS SERIAL OUTPUT - IT MIGHT DAMAGE YOUR DEVICE AND YOUR PC AS WELL... OH AND IT WILL NOT WORK)
if we do have any kind of masker-sbk i can only talk in theory:
you normally should be able to read out sbk from running system but this is of course prevented (in most cases by some kerner config).
i don't know exactly by what methode and what files exactly to change but I have read somewhere that you could make a custom kernel which doens't prevent read out of sbk. then fastboot boot boot.img, read out sbk and sould be good to go.
but praxis might be a good bit harde
... or maybe blob mehtode might work.
got important exams tomorrow but if anyone could send me link to wheelie-enabled n7 recovery i might take a look the next days.
maybe recovery-devs could make something out of it even earlier

[Touch Interface kexec Bootloader/Installer] nsboot aka NinjaSwag Bootloader beta

nsboot - NinjaSwag Bootloader/Installer
WILL REPLACE smackme2 and kexecboot!
Source: https://github.com/willcast/nsboot
Kernel source: https://github.com/willcast/ubuntu-kernel-tenderloin/tree/kexec (kexec branch, not Ubuntu)
Binary: https://docs.google.com/file/d/0B4WUjKii92l2Ukl4TE1EM1pjTDg/edit?usp=sharing
I have been working on this for about 2 weeks...
Features
Touch screen based interface
Able to boot kexec kernels
Able to install Android and Native Linux OSes, kexec tar files, and uImage kernels
Able to back up entire volumes as .tar.gz (with permissions & ownership)
Directly compatible with smackme and kexecboot config files
Can replace moboot entirely with the touch of a button.
Integrated file browser
Software touch keyboard available
Haptic feedback
uImage is < 4 MiB
Loads 3x faster than kexecboot
Has integrated ADB server so you can push and pull files from any mounted FS, or run a local shell.
Known issues so at this time
Colors are messed up in included TWRP recoveries
Things still to be tested
nothing as of now
kexec images for reference
webOS 3.0.5: https://docs.google.com/file/d/0B4WUjKii92l2WU9fdkNZa0V5NUk/edit?usp=sharing
Arch Linux ARM: https://docs.google.com/file/d/0B4WUjKii92l2YWRFUWJoMkpXRzg/edit?usp=sharing
Ubuntu: https://docs.google.com/file/d/0B4WUjKii92l2MXlEVmxQUHoyUzg/edit?usp=sharing
Slackware: https://docs.google.com/file/d/0B4WUjKii92l2MnRwMGRyTmRQcW8/edit?usp=sharing
Fedora untested: https://docs.google.com/file/d/0B4WUjKii92l2S3pVUkZNNzNSQUU/edit?usp=sharing
Android 2.2 Froyo: https://docs.google.com/file/d/0B4WUjKii92l2d2cwQlBtVVd4aGM/edit?usp=sharing
Android 2.3 Gingerbread: https://docs.google.com/file/d/0B4WUjKii92l2UGtETzBwNnNvckU/edit?usp=sharing
Android 4.0 Ice Cream Sandwich: https://docs.google.com/file/d/0B4WUjKii92l2UDc2cVZ2TjBWM2s/edit?usp=sharing
Android 4.1 Jelly Bean: https://docs.google.com/file/d/0B4WUjKii92l2d3g0U3p6c0l4NFk/edit?usp=sharing
Android 4.2 Jelly Bean: https://docs.google.com/file/d/0B4WUjKii92l2dlFzcFBacThSVXc/edit?usp=sharing
How to test
Code:
novacom boot mem:// < uImage.nsboot
To install, copy it to /boot (/dev/mmcblk0p13). It can also install itself if you put a copy of it on the SD card, and go Installer menu -> install uImage and navigate to it.
Screenshots are attached.
YouTube demo of a earlier version with only the boot working and a simpler menu: http://www.youtube.com/watch?v=0oQhSa4sqPU
Updates:
All OSes now boot (At least on my TP.)
Those which have had their kexec archives revised on GDrive since the first post are in italic.
Android 4.2
Android 4.1
Android 4.0
Android 2.3
Android 2.2
Android Recovery (included with all Android kexec archives)*
webOS
Ubuntu
Slackware
Arch Linux
Fedora
* The colors are still out of whack in recovery. It's mostly unneeded at this point with Built-In ADB support and zip installation, but I included it for those who want its more obscure or advanced features, or are more comfortable with its UI. Testing it specifically is appreciated because I don't have any plans to develop a test suite for it.
Compatibility list
Android ROMs
4.2
There is currently an issue with installing later Android 4.2 ROMs. The following 4.2 ROMs will install and boot:
Evervolv nightly 05-15-2013
The following 4.2 ROMs get stuck in a fairly serious bootloop (logcat shows at least surfaceflinger, mediaserver, and zygote segfaulting). I have tried different kernels.
CM 10.1 unofficial nightly 06-02-2013
Schzoid 2.0 nightly 04-23-2013
Other 4.2 ROMs are untested.
4.1
The following Android 4.1 ROMs have been tested and work:
JCSullins' CM 10 preview, 12-16-2012
Schzoid 1.2, 03-06-2013
4.0
The following Android 4.0 ROMs have been tested and work: CM 9 nightly, 01-06-2013
2.3
The following Android 2.3 ROMs have been tested: CM 7 Alpha 3.5
Issue: When the screen is woken up in CM7, nothing shows up on the display. The backlight does turn on.
2.2
The following Android 2.2 ROMs have been tested and work: my Froyo kang, version 0.4 and 0.3 (0.4 is on google drive on top of 0.3)
Native Linux
Ubuntu
The following Ubuntu releases have been tested and work: Ubuntu 13.04 final, Ubuntu 12.10 final.
Others are welcome to be tested, but I will probably not take issue with anything before 12.10 beta not working.
Arch Linux
Arch Linux boots, and seems to work. Wi-Fi has not been tested.
Slackware
Slackware boots and seems to work. Wi-Fi and Bluetooth have not been tested.
Debian/Bodhi
I am unable to locate any tar.gz archives to test for this distribution, nor a kernel of any sort. If anyone wishes to step up and send one to me or even host it, I would be grateful and also I'd probably get it booting within a day.
Fedora
These haven't yet been tested. They are theorerically installable with the new "tar.gz to custom LV" feature, but I would need to find a way to free more space on my TP to install them (my media partition is currently about 10 GB, 6 GB used for music, and 2.5 GB used for testing files.
Thank you
Good Job! I will test it tomorrow.I have been looking forward to ArchLinuxArm for a long time.Thank you.
Looks really good, I'll give it a spin.
Nice thing. But how Do I add my existing cm Installation to it? And how to add the cwm recovery in bootlist?
I repaced moboot with this and now i Can only Access Ubuntu
Sent from my GT-I9300 using xda app-developers app
Sir, I downloaded this, installed it, installed kexec-webos.
I rebooted
in boot menu section, i selected HP WebOS 3.0.5
Waited for 10 secs in Starting new kernel.
nothing only reboots
thinking to use webOSDoctor
But it is not going to webOS recovery mode.:crying:
What to do?:crying::crying::crying::crying::crying:
superboy123 said:
Sir, I downloaded this, installed it, installed kexec-webos.
I rebooted
in boot menu section, i selected HP WebOS 3.0.5
Waited for 10 secs in Starting new kernel.
nothing only reboots
thinking to use webOSDoctor
But it is not going to webOS recovery mode.:crying:
What to do?:crying::crying::crying::crying::crying:
Click to expand...
Click to collapse
Same here! But i Can Access Ubuntu
Sent from my GT-I9300 using xda app-developers app
superboy123 said:
Sir, I downloaded this, installed it, installed kexec-webos.
I rebooted
in boot menu section, i selected HP WebOS 3.0.5
Waited for 10 secs in Starting new kernel.
nothing only reboots
thinking to use webOSDoctor
But it is not going to webOS recovery mode.:crying:
What to do?:crying::crying::crying::crying::crying:
Click to expand...
Click to collapse
After I made the webOS image, I noticed that it's a bit... finicky. Just reboot from nsboot main menu. Then try loading webOS again.
If you need to get to recovery mode, the way to do it is to reboot like that, holding down VOLUME UP.
imapjonny said:
Nice thing. But how Do I add my existing cm Installation to it? And how to add the cwm recovery in bootlist?
I repaced moboot with this and now i Can only Access Ubuntu
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
If you installed CM to the logical volumes named /dev/store/cm-*, you need to back up and reinstall it from nsboot. As for booting CM recovery from nsboot, if you haven't done that yet, a feature I put in already lets you make .tar.gz archives from volumes (including Android ones.) I just enabled the extraction of them to Android volumes (used to only allow others), so you could use that to "move" your Android.
Minimum System Sizes to use for android partitions:
2.2 (froyo): 256MB
2.3 (gingerbread): 320MB
4.0 (ics): 320MB
4.1 (jellybean): 450MB
4.2 (jb mr1): 480MB
Step by step instructions:
Upgrade nsboot. Just released a new one. Either scp/adb it from a running OS or redo the install procedure except for the replace moboot part, after downloading it again.
Get the kexec tarchive for your android version onto the SD card. You could scp or adb push it. If needs be, find your old Android recovery image, and boot it via novacom:
Code:
novacom boot mem:// < uImage.ClockworkMod
Boot nsboot.
Go to Utilities - create volume tarchive.
Select "cm-system". Name the backup "System".
Repeat last two steps for "cm-data" if you want to keep your data partition. I don't recommend backing up "cache".
Go to Utilities - create volume set.
Name the new Volume Set depending on your Android/CM release: Use the names "android22", "android23", "android40", "android41", or "android42".
Format the new volume set: go to Utilites->format volume set, and select it. Click Confirm/OK.
After the set is created, go to Installer menu -> install .tar.gz to existing volume. Navigte to /mnt/media/nsboot/backups. You will find your two backups. Select "System" to restore to "androidXX-system", depending on the version you just created. Make sure you use a big enough size - see above table.
Repeat the last step for data, if you made such a backup.
You now need to find the kexec archive you copied to your SD card (it's mounted in /mnt/media.) Install it. If you chose the right volume set name, it will work.
Reboot or rescan boot items and you should see the Android version in your boot menu. Tell me if it doesn't work.
If it does work, go to utility menu -> delete volume set and select "cm" as your set. This will remove the old cm set, and leave the new androidXX one.
After that, if it did work, go to utility menu -> reclaim media space to get back any lost space for your media/sdcard partition.
Thank s it worked well. But i didnt get webos to run. I installed the webos kexec tar via install kexec tar to existing volume and of i wann Boot it, it hangs up and reboots nsbootloader
Sent from my GT-I9300 using xda app-developers app
imapjonny said:
Thank s it worked well. But i didnt get webos to run. I installed the webos kexec tar via install kexec tar to existing volume and of i wann Boot it, it hangs up and reboots nsbootloader
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
So when you guys who are having trouble with webOS try launching it, do you get to the screen that says 'please wait, booting...' or the HP logo that pulsates? Where does it reboot? I'm thinking I might have uploaded an old, non-workable tar file for that OS.
FYI: After testing every boot option, I discovered a problem with Android 4.1 (only 4.1). I'm looking into it.
EDIT: just uploaded a new kexec-webos.tar. I have things set up so the link remains the same. Redownload the new tarfile, and see if it works, it works on my end. Still working on fixing 4.1 - it's the only thing left, but most of you are probably using it (trying to.)
Sir,
Thanks for your reply.
But, I cannot get into recovery mode
I rebooted pressed POWER+VOLUME UP, nothing just going into nsboot.
I also tried pressing POWER+HOME+VOLUME UP, that is also the same.
please help.:crying::crying::crying:
I also replaced moboot with nsboot.
superboy123 said:
Sir,
Thanks for your reply.
But, I cannot get into recovery mode
I rebooted pressed POWER+VOLUME UP, nothing just going into nsboot.
I also tried pressing POWER+HOME+VOLUME UP, that is also the same.
please help.:crying::crying::crying:
I also replaced moboot with nsboot.
Click to expand...
Click to collapse
I have never seen this happen for real, and there is no way my code can just disable that combination. That said, I'm not leaving anyone out in the cold with a practically unusable TP.
If you have any ROMs installed, now is the time to use them to transfer needed files over to your sdcard.
Recovery mode works perfectly when I do it, I use that when I want to test a new version without installing it. I'll look in the moboot source and add a button to reboot directly into recovery. I'm also adding ADB support (if I can get kexec to tolerate the usage of the USB bus before the call, which I'm not sure.)
bootie (the TP first stage loader, comes before nsboot or moboot) transfers control over very, very quickly, so if you're pressing these buttons after you touch "Reboot", then don't. Though I don't seem to have issues if I do so, don't hold down Power unless you're force rebooting the TP or powering it on from the cold. Hold down Volume Up as you click reboot, keep it held down as you click "yes", and don't release it.
Also try powering off, then powering back on after 10 secs. Again, hold down Volume Up, then Power, don't switch over.
If you are really frantic, purposefully deleting the nsboot uImage (/mnt/boot/uImage.nsboot) will make your TouchPad boot to the "www.palm.com/ROM" screen, which is a more mandatory form of recovery mode. You could also "rename" or "move" moboot into nsboot, and you'll get moboot back.
castrwilliam said:
EDIT: just uploaded a new kexec-webos.tar. I have things set up so the link remains the same. Redownload the new tarfile, and see if it works, it works on my end. Still working on fixing 4.1 - it's the only thing left, but most of you are probably using it (trying to.)
Click to expand...
Click to collapse
Okay everything is working well with this new tar.
Sent from my GT-I9300 using xda app-developers app
Make sure your pad is fully charged. I have had problems before during partially charged tp
John 3:16
castrwilliam said:
I have never seen this happen for real, and there is no way my code can just disable that combination. That said, I'm not leaving anyone out in the cold with a practically unusable TP.
If you have any ROMs installed, now is the time to use them to transfer needed files over to your sdcard.
Recovery mode works perfectly when I do it, I use that when I want to test a new version without installing it. I'll look in the moboot source and add a button to reboot directly into recovery. I'm also adding ADB support (if I can get kexec to tolerate the usage of the USB bus before the call, which I'm not sure.)
bootie (the TP first stage loader, comes before nsboot or moboot) transfers control over very, very quickly, so if you're pressing these buttons after you touch "Reboot", then don't. Though I don't seem to have issues if I do so, don't hold down Power unless you're force rebooting the TP or powering it on from the cold. Hold down Volume Up as you click reboot, keep it held down as you click "yes", and don't release it.
Also try powering off, then powering back on after 10 secs. Again, hold down Volume Up, then Power, don't switch over.
If you are really frantic, purposefully deleting the nsboot uImage (/mnt/boot/uImage.nsboot) will make your TouchPad boot to the "www.palm.com/ROM" screen, which is a more mandatory form of recovery mode. You could also "rename" or "move" moboot into nsboot, and you'll get moboot back.
Click to expand...
Click to collapse
Sir,
I deleted nsboot, moboot and all uImages.
But now i am getting a blank screen after 5 secs it reboots.
this has been occured unlimited times.
Please Help
superboy123 said:
Sir,
I deleted nsboot, moboot and all uImages.
But now i am getting a blank screen after 5 secs it reboots.
this has been occured unlimited times.
Please Help
Click to expand...
Click to collapse
Okay, try the volume up button. If that doesn't work, try holding power + volume up + home (rebooting it), ignoring the boot loop. I only said to delete one uImage... wait, uImages are the only files you deleted, not anything else in /boot, right?
Do you ever see the HP logo?
If you touched "boot.bin" (among certain other possible files in /boot) you'll probably need the debrick program. This isn't nsboot's fault... link to program is here: http://forum.xda-developers.com/showthread.php?t=2010270
If you use that program, follow its instructions TO THE LETTER, if there is anything you need clarification on, ask here - I've never had to use it, but I've heard of it fixing TPs that don't even show anything on the LCD. That said, if something goes wrong with it, it has the opportunity to make the problem far, far worse.
castrwilliam thank you for your work
Rock on dude
loving your work man keep it up dude:good:
superboy123 said:
Sir,
I deleted nsboot, moboot and all uImages.
But now i am getting a blank screen after 5 secs it reboots.
this has been occured unlimited times.
Please Help
Click to expand...
Click to collapse
Is the pad fully charged? I would strongly suggest letting it charge for twenty four hours.
P.S. don't panic
Sent from my Galaxy Nexus using Tapatalk 2
Is it possible to install Ubuntu 13.04 and 12.10 at the same time?
Sent from my GT-I9300 using xda app-developers app
I am a little confused on the install process, would you mind elaborating.
Sent from my Galaxy Nexus using Tapatalk 2

[DUAL-BOOT][RECOVERY] Ouya Boot Menu for Support of Kernel Image Chain-loading

Hello everyone! Just like others here, I've been somewhat spooked by our inability to enter Ouya's Recovery partition at the earliest stage of booting, meaning a bad flash of the Boot partition would leave the device inoperable. When I heard that Ouya's stock firmware updates were possibly bricking a few units out there, I decided to block updates on mine and see if I could transform the Boot partition such that it would become a logical extension of the bootloader. What I ended up with is something close to the "Ouya Safe Recovery" project, where a user should only need to flash Boot one additional time, along with chain-loading support as well.
Chain-loading in this case refers to the booting of ROM kernel images that reside as regular IMG files under the /sdcard and/or /system filesystems. With this capability it is possible to choose an image to run when the Ouya turns on. As an example, one may wish to set up a 2nd/test kernel+ramdisk image to use with your installed ROM, or he may wish to run Tuomas Kulve's Debian project from time-to-time without having to set up the USB cable for Fastboot mode. When dealing with distinctly different ROMs (not just alternate kernels), only one of them may install to the Ouya's built-in storage (e.g., /system); others must have been designed/created to use external storage.
An image for the Recovery partition is available along with the Boot. The former may be helpful if you wish to try out the boot menu before performing the flash of the Boot partition, or are generally okay with bouncing to Recovery before invoking a chain-load. Either of these may be tested from Fastboot mode, but do note that a successful chain-load requires that the image actually be flashed to the Ouya. (Otherwise it just reboots.) The ClockworkMod (CWM) recovery application is available on both images and is accessible from the boot menu.
Additional Information
There are a few things to consider when deciding if this approach makes sense for you:
- Users of the "Ouya Safe Recovery" project may want to stay put unless the dual-boot aspect is of interest. If so then it would be cleanest to choose my Boot image; the Recovery partition (your ROM image) could be left alone.
- The images here are not compatible with Ouya's stock firmware, due to the auto-update nature of Ouya's ROM. Either your flashed Boot image would get overwritten, or an installed non-Ouya Recovery might cause that update to hang. Therefore, you should be prepared to switch to one of the ROMs here at XDA. If you're currently on stock and don't want to switch right away, that's fine; we'll go over how to block updates for the time being.
- The Ouya CM10 ROM is nice in that it provides the IMG file separately, allowing us to handle it as we wish. However, the other ROMs end up placing their boot.img in the main ZIP. This is standard practice for other devices, but we need to be careful ensuring our Boot partition doesn't get reflashed as part of the ROM installation. Therefore, it would be necessary to investigate repackaging the ROM with an alternate updater-script prior to installation. See my StockPlus post on page 2 for more. (This shouldn't affect those who've opted for my Recovery image.)
This feature is based on CWM's initial ramdisk, and includes a new boot menu application that comes up prior to CWM itself. Basically, CWM shows up later if the menu application exits for any reason. The Ouya stock kernel (561) has also been compiled with HDMI's copy protection turned off, and includes two patch sets:
- KExec-HardBoot is the key to chain-loading on our platform. It overcomes standard KExec's lack of hardware reset (and thus failed execution) by triggering a reboot in the middle of the preparation of the new kernel. This ingenious system has been developed by Tasssadar and others over in the Nexus forums. (Be sure to enable CONFIG_TEGRA_HARDBOOT_RECOVERY if interested in compiling a Recovery kernel.)
- HDMI visual stability has been improved with a little hack of mine: a significant relaxing of a timer in the driver. (The latest Android source has corrected the instability with a significant design change, but my hack seems fine enough for this project.) Also picked up specific Android fixes in the area of Framebuffer double-buffering, as that needs to be working for CWM usability.
Installation
If you're on Ouya's stock firmware, then you should make sure that any future updates do not get applied. There is a project here ("Mod Collection For Ouya") that should help. I personally side-loaded the Baxy custom launcher to avoid Ouya's update environment. It is also likely necessary to stay out of the Ouya/Discover store if going the custom launcher route as I believe the store app can trigger an update.
At this point you can download your chosen image (Boot or Recovery) and unzip to get the IMG file. Boot your Ouya to a working Root/BusyBox environment (ROM or Recovery), and then transfer the IMG to the Ouya. (An example using ADB would be "adb push boot102513.img /sdcard/boot102513.img".)
Bring up the Ouya command prompt (e.g., "adb shell") and run these commands to get started:
su [command not present on CWM - that's okay]
cd /dev/block/platform/sdhci-tegra.3/by-name
ls
You should see the various 3-letter partition names from that last command. Your command prompt should also contain the "#" character to denote root-level access. This next step will save off your current ROM image, both because we may end up overwriting it, and because the saved file will end up as your main bootable kernel for the chain-loader. Run:
cat LNX > /sdcard/kernel.img
(If configured for "Ouya Safe Recovery," then replace the preceding "LNX" with "SOS".)
We are near the flashing stage. Check to make sure your Ouya has a reliable source of power, preferrably from an uninterruptable power supply. Recall that a bad flash of my boot image can leave the device inoperable, but I feel the risk is very low provided the following directions are heeded. Fortunately the flash process only takes a few seconds.
For the Boot image option, verify by running:
md5sum /sdcard/boot102513.img
Do not proceed unless you get "e4b1b1ad553e55ad0b2ce3fb8f5bf623".
Again for the Boot image option, flash to the Ouya by running:
dd if=/sdcard/boot102513.img of=LNX
For the Recovery image option, verify by running:
md5sum /sdcard/rcvy102513.img
Do not proceed unless you get "dda0811a7e8e82a7d4ad3fa4c3ae35e4".
Again for the Recovery image option, flash to the Ouya by running:
dd if=/sdcard/rcvy102513.img of=SOS
You may optionally verify (post-flash) by running "md5sum" on the partition name. Finish up with these commands:
sync
reboot
Usage / Configuration
The menu should come up, defaulting to "kernel.img" for the Boot image and "CWM" for Recovery. That default will then launch after ten seconds of inactivity. You may also briefly press the Ouya power button during the wait to advance through the options. The option list is 1) kernel.img, 2) kernelA1.img, 3) kernelA2.img, 4) CWM, and 5) Recovery Partition.
The defaults from above should be fine for most everyone, but it is possible to fine-tune them. An optional configuration file (/sdcard/bootmenu_b.cfg for Boot, /sdcard/bootmenu_r.cfg for Recovery) may be established to specify the default menu entry as well as the inactivity timeout. As an example, the following command would make Recovery start kernelA1.img after five seconds:
echo "2 5" > /sdcard/bootmenu_r.cfg
It is hoped that the menu would never hang. If it does, then waiting a full minute should allow CWM to start. Otherwise, it may be necessary to attach a wired/USB keyboard and type in the Alt-SysRq-X sequence, similar to Ctrl-Alt-Delete on a PC. The sequence might have to be done early on in the menu startup process, and should blink the Ouya light and place it in Fastboot mode.
The menu may unexpectedly place you in CWM, which would indicate an issue with a chain-load. The reason may be due to a missing or corrupt IMG file. Otherwise you should be able to determine why by checking /tmp/bootmenu.log against the attached source code.
---
I hope this project will be of help to others!
An additional support forum that everyone should be able to post at is available: http://forum.xda-developers.com/showthread.php?t=2450711.
Wow, really great. Thanks a lot for your effort
Gesendet von meinem One X+ mit Tapatalk
nchantmnt said:
Wow, really great. Thanks a lot for your effort
Click to expand...
Click to collapse
My pleasure, nchantmnt. Hope your new Ouya is helping you feel at home!
Yes im happy it already arrived, but after a second miscarriage and lots of stress because of a lawsuit with our neighbour i didn't have time nor nerves to play or code. Seriously this year sucks
Gesendet von meinem One X+ mit Tapatalk
nchantmnt said:
Yes im happy it already arrived, but after a second miscarriage and lots of stress because of a lawsuit with our neighbour i didn't have time nor nerves to play or code. Seriously this year sucks
Click to expand...
Click to collapse
Gosh, I'm very sorry to hear that. Do think ahead to the upcoming holiday season, and may it be a time to reflect and anticipate a fruitful 2014.
@Hal9k+1 - THANK YOU!
I was so nervous flashing CWM and StockPlus as there is no real way to fix things if something goes wrong. This should give people more confidence when flashing their Ouya.
I understand the process using ADB...my question is: can this be used from CWM somehow?
PS. I assume new kernel will always be flashable from CWM, the hack does not require 561 specifically.
Ipse_Tase said:
I understand the process using ADB...my question is: can this be used from CWM somehow?
Click to expand...
Click to collapse
Hi Ipse_Tase - I do hope the feature will be helpful to you and others.
As I think about your question, I suppose I could have have created a ZIP that would have been installed by CWM. Similarly I could have worked through some form of installation shell script. But for an important operation such as flashing, I prefer the one-at-a-time approach of the interactive shell.
Note that CWM does have an ADB service running with it. Your Ouya would show up as a different device while in CWM, so you'd need to enter Device Manager (Windows) and point the unknown device to the same ADB driver as used for the main ROM.
Alternatively you could skip ADB for this Ouya Boot Menu installation and set up an SSH server on your main ROM. I personally have installed "SSH Server" (Ice Cold Apps). I recall two screens to set up (does require the trackpad in cases), where I enabled automatic start on both, and also set the port number to 2222. After an Ouya reboot I had SSH/SCP capability and could use PuTTY/pscp from Windows.
Hal9k+1...fast reply, thank you.
Just to put my ever-so-senile brain at ease: so I run StockPlus 519r1, and WHILE in the ROM, I start ADB and follow your instructions .
OR...I enter CWM, make sure I get the right ADB drivers installed for THAT instance and go from there.
For a developer, I'm sure it's easier and more familiar to run ADB commands - for people like me (5%-over-the average-user) a CVM option to flash a zip and do all this would be more in-line with the abilities to hack.
I have rooted 4-5 devices so far and the only time I type any ADB commands is at root/unlock time - sometimes not even then (Nexus 4 and the Root Toolkit).
So if you ever consider creating a recovery flashable file, it would help many. Probably not me, as by then I would have done the ADB trick
Sounds like great work! I was hoping to implement something like this myself, but I haven't made any more time for OUYA-related development in a while (due to positive life events/busyness)
I will definitely take a look at your work when I have time!
~Troop
Ipse_Tase said:
Hal9k+1...fast reply, thank you.
Just to put my ever-so-senile brain at ease: so I run StockPlus 519r1, and WHILE in the ROM, I start ADB and follow your instructions .
OR...I enter CWM, make sure I get the right ADB drivers installed for THAT instance and go from there.
Click to expand...
Click to collapse
You got it! You don't need to worry about booting to the other partition prior to flashing. That is a given partition (LNX/SOS) is no longer being accessed once the image is booted. For CWM's ADB, you'd simply point Windows to the same INF file that you originally used. Hope this helps.
StockPlus Installation
Well, I finally retired this old stock 393 ROM I was on, and moved to StockPlus 519r2. I was not able to install it the normal way given my Boot image is in place here. So I ended up modifying "updater-script" under META-INF/com/google/android, and then repackaged prior to running the install procedure. I'm attaching my changed version in case it helps anyone, and please note that it makes StockPlus the main image (kernel.img).
(You'll need to right-click to save the attachment. Once done it will need to be renamed such that it does not include the ".txt" suffix.)
The Windows "7-Zip" utility is helpful for packaging. You may start by right-clicking the downloaded ZIP, then 7-Zip --> Extract to "OUYA_[...]". Enter the newly created directory, get to the updater-script, and replace it with mine. Now back up to the area with META-INF, system, and boot.img, still in the new directory. Select all three under Windows (Ctrl+Click), right click that area, and then 7-Zip --> Add to "OUYA_[...].zip". Be sure this new ZIP is the one that makes it to the Ouya.
Still haven't tried this out yet, but I hope to soon.
I missed out on news over the holidays though and just noticed this:
Announcing Ubuntu and Android dual boot developer preview
http://developer.ubuntu.com/2013/12/announcing-ubuntu-and-android-dual-boot-developer-preview/
I'm curious of their dual boot implementation and how it compares and if we can synergize with their approach, but haven't looked into the details of how theirs works yet (its sounds like it uses a custom recovery image, and they have the ability to trigger it to reboot into Ubuntu from an Android app and vice versa, which is cool)
It'd be awesome to be able to multi-boot an Ouya ROM, an Android ROM (CyanogenMod), and Ubuntu with that kind of ease.
EDIT: This may be more our speed though: (MultiROM)
http://forum.xda-developers.com/showthread.php?t=2011403
(did you pull anything from there? Sounds like they have a modified TWRP that can flash zips to the other ROM slots, which is something I was also hoping to implement)
~Troop
Thanks, Trooper. Good to see Ubuntu moving further along in the mobile world.
I briefly looked at MultiROM since it originated from the KExec-HardBoot work, but decided not to go in that direction. The main reason is that I decided not to pursue the setup/learning of an Android build environment, but also because it wasn't clear how I'd deal with our lack of a touchscreen and lack of volume up/down buttons. I ended up creating a small application that fits within Ouya's CWM framework and starts up before CWM itself; it monitors the power button for click events and writes to the framebuffer memory region using regular Linux calls.
I'm not too concerned about the dual-boot aspect of this new Ubuntu, but the lack of touchscreen could be a hindrance if mouse/keyboard were not a viable substitute. Whether this Ubuntu is designed to work from external storage is another question, since our /system and /data would be occupied by Android. But in general I think we could boot it from my framework, and if my Boot image were selected over the Recovery one, then the Ubuntu kernel could reside in Recovery and also be bootable from the Android side with the "reboot recovery" command.
Best of luck, and hope you'll have a chance to try it all!
accidental post please delete

[Q] Can not ADB my device?!

I have a Verizon Galaxy Tab 7 (SCH-I800) and I can not link up to it in ADB.
I have installed the Android Development Kit, Samsung drivers, and downloaded CM10.1.
I was able to contact the tablet in command prompt through heimdall and push clockworkmod recovery.
I'm following this guide:
http://rootzwiki.com/topic/33743-ext...rd-only-guide/
I've removed the internal memory card.
I've modified the update.sh file and rezipped everything.
I just need to know WHY adb cannot find my device. When I type "adb devices" in the command line NOTHING shows up. I've tried reinstalling the samsung driver, reinstalling the driver that came with heimdall, and updating the samsung driver via windows update.
By the way, this device would bootloop at the verizon loading screen, could not be updated, and could not load its original android OS, therefore I cannot turn on debugging or anything like that. Alls I can do is access the "PC connection" yellow screen and the CWM bootloader I pushed with Heimdall.
By "Internal" Memory ya meant "External" Memory right? as the Internal Memory is the 16GB Flash ROM.
In any case all pedantry aside. Did you remember to check the USB Debug Setting?
I think you can find this under the Wi-Fi Settings (On the Samsung Stock ROMs), IIRC it should be near the "Samsung Kies / Media Player / USB Storage" Settings. On CM10 Builds you'll find it in the "Developer Settings" near the bottom of the List.
Pretty sure you have to check this "Flag" before you can use ADB on your Device...
In that case consider yourself bricked!
In this case I'd recommend you find the Overcome Recovery Package: HERE
Install such Driver that you may need, then fire up Odin3 v1.7
Then set your Device into Download Mode (e.g. Hold Volume Rocker down + Power till you enter the Download Mode Screen)
Pit -> gt-p1000_mr.pit
PDA -> GB_Stock_Safe_v5.tar
Phone -> modem.bin**
Most People would just use the XXJPZ (GSM modem.bin), here but, since you have a CDMA Phablet, you'll have to find and pick the correct modem.bin File that is the best match for your CDMA Device. This is also likely why your now soft-bricked.
Hopefully after all this rigamarole you'll land up on a Stock, non-branded Samsung Gingerbread 2.3.3 ROM.
To which I would just download This, and that should give you Root.
Without all that tedious mucking about with ADB.
The internal chip has failed. I cannot boot the device whatsoever. I removed it as the link states. Therefore i cannot check off debug mode on the tablet. I will try your suggested method and report back
Don't look at Overcome method if you have a CDMA tab.
It will only brick your tab if it ever worked at all.
Regarding bad internal memory, there are two chips. The OneNand 512MB and the MoviNAND 16GB.
If your OneNAND is the one broken, removing the MoviNAND achieved nothing.
The bootloader, modem, (and is it /system too of stock rom?) sits on OneNAND.
If you look at the link I posted, my tablet was doing the same exact thing as pictured in the link. Saying it could not mount any files or anything. No matter what I did, it would just get to the verizon loading screen and keep flashing "verizon".
I haven't tried the "overcome" method as it didn't really seem like it'd work.
I want to ADB my device to push the new ROM to it. I've already formatted the SDcard as suggested in the guide. Since clearly no one is clicking the link and reading the guide, I'll post it:
Summary:
- Open up the device and take internal SD Card out.
- Re-assemble the device.
- Partition the external SD Card (3 partitions, two small ext4 and one big FAT32)
- Modify ICS or later ROM's update.sh to use partition 3 as external SD Card.
- Flash modded ROM via CWM (and Google Apps optional).
- Enjoy
Taking it appart:
Don't panic!, if you can use a screwdriver and build with Legos you are qualified to do this!
iFixit does a wonderful job of showcasing how to open the device up that I rather link to them than try to out-do them.
Follow their guide until step 13 then refer back to this guide. http://www.ifixit.co...Teardown/4103/1
Posted Image
To actually remove the Internal SD Card (that is not soldered to the board but in-fact glued to it), I recommend you take an exacto knife (or other small blade or thin screwdriver) and slide it around the edges gently; once the edges are loose, take your screwdriver under the chip and just pop it up.
Posted Image
There will be adhesive residue on the board, I recommend using some gentle solvent to remove it (I used a cloth with a little paint thinner).
Put everything back together (just follow the iFixit guide on reverse) and feel proud that you are done with the hardware mod.
Partition your external SD Card
I used three partitions (all primary, not logical) , two 500 MB ext4 and a FAT32 with the rest of the space.
Linux users will probably not require much help on deciding what software to use, but for Windows users MiniTool Partition Wizard does a good enough job.
Do note that your device will perform according to your external SD Card, so it's not a bad idea to invest in a category 10 SD Card.
Modifing the ROM:
Download your ICS / JB ROM of choice, unzip it and open update.sh
Edit both line 31 and 35 to be as bellow
SD_PART='/dev/block/mmcblk0p3'Save and zip back.
Loading the Modded ROM to the SD:
Because we messed with the SD Cards, CWM will have a bit of trouble finding the external SD Card (until we flash our ROM).
Go ahead and connect your device to your computer and ADB the following command:
adb shell "echo /dev/block/mmcblk0p3 > /sys/devices/platform/usb_mass_storage/lun0/file"
That will allow you to access your SD Card from your PC, just copy your modded ROM to it.
Now, issude the following command:
adb shell mount /dev/block/mmcblk0p3 /sdcard
This will allow you to install the .zip file from CWM, go ahead and do that.
After checking partition types, your device will reboot and appear on a countdown to find the external SD Card, go ahead and reboot it manually before it does automatically (reboot to recovery with volume up).
Flash the .zip again, this time the installation will go successfully and you will have a working device.
Optionally, flash your desired Google Apps.
Now if we could get back to my original question, does anyone know why this device will not allow me to ADB it even when it's in download mode (a.k.a volume down/power button)
I actually got my tablet to boot up this morning for about 1 minute, then it shut off for no reason and did the "verizon" flash again when restarted.
priyana said:
Don't look at Overcome method if you have a CDMA tab.
It will only brick your tab if it ever worked at all.
Regarding bad internal memory, there are two chips. The OneNand 512MB and the MoviNAND 16GB.
If your OneNAND is the one broken, removing the MoviNAND achieved nothing.
The bootloader, modem, (and is it /system too of stock rom?) sits on OneNAND.
Click to expand...
Click to collapse
Please correct my but, what other then the modem.bin File could brick such a CDMA Device?
AFAIK as long as he picks the correct CDMA modem.bin it should work alright?
In the case that I am in error, then how does One recover such a CDMA Device then?
I can easily recover this device if I can get the ADB commands to start working. I feel like no one is reading the instructions. If you look at the link where the instructions are, there is a screenshot of his device. All of that "unable to mount" etc is what was happening to my device, hence why I removed the failed chip.
If I could get my device to show up in ADB, I wouldn't be asking this question!
By the way, I'm on an HP DV6. I tried all this in windows 8 and got nothing, so I installed a backup hard drive and put windows 7 on (this is what I'm on now) to see if that'd make a difference. Still nothing. I also tried on my old Gateway desktop but in download mode my old PC (still USB 1.1 1GHz celeron 512mb ram) the PC has no clue what the tablet is.
So I finally got this thing to boot into 2.2. Now the touch screen is unresponsive and the battery goes to 0 as soon as it's unplugged. Going to take it apart in the morning and make sure everythings connected. Might try a new battery but if this thing doesn't show more promising results soon I'm going to just say screw it and get rid of it.
Edit: Touch screen works but is flipped. If I slide my finger side to side nothing happens. If I slide it up and down i can awkwardly unlock the device. I'm guessing reload the factory image?!
the CDMA device is of different hardware. Not just the modem.
I am not technical enough to explain the difference. But I know Overcome method will brick it.
EliteEmerz: can you at least share how you get the PC to detect your device again?
priyana said:
the CDMA device is of different hardware. Not just the modem.
I am not technical enough to explain the difference. But I know Overcome method will brick it.
EliteEmerz: can you at least share how you get the PC to detect your device again?
Click to expand...
Click to collapse
If you put it into download mode it shows right up in my device list, drivers for "samsung USB device" load up. I can contact the tablet through heimdall to load bootloaders, images, etc.
For some reason I got it working pretty good last night except the touch screen issue. I reloaded the stock rom again and am playing with the SD card partitions since that's how I got it to boot up the last 2 times. I dont even care if I can load Jellybean on, I just want a working tablet.
By the way, this is SOLVED.
It will now boot up using a Stock ROM plus the zImage + recovery from clockworkmod
My touch screen is flipped (so I have to slide up and down to get it to swipe side to side) but at least it's on now. Made a new thread to address the flipped touch screen issue!!

Categories

Resources