yashsingh1/xdaforums huggingface dataset:
[Motorola Photon Q 4G LTE] mionica:
Mmm will have to check. For me it's working in the EU using GSM/HSPA on the xt897 with the SIM mod.

I used the stock config from the cm12.1 xt897 kernel - I'll have to diff that with the cm11 one.

Another possibility is that it wouldn't work because of SElinux mismatches between kernel and userland. The following has to be in the fstab:

/dev/block/platform/msm_sdcc.1/by-name/modem	/firmware	ext4	ro,nosuid,nodev,noatime,nodiratime,barrier=1,[b]context=u:object_r:radio_efs_file:s0[/b]	wait,check

If it doesn't, on the xt897 you get no WiFi, but I expect results might vary by device :D

All I'm saying is, it might or might not be a kernel config, would have to check when I get to my PC.
[Motorola Photon Q 4G LTE] mionica:
I reviewed the entire changelog from cm-11.0 to HEAD, and couldn't find anything that looked even remotely radio-related, so I reckon it's most likely the SElinux thing. And now that I built a TWRP that has a chance of running on AHD, I guess you could tell me whether that's the case :)
[Motorola Photon Q 4G LTE] enigma9o7:
Yep, pretty sure. All started a year ago when I was looking for an android smartphone with a keyboard, this one was rated best, wikipedia itself said CM was required for kitkat, so looked into CM, found their installation wiki http://wiki.cyanogenmod.org/w/Install_CM_for_xt897 which step #2 is install clockworkmod recovery. Right now if I follow the link it leads to recovery-clockwork-6.0.1.3-asanti.img, but I'm pretty sure at the time I originally installed it lead to that version I used, which did work fine for installing CM as I do have it installed. But it's possible something else lead me to that version, I can't really remember for 100% sure, but I definitely started from CMs wiki.

---------- Post added at 10:17 AM ---------- Previous post was at 10:04 AM ----------

Thanks. My understanding is there is no KKBL for Photon Q anyway, but anyways I've always used the msm...jbbl roms.

Okay, will add installing SU to install steps.

Since I already have that version of gapps, my question is do I need to reinstall it then update everything. Shouldn't it already be good? I didn't have to reinstall gapps with the official nightlies, so want to know if I really need to for this.

My concern with unofficial is not that I dont trust it or think it's less stable, just that it may make it more difficult in future to upgrade or get back onto official path as I may not be able to follow the same steps as everyone else.

I'm still unsure if it's okay to dirty flash over CM11 nightly. I do actually use my phone for work so don't want to mess it up... but really want google stuff working again and can't keep waiting forever for official cm11.
[Motorola Photon Q 4G LTE] palmbeach05:
Yes, you can dirty flash this ontop of an existing CM11 after switching /data and /cache from ext4 to f2fs. Gapps will be fine since they install on the /system partition.
[Motorola Photon Q 4G LTE] mionica:
Switched to Carbon, but preserved most of the goodies from CM; links in the first post.

Also added a note on how to hack your radio to disable CDMA/LTE - so you could go with this phone in the US and never register on Sprint's network (unless they have a GSM/WCDMA network in place too, which should be fine).
[Motorola Photon Q 4G LTE] enigma9o7:
I decided to give it a try with your latest CM11. I installed the TWRP from your first post, was able to backup fine, but don't see how to reformat as f2fs....
[Motorola Photon Q 4G LTE] palmbeach05:
There should be an option to wipe things, go there
[Motorola Photon Q 4G LTE] enigma9o7:
Thanks, found it.

And now I'm stuck. But I bet it's an easy solution.

I changed filesystems, restored data & cache, installed cm (04/27), installed superuser (wasnt sure if needed, but figured it couldnt hurt), and I booted.

No wifi or phone service but I'm hoping the last step will fix that, restoring sdcard0. However, I can't figure out how to copy that back. I used ES File Explorer to copy it to a folder in sdcard1 before I started. But now I can't paste it back to /storage, always told copy fails. There is a 0 byte file called sdcard0 there, if I delete it, it comes back. Since it's not a directory I can't change to it and copy the contents of my previous save into it... I tried deleting it and making a folder called sdcard0 before it recreated the 0 byte file but that failed too.

I thought maybe I'd try command line, but I'm no expert there... I su'd and tried similar things as in EX but similar results.

