yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] jasonmerc:
IMO its unlikely we'll get anyone new. The Terrain is still inexpensive (still around $60 on eBay), but there's just not a lot out there. Heck I haven't even picked up mine in almost half a year.

On a related, I'm considering donating my Terrain to anyone who is seriously into development in the US (I'd rather not pay extra for international shipping) since I haven't used it for so long and have a new waterproof device I can use as a daily driver.
[Android Software/Hacking General [Developers Only]] Daxiongmao87:
A shame! Still, I'm sure everyone (including myself) who have taken advantage of the progress you and the others have made truly appreciate the work you all put in! While I hope the progress continues in some form or fashion, you have my gratitude :)
[Android Software/Hacking General [Developers Only]] alex-kas:
Hello to all, I'm back to action!

Remember, it is not my job to tackle phones... I'm not a programmer, even not an engineer ...

In short, the kernel from source seems to lack support for the touchscreen ... It is very bad as this crashes the graphical system.

However, this kernel seems to waive the problem of reboots. It reads almost seamlessly big data arrays. However. still there are some remnants of glitches. I'm not sure though, they are from the "journal" part of the story.

In the meantime, playing with the new kernel I killed my phone.

Today I discovered a method to wake it back from QDLOAD 9008 state. Instructions follow on my github.

https://github.com/alex-kas/nec_terrain

Stay tuned.
[Android Software/Hacking General [Developers Only]] mak18:
Hi, great to have you back!

what do you mean by QDLOAD 9008 state?

why do you call it QDLOAD 9008 state?
[Android Software/Hacking General [Developers Only]] hyperqwest:
That would awesome to get the reboots and other lags fixed, Such a great little phone.
[Android Software/Hacking General [Developers Only]] mak18:
the reboots were fixed, follow alex-kas's steps to reformat to ext2
[Android Software/Hacking General [Developers Only]] hyperqwest:
Thanks, I am trying to find the instructions on github, Is it the same process in the repart section, but just change the ext4 to ext2?
[Android Software/Hacking General [Developers Only]] standal.10:
Hello, I have a problem with the terrain. If I am connected over wifi, then there is very offen the icon of mobile data conection flashing. It comes also to wifi drop, long loading of web or gplay. Do you observe the same behavior? And have you solution for it?
[Android Software/Hacking General [Developers Only]] mak18:
here is the post regarding that

http://xdaforums.com/showpost.php?p=62673224&postcount=25
[Android Software/Hacking General [Developers Only]] alex-kas:
Kernel?

So, having some spare time I discovered the following:

The source provided by NEC lacks some components even mentioned in their provided defconfig. In particular no Kconfig file contains several config-variables related to touchscreen, sound device (some amplifier and headset jack) and some diag options. Strangely, but it may happen that diag options are indeed true drivers. This is exactly the case for the LED support there.

Devices in question are known, not specific for Terrain and in principle their drivers exist. OpenSource. But, it seems that the enumeration, referencing and protocol addressing is Terrain-specific. Maybe because Terrain makers had some initial copies of those devices and the corresponding specifications were changing/improving.

In short: touch screen seems not working now. Without it it is not clear how to test sound components as any rom crashes. Even if the touchscreen can be made working I suspect we will have to tackle the sound part. Stock rom bootloops with the kernel from sources, rom compiled from sources crashes (looks like because of no working touchscreen support)

However, the compiled kernel works in my style recovery, which is a pure adb system w/o interaction on the phone. It means, that at least we can access dmesg and analyze /dev tree.

Yes, no device for the touchscreen in the /dev tree. Quite bad. The driver, however, supplied in sources, refers the proper device. The stock kernel also provides ioctl wrapper, while the sources are lack of it (but indicate in defconfig).

Needless to say, I have not reached yet the ril. It with probability 100% proprietary. And it may have chances to be compiled against a specific kernel ...

About reboots. As expected, NEC tinkered with the journal of ext3,4. In fact there are only two files which are changed compared to vanilaa CAF repository in filesystem support. And these are exactly journal.c in fs/jbd and journal.c in fs/jbd2 directories. In adb style recovery the journal does not cause reboots any more but the mempages are still messed up resulting in a corrupted kernel space memory.

