[BOOT] NanoBoot r10 CM10 [UMS][2012-08-17] - Galaxy Tab 2 7" Android Development

After testing CM10 for a while (thx codeworx) I now ported my NanoBoot image to CM10.
Changes compared to original CM10 boot:
"insecure" (means: / and /system mounted read-write (easy 'adb push' into /system ...), ro.secure = 0)
support for /system/etc/init.d/ init scripts
(somewhat) easy UMS access
Changes in r10:
Use 179:24 instead of 179:25 as address for UMS (fixes UMS on Windows)
to enable UMS for external SD with this boot.img it is enough to do:
Code:
setprop sys.usb.config mass_storage,adb
to return to MTP:
Code:
setprop sys.usb.config mtp,adb
TIP:
If you use Linux you may use some function like:
Code:
ums () {
if [[ $1 == "+" ]]; then
adb root
sleep 2
adb -s c1607c00051963f shell 'setprop sys.usb.config mass_storage,adb'
else
adb root
sleep 2
adb -s c1607c00051963f shell 'setprop sys.usb.config mtp,adb'
fi
}
'ums +' will enable UMS, 'ums -' will disable UMS on your tablet (not to mention it needs to be connected (...))
replace '-s c1607c00051963f' with '-s <your adb id>' - you get the id via 'adb devices'.
If you only got one adb-enabled device, you could remove '-s c1607c00051963f' from the commands.
If there's more than one device connected adb needs to know which one should receive the commands.
I did not yet have the time to modify framework-res.apk to add UMS to the list of options...
Flash using img/pit with either Odin or Heimdall. Or use zip to flash using CWM.
Images for Odin/Heimdall
PIT:
p3100.pit http://downloads.nanolx.org/P3110/p3100.pit
p3110.pit http://downloads.nanolx.org/P3110/p3110.pit
Stock CM10 Kernel:
NanoBoot-r10-CM10.img http://downloads.nanolx.org/P3110/NanoBoot-r10-CM10.img
Johnsel's CM10OC Kernel:
-No WiFi-
Zips for CWM
Stock CM10 Kernel:
NanoBoot-r10-CM10.zip http://downloads.nanolx.org/P3110/NanoBoot-r10-CM10.zip
Johnsel's CM10OC Kernel:
-No WiFi-

Tried this on my P3113 and it broke my WiFi.

Macadamia Daze said:
Tried this on my P3113 and it broke my WiFi.
Click to expand...
Click to collapse
Here with 3110 it works... if you provide me the original 3113 boot.img, I can re-pack one, that should work.
And it only works with Cyanogen Mod 10. Not on 9 or stock rom.

Setialpha said:
Here with 3110 it works... if you provide me the original 3113 boot.img, I can re-pack one, that should work.
And it only works with Cyanogen Mod 10. Not on 9 or stock rom.
Click to expand...
Click to collapse
I am using CM10, so here's the original boot.img for CM10 on the P3113. You don't need the stock one, do you?

Macadamia Daze said:
I am using CM10, so here's the original boot.img for CM10 on the P3113. You don't need the stock one, do you?
Click to expand...
Click to collapse
try with attached CWM zip.

n00b here.....what does this do??
Sent from my GT-P3113 using Tapatalk 2

F3AR420 said:
n00b here.....what does this do??
Sent from my GT-P3113 using Tapatalk 2
Click to expand...
Click to collapse
Just as first post says. This is a modified boot image for cyanogen mod 10 (no other ROM supported!) for galaxy tab 2 7", which makes / and /system read-write, adds support for init-scripts and adds pretty easy way to access UMS (USB Mass Storage) for external SD-Card.
According to your signature you're using an incompatible rom anyway - so don't use this.
@Macadamia Daze: now also tested with a 3100 I got my hands on: WiFi works. Dunno why it doesn't work with 3113 (I got no clue whether 3113 has some special WiFi stuff or whatever). Either way, please tell me, whether the attached one for 3113 (two posts above) works with WiFi.