I thought I'd try to copy it back with TWRPs file manager, but I couldn't figure out where to put it, there was no /storage directory, so I tried putting it in / and that started copying for a while but before it was done it rebooted and just hung at the TeamWin screen until I powered off...

So yeah. Dunno how to restore sdcard0. Help please....

edit: maybe superuser doesn't work? I tried to use default "file manager" and it wont let me switch to root mode. Then I noticed that while trying ES File Manager again I didnt see the popup about "root granted" or something like that that I normally see. But superuser is installed, its in the apps menu and runs and a quick look thru the settings seems okay to me, but I don't recall ever setting anything before.

edit2: I'm giving up and going to try to go back to last cm11 nightly and hope my phone starts working again. I tried reflashing multiple times, eventually tried supersu instead of superuser and that worked to get root explorer working, but I still couldn't copy over sdcard0 using ES anyway, but using default filemanager I could start (although I hate that filemanager cuz I dont know how to change directories, usually have to tap about 15 times before it opens a folder), but it would always start then reboot before it finished. So I still dunno how to copy that back.
[Motorola Photon Q 4G LTE] mionica:
Superuser is probably not a smart choice on KK. Use SuperSU instead.

The very first boot is somehow handled differently - I discovered this when I worked on integrating SuperSU into a catch-all zip of mine (alongside Windows Mobile ringtones, Midnight Commander, patched hosts, and a few other goodies). I got no radio with my package, but if I flased SuperSU instead, it worked.

It took me a coupe of tries to find the culprit - a flag file in /etc that SuperSU created after the first boot (and I attempted to create that from my zip). Made my zip not create that, and bang! everything worked just fine. Btw, removing that file after the first boot had no effect, the phone'd be screwed until you wiped /data.

Now, the fact that SuperSU handles the first boot differently kinda makes me think that older su's might very well not work (properly) on KK - and what you're reporting seems to confirm that.

I would strongly suggest going Carbon instead; that includes a working su. It's essentially CM with a different boot logo and a good few extra customization options (which you can safely ignore if you're not into that sort of thing).

So if you didn't go back yet, try either

flashing carbon and being done with it, everything will work;

flash the cm rom alongside supersu, not any other root app,

Either way, root will work, phone will work, and you'll be able to copy stuff around to your heart's desire.

As for a FM, I strongly suggest an app called Total Commander. The UI is atrocious as of late (the author is obviously better at coding than designing icons :D), but it' probably the most complete FM solution for Android, bar none. And it's free, without adds; wait til you try it in landscape :)

I'm sorry for you inconvenience, but I also somehow feel it's earned :) - the OP said SuperSU back before Carbon replaced CM; because that's what I was using, and it worked for me - no guarantees if you went your own way. I've re-added the limitation and made it bold+orange in the CM part of the post (Carbon has its own, fully working, su).
[Motorola Photon Q 4G LTE] mionica:
Added the 2015.05.03 build of Carbon; links to 2015.04.30 removed.

At this stage, CM users should have everything they liked about CM, already compiled in (except for WhisperPush, the point of which I don't quite see).

Changelog from 2015.04.30:

added Calendar (!!!) - why on earth would the Carbon guys build an ROM without this?!

built on gcc-4.8.x-sabermod-20150429

added CMWallpapers, Video Editor

added the previously-missed vim, unrar, zip and gdbserver

synced with upstream; in particular, there was a noteworthy GPU memory allocation improvement in the kernel

Todo:

add an app for messing with the NV settings (enable/disable bands, enable/disable US GSM lockdown)

enable zram.
[Motorola Photon Q 4G LTE] mionica:
Added the 2015.05.05 build of Carbon; links to 2015.05.03/04 removed.

Changelog from 2015.05.04:

set default governor to msm-dcvs - better out-of-box performance

imported the cm-12.1 init support (including swap enabling)

Changelog from 2015.05.03:

support for fstab alternatives, cm12-style (my own code in fs_mgr); now you can use the ROM with either f2fs or ext4 for /cache and /data

massively improved FS performance for both ext4 and f2fs - tuned the fstab settings for best performance;

added radio-tool to enable/disable US GSM lock and groups of radio bands (CDMAs, US GSM/HSPA, EU GSM/HSPA, Sprint LTE, Verizon LTE) - see spoiler in first post

Todo:

figure out why swapping doesn't want to start, despite the device being there and mkswap succeeding (error -16).

Updating the recovery to a 20150505 build is highly recommended.
[Motorola Photon Q 4G LTE] enigma9o7:
Thanks for reply. I did end up trying the cmrom with supersu, and I did get working superuser then. But I still couldn't copy over my backed-up sdcard0 folder into /storage, or copy the contents of it into a newly create /storage/sdcard0 folder (after deleting the sdcard0 0 byte file). So I went back to cm nightly and that works again, but may try again with total commander and if that doesnt work try carbon, as it seems it wasn't too difficult to restore if things don't work again. I was thinking perhaps copying sdcard0 back required some specialized procedure or command line parameters or something to do with linked paths or something like that....
[Motorola Photon Q 4G LTE] enigma9o7:
Tried all over again, still cannot restore sdcard0, even with total commander.

I'm probably doing something wrong, so I'll explain what I tried this time, using total commander

1) navigate to /storage