Analyzing changes in journal.c I could not understand why its NEC version works at all ... Really.

Perhaps restoring the vanilla version of these files will bring back normal journal workflow. I have not tried yet as this seem simple and much less severe than absence of crucial drivers with proper protocol referencing. Right?

The good news, mentioned in another thread look as this:

http://xdaforums.com/showpost.php?p=65825814&postcount=45

So no worries to tinker with Terrain at all gears. It can be restored from any mess (almost, notice modemst1,2 warning in my github, referred in the above mentioned post).

If there is someone with a wish to help - come and join. Those willing are expected to understand the linux kernel and the ideas around. ROM itself is the next step.
[Android Software/Hacking General [Developers Only]] Daxiongmao87:
Welcome back!

Welcome back Alex! Ever since I tried to switch to ext2 filesystem I could not get my phone to boot. I can still access recovery so I will give it another go. I believe I tried following instructions on the github a while back, but couldn't follow it with 100% confidence (i found some parts too vague). I will give it a go again and if I can get it to boot back up, I'll be happy to help in any way I can.
[Android Software/Hacking General [Developers Only]] aluminumx:
if you have formatted the partitions in ext2, you'll need to use the correct rc script that boot using ext2. Thanks to Alex, he has created a boot image that took care of it. So all you need to do is flash the kas.boot.bin-0.9-ext2 from his github below.

Cheers.

https://github.com/alex-kas/nec_terrain/tree/master/boot
[Android Software/Hacking General [Developers Only]] Daxiongmao87:
unfortunately my phone is using the old recovery, and I cannot boot normally. As per instructions, I am required to boot normally to even install the new boot image.

Edit: Upon further investigation, there seems to be some inconsistencies between the adbb.bat file and my flash_boot.sh . For one, the adbb.bat file calls for mkdir /mnt/external_sd while my flash_boot.sh does a mkdir /mnt/extsd. I assume these are supposed to be the same, as it asks for /mnt/extsd/brnects0.715/kas.boot.bin (which doesn't exist because its pushed to /external_sd/...).

However, when correcting the path so it actually DD's correctly, and it successfully runs, upon reboot i'm still greeted with a blank screen.
[Android Software/Hacking General [Developers Only]] aluminumx:
Hi Daxiongmao87, so just to understand your situation a bit better so that I can offer some help....

1. have you changed the partition table to resize the GROW and userdata to your liking?

2. have you format the recovery and boot and system partitions to ext2?

3. Have you done a backup of the system partition? This partition has all your stock apps, hope you had a copy before you formatted the partition. Your phone won't boot up to the android os without it.

4. Have you done a backup of the userdata partition? That's all your user data, it's not too bad if you format it without a backup, if that partition is empty, your phone will just boot as a clean reset.

Let me know and I'll see if I can use my limited knowledge to help you get your terrain back.

A
[Android Software/Hacking General [Developers Only]] Daxiongmao87:
Thanks Aluminum for the reply. My situation looks rather dire.

1. Yes I have changed my partition table to resize GROW and userdata, and it worked.

2. I have followed the instructions for this procedure a year ago. I don't know how to confirm if they both are formatted or not. My linux knowledge is a little limited

3. I have done a backup but that was a year ago and I'm afraid it may have been wiped, what steps should I take to confirm this on my SD?

4. This is irrelevant as this is my secondary phone, no user data needed for backup!

Thanks!
[Android Software/Hacking General [Developers Only]] mak18:
internal SD Card not mounting

Hi

my internal SD Card is not mounting

i think my proc/mounts file might be messed up.

can someone post the text of their proc/mounts file so i can compare it to mine?

thanks

I am using the KAS boot 0.9.2 and KAS recovery
[Android Software/Hacking General [Developers Only]] baolen:
Dear Alex and the dev team,

I am a Belgian living in China (but leaving soon :))

I have decided to give up my Priv to get a real badass phone, the NEC Terrain haha, my wife told me it was stupid, and I know it is but I just cannot explain my attraction to that phone ..

I just order one in Amazon new for 129,99USD, have it shipped to US, then forward to HK, then to my hands :). It will be there within days!

I have read all the problems about this phone and I wonder if I should simply leave it stock and load a few apps as I possible can (mail, whatsapp, skype, bbc news and Boom Beach should be enough :)))

