I started my little own project to port exfat, ntfs and ext4 read-write support for OTG storage devices from CM to AOSP.
It was fun to discover how git works and understand how a little portion of the android system works.
Eventually, I was able to port it to AOSP, but I still have some questions and I have to admit there are still huge black holes in my mind about the soruce code. That's why I want ask you to tell me what I did wrong, what was unnecessary, what else I still have to add or modofy and why.
My source code based on AOSP kitkat-mr2.1-release branch.
I added Add support for USB OTG and HACK: Disable secure discard commits to device/lgehammerhead.
Question 1: HACK: Disable secure discard is a fix for when I select "Erase USB storage" in Settings/Storage to not take too long?
I added Make "SD Card removed" notification dismissible commit to frameworks/base
I added Dont show "Erase SD Card" when there is none commit to packages/apps/Settings
I added blkid: Add support for probing exFAT commit to external/e2fsprog
I merged 6 commits into one commit and added it to external/sepolicy. You will find the links for merged commits in the commit I made.
Question 2: I think, I dont need the changes about ASEC containers, because if I understand right these ASEC commits for phones which has support for installing apps to sdcard. Am I right?
Question 3: I was in trouble with system/vold. There were so much commits made by CM. It is beyond my knowledge to decide which commit I need for exfat/ntfs/ext4 rw otg support at the moment, therefore I decided to use the CM system/vold instead of the AOSP one, and fixed a build error. Is that okay or should I find the commits for the ntfs/exfat/ext4 rw otg support?
Question 4: Is it okay to solve that above mentioned build error that way or should I resolve the conflict with the selinux_android_restorecon funciton in external/libselinux/src/android.c (CM version)
I added Add libminshacrypt static lib commit to system/core to fix a lib dependancy needed by something from system/vold.
I added the repos of the exfat, ntfs and fuse sources from CM to my manifest and also made it github compatible and added the modified repos.
I added the exfat/ntfs modules to build
After some testing it tunred out I cannot format pendrives formated as NTFS or ext4 because the binaries (mkntfs and mke2fs) were missing qhich could format the storage device to ntfs or ext4. Luckily the modules already have been declared in their Android.mk files so I just had to add that two modules mkntfs and mke2fs.
I am sorry if something is confusing or not understandable. I am really at the begining of programing android.
Also here is a build the AOSP rom with exfat/ntfs/ext4 rw otg support. You have to flash it in fastboot, because the zip packages has recovery.img which will overwrite your recovery during flashing. Just extract it then fastboot flash system system.img then fastboot flash boot boot.img and do a factory reset.
It was fun to discover how git works and understand how a little portion of the android system works.
Eventually, I was able to port it to AOSP, but I still have some questions and I have to admit there are still huge black holes in my mind about the soruce code. That's why I want ask you to tell me what I did wrong, what was unnecessary, what else I still have to add or modofy and why.
My source code based on AOSP kitkat-mr2.1-release branch.
I added Add support for USB OTG and HACK: Disable secure discard commits to device/lgehammerhead.
Question 1: HACK: Disable secure discard is a fix for when I select "Erase USB storage" in Settings/Storage to not take too long?
I added Make "SD Card removed" notification dismissible commit to frameworks/base
I added Dont show "Erase SD Card" when there is none commit to packages/apps/Settings
I added blkid: Add support for probing exFAT commit to external/e2fsprog
I merged 6 commits into one commit and added it to external/sepolicy. You will find the links for merged commits in the commit I made.
Question 2: I think, I dont need the changes about ASEC containers, because if I understand right these ASEC commits for phones which has support for installing apps to sdcard. Am I right?
Question 3: I was in trouble with system/vold. There were so much commits made by CM. It is beyond my knowledge to decide which commit I need for exfat/ntfs/ext4 rw otg support at the moment, therefore I decided to use the CM system/vold instead of the AOSP one, and fixed a build error. Is that okay or should I find the commits for the ntfs/exfat/ext4 rw otg support?
Question 4: Is it okay to solve that above mentioned build error that way or should I resolve the conflict with the selinux_android_restorecon funciton in external/libselinux/src/android.c (CM version)
I added Add libminshacrypt static lib commit to system/core to fix a lib dependancy needed by something from system/vold.
I added the repos of the exfat, ntfs and fuse sources from CM to my manifest and also made it github compatible and added the modified repos.
I added the exfat/ntfs modules to build
After some testing it tunred out I cannot format pendrives formated as NTFS or ext4 because the binaries (mkntfs and mke2fs) were missing qhich could format the storage device to ntfs or ext4. Luckily the modules already have been declared in their Android.mk files so I just had to add that two modules mkntfs and mke2fs.
I am sorry if something is confusing or not understandable. I am really at the begining of programing android.
Also here is a build the AOSP rom with exfat/ntfs/ext4 rw otg support. You have to flash it in fastboot, because the zip packages has recovery.img which will overwrite your recovery during flashing. Just extract it then fastboot flash system system.img then fastboot flash boot boot.img and do a factory reset.