yashsingh1/xdaforums huggingface dataset:
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
Here's what I've done so far and info relating to my setup

Phone: klte - G900T (T-Mobile Samsung Galaxy S5). I'm not on SafeStrap, I'm installing to system. I'm running TWRP recovery 2.8.4.0.

I first installed the CyanogenMod 12 nightly for 20150204 with Paranoid Android GApps 5.0.1RC3. All good there. I then went to "Security" and clicked "Encrypt Phone." It didn't ask me to set a password, so I assumed it'd generate a random key for LUKS and encrypt it with the default password. All good there. It rebooted into the "Encryption Wizard," and went through encrypting the phone. Cool, I thought.

It then boot-looped on start, seemingly because it didn't yet understand how to decrypt using the default password. TWRP decrypted data on startup of the recovery just fine, so that's cool. Okay, so maybe the nightly doesn't support decrypting on boot yet. Fine. I upgraded to CM 12 20150208 (today's) and tried again. Nothing.

I then did a factory reset and wiped system, reinstalling CyanogenMod from scratch. No joy either, couldn't boot. What was weird was that I still noticed that it was mounting /dev/dm-0 at /data, so my data was still encrypted. Shoot. How to get rid of encryption? I wrote a ton of zeroes to the beginning of data to wipe out the LUKS header:

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/userdata bs=4096

I terminated this process a while in (probably should have been more exact by specifying how much to zero, but laziness). I then ran

make_ext4fs /dev/block/platform/msm_sdcc.1/by-name/userdata

Next, reboot recovery, and all is well. Install ROM, and try encrypting again, this time setting an unlock code so that it actually uses a real encryption key instead of default. It reboots, takes a really long time, and then just continues into regular boot, no encrypting taking place, it seems to bypass that. Dangit.

I then tried switching off and on again the set_encrypted_filesystem flag to recovery:

adb shell recovery --wipe_data --set_encrypted_filesystem=off
adb shell recovery --set_encrypted_filesystem on

No joy, when I try to encrypt it still just reboots regular (albeit really slowly) into regular system and doesn't encrypt. Ugh, I feel like I've lost all progress. I've made sure to clear Dalvik and regular caches on each try, so things shouldn't be persisting. I had an old backup of the stock T-Mobile ROM, so I flashed back to that, and then tried installing CM 12 again and encrypting, and no matter what I do, I can't get to that encryption screen. (my original T-Mobile backup had EFS, Modem, etc. basically everything that TWRP would let me include) $@##$!!! Y U NO ENCRYPT!?

What are my next steps? How can I see what happens in that boot, ie what fails, so I can fix it and get onto my lovely life outdoors?
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
Shoot, logcat shows the following

E/Cryptfs ( 241): Orig filesystem overlaps crypto footer region. Cannot encrypt in place.

I'd better just zero out the entire thing to bypass this madness. Maybe that's what I screwed up?
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
I wrote all zeroes to the data partition to clear it out completely:

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/userdata bs=512

Then, encrypt, and fail to encrypt. Output from logcat:

E/Cryptfs ( 242): Bad magic for real block device /dev/block/platform/msm_sdcc.1/by-name/userdata
E/Cryptfs ( 242): Error getting crypt footer and key

I'm now going to try again by doing

adb shell dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/userdata bs=512
adb shell recovery --set_encrypted_filesystem=on

We'll see what happens. This is a weird process.
[Galaxy S 5 Q&A, Help & Troubleshooting] dsachdeva:
I am no expert but I had trouble with encryption on my s3 with cm rom a while back.

What eventually helped was to flash official ROM and recovery using Odin, which brought the phone back to life. and then flashing whatever you need.

Hope it helps you.
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
I'll have to try that. I'm compiling a list of what to try next. This is a bit of a nightmare, but I'm convinced that eventually I can get back to the way it was originally.
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
Okay, so all this is pretty spooky stuff, but here's what actually worked.

Grab the latest stock ROM. This will take you forever trying to find it on a stupid pay-per-download website and you'll have to hack your way around or through it to get to the download (which won't complete if you have a free account because it's too big, be forewarned). After your (premium!) download completes after 3 hours, use Odin and flash. Once your phone reboots, it'll see something's wrong with /data and will fix it. I'm not sure what fixing it entails, but I have to imagine it's something like wiping the LUKS header/footer (yes, there actually is something called a LUKS footer, as I discovered through this process) and reformatting the partition. It'll reboot again, and you'll be in happy stock land.

Next, install your recovery weapon of choice using Odin (reboot bootloader, flash, reboot recovery).