Do you think it will work or I will be already out of memory ?

I cannot help a lot on the engineering side but I am happy to buy beers to my fellows developers :)

once again thanks for the helping Mr Alex and the team

Best,

Bao
[Android Software/Hacking General [Developers Only]] jasonmerc:
I wish you the best of luck with your terrain. I haven't touched mine in forever, so I'm not sure what 4.0.4 ICS is still capable of running today. It was a solid phone, had a very good feel to it. It will definitely survive drops, no problem. My only concern with it was the battery life on mine was horrible, I'd be getting 2 hours out of it at most. It could just be a defective device as I believe I bought mine used. For everyday task, you should be fine with it. It'll take a little bit of time to adjust to the small screen though:)
[Android Software/Hacking General [Developers Only]] fragilematter:
battery life issues

Hi guys,

Sorry for de-zombifying this thread.

I have recently received a Terrain and decided that it would be good as a second phone. I have repartitioned the internal memory, reformatted to ext2 and everything seems to be in order (thanks Alex). Also, I have disabled most of the AT&T bloatware.

However, no matter what I have tried, I can't seem to get the phone to deep sleep properly.

The issue seems to be related to the accelerometer - event3.

Here's a BetterBatteryStats log and the corresponding dmesg output where you can see what's happening - basically, it only had 1h30 of Deep Sleep in over 10h of power on time.

PID 269 is orientationd - if I try to kill it, it will just restart and continue to cause suspend backoffs. I have also tried various google searches relating to orientationd, event3 and a whole set of keywords, but I couldn't find anything relevant.

My next attempt would be to try to set the orientationd service as disabled in init.rc, but this requires unpacking the bootloader. I have tried using Android Image Kitchen on windows, but the resulting repacked image was only 6MB in size and I would like to get an opinion or two regarding this plan before I try anything extreme.

The only function that I can think of where I could use the accelerometer/orientation sensor is the camera, but I'd gladly rotate any photos I take with this phone manually if I can trade that for better battery life.

Any information or hint would be greatly appreciated!

Later edit:

I bit the bullet and, after some more prodding around, I flashed my altered bootloader to the device. And whaddya know, now I easily get >80% deep sleep and 2-3% battery use per hour.

As expected, the orientation sensor is not functional anymore, but I'm more than willing to trade that for way better battery life.

I have attached my modified bootloader to this post. It's based on kas boot 0.9 ext2 - flash at your own risk, and only if you have reformatted system and data to ext2. In order to flash the modified image, you can follow Alex's guide.
[Android Software/Hacking General [Developers Only]] standal.10:
Hello, can you tell me how to reformat to ext2. My terrain is rebooting very offen probably because of ext4. I know that i have to reflash bootloader, but do not know what than. Thanks
[Android Software/Hacking General [Developers Only]] standal.10:
Hello after flashing yours boot.img the rotation was still working. Did you upload the right image?
[Android Software/Hacking General [Developers Only]] fragilematter:
Hi,

As far as I know, it is the correct image. You can try to install Android Army Knife and see if the bubble level still works - on my Terrain it doesn't. Oddly enough, the camera app still rotates, I think it may be bypassing orientationd and accessing the sensors directly.
[Android Software/Hacking General [Developers Only]] FFDA:
Hello,

So I messed up while tinkering with my Terrain. I need to restore /system partition. Anyone willing to share? I know I am asking a lot.
[Android Software/Hacking General [Developers Only]] fragilematter:
I'll upload a system backup during the day. Would you prefer the tgz as made by kas' bu_system script, or a dd image?
[Android Software/Hacking General [Developers Only]] FFDA:
I think tgz made by the script will be better, because I already have resided /system partition and if my understanding of DD command is correct it won't work as intended if sizes of image and partition doesn't match.

I really appreciate this. Thank you.
[Android Software/Hacking General [Developers Only]] fragilematter:
Correct, for dd image you need to have at least the same partition size.

You can grab the backup from here: https://drive.google.com/open?id=0B0F3E6752yTiNkh3MGY4MkFVd2c

If you want to restore it using kas recovery, create a folder named brnect08.715 on your micro SD card and place system.tar in that folder.