Setialpha said:
@Macadamia Daze: now also tested with a 3100 I got my hands on: WiFi works. Dunno why it doesn't work with 3113 (I got no clue whether 3113 has some special WiFi stuff or whatever). Either way, please tell me, whether the attached one for 3113 (two posts above) works with WiFi.
Click to expand...
Click to collapse
Silly me; the problem was an incompatible kernel (Johnsel's). I returned to the default CM10 kernel and reflashed this, so now WiFi works. Still, in Windows it doesn't work properly. While it does create a new removable disk in Computer, it gives the "Please insert a disk into drive" error when I try to open it. Haven't tested in Linux yet, but based on my earlier tests with your previous UMS solution, it probably works.
---------- Post added at 08:12 PM ---------- Previous post was at 07:22 PM ----------
Ooh, I have good news! I used Device Manager to examine the blank drive letter on the computer, and it was recognizing it basically like an SD card reader with no SD card. So, I decided to poke around some of the files referenced in your UMS script from before to check their values. When I tried to open /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file, I got an error. Thinking it may not be working properly, I created a file on my computer with the contents "/dev/block/vold/179:24" and ADB pushed it to overwrite the broken file. Instantly, my SD card mounted on the PC. I hope this is useful information for you!

Macadamia Daze said:
Silly me; the problem was an incompatible kernel (Johnsel's). I returned to the default CM10 kernel and reflashed this, so now WiFi works. Still, in Windows it doesn't work properly. While it does create a new removable disk in Computer, it gives the "Please insert a disk into drive" error when I try to open it. Haven't tested in Linux yet, but based on my earlier tests with your previous UMS solution, it probably works.
---------- Post added at 08:12 PM ---------- Previous post was at 07:22 PM ----------
Ooh, I have good news! I used Device Manager to examine the blank drive letter on the computer, and it was recognizing it basically like an SD card reader with no SD card. So, I decided to poke around some of the files referenced in your UMS script from before to check their values. When I tried to open /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file, I got an error. Thinking it may not be working properly, I created a file on my computer with the contents "/dev/block/vold/179:24" and ADB pushed it to overwrite the broken file. Instantly, my SD card mounted on the PC. I hope this is useful information for you!
Click to expand...
Click to collapse
I see... 179:24 is the sdcard itself, 179:25 (what I use) is the first partition on the sdcard... unixoid systems don't care about that, but windows seems too... I'm gonna test with 179:24 on Linux and if it works there (I'd say yes even without testing, I provide an update). Thanks for testing.

r10 is now online - fixes UMS issue on Windows.
I can't get WiFi to work with Johnsel's CM10OC Kernel - so I skiped uploading those image/zip...

You can find me in Freenode #cyanogenmod-dev if you care to sort out what's happening with the wifi on my kernel

Johnsel said:
You can find me in Freenode #cyanogenmod-dev if you care to sort out what's happening with the wifi on my kernel
Click to expand...
Click to collapse
It fails to load something and therefore can't be enabled, don't remember exact log-message right now.
I'll contact you, when I'm hacking around the next time.

This is pretty interesting.
Two things
1-Doesn't CM10 already support init.d scripts?
2-Would it be possible to swap the mountpoints for the "internal" sdcard space and the actual microSD card slot? My current method of re-mounting things right after boot is OK but not very elegant.

DivinityCycle said:
This is pretty interesting.
Two things
1-Doesn't CM10 already support init.d scripts?
2-Would it be possible to swap the mountpoints for the "internal" sdcard space and the actual microSD card slot? My current method of re-mounting things right after boot is OK but not very elegant.
Click to expand...
Click to collapse
1 - atleast not via boot.img - that's why I added it.
2 - I have an older tablet I used before (ARNOVA 7C G2) it worked with this one, so it should work with this one, too. But you should never enable UMS while some app is running... On that other tablet I had to use EXT2 or EXT4 on SD-Card else all that permission stuff didn't work (FAT only has very basic permission rules for files). Also I recommend using second partition of SD-Card for /data. (first gets used as external storage and is managed by vold - at least that is what I did on my other tablet).
I attached init.espresso.rc, so that you can play around with the mount points (re-send me the file after you're done and I can provide you a flashable zip).

Setialpha said:
1 - atleast not via boot.img - that's why I added it.
2 - I have an older tablet I used before (ARNOVA 7C G2) it worked with this one, so it should work with this one, too. But you should never enable UMS while some app is running... On that other tablet I had to use EXT2 or EXT4 on SD-Card else all that permission stuff didn't work (FAT only has very basic permission rules for files). Also I recommend using second partition of SD-Card for /data. (first gets used as external storage and is managed by vold - at least that is what I did on my other tablet).
I attached init.espresso.rc, so that you can play around with the mount points (re-send me the file after you're done and I can provide you a flashable zip).
Click to expand...
Click to collapse
That's the thing I have been wrestling with lately, what's "the best" way to manage this stuff?
It seems like the main thing that needs to be done for legacy purposes is linking the regular /storage/sdcard0/data directory over to /storage/sdcard1/data/.
One idea I had was to format the "internal" sdcard (/storage/sdcard0) with ext4, which would allow symlinks to exist there, then just remove the data directory and replace it with a symlink that points to /storage/sdcard1/data.
From what I've read, ext4 is supposed to be a better, higher performance solution, so I'm kinda curious to try it out.
It would make UMS pretty worthless to Windows guys like me, but I basically do everything via network anyways (SFTP mostly).
Is it possible to control the file systems used on the internal & external sdcards in the init? I didn't look too deeply at it cuz I don't know how to rebuild a boot.img (at least not yet)

Tested this with the current AOKP JB nightly, and it also breaks WiFi. I'm trying now to keep the rom and restore the CM10 NanoBoot backup. Fingers crossed it will be stable.

Related

[DEV][BRAINSTORM] Fully-working CWM Recovery

While the recovery we have at the moment, fruit of the hard work of xantaro, unclecracker and digitalfrost, is enough for most operations there are some things bugging me that is in our interest to fix with the ultimate aim of adding it to ROM Manager and thus get official support.
Current issues:
1. It isn't the latest version of CWM and isn't official.
2. It doesn't have USB mount working.
3. It doesn't have ADB working.
4. It doesn't support EXT4.
Now, I have tried to fix these but recoveries are a new domain for me and at a first attempt I couldn't bring some of these to work. Compiling the latest version was easy and an important first step towards official; however, all others I couldn't do it and I don't think we should talk with koush before fixing all this.
Here are my short attempts:
- For USB mount I defined on the BoardConfig the path for UMS lun0 file. The path seems to be correct and there's no other file in /platform/ as I've found out by running a ls -R. I have no idea why it's not working.
- For ADB, I made sure the persist.adb.service is set to 1 and the init.rc is starting it. This being said, I don't know what's missing. Perhaps this is of interest?
- For EXT4 support I thought it was just a matter of adding alternative FS to recovery.fstab. Seems I was wrong though.
So, does anyone want to join in and help?
This is really new territory to me and I have a quite faint idea of what I'm doing.
A few guidelines:
- Read this to get an idea.
- You'll need CM sources (repo init... repo sync...)
- The CWM recovery source is in /bootable/recovery
- Here is my device source and a patch file for some changes on recovery src *
- Run build commands (. build/envsetup.sh, lunch full_p970-eng, make -j4 recoveryimage)
* If you don't change what I did on the recovery source you won't have a key to select.
Also, I have CWM 4.x at the moment on my OB but since it does the same as the already posted 3.x I don't deem necessary to share it; but if anyone wants, I'll upload it.
I'll join the party when I come from the mini-vacations, hope there'll be some progress meanwhile!
Great
i'll try to do some help,maybe little
If anyone wants you can request a pull from my source.
Also, here's a flashing CWM 4.x. I renamed it Nova recovery for the lulz.
http://www.multiupload.com/R7WGNYTL7G
Changes on the Source to get selectbutton to work shouldn´t be necessary. Adding "BOARD_HAS_NO_SELECT_BUTTON := true" to boardconfig.mk suffices to get selectbutton to work.
EXT4 Backup and Restore worked for me after editing the fstab file.
For the ADB and USB mount problem i have no Idea what is missing. Like you said, adb daemon should get started througt the initscript.
BTW. seems like the Progressbar isn´t working on the newer Versions of CWM
xantaro said:
EXT4 Backup and Restore worked for me after editing the fstab file.
Click to expand...
Click to collapse
Could you release a new version or tell us how to do it? Thanks
To get EXT4 working in my O2X builds my /data line looks like this:
Code:
/data ext3 /dev/block/mmcblk0p9 NULL auto
xantaro said:
Changes on the Source to get selectbutton to work shouldn´t be necessary. Adding "BOARD_HAS_NO_SELECT_BUTTON := true" to boardconfig.mk suffices to get selectbutton to work.
Click to expand...
Click to collapse
I thought the flag wasn't suffice. Thanks.
Rusty! said:
To get EXT4 working in my O2X builds my /data line looks like this:
Code:
/data ext3 /dev/block/mmcblk0p9 NULL auto
Click to expand...
Click to collapse
Nice tip, I'll try.
knzo said:
While the recovery we have at the moment, fruit of the hard work of xantaro, unclecracker and digitalfrost, is enough for most operations there are some things bugging me that is in our interest to fix with the ultimate aim of adding it to ROM Manager and thus get official support.
Current issues:
1. It isn't the latest version of CWM and isn't official.
2. It doesn't have USB mount working.
3. It doesn't have ADB working.
4. It doesn't support EXT4.
Click to expand...
Click to collapse
Hey,
I know this is an old thread but still if u have not resolved the problem with ADB and USB follow these instruction:
Before we start:
My mobile is Spice Mi-410 (Qualcomm made), also known as Cherrymobile magnum, Wellcomm, Motorola triumph in different countries. So may be these tweak will not work with your device. (But you can give it a try )
I hope you know how to unpack recovery.img of your device (or boot.img if your recovery ramdisk is stored in boot.img like Xperia Arc) if not then follow this guide to unpack recovery.img and extract recovery ramdisk into a folder.
Tweak
For ADB: Open init.rc file from recovery ramdisk/initram using any editor of your choice
Put this line at the end of "on init" section
Code:
write /sys/module/g_android/parameters/product_id ####
where #### should be replaced by your device's product id.
(if you dont know what it is then connect your mobile to PC and issue "lsusb" command in ubuntu terminal, you should see something like this
Bus 001 Device 027: ID 0489:c000 Foxconn / Hon Hai
Here c000 is my devices product id and Foxconn is my device's manufacturer)
Though /sys/module/g_android is not present in our device but this worked for me.
Please note that the device id is case sensitive, so write what you see on PC
For USB: For this add following line at the end of "on boot" section in init.rc file
Code:
echo 1 > /sys/class/usb_composite/usb_mass_storage/enable
For your device first confirm the location of /sys/class/ ###### / ####/usb_mass_storage/enable
Since this location vary from device to device.
This should enable usb storage mounting from recovery.
Best of luck!!
One option for load rootfs image in native mode is necesary
enviado

sd-card blues...

Hey guys I have a question for you all about sd-cards
I sbf'd
Installed ota 5.7.894 (because of no true .906 sbf I won't flash it)
Regained root
Installed busybox 1.20 (figured newer might be better)
Installed safestrap (tweaked of course 1.08f)
Now
My phone see's the internal/external sd-cards fine and mounts/formats/explores just fine
My laptop also see's internal/external sd-cards just fine
However
Rootbrowser cannot see the sd-card
Safestrap cannot find /sdcard
But
Root explorer can see the internal and external just fine
I have tried sbfing several times to see if it will fix it
I have tried not installing the ota,changing versions of busybox ect..
Why can my phone see and work with the sd-cards just fine but programs cannot?
Because safestrap cannot see the sd-card I cannot create backups..
Any help is greatly appreciated
I think Rick#2 acknowledged this in the safestrap 1.08f thread and had this advice for those experiencing the error:
(For the record, this change almost worked for me - safestrap would now access my external sdcard (/sdcard), but when I would select a zip to flash, it would just take me back to the menu. I dropped a reply with my results in that thread.)
Rick#2 said:
While you're in Safestrap, either go into the console or "adb shell" into your phone. (Remember that for adb to work properly in the recovery your phone has to boot up with the USB cable already connected).
If you type:
Code:
ls -l /dev/block | grep mmcblk0
what output does it provide? For me, it spits out "mmcblk0" but... I'm pretty sure that for those that aren't able to mount their external sdcards it will say mmcblk0p1. In which case, the fix is easy; I'll be sure to update my package, obviously, but for those of you who want to try a little DIY, copy the file /systemorig/etc/safestrap/recovery.zip onto your computer and unzip it. Inside, there's be a file called /etc/recovery.fstab; edit this and change the line corresponding to /sdcard (It ought to be on line 3, or the second line of actual text) to the following:
Code:
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
Click to expand...
Click to collapse
At this point, after copying the recovery.fstab back to my phone, I assumed I had to correct the permissions of the file, so I did. If I am wrong, someone please let me know!
continuing his reply...
Doesn't really matter how many spaces you have between; ideally you'll just need to hit tab each time.
Hopefully this is what the issue was. I remembered changing that line because I was getting random error messages about my external /sdcard and since I didn't see /dev/block/mmcblk0p1 in my /dev/block directory I assumed I must have made a typo and changed it... here's one tiny example of how easy it is to completely bork these things. Multiply it by a million and you have kernel development...
Click to expand...
Click to collapse
That might work if it was just safestrap having the issue..but its not
Even cwm cannot backup the apps on the sd-card as it cannot see it as well..
But root explorer and the stock file browser can see the internal/external sd-cards
And write on them just fine..and even mount/unmount and format...arrrggggg
This is killin me

[Q] Mounting USB mass storage in CM 10.2

I recently flashed my stock B&N Nook HD+ with CM 10.2. I am ultimately trying to use the Nook HD+ to transfer photos from a CF flash card, in a usb reader to a 500gb USB HD. I have the usb devices plugged into a powered hub. I have tried numerous apps to get these two devices to mount at the same time. I have spent most of my time with Chainfire stickmount.
Some things that I have seen:
When the devices are plugged in, they are recognized as uba1 and ubc1. This differs from the many references to sda1, etc. I've seen in web searches. If they are unplugged and re-inserted, these value change. That makes manually mounting them rather inconvenient. I have successfully manually mounted these devices.
When inserted, stickmount, prompts me, and says "searching", but never lists any mounts. If I make directories in /sdcard/usbstorage, those paths are displayed as active mounts instead of the "searching" display. But nothing is really in them. From this, I'm assuming that Stickmount is supposed to create these directories.
I attempted to make entries in fstab.ovation, similar to usb0. But after re-boot, the file reverts to the original condition. I guess that I don't understand the boot sequence well.
Has anyone had any success mounting several USB mass storage devices to the Nook HD+ and CM 10.2? If so, how?
Well, your almost there... just jump over to here -> http://forum.xda-developers.com/showthread.php?t=2307585 and have fun with usb devices.
There's an app there in the first post.
Mounting multiple USB mass storage devices
sandsofmyst said:
Well, your almost there... just jump over to here -> http://forum.xda-developers.com/showthread.php?t=2307585 and have fun with usb devices.
There's an app there in the first post.
Click to expand...
Click to collapse
If you are referring to the USBSwitch app, I have tried that. It appears to only mount one USB mass storage device on /storage/usb0. But I already have to use it to turn on the OTG USB host function, anyway. I see the related entry in fstab.ovation that makes that work. As I mentioned before, I think adding a similar line in that file using, say usb1, would work. But as I mentioned, I can't get my edits of that file to stick.
marklieber1 said:
If you are referring to the USBSwitch app, I have tried that. It appears to only mount one USB mass storage device on /storage/usb0. But I already have to use it to turn on the OTG USB host function, anyway. I see the related entry in fstab.ovation that makes that work. As I mentioned before, I think adding a similar line in that file using, say usb1, would work. But as I mentioned, I can't get my edits of that file to stick.
Click to expand...
Click to collapse
You will never get an edit of that file to stick. That file is part of the boot initiation sequence that is permanently embedded in the boot files.
Sent from my SCH-i705 using Tapatalk
Alternative to editing the fstab file to mount devices
leapinlar said:
You will never get an edit of that file to stick. That file is part of the boot initiation sequence that is permanently embedded in the boot files.
Sent from my SCH-i705 using Tapatalk
Click to expand...
Click to collapse
That's what I suspected. Is it possible to add a file to the init.d folder to perform mounting tasks? Or will that file be wiped on re-boot too?
Thanks for confirming my suspicions about fstab and the boot sequence.
marklieber1 said:
That's what I suspected. Is it possible to add a file to the init.d folder to perform mounting tasks? Or will that file be wiped on re-boot too?
Thanks for confirming my suspicions about fstab and the boot sequence.
Click to expand...
Click to collapse
Yes, it is possible to add mounting commands to the init.d folder and they stick (at least until you flash a new ROM). But for how to write those commands you are on your own.
Sent from my BN NookHD+ using XDA Premium HD app
Mount commands in init.d files
leapinlar said:
Yes, it is possible to add mounting commands to the init.d folder and they stick (at least until you flash a new ROM). But for how to write those commands you are on your own.
Sent from my BN NookHD+ using XDA Premium HD app
Click to expand...
Click to collapse
Thanks for that confirmation. I think that I can handle the simple commands that I need.
marklieber1 said:
When the devices are plugged in, they are recognized as uba1 and ubc1. This differs from the many references to sda1, etc. I've seen in web searches. If they are unplugged and re-inserted, these value change. That makes manually mounting them rather inconvenient. I have successfully manually mounted these devices.
Click to expand...
Click to collapse
The ub driver is obsolete and not present in recent Linux kernels. You should blacklist it and use usb-storage instead. If you can't blacklist ub, you can get the same effect by writing "usb-storage" to /sys/module/libusual/parameters/bias.
Blacklisting the ub driver
Delta^1_1 said:
The ub driver is obsolete and not present in recent Linux kernels. You should blacklist it and use usb-storage instead. If you can't blacklist ub, you can get the same effect by writing "usb-storage" to /sys/module/libusual/parameters/bias.
Click to expand...
Click to collapse
I am not familiar with the procedure to blacklist a driver. Any searches that I've done on this procedure reference folders/files that I don't see on my device. I also don't see a libusual directory on my device within /sys/module. I DO see a few USB related directories such as usb_storage, usb_wwan, usbcore, usbhid, and usbserial. Or do you mean that I need to create this path, /sys/module/libusual/parameters, and a file, "bias", with line containing "usb-storage"?

TWRP Recovery Issues Thread

I'm starting this thread to move the topic out of another forum.
I encountered the issue of TWRP not being able to write to the internal storage after downgrading to 4.4.4 and only flashing the boot, system & baseband images from the KXE package Motorola provides.
It gave the error message errno=13
It gave the same error on 4.4.4 & 5.0
I had double-checked all permissions & symlinks.
To fix the issue I had to re-flash the KXE recovery, reboot the bootloader & then reflash TWRP 2.8.6.0, then all was well with both 4.4.4 & 5.0
adm1jtg said:
Not sure if this solves the error 13 or not but I can confirm using your process exactly OTG is still broken on 2860 and still works in 2850 so separate issue I would guess but since I need OTG for my backups and restores I will keep using the modded 2850 for now. Can you confirm on your setup if OTG works or not from within twrp. On mine the drive light doesn't even come on, I cannot mount it it just vibrates and I cannot backup to it. All the correct options are there but it cant access the drive at all..
Click to expand...
Click to collapse
@adm1jtg Can you backup to the internal storage?
defcondev said:
@adm1jtg Can you backup to the internal storage?
Click to expand...
Click to collapse
I had other weird issues. Initially mine would backup internally just fine but those files could not be viewed from rom side aka root explorer and such couldn't see files. Only twrp could see the backup files. I then formatted the sdcard and got the error #13 error.
To be honest I FINALLY got my phone setup and backed up the way i want it. The newly re-released 2850 works in all aspects I have tested, aka no error 13, can see files backed up internally on rom side, can see and use otg thumb drive for both backups and restore. Since 2850 works for all I need I really am not overly motivated to test much with 2860 just to be honest with you.
Since I confirmed that OTG is still broken in 2860 that makes using 2860 a deal breaker for me.
adm1jtg said:
I had other weird issues. Initially mine would backup internally just fine but those files could not be viewed from rom side aka root explorer and such couldn't see files. Only twrp could see the backup files. I then formatted the sdcard and got the error #13 error.
To be honest I FINALLY got my phone setup and backed up the way i want it. The newly re-released 2850 works in all aspects I have tested, aka no error 13, can see files backed up internally on rom side, can see and use otg thumb drive for both backups and restore. Since 2850 works for all I need I really am not overly motivated to test much with 2860 just to be honest with you.
Since I confirmed that OTG is still broken in 2860 that makes using 2860 a deal breaker for me.
Click to expand...
Click to collapse
I had that issue as well (not being able to view the TWRP folder);
The folder wasn't showing up in storage/sdcard but was showing up in data/media/0
To fix this there are a couple things you need to do;
1. Using a terminal emulator, execute the following command
su
restorecon -FR /data/media/0/*
2. Using a root-enable file browser, go to /data/media/0/ and change both the Owner & Group of the TWRP folder to "media_rw" (without quotes) and make sure permissions are set to drwxrwxr-x
defcondev said:
I had that issue as well (not being able to view the TWRP folder);
The folder wasn't showing up in storage/sdcard but was showing up in data/media/0
To fix this there are a couple things you need to do;
1. Using a terminal emulator, execute the following command
su
restorecon -FR /data/media/0/*
2. Using a root-enable file browser, go to /data/media/0/ and change both the Owner & Group of the TWRP folder to "media_rw" (without quotes) and make sure permissions are set to drwxrwxr-x
Click to expand...
Click to collapse
Different scenario as i had that happen to me on my 2013 where it went into a 0 folder. This was not the case on the 2014 it LITERALLY didnt exist anywhere, the twrp folder existed with NOTHING under it. But in twrp all files and file structure were visible and working. Mass storage did show the space being taken up of course.
Just to clarify all this mess and all these issues are cause I was going back and forth between lp and kk. It was not REALLY an issue with twrp per say EXCEPT the otg not working... that IS specifically a twrp issue near as i can tell

[REQUEST] Systemless Filesystem Drivers for Kernel mode and FUSE support

Hey!
I found this thread with fully compile-able code for android on most hardware platforms, I see it uses system level modifications to do its business, and would love to see it rolled into a magisk module. I regularly use external hard drives on my Pixel 2 XL for a plethora of reasons and really need legit exFat and NTFS support as I use flash kernel and I cant merge the code myself (my only machine couldn't handle the compiling). Anyway, If possible, making a ZIP that is universal and has the binaries for arm, arm64, and all x86 variants would be pretty great!
GitHub: https://github.com/Lurker00/Android-fs
XDA: https://forum.xda-developers.com/android/development/exfat-ntfs-fuse-drivers-easy-build-t3126413
I am not magisk-ninja so anyone who can help make this happen OR educate me in the process of doing so (and who can compile the above Git files for arm64 and send them to me) would be very much appreciated! I am willing to learn to help the community!
Over and out
thomasamas said:
Hey!
I found this thread with fully compile-able code for android on most hardware platforms, I see it uses system level modifications to do its business, and would love to see it rolled into a magisk module. I regularly use external hard drives on my Pixel 2 XL for a plethora of reasons and really need legit exFat and NTFS support as I use flash kernel and I cant merge the code myself (my only machine couldn't handle the compiling). Anyway, If possible, making a ZIP that is universal and has the binaries for arm, arm64, and all x86 variants would be pretty great!
GitHub: https://github.com/Lurker00/Android-fs
XDA: https://forum.xda-developers.com/android/development/exfat-ntfs-fuse-drivers-easy-build-t3126413
I am not magisk-ninja so anyone who can help make this happen OR educate me in the process of doing so (and who can compile the above Git files for arm64 and send them to me) would be very much appreciated! I am willing to learn to help the community!
Over and out
Click to expand...
Click to collapse
Hi. I just started working on this yesterday.
It seems like the perfect method to install additional filesystem support.
I am currently able to manually mount exfat or ntfs sdcard images on my phone (LG Aristo 2, Android 7).
However, a great deal has changed in how filesystem support is added to an existing kernel. Lurker00's code is for Android 4.4.2.
If you want to work together on it, I would be more than happy to do so. I will try to get together what I have so far in a post later today.
FYI, this is a TWRP installable .zip that has Lurker00's compiled binaries for arm64-v8a, armeabi-v7a, x86 and x86_64.
It also installs init.d scripts that supposedly support auto mounting of exFat and NTFS partitions. That part is not working for me, as I think it is setup for Android 5 and before. However the mount binaries work for manually mounting exFat or NTFS partitions.
Just install the .zip from TWRP.
https://forum.xda-developers.com/attachment.php?attachmentid=4600419&stc=1&d=1537390717
Hey! I just saw this, I can try my best but I was assuming it wouldn't be an android thing but rather a Linux/android kernel thing. Is there a way we can Abstract the mounting from android, solely into the kernel, basically leaving Android unaware that the introduced file system is not "officially supported"? I'm assuming FUSE can do this.
Edit: spelling.
tecknight said:
Hi. I just started working on this yesterday.
It seems like the perfect method to install additional filesystem support.
I am currently able to manually mount exfat or ntfs sdcard images on my phone (LG Aristo 2, Android 7).
However, a great deal has changed in how filesystem support is added to an existing kernel. Lurker00's code is for Android 4.4.2.
If you want to work together on it, I would be more than happy to do so. I will try to get together what I have so far in a post later today.
FYI, this is a TWRP installable .zip that has Lurker00's compiled binaries for arm64-v8a, armeabi-v7a, x86 and x86_64.
It also installs init.d scripts that supposedly support auto mounting of exFat and NTFS partitions. That part is not working for me, as I think it is setup for Android 5 and before. However the mount binaries work for manually mounting exFat or NTFS partitions.
Just install the .zip from TWRP.
https://forum.xda-developers.com/attachment.php?attachmentid=4600419&stc=1&d=1537390717
Click to expand...
Click to collapse
How exactly do you manually mount them? (your method)
Edit: also! I was thinking maybe this could become a kernel patch that I could alert kernel devs to? (see my above comment)
And... Thanks for all the hard work to get this going. Tell me how I can help!
thomasamas said:
How exactly do you manually mount them? (your method)
Edit: also! I was thinking maybe this could become a kernel patch that I could alert kernel devs to? (see my above comment)
And... Thanks for all the hard work to get this going. Tell me how I can help!
Click to expand...
Click to collapse
I installed the .zip file that I posted earlier using TWRP.
This installs these binaries to /system/xbin:
mount.exfat
mkfs.exfat
fsck.exfat
dumpexfat
exfatfsck
exfatlabel
mkexfatfs
mount.exfat-fuse
ntfs-3g
ntfsfix
probe​
I then inserted an exFat formatted SDCard into my phone and Android told me the device was corrupt.
That is due to the fact that Android no longer uses probe to determine the filesystem of a device, it now uses a program called blkid.
I would like to figure out how to add a new supported filesystem type to blkid
In any event, I mounted my exFat sdcard by launching a shell from adb, running su to get root and then I created a folder named exfatsd in the /mnt folder. I then ran this command:
mount.exfat /dev/block/mmcblk1 /mnt/exfatsd
The mount succeeded and I was able to browse the sdcard from /mnt/exfatsd
When I typed mount to enumerate the mounts, this is the entry I saw for my sdcard:
/dev/block/mmcblk1 on /mnt/exfatsd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
By the way, even as i was browsing the exfat sdcard, Android still had a notification up telling me that my sdcard was corrupt
Is there any legit documentation on blkid?
I haven't found any, but I haven't given up on this project either. I have been busy on a couple of other things lately, but I still would like to see this work.
Making progress on this on my LG cv1 ROMs
I just wanted to let you know that I now have exFAT and NTFS support working on my phone, even though the kernel does not have support for either filesystem..
I am mounting the Micro SD using a script that runs under Magisk from the:
post.fs.data.d folder
This folder contains scripts that are to run immediately after the /data filesystem is mounted.
My script is checking the Micro SD device using the blkid command.
The blkid command will indicate the type of filesystem residing on the device, even if the kernel won't mount it.
So I use the results from the blkid command to issue mount commands myself using the binaries created by lurker00.
Here is the script I am using, it is really quite short:
Code:
#!/system/bin/sh
#
# mount NTFS / exFAT
# 06/07/2019 by TecKnight
# This script checks the inserted Micro SD--
# If Micro SD is formatted exFAT or NTFS, it mounts it
sdcard_device=`blkid /dev/block/mmcblk1`
sdcard_part1=`blkid /dev/block/mmcblk1p1`
# Uncomment next 2 lines to troubleshoot
# echo $sdcard_device > /cache/sdcard_device.txt
# echo $sdcard_part1 > /cache/sdcard_part1.txt
# output from blkid command looks like this:
# /dev/block/mmcblk1p1: LABEL="e" UUID="CEDC-3F3A" TYPE="exfat"
# create mount point
mkdir /mnt/media_rw/extsd
# mount approriate filesystem if it resides on device directly
case "$sdcard_device" in
*exfat*) mount.exfat /dev/block/mmcblk1 /mnt/media_rw/extsd ;;
*ntfs*) ntfs-3g /dev/block/mmcblk1 /mnt/media_rw/extsd ;;
esac
# mount approriate filesystem if it resides on first partition of device
case "$sdcard_part1" in
*exfat*) mount.exfat /dev/block/mmcblk1p1 /mnt/media_rw/extsd ;;
*ntfs*) ntfs-3g /dev/block/mmcblk1p1 /mnt/media_rw/extsd ;;
esac
FYI: The reason I am checking /dev/block/mmcblk1 (the actual SD card itself) and dev/block/mmcblk1p1 (the first partition on the sdcard) is that depending on where the sdcard is formatted exFAT or NTFS, it could be on the disk itself or within a parrition. This way, I will catch it either way and mount it correctly.
I was thinking of creating a subroutine to cycle through the block devices to determine the sdcard device.
This would make it compatible with practically every device.
Then I could turn the whole thing into a Magisk module.
There are still 2 minor issues that I am having:
1. The phone still displays a notification about the sdcard being corrupt. You just have to clear the notification and it never reappears.
2. The mounted card is not identified as an external SD by android.
However, the exFAT or NTFS filesystem is mounted at /mnt/media_rw/extsd and is browseable and the filesystem is readable and writable.
Tell me what you think.
TWRP installable .zip to install NTFS/exFAT suport
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​
tecknight said:
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​
Click to expand...
Click to collapse
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?
rachelld said:
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?
Click to expand...
Click to collapse
Same here. Maybe the template is to old? Also could use this module.
aCIDsLAM said:
Same here. Maybe the template is to old? Also could use this module.
Click to expand...
Click to collapse
Try this one:
https://www.androidfilehost.com/?fid=4349826312261782012​I removed the check for
ro.boot.bl_unlock_complete = true
---------- Post added at 11:08 PM ---------- Previous post was at 11:06 PM ----------
rachelld said:
Hi,
I know this post isn't new, but I tried installing this zip file and it tells me that my bootloader in't unlocked even though I'm pretty sure it's unlocked,
any way around this?
Click to expand...
Click to collapse
Try this one:
https://www.androidfilehost.com/?fid...26312261782012​
I removed the check for
ro.boot.bl_unlock_complete = true
I could flash it, using TWRP. In Magisk itself, it told me me, its no magisk module. Anyway. Thanks!
@thomasamas
@tecknight
Is this thread dead ?
Has these drivers been tested on Android 11 ?
I have a custom ROM and would like to use my SDCard with NTFS/exFAT but the ROM only supports FAT32.
KineSight said:
@thomasamas
@tecknight
Is this thread dead ?
Has these drivers been tested on Android 11 ?
I have a custom ROM and would like to use my SDCard with NTFS/exFAT but the ROM only supports FAT32.
Click to expand...
Click to collapse
+1
tecknight said:
TWRP installable .zip to install NTFS/exFAT suport
OK, this is a installable .ZIP that will copy the binaries to /system/xbin and copy the mounting script to:
/data/adb/post-fs-data.d.
This should enable NTFS/exFAT support to most phones.
Requirements:
1. You must have Magisk installed
2. Your Micro SD''s device address must be:
/dev/block/mmcblk1. This is the case on most devices running Android 6 or higher.
If your Micro SD's device address is different, you can fix it by modifying:
/data/adb/post-fs-data.d/mount_ntfs_exfat.sh
replacing /dev/block/mmcblk1 with the device address of your external Micro SD.
Download the installer here:
https://forum.xda-developers.com/attachment.php?attachmentid=4773292&stc=1&d=1559992139​
Click to expand...
Click to collapse
Actually, this still works! Have tested this on A11 OctaviOS GSI. You still need to have Magisk installed, but you don't necessarily have to install this as a Magisk module.
Don't flash the .zip file from TWRP, it doesn't do anything (at least not for me). Just unzip everything in the .zip file into a folder. Then, take the files inside the xbin folder and put it into /system/xbin (as per instructions). Make sure those files have execute permissions. I just set the xbin folder with full execute permissions and apply to all child files in the folder, by using Root Explorer.
Next, do the same thing by taking the script and chuck that into /data/adb/post-fs-data.d. Again, give this script full execute permissions.
Reboot phone and voila, it should work! You should also see that the script is loaded and running in Magisk logs.
Oh and the reason why Magisk is required is because Magisk creates that "post-fs-data.d" folder after it is installed. If you put scripts into /data/adb/service.d or /data/adb/post-fs-data.d, they will automatically get executed by Magisk and run with superuser rights.
chaoscreater said:
Actually, this still works! Have tested this on A11 OctaviOS GSI. You still need to have Magisk installed, but you don't necessarily have to install this as a Magisk module.
Don't flash the .zip file from TWRP, it doesn't do anything (at least not for me). Just unzip everything in the .zip file into a folder. Then, take the files inside the xbin folder and put it into /system/xbin (as per instructions). Make sure those files have execute permissions. I just set the xbin folder with full execute permissions and apply to all child files in the folder, by using Root Explorer.
Next, do the same thing by taking the script and chuck that into /data/adb/post-fs-data.d. Again, give this script full execute permissions.
Reboot phone and voila, it should work! You should also see that the script is loaded and running in Magisk logs.
Oh and the reason why Magisk is required is because Magisk creates that "post-fs-data.d" folder after it is installed. If you put scripts into /data/adb/service.d or /data/adb/post-fs-data.d, they will automatically get executed by Magisk and run with superuser rights.
Click to expand...
Click to collapse
Hello, I did everything as you said and it worked normally, but now SELinux is turned off. This is normal?
i have same issue. But i cant find xbin folder
my device is Samsung M51 on custom os
I converted this twrp zip into a magisk module https://github.com/phhusson/treble_experimentations/files/8948418/ntfs-exfat-support.zip
Hi.
I'm using Ancient OS A13 and I can't access my SD Card.It asks for format and after formatting it still asks for format.
it still works on my pc and twrp recovery. Unfortunately, this fix isn't working. Also, there is not any xbin folder in system.
What should I Do?

Categories

Resources