2) select sdcard0 and copy to clipboard

3) navigate to /storage/sdcard1

4) paste from clipboard

(reboot to TWRP, backup, wipe/change data and cache to f2fs, restore the backup, flash cm and supersu, reboot, back to total commander)

5) navigate to /storage/sdcard1

6) select sdcard0 and copy to clipboard

7) navigate to /storage and paste from clipboard (granting superuser when prompted)

At this point it starts copying, goes for a while (maybe 10-15%) and then just closes the copy box. No errors or hangs or reboots, just stops copying. But after it quits nothing is copied, sdcard0 is still just a 0-byte file. Tried a couple times to be sure, always the same. I then tried deleting the 0-byte /storage/sdcard0 file, but total commander warns me it can't copy with su error: rm failed for /storage/sdcard0, Read-only file system. [If it had let me delete it, I was going to try the paste again, although when I tried that with other file managers last time it didnt work either.]

If anyone was able to successfully backup and restore sdcard0, please let me know exactly how...

edit: I did try carbon after this. After booting lots of popup messages about services stopped. However my sdcard0 folder existed and was normal, and I had phone service..... anyways I mainly did it as an experiment and will go back to the latest cm nightly until I have something else to try to make this cm version work...
[Motorola Photon Q 4G LTE] mionica:
Ok, how about you try the following (using Total Commander):

avoid copy-paste

enter "SD-card (2)", create a folder called bak_intsd and enter it; to create a new folder, use the top-right menu button, and select "New Folder..." from it, type the name, hit OK;

switch to the other TC panel (I suggest doing this in landscape mode :p); in portrait mode, you need to swipe the screen in the direction opposite the vertical margin with 3 arrows and 2 equal signs;

enter "SD-card"

select all files, using the bottom-left button with "Sel" written on it; when the dialog box pops up, leave the "*" in place and just hit the Select button; every icon should now have a green checkmark on it;

copy all the files to the location in the other panel, using the second-from-the left button (the one with a blue arrow on it); leave "/storage/sdcard1/bak_intsd" alone, just hit "Copy"

if you get any errors, just hit "Skip all" - it is possible that some files couldn not be read

To restore the SD card, do the same, except copying from where you backed up everything (/storage/sdcard1/bak_intsd/) to the internal sdcard location (/storage/emulated/0); if you're prompted if you want to overwrite things, hit "Yes to all".

Anyway, you can use Carbon on either ext4 or f2fs (unlike cm11 for which you needed f2fs). I'd still suggest using f2fs though - it's miles faster, and reduces the wear on your eMMC.

The guy who invented the SIM mod wanted Carbon for some reason, so I was happy to accomodate him. That said, I wanted the CM goodies not present in Carbon, so what you get on this ticket is a hybrid - carbon base with all the useful goodies from CM in.
[Motorola Photon Q 4G LTE] enigma9o7:
There is no /storage/emulated/0 after I flash your cm rom, and I cannot create it (or dont know how). I tried to take a screenshot (power/volume down) to show, but can't take screenshots, error about being unable to save (probably cuz sdcard0 is unavailable to write to and thats where it saves them).

I also tried the 'fix permissions' thing in TWRP incase that would fix something, didn't appear to do anything.

edit: Starting over one more time paying very close attention, I think I see a problem. Although I reformatted cache as f2fs, when doing the restore, for data it warns that its f2fs, but for cache it appears to be reformatting it back to ext4... This is on the screen from TWRP (bold added for emphasis):