Then, in kas recovery, run:

/rbin/rr_system.sh

Hope this helps!
[Android Software/Hacking General [Developers Only]] FFDA:
I'm already downloading and want to thank you again.

The most surprising thing about all this is I never thought I will get response so fast if at all.

---------- Post added at 11:10 AM ---------- Previous post was at 10:28 AM ----------

Just a status update. My NEC Terrain boots normally again.

Reminder to everyone, to check if you still have your old back ups before formatting something.

I am trying that boot with no orientation but my orientation still works. However, I plan to keep my phone on overnight and see how battery holds.
[Android Software/Hacking General [Developers Only]] fragilematter:
Great to hear that :)

As a side-note to your comment about not expecting a reply so fast: I'm still subscribed to these threads regarding the Terrain, even if mine sits in a drawer. It's one of those quirky Android devices that hat a lot of potential, but were let down by the lack of updates and manufacturer interest.

Install Better Battery Stats, you'll find the full version here on XDA, and grant it root permissions - this way you'll see what is draining your battery, it might be some other cause. In my case it was orientationd holding a wakelock like crazy - I'm still not sure if this is due to software or some weird hardware condition, my father in law's Terrain doesn't have this issue and he uses it as his main phone.

Good luck!
[Android Software/Hacking General [Developers Only]] FFDA:
Just short last update for anyone who will visit this thread in the future.

I used [MENTION=2032103]fragilematter[/MENTION] boot when I tried to recover from soft brick and now my NEC Terrain after being on battery for 20h and 45 minutes discharged only 14%. In other words 86% of battery sill left after ~21 hours. Of course I did not used it in any way and it do not have SIM card in it. I think this is as good as it can be for this phone.

Thanks for all your help [MENTION=2032103]fragilematter[/MENTION]
[Android Software/Hacking General [Developers Only]] jasonmerc:
Wish I'd known this when I was using my terrain, that's insanely good battery life!!!

Oh by the way, would anyone happen to have the kernel source code for this phone? It could prove very useful to you in the future. If not, give NEC a call--according to the GNU GPL, they MUST release the source to anyone that asks for it since they've released the phone (and therefore the compiled source code of the android/Linux kernel) to the public.
[Android Software/Hacking General [Developers Only]] FFDA:
NEC released kernel source code, but the link is dead now.

I am also not using it anymore, but plan to make a MP3 player out of it using guide I found on this forum. If I have time, that is.
[Android Software/Hacking General [Developers Only]] jasonmerc:
I'm busy tinkering with another device at the moment, but if you were to somehow find this kernel source and send it to me, I might be able to get a build of TWRP going for you, if you or anyone else would be interested.
[Android Software/Hacking General [Developers Only]] FFDA:
Kernel