Next, wipe system and install CM 12. (20150204 works for me) Boot into CyanogenMod, and go to encrypt the phone. Here's the catch: you must use a PIN that's longer than 4 characters. I found this out the hard way. I'm not sure if six characters are required, but my four-character PIN simply didn't work and was the source of so much frustration. Give a good PIN or passphrase (passphrase is obviously better) and go forward with the encryption. My device rebooted a bunch of times and seemed to get into a boot loop. However, on each boot, it'd ask for the PIN, so I knew I was getting somewhere. Unplug it from the wall, and it should boot into the ROM.

Thank goodness, I lost a lot of time on this today.

An interesting aside: it seems that now in Android you can set a different disk encryption passphrase than your screen unlock pattern. FINALLY! Android Lollipop is awesome!
[Galaxy S 5 Q&A, Help & Troubleshooting] saintxseiya:
Having the exact same issue with multiple devices!!!

it is always the same! if a device was encrypted on cm12 and you wipe out everything, you will run into that problem again.

So, if a device is used and you want to format it and reuse it, the encryption will always fail! That can not be the right approach!
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
Understand the problem.

CyanogenMod 12 as of this point doesn't support the default encryption password, which is why it fails to boot. If the encryption password gets set to the default password, like if you change your screen pattern and not specify it for encryption also, it will fail to boot. This is a bug in CyanogenMod 12.

Your recovery also has a bug. If and when you factory reset, if the device is encrypted, the recovery should overwrite the encrypted filesystem footer with zeroes and then recreate an ext4 filesystem there and configure it properly. It doesn't, which leads to this annoying problem of not being able to boot.
[Galaxy S 5 Q&A, Help & Troubleshooting] saintxseiya:
Still struggling with an S4 mini, going back to stock and reflashing again works, but after encryption i have a lot of FCs and clearing cache etc. does not help @ all :(

So you mean, setting a pin BEFORE encryting will cause this fault?

Cheers,

saint
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
Not exactly. If you setup encryption with a password or PIN, the encryption should more or less work. If you then change your PIN or password and that change doesn't hit the disk (ie: you elect not to use your screen unlock password as your encryption pasword), the default password will be used, which will fail on boot.
[Galaxy S 5 Q&A, Help & Troubleshooting] PacoBell:
This is gonna be hella necroposting, but I did the same thing on different device and I know what I did wrongly. You can't just blow away the entire partition because the last 16KB needs to be dedicated to the crypto footer. Without that, Android has nowhere to store the encrypted key, "magic" header, etc. it needs to process the rest of the partition. That's also why FDE that isn't hardware-backed isn't a great idea. Anyway, that's all. Time to reformat using a slightly smaller filesystem size.
[Galaxy S 5 Q&A, Help & Troubleshooting] rfkrocktk:
LUKS AFAIK typically uses a header and not a footer on these volumes, which is why I was confused. No idea why the logic is better to store these things at the end of the disk, it makes it much more difficult to target easily.
[Android Q&A, Help & Troubleshooting] jaysouth27:
I recently rooted my LG optimus f6 ms500 and partitioned my 64GB SD card for more internal memory... But lately I've been experiencing lagging and freezing problems, apps constantly crash and my phone will get stuck in a reboot loop overnight and I have to remove the battery and power it back on. I downloaded and installed the Freedom Overclock for the ms500 but still get the same problems.... Is there something else I forgot to do or could do to fix this and keep my root?
[Android Q&A, Help & Troubleshooting] vanisleguy1976:
You're definitely not asking in the right forum lol... Try your device forum Q&A

~~~~~~~~~~~~~~~~~~~~~~~~~~

DEVICE: SM-N900W8

ROM: Temasek's CM12 v7.4

BASEBAND: N900W8VLUCNI1

KERNEL: 3.4.106-f2fs-temasek-cm12-hlte-v0.65+
[Android Q&A, Help & Troubleshooting] jaysouth27:
Thanks
[AT&T HTC One (M8)] MexicanSamurai:
Hi I was wondering how to get back to sense because I want to have a stock experience but the problem is I don't know how. It would be greatly appreciated if you can help. ?
[AT&T HTC One (M8)] Tigerstown:
Did you convert your phone to full GPE or just flash a GPE ROM?
[AT&T HTC One (M8)] MexicanSamurai:
Full GPE
[AT&T HTC One (M8)] Tigerstown:
I can help you. Just bout to go to bed tho so tomorrow. Download these files

4.4.4 firmware zip(if stock recovery isn't included download that to)

4.4.4 ruu

If you changed your Cid an mid or either one go ahead an change those back to your stock Cid an mid. I'll sent you a pm tomorrow an I'll help you
[AT&T HTC One (M8)] Tigerstown:
Are you available after 4pmEST we can do this if you r free today let me know.
[AT&T HTC One (M8)] thoughtstorn854:
Can you help me out too, Tigerstown I just recently bought a htc m8 from eBay and it had lollipop 5.01 I wanna downgrade back to 4.4.4. And put Viper rom on it. Thank you I'd appreciate it so much. Here's my email anjunaholic@outlook.com
[AT&T HTC One (M8)] Tigerstown:
You use hangouts?
[AT&T HTC One (M8)] thoughtstorn854:
the

Nope, really new to this.
[AT&T HTC One (M8)] Tigerstown:
OK so I'm clear. You got a s-off m8 on eBay an its running 5.0.1(GPE or sense) if GPE was it just a ROM flash or a full conversion from sense to GPE

---------- Post added at 01:04 AM ---------- Previous post was at 12:48 AM ----------

I have time to help you now.

---------- Post added at 01:05 AM ---------- Previous post was at 01:04 AM ----------

Ever find that firmware zip you need to convert back?
[AT&T HTC One (M8)] Tigerstown:
I can't all the files u need if you still are looking to convert let me know.
[AT&T HTC One (M8)] thoughtstorn854:
Thanks to Tigerstown and DDOT! my phone is fixed and working perfectly 4.4.4 Kitkat :) Thanks so much!
[Upgrading, Modifying and Unlocking] Bozzoq:
MTK Boot Logo​

Download

Download

Download

Download

Download

Install via cwm ;) DAYOR :angel:
[G2 General] ferreirawax:
There is still no "how to" specific to the LG G2, so I'll try to share the maximum of my experience (or almost) with ["kernel", "build", "LG G2"] here. I'll show two methods different using CM12 kernel, The method for LG ROMs is very similar, I show some tips for LG ROMs also. The first method is the "manual" and second is the "automatic" using my "tool" called DCC. So come on! For this you will need a computer running Linux (x64) and have knowledge about basic Linux commands. I'm using a laptop (i3-2328M and 4GB of RAM) running Ubuntu 14.10 :good:
[G2 General] ferreirawax:
DCC is a tool I developed to simplify my day, DCC is just a simple Python code that can help you save your time! See the features:

Command-line arguments like M$'s DiskPart

Real-time Shell executer

Manage builds for AOSP and LG ROMs

Build for single or ALL variants in same time

Manage the parameters of your kernel

DCC works with embedded open_bump

Manage your favorite toolchain

Easy to configure and use

I'll show how to use DCC is easy

Setup kernel environment:

reset && cd $HOME
mkdir dev && cd dev
git clone https://github.com/ferreirawax/dcc
cd dcc && find . -name '.gitignore' -delete
git clone https://github.com/ferreirawax/ramdisk_g2_aosp ramdisk/aosp
git clone https://github.com/ferreirawax/kernel_lge_msm8974-patched msm8974/aosp

Build kernel:

python dcc.py
do boot d802
exit

You know what happens to these magical commands? An immediate flashable zip of your kernel ready to flash. But for that you need to "setup" to your taste, see the page on github.
[G2 General] Boris31:
[MENTION=5859397]ferreirawax[/MENTION] this is great i was waiting for something like this so much, tommorow i will try your guide and post the results :D:D:D

EDIT

I followed everything and got stuck here:

simex@Simex:~/android/mykernel/msm8974$ make clean && make mrproper

make: /home/simex/android/mykenel/arm-cortex_a15-linux-gnueabihf-linaro_4.9/bin/arm-eabi-gcc: Command not found

THANKS for help :)

EDIT 2

I tried method with DCC and im stuck here:

simex@Simex:~/dev/dcc$ python dcc.py

Traceback (most recent call last):

File "dcc.py", line 19, in <module>

from colorama import *

ImportError: No module named colorama

simex@Simex:~/dev/dcc$

Sorry if im annoying but i hope someone can help me :)
[G2 General] ferreirawax:
This error happens when the toolchain path is wrong.

Colorama module need to use DCC (I forgot to mention that)

sudo pip install colorama
[G2 General] Norside:
Really exited to see sutch a complete guide for how to make a kernel for our G2:D

Will try and see if I can manager to compile my first kernel with this guide today..
[G2 General] Boris31:
ok thanks i got i working