Wiping Data....

WARNING: This /data backup was made with ext4 file system!

The backup may not boot unless you change back to ext4.

Wiping /data without wiping /data/media

Done

Restoring Data...

[Data done (315 seconds)]

Wiping Cache...

Formatting cache using make_ext4fs function

Restoring Cache...

[Cache done (18 seconds)]
[Motorola Photon Q 4G LTE] mionica:
Oh well. It exists on my phone :) No idea what's wrong on yours. On my Carbon, the internal sdcard is available as: /sdcard, /storage/sdcard0, /storage/emulated/0, /storage/emulated/legacy and /data/media/0.

Sorry about that, I really have no idea what could be wrong on your phone.

Then again, you could flash Carbon an back up the internal sdcard before changing to f2fs (the Carbon build support either).
[Motorola Photon Q 4G LTE] enigma9o7:
All of that is there when I tried carbon. Just not with your plain CM 04-27.

However, as mentioned above in an edit, TWRP won't let me restore cache and keep it f2fs. Perhaps that's the problem. I'm now trying to flash cm and supersu after reformatting cache as f2fs but not restoring cache... I'm guessing maybe I don't need anything from cache and this will keep it the right filesystem....

---------- Post added at 01:58 PM ---------- Previous post was at 01:38 PM ----------

SUCCESS! The whole problem appeared to be that TWRP wouldn't restore cache without reformatting it to ext4, and this rom wants it to be f2fs. Now after flashing (without restoring cache and leaving it as f2fs) everything looks good, the sdcard0 is there, and I was able to copy my backup to it no problem. Also phone/wifi/etc all worked even before I restored sdcard0 this time. So no problem with the ROM itself, problem is with TWRP (and using it to restore cache as earlier described in the first post). But from my limited understanding of cache, I would assume that it's not going to matter anyway as anything missing from cache will automatically reload or whatever... hopefully.
[Motorola Photon Q 4G LTE] arrrghhh:
I was going to ask why you were restoring /cache at all. You should never restore cache really, unless you are restoring every partition. If you're clean flashing, don't restore any old partitions.
[Motorola Photon Q 4G LTE] enigma9o7:
Because that's what it says to do on the first post (quoted below, bold added for emphasis). I was going for dirty flash tho, basically trying to be as close as possible to doing a regular nightly update thru the phone so I don't have to do anything else...

Anyway I'm happy now that I finally got it installed. But following that procedure won't work exactly, at least with the TWRP version linked there, as it won't restore cache without changing it back to ext4. I expect the same thing with carbon, my guess as to the reason it didnt seem to have the same problems when I tried it is because it can use either f2fs or ext4 for cache, where his cm build is f2fs only...

---------- Post added at 04:05 PM ---------- Previous post was at 03:35 PM ----------