I think this is all that link contained. At least that's all I have. I remember that I followed instructions in the readme to set build environment and it was 22GB or even more. Anyways ... do what ever you what with this. I don't need (or at least I don't think I need) TWRP or any custom recovery, but others may appreciate it. However, if you make one I will definitely use it.

I hope this is what I promised: View attachment NEC_Terrain_Kernel.7z
[Android Software/Hacking General [Developers Only]] standal.10:
There was somebody who tried it but faild. If you get it, than you can probably fix the ext4 bug. I will definetely use it. My girlfrien use this phone dayly and the bug is really anoying.
[Android Software/Hacking General [Developers Only]] FFDA:
After 5 days and 8 hours on battery my Terrain still has 35% of charge left. I just want to remind that it doesn't have a SIM card in it and I think phone would use more battery with SIM in it.

Furthermore, I forgot to mention in my first post that my screen still rotates. So ... I have no idea what up with that, but hey if the fix doesn't come with any side effects I am all for it.

It's just a bummer that the fix came few years to late.

Cheers.
[Android Software/Hacking General [Developers Only]] jasonmerc:
Building TWRP has been giving me some issues, and I've got some other projects I have to work on at the moment. Sorry I couldn't get anything for you.

On the other hand, maybe if enough of us band together, we can work on a CM9/10/Lineage 11 ROM for this thing.
[Android Software/Hacking General [Developers Only]] FFDA:
I would love to do it, however I do not have almost any knowledge in this (eager to learn tho) and most importantly I do not have time at all. I come back from work and the only thing I want to do is watch some fun dumb movie.

So... Yeah. Good luck to you and everyone else who tries that.
[Android Software/Hacking General [Developers Only]] iDomino:
This may give the second live for the device. I'm happy to help, but the problem is that I don't have enough knowledge. :(

I almost bought BB Priv, and then discovered that it won't get any upgrade in the future. So, still using my Nec :) and waiting for a qwerty device which can replace it. But many apps aren't working / can't update on the current firmware, and this number increases day after day.
[Android Software/Hacking General [Developers Only]] fragilematter:
Hi crowd,

I've been messing around with the NEC-provided kernel files during the winter holidays and I have managed to build a kernel + associated modules, but for the moment all I got was a bootloop.

Because ICS is so old, it needs to be built with a rather old toolchain, but I have tried gcc 4.4, 4.6 and 4.9 and all have pretty annoying compilation issues.

Also, the kernel source is missing the wifi and nfc drivers and I haven't figured out why the original rom has a RTC kernel module that seems to be different than the Qualcomm clock.

The missing wifi driver should be solvable - the Qualcomm Prima driver is available and I have been trying to integrate the 4.0.4-specific version from CodeAurora, but it's not 100% compatible with the kernel.

That's about it for now, I don't know how much time I will have for this after work starts.

If you feel like poking around, my experiments are available here: https://github.com/fragilematter/codeaurora_kernel_msm8960_nec_terrain
[Android Software/Hacking General [Developers Only]] jasonmerc:
Wow. I'm surprised you were able to even compile it.

Drivers might be a tricky thing though. I'm not sure if the drivers are available under the GPL like the kernel is, so we might be on our own with that. Even so, if all we'd be missing out on was just NFC, having a custom kernel with, say, a Lineage 11 KitKat ROM would be nothing short of a miracle for this phone.

If you have one, PM me your telegram username. If you ever need help, I know an experienced kernel dev or two who might be able to help/send advice regarding compilation issues. He isn't experienced with kernels this old, but I think he could still help you out.

EDIT: I can't find my Terrain for some reason, but if you ever have some risky builds you need to test, feel free to send them my way. It's collecting dust at this point so I'm more than willing to sacrifice it to even a hard-brick if it means bringing a legit development project for it one step closer to completion
[Android Software/Hacking General [Developers Only]] iDomino:
Hello everyone,

Can someone advise how to change ext4 to ext2 correctly? I didn't find the guide and don't want to brick my Nec :) I've rooted and done re-partition using instructions from alex-kas, but don't actually know what to do next. Is there a quick guide?

Thanks
[Android Software/Hacking General [Developers Only]] FFDA:
Read this post:

https://xdaforums.com/showpost.php?p=62673224&postcount=25

If you rooted and repartitioned your Terrain you already formatted your partitions once. The only difference is that your formatted them to ext4.

Before you start I would like to remind you that...

Firstly, you will need to restore system partition from a backup after you format it to ext2, otherwise your phone will not boot to the OS, however recovery will still be accessible.

Second very important thing to have in mind that you will need a boot image with fixed init.rc file. You can download it from alex-kas GitHub page.

Good luck.
[Android Software/Hacking General [Developers Only]] romanlynch:
Has anyone seen/tried this? I want to get a terrain and have been diving into xda and other searches trying to find out more about rooting and removing the bloatware.

youtube.com/watch?v=AZQH072xNXA
[Android Software/Hacking General [Developers Only]] FFDA:
I think it's a scam that tries to make you install some kind of malware on your device.

If you look at the channel it has the same video for a lot of phones. It's purpose is to show up in your Google searches and most likely made by a bot.

Don't do it.
[Android Software/Hacking General [Developers Only]] romanlynch:
Well I'm working my way through alex-kas's github to get my phone rooted. My question now is, am I limited to ice cream sandwich or can I update it some to jelly bean or newer?
[Android Software/Hacking General [Developers Only]] romanlynch:
So I started going step by step through his git-hub today and I'm having a problem. I get to the re-partitioning part and it says gdisk not found. Here is a picture of the commands I did

https://imgur.com/3p6Xjtq

I also can't boot into the new recovery