---------- Post added at 10:43 AM ---------- Previous post was at 10:21 AM --------- [MENTION=5859397]ferreirawax[/MENTION] you got a typing mistake here thats why method 1 didnt work i finaly figured it out:

Export Architecture and Toolchain:

Code:

export ARCH=arm

export CROSS_COMPILE=~/android/mykenel/arm-cortex_a15-linux-gnueabihf-linaro_4.9/bin/arm-eabi-

It should be myKERNEL and that it works ;)

Now i succesfully build my kernel but im having problems with bump, i cant get past this:

simex@Simex:~$ python open_bump.py ~/android/mykernel/out/boot.img

python: can't open file 'open_bump.py': [Errno 2] No such file or directory

but im sure its there i tryed nearly everything but cant get bumped boot.img :(
[G2 General] bolt890:
Thank you!!!! I have wanted something like this to compile different kernels .:)
[G2 General] Norside:
It would have been totally awesome if [MENTION=2376110]dorimanx[/MENTION] did a tutorial once where he shared how he makes his (stock) kernels..anyways will this work on a 11 year old PC with 1gb RAM and 1,7 GHz processor? :P
[G2 General] Boris31:
any help for bumping boot.img ?
[G2 General] 6ril1:
http://xdaforums.com/showthread.php?p=56987541

(OP gave cmd lines too)
[G2 General] Boris31:
Yeah thanks i finally got it :)
[G2 General] ferreirawax:
This is willpower :)
[G2 General] ferreirawax:
Now you have what start modifying your kernel! :D
[G2 General] Boris31:
Yeah finally i'v built a kernel :D now i need to learn to modify it. Any good guide for that maybe :p
[G2 General] ferreirawax:
For that you need to read a little about git, then see the changes made by other developers and place them in your own kernel.
[G2 General] bolt890:
Thanks, I'm finally beginning to understand Linux terminal commands.
[G2 General] 6ril1:
[MENTION=5859397]ferreirawax[/MENTION]

I am aware that the rules prohibit posting simple thanks but I feel duty do it here because it is really nice to find shared topics showing how to fish rather than giving fish.

Big thank you to you so, great initiative !
[G2 General] RenderBroken:
[MENTION=5859397]ferreirawax[/MENTION]

Thanks for taking the time to post this. I would love for more people to try their hand at Custom Kernels! Otherwise you end up with the same kernel, different name.
[G2 General] bolt890:
DTB combiner:

Input directory: '/home/bolt890/dev/dcc/msm8974/aosp/arch/arm/boot/'

Output file: '/home/bolt890/dev/dcc/outputs/dt.img'

Found file: msm8974-v2-2-g2-open_com.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag

Found file: msm8974-v2-g2-open_com.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag

Found file: msm8974-g2-open_com.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag

=> Found 0 unique DTB(s)

error: dt.img not found, failed to make target

Keep getting this error:(
[G2 General] ferreirawax:
Seem to lack the DTC binary on your system. Download the attachment and follow:

sudo cp ~/dtc.zip /usr/bin/dtc

Or you can simply remove the extension and copy the file to /usr/bin any other way, may be necessary to a log-in/out for effect. Then compile again. :)
[G2 General] bolt890:
Thanks , going to try again when i get back.
[G2 General] crutchcorn:
Hey, how did you patch the kernel for easy build? I have an LG L70 and would like to use this guide to build a custom kernel but not sure how to patch the kernel? If I missed something I apologize.
[G2 General] bolt890:
/usr = my user name or should I use it as it is. I have tried this:

bolt890@bolt890-OptiPlex-755:~/Downloads$ sudo cp ~/dtc.zip /usr/bin/dtc
[sudo] password for bolt890:
bolt890@bolt890-OptiPlex-755:~/Downloads$

Tried login/out but still getting the error. Sorry but i am a newbie.
[G2 General] :
usr/bin is in /(filesystem), not in /home

cd ~/Downloads && sudo mv dtc.zip /usr/bin/dtc && sudo chmod +x /usr/bin/dtc

or

gksudo nautilus

This command opens the file explorer with root permission. So you can copy the dtc to /usr/bin, then click the right mouse button and go to properties and mark as executable. Reboot and try again.
[G2 General] :
You can use this guide as an example, I do not know L70 well but for sure the parameters to compile your kernel is a bit different. There is no documentation with kernel source? The "patches" are specific bug fixes for msm8974.
[G2 General] bolt890:
Thanks it worked.:D
[G2 General] somboons:
Can I use your tool with stock LG kernel ?
[G2 General] bolt890:
According to the OP yes. You need to edit dcc_h.py file. There are instructions in the file about how to use it with lg kernel but ofcource you need seperate source and ramdisk for it.