Since I've now read this post about 20 times now, got me curious about this radio tool. I assume that by disabling the LTE bands (that cant be used by sim-mod users anyway) it'll save some battery power or something? It appears this tool was only in the carbon rom, not the cm one. Do you have a standalone binary that'll work under CM? And if so, would the appropriate command line to disable LTE be "radio-tool -sprlte -vzwlte" What about the CDMA stuff, what's that used for, would that also be something sim-mod users should disable, or is it used somewhere. (Even if not used where I live on my home carrier, I'd rather not disable it cuz if traveling I don't want to have to remember how to re-enable it if it's usable other places).
[Motorola Photon Q 4G LTE] mionica:
I doubt it will help with battery life in a big way; Carbon (and, I expect, CM too) allow you to disable LTE altogether, which I expect will tell the radio too (not only the OS) to stop peeking at the LTE freqs.

There have been reports of people with the SIM mod going to the US and having trouble because the phone would attempt to logon to Sprint's network regardless of how you set it. I expect that preventing the phone altogether from contacting Sprint's network would fix that for everyone (radio-tool -uslock -cdma -sprlte).

Unlike that, disabling specific GSM/HSPA bands could help with battery life if you're an area where signal is poor. Not that it would matter for Sprint customers, since AFAIK Sprint doesn't do GSM/HSPA at all. So you'd probably want to keep this,

if you're on Sprint: +uslock +cdma -eugsm -usgsm +sprlte

if you're using the SIM mod in US, you want -uslock -cdma +eugsm +usgsm -sprlte, since some networks apparently use some EU bands - T-Mobile for one;

if you're using the SIM mod in EU, you want +uslock -cdma +eugsm -usgsm -sprlte.

The reason why there's a vzwlte option is that this tool would work on any device with the same radio (Razr M, Atrix HD, etc), a lot of which are on Verizon. And on which my ROM should work just fine as long as they have the JB bootloader.

Really, this is simply a tool I did for myself, as RADIOCOMM is a royal pain in the arse, and even with CDMA Workshop I still needed to look up my reverse engineered band mapping notes if I wanted a change (in case of travelling to the US). I didn't need all it can do, but it was just too easy to do it all :)

As for the tool, you can easily extract it from the Carbon ROM (it's in the zip, as /system/xbin/radio-tool), and I expect it would work on most, if not all, ROMs. Oh btw, I reckon this could brick the radio of other chipsets - so unless your phone is a msm8960-based Motorola, you probably don't want to try it.

The one thing I don't get though - why are you hell bent on CM? I can't think of any difference of consequence between my Carbon/CM hybrid and stock CM. Not in terms of performance, not in terms of memory usage, not in terms of the feature set. You get more control, and it comes for so low a cost you can safely consider it free. Carbon is a CM fork afterall, and a lot of the repos are actually from CM not CarbonDev.

PS. I fixed the source code link in the OP (I had renamed the branch it was on, so it didn't work for the last two days).
[Motorola Photon Q 4G LTE] Nuck-TH:
What the exact difference between regular and f2fs builds, besides update-script, fstab.qcom and new kernel? I tried to change update-script in other rom, but it fails to mount all partitions(not only f2fs) :(

I'm not bent, but still - Carbon lacks some small, but useful features like auto-resizing icons in switch ribbon(can't tell other right now, but there is some more...).
[Motorola Photon Q 4G LTE] mionica:
Here's the deal:

stock cm11 builds, as well as stock carbon-kk, only support one partition configuration in fstab - you can't list /data with both f2fs and ext4, you need to pick one; my "UNOFFICIAL_f2fs" cm builds only accepted f2fs;

the fs_mgr function which the .rc mount_all command invokes returns an error on the first failed mount (emmc, vold and swap partitions are skipped, but nothing else); so if any partition can't be mounted, none of the subsequent partitions from fstab will be mounted;

since the 2015.05.03 build of Carbon, I have included cm12-like support for mount alternatives on the cm11 tree (android_system_core); merging the cm12 code proved to be too big a pain, so I just wrote my own code for that (it's on github if you want to review it - though a dmesg as root should give you a fair idea of what's going on, as I instrumented my changes properly)

Now, I'm happy enough with Carbon so I won't go back to doing stock cm builds; any future developments will be Carbon. But all my code is on github, so anybody so inclined could merge my stuff into a clone of the cm11 repo; OP has the link to my Carbon repo, and diff'ing that against the stock CarbonDev repo should be enough to know exactly what changes you'd need to make to a CM11 repo, in order to build it with my enhancements.

In plain English: if there's a will to do so, people could build CM11 with my enhancements built in, with relative ease, even if I won't.

Oh, and an important hint: this project was my first Android build, ever. I knew C and make, but very little Java. And no git - none at all. I also don't know any Python or Android programming :p. So I started basically from nothing, and here I am. Just something for the people who consider saying, "but I can't do CM11 builds - I don't know how"; neither did I, but I did it anyway.
[Motorola Photon Q 4G LTE] mionica:
Forgot one, rather important, thing.

There's a very good chance that if you modified the cm11 zip by replacing boot.img with the one from the Carbon ROMs, you'd get CM11 with support for mount alternatives (so you'll be able to use either ext4 or f2fs for the /data and /system partitions).

If you check back in a couple of hours, you'll also get lz4-compressed zram support - finally got that working properly, the 2015.03.06 build will have it (it's also in boot.img). That was the last big change on my list, and I got it sorted finally; after that, I'll get back to doing weekly builds, and only if some things I care about have improved.

I might also do a one-off full cm11 build with all the goodies from Carbon 2015.03.06, but no promises; and even if I do, I won't subsequently update it like I update Carbon, and I won't publish repos for that; the amount of time and SSD space I'm willing to give to the CM crowd is somewhat limited :D. Though, personally I'd like to see somebody picking up the ball and doing CM11 builds; I would certainly help such a person set things up to the best of my abilities.