yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S III] DrGit:
I've been working on getting Ubuntu running on my Sprint Galaxy S3 using the same method I used on my Epic 4G - kexec from recovery loading the root filesystem off a partition on an SD card.

What I've done so far:

* Found a kexec loader to boot into a custom kernel, which is required for booting off an SD card, among other things;

* Compiled a custom kernel with KGSL DRM support enabled for Freedreno;

* Built a minimal Ubuntu 13.10 armhf rootfs and compiled the Freedreno DRM/DDX/Mesa Gallium driver with changes to support the Adreno 225 and stub occlusion query (possibility of full dekstop OpenGL 2.1 support!);

* Got X11 working with USB keyboard, touchscreen, and fbdev. Still working on getting the Freedreno DDX to load.

I still get a kernel oops with the camera driver (http://pastebin.com/egZbxsED), but it apparently doesn't affect stability or cause reboots anymore.

Working so far:

* USB Host - only tested with a keyboard, but other input/storage/audio/video devices should also work.

* Framebuffer console - thanks castrwilliam!

* Touchscreen works with X.org fbdev driver and the following added to /usr/share/X11/xorg.conf.d/11-evdev-quirks.conf:

Section InputClass
Identifier "Touchscreen"
Driver "evdev"
MatchProduct "sec_touchscreen"
EndSection

* Power and volume buttons

Untested:

* Bluetooth - might need firmware

* Sensors - should work just fine

* Home, menu and back buttons should work but probably need mapping

Unlikely to work due to proprietary Android-only blobs:

* Camera

Kernel config changes:

# IMPORTANT: remove the line that says "depends on !MSM_KGSL_DRM" from drivers/gpu/msm/Kconfig:70

CONFIG_DEVTMPFS=y

CONFIG_DEVTMPFS_MOUNT=y

CONFIG_VT_CONSOLE=y

CONFIG_DRM=y

CONFIG_MSM_KGSL_DRM=y

I may eventually post a pre-built kernel, but if you don't know how to compile a kernel from source, this guide is not for you.

Likewise, if you don't know how to prepare an armhf Ubuntu root filesystem, this guide won't help much.

After building the kernel, copy arch/arm/boot/zImage to your SD card along with the attached zImage.zip (CWM-flashable kexec loader).

It might need modifications (META-INF/com/google/android/updater-script) depending on how you have your card set up.

UPDATE: Unfortunately, this phone hasn't been a good fit for me. I never got very far booting Ubuntu or Freedreno, so I decided to sell it.

For anyone still interested in this project, I believe castrwilliam has the required patches.

When I get my next Snapdragon device (either the new Nexus 7, a Nexus 4, a Galaxy S4, or another phone with Adreno 320 graphics), I will post the Mesa patches for occlusion query support. Sorry I wasn't more helpful with this device.
[Sprint Samsung Galaxy S III] Nexus11:
Added to favourites, I'll see what I can do with it over the weekend
[Sprint Samsung Galaxy S III] hotwired34:
Great work. Good luck debugging.
[Sprint Samsung Galaxy S III] moonzbabysh:
Maybe taking a look at how Motorola worked Ubuntu, in a way, with Webtop that came on the Photon. The Photon has the integrated Ubuntu-based 'Webtop' application from Motorola. The Webtop application is launched when the phone is connnected to the external display through Laptop dock or HD multimedia dock. In Webtop mode, offering similar user interface of typical Ubuntu desktop, the phone can run several applications on external display such as Firefox web browser, SNS clients and 'mobile view' application enabling total access of the Photon and its screen. In September 2011, Motorola released the source code of Webtop application at SourceForge.

I know it's not an app you're trying to use but it may help in finding how to work some of the kinks you have. I hope that helps :)
[Sprint Samsung Galaxy S III] castrwilliam:
Hi, I'm the person maintaining Ubuntu currently for HP Touchpad (http://xdaforums.com/showthread.php?t=2225462) (which also uses an MSM SOC.) It's starting to show its age... I'm trying to get this to where you have it currently on a Verizon S3 / d2vzw (obviously, kexec'ing into a Verizon kernel instead.) Maybe we could collaborate?