I myself am trying but i currently need to get the correct ramdisks for lge. I hope i am right, i dont honestly know much.
[G2 General] :
You can use the ramdisk that is the [MENTION=5232783]dr87[/MENTION] source: https://github.com/dr87/SimpleKernel/tree/stocktesting/ramdisk

Create a folder for each model in ramdisk/lge and place the decompressed files, I still have not tested DCC with Stock LG kernels.

To unpack lz4 use:

lz4 -d ramdisk.lz4 ramdisk.cpio

Then extract the cpio file. I'm a little busy with CM12, then I will test with Stock LG ROMs :)
[G2 General] crutchcorn:
No, I understand that. We have a pretty decent setup for the kernel - and it's already been built by another. I know there are different things, but I'm willing to figure it out. Just was wondering if there was anything more that I needed to do to the kernel source
[G2 General] :
If you have no problems, There is nothing to do at this point. If you have any questions later I might be useful. :)
[G2 General] bolt890:
I have got the ramdisk now. While compiling I am getting the following error after some time:

error: zImage not found, your build stuck

I have tried two different stock LG kernels now(Stock 20b and Simple Kernel) but they end up with the same error. I hope i dont annoy you too much, i try to find solutions online(Google) but when i cant i ask them here:)
[G2 General] :
This warning comes from the DCC, not the kernel, Yesterday I was busy compiling CM12 (which took 8 hours for a single build, definitely my PC is not good for this). Right now I'll try and update the thread. :)
[G2 General] bolt890:
Sure dude, going to wait for any updates not in a hurry;) Im enjoying Blisspop with CM12 Kernel compiled by me thanks to you:good:
[G2 General] :
I checked the [MENTION=2376110]dorimanx[/MENTION] sources and realized that to build for LG ROMs is a little different, so I'll have to adapt the guide and the DCC, will take a while there. I am also having problems in the stock ROM. :eek:
[G2 General] fix-this!:
Wondering if i can use this to make an updated kernel based on the furnance kernel for lollipop? Gonna try this weekend.
[G2 General] :
You can, but it will be necessary adaptation to work in another version, it would be easier to take a clean kernel and pick up the changes from Savoca's sources.
[G2 General] berryman13:
Ye. But YOU have to do the lollipop comparability work. Its not in furnace obviously

---------- Post added at 01:31 AM ---------- Previous post was at 01:30 AM ----------

+1

Start fresh and cherry pick furnaces awesome features.
[G2 General] fix-this!:
actually the furnace kernel does support lollipop for the g3 and one+ so hopefully porting its features in will be easy. how do you cherry pic kernel tweaks? gonna try on saturday.
[G2 General] :
Here a nice guide for beginners.

Sample

https://github.com/ferreirawax/kernel_lge_msm8974-patched/commit/352364b9ae7bd7d41cc3e186489552387041ebfd

I need that commit to my kernel. For this I need to fetch repository that has this commit on my repo:

cd ~/msm8974
git fetch git://github.com/ferreirawax/kernel_lge_msm8974-patched.git

Now you choose which commit want to get using your hash (red):

git cherry-pick 352364b9ae7bd7d41cc3e186489552387041ebfd
[G2 General] fix-this!:
n/a
[G2 General] fix-this!:
So i got kubuntu x64 installed and setup the enviorment. The questions i have are is it best to use a clean based cm12 kernel or maybe use renders or blackbird as a base and add or remove the features i want? Lets say i want to add zzmove cpu govenor or alucard hotplug. Do i just search for those on github? Also as far as the cherry picking commits, at which step in your guide would i add or remove features? Thanks again.
[G2 General] :
You can use Render or Blackbird based but you will not control the flow of changes, This would result in a kernel with conflicts. Ideally get a clean kernel and track repositories of render and dorimanx and build your own kernel with the changes that you think would be good. However you can get features using cherry-picks and remove using "revert" git feature.
[G2 General] :
I'm having serious problems with my LG G2 panel after testing with the stock kernel, the CM12 In my LG G2 panel had as JDI, so I compiled the kernel for stock JDI, But unluckily my panel was LGD, So why the hell in CM12 as pointed JDI? The result is now my device with a white spot on the screen background. :(

I want to apologize for my incompetence. Soon the guide will be updated/DCC with new features.
[G2 General] Norside:
Hasn't Render or dorimanx or someone else made an auto screen type detector for their kernel? Could it be possible to show us how to add that to avoid damaged screens etc?