Currently I have the KT747 kernel (kexec host support as well as guest) (compiled as a zImage. If you can provide me with access to the patches you have for freedreno and hopefully also an initramfs image (I'm going to mod the HPTP rootfs, so no need there)... I'd love it.
[Sprint Samsung Galaxy S III] DrGit:
My only modifications to the kernel so far are the ones I mentioned in the OP and three of Rob Clark's Freedreno commits from the mako-kernel branch of kernel-msm on his GitHub - namely, "kgsl: drm: remove checking on 'active'", "video/msm: add true ARGB", and "kgsl: fix null ptr on cache flush".

At one point I had X11 working with freedreno displaying the GNOME background, but the screen blanked after 10 seconds and I couldn't recover from that. Unfortunately, after experimenting with different kernel config options, I lost that semi-working configuration and the GPU started to page fault, sometimes displaying a corrupted screen and sometimes rebooting before displaying anything.

Believe me, I've been working on this for weeks, and it's very frustrating that it doesn't even sort of work. My minimal modifications to Mesa to get it to recognize the Adreno 225 are highly unlikely to be the cause of the problems, and I highly doubt the differences between the 220 and 225 are to blame since it was working at one point. It's a one liner, figured out from from freedreno/mesa issue #2.

Castrwilliam, the initramfs is the least of your worries. I don't use one, since its only function is to display the Plymouth splash, which doesn't work anyway.
[Sprint Samsung Galaxy S III] castrwilliam:
Yeah, I realized how you were doing this after looking at the kexec script. I was trying to boot from Android, not recovery, and was under the impression you had put a disk image on external SD, and then made the initramfs loop-mount that and boot from it... but now I see you partitioned it.

It's a shame you don't have your original config, I'll try to get it booting again on my end. I remember doing something like this a while back, where I made like 10 differently configured kernels at once, and tested them each in turn. I imagine the ramconsole would help a good bit so that I could look a how far we're getting. (The touchpad has its own version of that, which you can read directly from the bootloader (bootie.) Then again, it also has LVM volumes for storage instead of actual partitions (except for boot) - which makes it uber easy to boot lots of OSes.)

Currently I'm not doing too well. I remember that kexec did work at one point on d2vzw hardware but I'm assuming that it still does now (new bootloaders, 3.4 kernels, ...) I do kexec -e, the reboot happens, I see the Samsung bootloader screen, then the screen blanks for like 5 seconds and it reboots again - back into android.
[Sprint Samsung Galaxy S III] DrGit:
The RAM console should be enabled by default, so check /proc/last_kmsg once Android boots back up.

It could be something simple like the root filesystem not mounting, either due to how you partitioned the card or not having time to settle, hence rootwait. Or it could be something else. I haven't gotten any useful output in /proc/last_kmsg with the framebuffer console enabled, so make sure that's disabled unless you want a headache and a psychiatrist visit.

Unfortunately, I've spent way too much energy trying to debug the GPU page fault, and I probably won't have much time to work on it after next month. I want this bug dead and forgotten, so more eyes would be great!
[Sprint Samsung Galaxy S III] castrwilliam:
X11 works (shows something on screen) with the X.org "fbdev" driver. I can't reproduce anything with "freedreno" (or "modesetting", which I accidentally loaded at one point...)

The touch screen doesn't respond, but the power key works and brings up a shutdown dialog.

Screenshot attached. I used the 13.04 Touchpad rootfs with some modifications...
[Sprint Samsung Galaxy S III] castrwilliam:
Okay, you can get the fbcon working by either loading it as a module during boot OR changing its "module_init" macro in drivers/video/console/fbcon.c to "late_initcall".

Picture attached. Sorry for blurriness, I don't have an actual digital camera, only what's on my sig. This should make debugging a bit easier.
[Sprint Samsung Galaxy S III] Wootever:
Nice to see some more freedreno development on android phones :)

I'm using freedreno with a slightly different approach, starting it directly from android on a chrooted shell, which is a lot more easier to debug.

The kernel needs some fixes from the mako branch and the following configs:

CONFIG_DEVTMPFS=y
CONFIG_VT=y
CONFIG_DRM=y
CONFIG_MSM_KGSL_2D=y
CONFIG_MSM_KGSL_DRM=y

Rob Clark (the maintainer of freedreno) has been working on his own kernel driver for adreno gpu:

https://github.com/freedreno/kernel-msm/commits/ifc6410-drm

This would be a nice addition/replacement for the current qualcomm gpu driver.
[Sprint Samsung Galaxy S III] castrwilliam:
How do you stop the SurfaceFlinger (I think that's proper terminology) from hogging the framebuffer?
[Sprint Samsung Galaxy S III] castrwilliam:
Semi Working Freedreno/X11

HEY, look what I did?!

(There are a lot of patches req'd to get this far. Even at this point, there's a weird bug where the cursor loops across the edge of the screen and windows overlap themselves. If you want to know, I'll elaborate in a further post, otherwise, let's get that touchscreen working for release!)

Thanks to Rob Clark (again, the author of freedreno) who helped me get this far on his IRC channel at Freenode.
[Sprint Samsung Galaxy S III] DrGit:
Are we keeping track of all the necessary patches? I'm on https://github.com/CyanogenMod/android_kernel_samsung_d2, branch cm-10.2_kgsl, with the per-process pagetable hack, the "active" kgsl_drm fix, Adreno 225 case in Mesa (freedreno_screen.c), and my stub occlusion query hack. I wasn't on #freedreno when Rob Clark pointed out the libdrm bug I heard about from the Wiki - did you fix that? I'm still getting the assert crashes.

I'll be on #freedreno at some point tomorrow.
[Sprint Samsung Galaxy S III] castrwilliam:
I got this to work by using a fairly old libdrm, but a new DDX (xf86-video-freedreno). I haven't fixed the assert bug on the newer ones.

You need to patch the DDX's msm-device.c to set the width to 736 (has to be a multiple of 32), and then disable/comment out/delete where it calls the mode-set function (there's a comment about making xrandr happy in the right place.) I can make a patch soon, but I have a feeling that this is what made the other bug happen with the looping cursor.

edit -- I fixed the looping cursor. A patch is attached...

Youtube video of it working: http://www.youtube.com/watch?v=rh9wmmYuKxY

Tips:

Set the firnware path for the dhd (wi-fi) driver to /system/etc/wifi/bcmdhd_sta.bin (WITHOUT the _b2 buffix, it will be added by the module). Set the nvram file to /system/etc/wifi/nvram_net.txt. Then, add the Android partitions to the /etc/fstab (mmcblk0p14 is system.)

apt-get install xserver-xorg-input-multitouch and then add a config file under /usr/share/X11/xorg.conf.d/ to get the touchscreen working. It will act like a laptop trackpad. You MUST use the multitouch driver. "evdev" will segfault the server on any touch. Note that you can match the TS in an InputClass with its udev name, "sec_touchscreen".

The date that I compiled the working Freedreno libdrm was the date that Ubuntu 13.04 was released. I'm working on narrowing it down to a Git SHA1 revision. I used Rob Clark's repository, not the freedesktop one.

Use the master branch of the DDX, sorry for the earlier confusion.

For battery savings, you might want to cherry pick the DPMS commit from the a3xx branch of the DDX.
[Sprint Samsung Galaxy S III] Wootever:
There are two binaries you can execute with adb shell stop/start that kills and restart the android proccesses, allowing access to the framebuffer.
[Sprint Samsung Galaxy S III] castrwilliam:
Okay, so 2-D does work with my mods, but I just tried 3-D last night (ran es2gears with the Adreno 225 mod in place on mesa) and the pagefaults returned.

I did notice something about your pagefault reboots, though: they shouldn't necessarily be happening, it's a NULL pointer dereference that can be fixed in the handler by doing this in drivers/gpu/msm/kgsl_iommu.c (function is kgsl_iommu_fault_handler):

Change

curr_context->pagefault = 1;
curr_context->pagefault_ts = curr_global_ts;

To:

if (curr_context) {
curr_context->pagefault = 1;
curr_context->pagefault_ts = curr_global_ts;
}
[Sprint Samsung Galaxy S III] allenjthomsen:
So anyone got any updates for this if not i will start building upon what is there if it is ok
[Sprint Samsung Galaxy S III] xxSTARBUCKSxx:
I guess it is OK. Hopefully you can make a dent in this development. Keeping my eye on this thread.
[Sprint Samsung Galaxy S III] DrGit:
No longer developing for this phone :(

Unfortunately, this phone hasn't been a good fit for me. I never got very far booting Ubuntu or Freedreno, so I decided to sell it.

For anyone still interested in this project, I believe castrwilliam has the required patches.

When I get my next Snapdragon device (either the new Nexus 7, a Nexus 4, a Galaxy S4, or another phone with Adreno 320 graphics), I will post the Mesa patches for occlusion query support.
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
Before flaming me... notice I've been a member since 2009 with my G1, and also notice that I've barely posted. I mostly read, search, and follow instructions.

I am having a problem that I've never seen before through all the Android's I've had. It's SIMILAR to one's I've seen, but NOT the same. I'm hoping someone can take a minute to give me ideas.

The other night I installed TWRP 2.6.0.0 via GooManager... when I chose "reboot recovery" from inside GooManager just to see what had changed and then the following happened........................

My GS2 will NOT boot up. Will NOT charge. Will NOT go into recovery... however it WILL GO INTO DOWNLOAD (ODIN) MODE. I've bricked phones before... never once have I been able to access DL mode. HOWEVER: I cannot get the PC (ODIN, ADB, GS2 Toolkit, Keis) to recognize the phone in download (or any) mode. When I try to boot the phone unplugged the Samsung logo will flash up quickly then the screen goes blank. Typically I'd see Deviant Development or Cyanogenmod Boot Anim at this point but NOTHING. Just goes black. Same result for manually trying to boot into recovery. When plugging the device in while powered off, I will get an empty battery with "waiting/busy/thinking" circle inside of it for a second then it also goes blank.

What I've tried:

-uninstalling Samsung USB drivers and reinstalling (both versions i could find in my PC and online- v1.3.2200.0 and 1.5.14.0 or something close to those)

-uninstalling Keis and reinstalling in combo with the Samsung drivers

-uninstalling all traces of drivers from anywhere and seeing if Windows Update would notice it

-different USB cables... about 9

-other Samsung Android phones in DL mode (windows immediately recognizes them and installs necessary drivers)

-CRC QD Electronic Cleaner inside USB

-took apart phone, gently cleaned with alcohol and insured no loose pieces

-tried with no battery inserted

-probably other's I've forgotten by now

I'm begging and willing to pay at this point for the person who helps me fix my phone. I cannot afford a new one. Samsung and T-Mobile are not willing to do anything for me. I'm pretty good with Android, and with using ADB for simple tasks. If it's possible to have happened- it honestly seems like the Recovery and OS got deleted. Either that or the USB port has gone bad but no tabs are bent inside and all "looks" fine.

Again, a CASH reward is being offered to the person who helps me FIX this. How much $ will be considering how much work it takes for the individual(s) to help fix it.
[T-Mobile Samsung Galaxy S II SGH-T989] meekrawb:
Did you try different USB ports? Or a different computer?
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
ports yes, computer no... i don't have any others built here at my house. i just dont see how all the other phones and cables are working with this PC... how could that matter. im willing to try it but i just dont have another one up and going yet.
[T-Mobile Samsung Galaxy S II SGH-T989] gc84245:
Try opening kies and selecting "Emergency firmware recovery"

---------- Post added at 03:41 PM ---------- Previous post was at 03:39 PM ----------

Hope this helps:

http://xdaforums.com/showthread.php?t=2261153
[T-Mobile Samsung Galaxy S II SGH-T989] noob41:
A lot of people have had trouble updating through goo. Some in this thread discuss it: http://xdaforums.com/showthread.php?t=1768742

All seem to solve their problem with Odin though. Make sure you're on Odin 1.85, I used 1.84 by mistake once and it kept failing and once crashed my computer. Also make sure to deactivate Kies, Odin won't work with it running. Sometimes we miss basic stuff when we're stressing!

T989D

latest CM10.1

latest Uber
[T-Mobile Samsung Galaxy S II SGH-T989] wizkidj:
Go into Samsung kies and try a emergency firmware update

sent from my xylonified phone....
[T-Mobile Samsung Galaxy S II SGH-T989] meekrawb:
The only other advice I can think of is to try making a new Windows user account and give it administrative privileges.
[T-Mobile Samsung Galaxy S II SGH-T989] soupysoup:
OK this is he fix for that, can u get into DL mode? If u can its an easy fix

---------- Post added at 08:46 PM ---------- Previous post was at 08:37 PM ----------

Just read a little more of your post here is how u can fix it and its very simple, the thing is goomanager has been a little f'd up lately, its been softbricking ppls phone since 2.6 came out, u need to go here http://techerrata.com/browse/twrp2/hercules and download twrp 2.6.0 tar file, turn off or uninstall kies, odin will never connect or see the phone if kies is running, even if in the background odin will never see the phone if kies is abywhere near it, and kies wont see it because its modified software wise, now open Odin file and run the app, put the Hercules into DL mode and connect to PC with your factory OEM USB cable, Hercules doesn't like any other cable with Odin for some reason, Odin should say "Added" once it does click on the PDA box- DONT CHECK ANYTHING ELSE, find the tar file u downloaded from the link i put above, the click start, Odin should take about 1min to do its thing, do not dissconect the phone at all until Odin gives the green "passed" signal in upper box, Odin will auto reboot ur device and that should've fixed it, if not u may need to flash another rom bit don't worry all easy fixes, I can't stress how important it is to not panic in these situations, follow what I said and ur herc will be good as new, no I don't want the money, just forward the help to the next person...
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
I'm about to try this. Let it rest a few days. I will go into the PC and remove kies and all its traces... I have tried many times without it installed and still it won't recognize the phone. Even with the 3 OEM cables I tried. I do use Odin 1.85 and have a few tar laying around I would have used had I got a connection. Other galaxy phones and my wife's captivate glide are recognized as soon as I plug them in. I just feel like it is more than it is letting on to. Like ... something as stupid as could the battery be bad. Would it cause this. Did a jig for my i897 mess up my USB port or motherboard. I'm just so upset. Using a crappy $20 phone and it sucks bad. Thanks to all who have helped so far. Going to take a few more stabs at it.
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
thank you, i'm trying this right now, just deleted all traces of samsung anything off the computer and am going to reboot. not a bad idea.
[T-Mobile Samsung Galaxy S II SGH-T989] gc84245:
Kies fixed my soft brick when odin didn't work, don't underestimate it :)

Sent from XDA app
[T-Mobile Samsung Galaxy S II SGH-T989] soupysoup:
That is very strange indeed then, I can't think of any other task reason as to why it wouldn't recognize the device, if kies isn't installed and ur on OEM cable and drivers are installed that's very strange indeed I don't think I've ever run into an issue like that, I do know goo has been fing ppls phones up lately but I also heard they got it fixed so Im lost, I mean theoretically it could be the battery but it still doesn't make sense because u should get done response even with no battery, let me look into it a little more, now I'm interested, pm me if u figure it out or any new info this struck an itch in my brain lol sorry to hear about the herc, I lost mine for a whole day due to a bad Odin flash once and was freaking out cuz I had to use my old precedent so I feel for u, just doesn't make sense...
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
no luck

so here is a brief update... tried everything that was replied. im getting ready to make a video just so the hacking world can see. thats what i mean, im no NooB when it comes to this stuff. i've been building computers since i was 14... not a genius but i've never gotten "stuck" before. even when bricked i have found out how and coached people how to fix their issues lol. doesn't make any sense at all to me either. i tried searching everything i could and came up with people who had similar issues not exact. unlike you, some who replied to this didn't read my entire post especially where it says "what i've tried" lol. glad you did though. i cant tell you how much it means to me that you're thinking about it. i wish there was a way to "escalate" this matter lol. i bet the original Cyanogen dev Steve Kondik would know in a heartbeat. not discrediting anyone just saying. i bet he has come acrossed it before. unfortunately though i was running JMT6 i didn't receive any help from Deviant Development when i posted to their facebook group. Just wish more people were on who'd take a second to help others like you did. thanks again.
[T-Mobile Samsung Galaxy S II SGH-T989] Droid8Apple:
*_!*_!*_!*_! I tried kies folks *_!*_!*_!*_!*_!*_!

GUYS I'VE TRIED EVERY POSSIBILITY WITH KIES. Anything that Kies could give me right now in this state (aka: one of 2 things... install drivers 50 times or 'emergency firmware upgrade' which requires an acknowledged connection to PC and a screen that is similar to the DL screen but indeed is not the DL screen...) i have tried. that's why i went through the hassle of making this post... if it were a basic, every-day NooB problem i would have fixed it already...

sorry if that sounds trollish but i took the time i did writing the "issues/what i've tried" in the original post for a reason. this goes far beyond what Kies can do for me. thank you very much for the help though, much obliged!
[T-Mobile Samsung Galaxy S II SGH-T989] soupysoup:
Haha I'm STILL thinking about it lol, like u I've been building and hacking software for around ten yrs now, and also like u I've never just been stuck, I've bricked devices and still brought them back, even applied the unbrickable mod to my captivate and never have I just not been able to explain what was going on lol, I help whenever I can because I may be the one asking for help someday, this issue u have though is very perplexing, it can't be the port if the phone still goes into DL mode, but then why is it not able to connect? The PC should see something, even a hard brick gets noticed by PC as being there, can't get a flashable connection but the pc still sees it, I've been working this over for 2 days now lol, I am trying for u buddy lol