[KERNEL] [15/04/10][5.1/3G+WIFI][Fix for empty directories after mount] [V18]

Search This thread

brainbeatuk

Senior Member
Oct 13, 2012
176
28
Re: [KERNEL][WIFI][4.2.X] Included "Fix for empty app-mounted directories"

Your a star, I managed to get games streaming again now, I upgraded before this is mount command to bind /mounts to sdcard, I had to set rw on cifsmanager options too.

Doesn't work fully obb folder doesn't get bind mounted. See my next post to bind just data folder and obb folder

mount -o bind /mounts /data/media/0

Works a treat, now just need network optimisations and it will be as good as on 4.1.2.

Anyone know what best io scheduler and cache settings to use when I'm bind mounting a 1 tb hard drive on a cifs share?
Thanks again
Sent from my Nexus 7 using XDA Premium HD app

Is there a way to patch kernel then as I want this on my nexus4 too :)
 
Last edited:
  • Like
Reactions: Orthia

brainbeatuk

Senior Member
Oct 13, 2012
176
28
Re: [KERNEL][WIFI][4.2.X] Included "Fix for empty app-mounted directories"

mount -o bind /mounts/Android/obb /data/media/obb

Have to do this script first then

mount -o bind /mounts/Android/data /data/media/0/Android/data

Managed to save game too, if you get permissions error try this script before mounting in cifs manager

Mount -o remount rw /
(No bind sorry)
I can't download from store games that have obb file for some reason however I have backup of apps so just restored and it reads data and obb file fine, its because I not bind mounted whole card and I have over 20gig of data on a reported 5x gig. Whereas before in storage it showed 1.00 tb on 4.1.2.
Workaround install to internal and cut and paste to smb server then reboot mount up.

Sent from my Nexus 7 using XDA Premium HD app
 
Last edited:

vorcers

Senior Member
May 21, 2012
158
127
The user moncojoe asked me, if the Kernel is working is also working on the 3g. So I asked him for some Information.

First of all, some uname -a outputs: (3g from him, wifi from me)

3G: Stock with Android 4.2.1
Code:
root@android:/system # uname -a
Linux localhost 3.1.10-g22b4fcd #1 SMP PREEMPT Fri Nov 2 10:55:26 PDT 2012 armv7l GNU/Linux

Wifi: Stock with Android 4.2.1
Code:
shell@android:/ $ uname -a
Linux localhost 3.1.10-g22b4fcd #1 SMP PREEMPT Fri Nov 2 10:55:26 PDT 2012 armv7l GNU/Linux

They are the same. That surprised me. So I compared the nexus 7 factory images.

Results:
zImage 100% the same --> Extracted Factory Image
bootimg.cfg 100% the same --> Extracted Factory Image
initrd.img seems to differ... but "diff" on the extracted image doesn't give me any output. So, they are the same.

He flashed the Kernel, and he said it worked - but couldn't test 3g. Maybe someone can test it?

But for now, I would say, it is save to use my kernel with the 3g version. I will update the first post.

-------------------------------------------------------------------------------
mount -o bind /mounts/Android/obb /data/media/obb

Have to do this script first then

mount -o bind /mounts/Android/data /data/media/0/Android/data

Managed to save game too, if you get permissions error try this script before mounting in cifs manager

Mount -o bind remount rw /

[...]

The command "Mount -o bind remount rw /" is (sorry) bull****. First of all, you need two directorys to bind something. I think you mean the command:
Code:
mount -o remount rw /

without bind.
 
Last edited:
  • Like
Reactions: brainbeatuk

brainbeatuk

Senior Member
Oct 13, 2012
176
28
Re: [KERNEL][WIFI+3G][4.2.X] Included "Fix for empty app-mounted directories"

Oh yeah sorry my bad I'll edit. I confused myself yesterday tried so many different lines lol

Sent from my Mako using XDA Premium HD app
 

vorcers

Senior Member
May 21, 2012
158
127
I was asked if I can compile the new Android 4.2.2 Kernel. In fact, you can extract every kernel-config with an script located in linux source:

Code:
./scripts/extract-ikconfig /tmp/zImage > /tmp/config

So I can compile the kernel now :victory::victory:

As spthacker asked me to include usb-audio-support: There are other wishes to include some modules oder "features" in the kernel?
I consider to include all extra-modules (like nfs and other modules .... ) in the future as .ko modules, not directly included in kernel... So you need to modprobe/insmod the modules by hand. Don't be afraid, I will compile the cifs, utf8 and md5 module directly in the kernel.

A bit off-topic: Does someone get also hangs if you watch video over cifs? This is very annoying.... I couldn't fix this yet. Buffer-Mount-Options like rsize doesn't help.

One"Click"Mount

I am currently develop my first android-app. I make something like a universal-mounter, which supports mount usb and network shares. I am also planning to support the debuggerd method.

Here the first concept:

attachment.php


Great work!

Any chance you could add otg audio (external audio dac) support to it please :victory:

Well, there are some options in kernel-configuration I can add:

attachment.php


Do you know what else is needed?
 

Attachments

  • kernel-1.jpg
    kernel-1.jpg
    32.9 KB · Views: 1,667
  • Screenshot_2013-02-15-08-17-49.jpg
    Screenshot_2013-02-15-08-17-49.jpg
    26.4 KB · Views: 1,618
Last edited:
  • Like
Reactions: spthacker

vorcers

Senior Member
May 21, 2012
158
127

spthacker

Senior Member
Jun 24, 2012
627
137
Suffolk

vorcers

Senior Member
May 21, 2012
158
127
Can someone test whether the adb works on 4.2.2 with v3?

Say what?

I can barely know what to do with flashing kernels!

I created for you a special kernel, which has the usb-sound modules build-in. See the attachments of this post. Please tell me, if it works.

Thanks a lot :) Remarkably fast turnaround! I thought I might have to wait a while before moving on to 4.2.2. Good luck with your first app :fingers-crossed:

Thanks :)
 

Attachments

  • boot-grouper-4.2.2-vorcers-v3-test-1.zip
    5.3 MB · Views: 19
  • Like
Reactions: spthacker

spthacker

Senior Member
Jun 24, 2012
627
137
Suffolk
Re: [KERNEL][WIFI+3G][4.2.X] Included "Fix for empty app-mounted directories" (v3!)

Can someone test whether the adb works on 4.2.2 with v3?



I created for you a special kernel, which has the usb-sound modules build-in. See the attachments of this post. Please tell me, if it works.



Thanks :)

I'll download and try flashing after work tonight :D
 

spthacker

Senior Member
Jun 24, 2012
627
137
Suffolk
Re: [KERNEL][WIFI+3G][4.2.X] Included "Fix for empty app-mounted directories" (v3!)

Usb audio works just great thanks, just gotta find a music player that will see the cifs mounted folder
 
  • Like
Reactions: vorcers

farhanito

Senior Member
Aug 21, 2010
901
231
Jakarta
Re: [KERNEL][WIFI+3G][4.2.X] Included "Fix for empty app-mounted directories" (v3!)

I can't seems to insmod any snd-*.ko
Always came up with "no file or directory" errors or something.
lockd and sunrpc.ko loaded fine tho...


EDIT: looks like i need to load them in certain order

Sent from my Nexus 4 using Tapatalk 2
 
Last edited:

vorcers

Senior Member
May 21, 2012
158
127
I can't seems to insmod any snd-*.ko
Always came up with "no file or directory" errors or something.
lockd and sunrpc.ko loaded fine tho...


EDIT: looks like i need to load them in certain order

Sent from my Nexus 4 using Tapatalk 2

I am currently working on the v4 version of my kernel, which support init.d and can auto-include (modprobe) the modules.
 
  • Like
Reactions: tobiasth

ThurstonX

Senior Member
Oct 29, 2012
255
120
I am currently working on the v4 version of my kernel, which support init.d and can auto-include (modprobe) the modules.
I'm addicted to your kernels now :D
I mainly just wanted it for CIFS support. Can you please explain a little more fully the benefits of v4, when it arrives.

Thanks again for your efforts! Truly appreciated.

Cheers.
 

vorcers

Senior Member
May 21, 2012
158
127
I attached v4. For more Information look at the first post. I am also working hard to make a better One"Click"Mount. It will get something like fstab (to mount cifs and nfs and usb-devices and maybe other...) :highfive: You can follow my development at github: https://github.com/vorcers/oneclickmount

@ThurstonX

If you flash the kernelmodules*.zip at my kernel you will get (currently) also support for nfs and usb-audio. But if someone want some other kernel modules, I will compile and include them.

And v4 includes init.d support via busybox's run-parts.

@tobiasth

To support mounting without hjack debuggerd you just need to flash the kernel - the rom itself don't need to be changed. mkasick modified the mount function of the kernel.

You just need to mount your devices at /data/media/0/ to see them also inside /mnt/sdcard. Android redirects it. Some same does also stickmount. Stickmount runs with debuggerd his mount commands in the same level as the kernels with mkasick's patch. I will post a final statement and how bad stickmount is written in my thread soon: http://xdaforums.com/showthread.php?t=2062768 (The reason why it doesn't work, is that we tried to mount inside of /storage, but we needed to mount inside /data/media/0.) I will post the complete mount script which is in /system/bin/debuggerd written. I need to do it, because chainfire didn't it. I can't understand that... So everyone can use that and there are not only two apps which support mounting in android 4.2. (Soon three, onecklickmount will support the debuggerd method :) )
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Hey Guys,

    mkasick released in his thread a fix for the mounting problems in Android >= 4.2.

    Description of the issue:
    Android >= 4.2 breaks Dalvik-apps that mount file systems to be shared with other apps. This includes CifsManager, Mount Manager, essentially anything that mounts cifs shares, FUSE file sytems, etc. The symptom is that the mounted contents appear fine to app that peforms the mount operation (assuming the app itself provides the ability to browse the contents), but every other app only sees an empty directory at the mount point.

    As I said - mkasick released a solution - so I compiled my own kernel. Now we can again easy mount cifs and others! All old apps should work. Only limitation: the mount point needs to be outside of /storage (and also /mnt/sdcard/). Fix for this: Mount within /data/media/0 -- android will redirect the mount so you can access the mounted-files from this folders.

    The kernel is a "stock kernel" and also includes:
    • mkasick Patch
    • Built-In cifs, md4, utf8, nfs, f2fs (Since V17)
    • kexec hardboot patch (The full patch, allows boot as host and as guest)
    • As Modules: .ko: snd-usb-audio and all of its devices (Installed, but not modprobe'd since V17)
    • [Since V16/Android 5.0.2] Fix for baseband_xmm_power wakelock on tilapia (see Hints and Bugs since V16 / Android 5.0 / Lollipop ; for Android 4.4.4 see this post)

    mkasick recommends in his thread to patch dalavik, but for the stock-roms it is easier to patch the kernel.


    Known Bugs:
    • Since Android 5.0.X/V16: SELinux is now blocking the access of cifs/nfs even in read. Also nfs isn't loaded at boot time anymore. For more information look below.
    • Since Android 4.4.X: There is a known bug with mounting cifs (you can't write). The solution is (try at your own risk) here. If you want to do this workaround at boot-time, you can flash the zip linked here.
    • With SuperSU >= 1.50 && < 1.65 the mounted folders are empty. Please update! (For more Info see hide-box "SuperSU Information" below)

    Hints and Bugs since V16 / Android 5.0 / Lollipop:

    SELinux, cifs and nfs

    SELinux is since Android 5.0 "more" enforced. Because of that, even the read on nfs / cifs isn't working anymore without disabling selinux by "setenforce permissive" as root. Be careful, disabling selinux is an security hole. USB is still working with selinux at enforcing.

    Because of the same reason the nfs and sound modules are not loaded at boot anymore. Because I don't want to mess around with selinux at boot time, you can modprobe them yourself, if you need it. Run the following commands as root to use nfs / sound modules (a installed busybox is required):

    Activate sound modules:
    Code:
    busybox modprobe snd-usb-audio

    Activate NFS File System:
    Code:
    busybox modprobe nfs

    Workaround for baseband_xmm_power wakelock

    Some people have massive issues with tegra3 + cellular devices with the baseband_xmm_power wakelock. The wakelock drains all the battery. With V16 I included a possible fix for this. The fix is based on the work of jfmcbrayer and Sgt. Meow. By default, the fix isn't active and the kernel uses the stock behaviour.

    If you want to disable the wakelock entirely, you can flash this zip: CWM_activate_baseband_xmm_power_wakelock_workaround_vorcers_rev2.zip

    I used this this workaround for some time with Android 4.4.4 and I had no issues. Well, I did not test the mobile data... Please tell me, if something isn't working (And the workaround is active). I just wanted to get rid of that battery drain. I was on flight mode all time.

    Technical:

    The workaround is enabled by echoing a number into a baseband_xmm_power module parameters:
    Code:
    echo 0 > /sys/module/baseband_xmm_power/parameters/bb_timeout

    Possible Values:
    < 0 - disable workaround, stock behaviour [Default (-1)]
    = 0 - disable the baseband_xmm_power wakelock completely
    > 0 - how long the wakelock can stay active, every time the wakelock is triggered, in 10ths of a second. Meaning: Value 5 = 500 ms, 10 = 1 second, 20 = 2 seconds....

    You find the patch I used in the actual Patchset. (Included since Android 5.0.2)


    Downloads

    (Kernels since v8 are only tested by me for the 3G version (tilapia) - but should also work with wifi (grouper).)

    The flash of the kernel shouldn't break anything, but I recommend to backup your system.

    Download-Links for grouper and tilapia:

    In V11 the kernel modules are placed in /data instead of /system. If you are upgrade from < V11 and you want to delete the modules in /system, you can delete the folder "/system/vorcers_kernelmodules" manually, or you use this CWM-Zip to delete.


    Download-Links only for grouper: (try on tilapia at your own risk)

    Extra-Links:

    Integration wishes for new kernelmodules to support new hardware are always welcome (you will get .ko's for my kernel)

    Have a lot of fun!


    Sources:
    http://xdaforums.com/showthread.php?t=2106480 (Mount fix)
    http://xdaforums.com/showthread.php?t=2104706 (Hardboot patch)
    http://source.android.com/source/building-kernels.html
    http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
    http://nek0s.blogspot.de/2012/12/nexus-7-ramdisk.html


    Changelog:

    Android 5.1: gf5d7b8b-v18 (2015/04/10)
    - Switched to gf5d7b8b / android-tegra3-grouper-3.1-lollipop-mr1
    - Build-In nfs
    - Disabled Module auto loading for snd-usb modules -- are still installed
    - Added f2fs Filesystem, untested, standard is ext4

    Android 5.0.2: g6ff7a51-v16 (2015/01/31)
    - Switched to g1e42d16 / android-tegra3-grouper-3.1-lollipop-release
    - Added Workaround for the baseband_xmm_power wakelock on tilapia (Please see "Hints and Bugs since V16 / Android 5.0 / Lollipop" for more information)
    - NFS and Sound Modules are not loaded anymore by default but can loaded manual via "busybox modprobe nfs" / "busybox modprobe snd-usb-audio".

    Android 4.4.4: g1e42d16-v13 (2014/06/06)
    - Switched to g1e42d16 / android-tegra3-grouper-3.1-kitkat-mr2

    Android 4.4.3: g4776c68-v12 (2014/06/03)
    - Updated Grouper and Tilapia ramdisks for Android 4.4.3.

    Android 4.4.2: g4776c68-v11 (2014/01/11)
    - To save space in /system, the kernel-modules had been moved from /system/vorcers_kernelmodules to /data/vorcers_kernelmodules.
    If you want to delete the modules in /system, you can use this zip: CWM_delete_system_vorcers_kernelmodules.zip
    - Nothing else is new

    Android 4.4.2: g4776c68-v10 (2013/12/11)
    - Updated Kernel Config and Ramdisks. (Both changed in Android 4.4.2/KOT49H)

    Android 4.4: g4776c68-v9 (2013/12/10)
    - Created separate files for grouper and tilapia (their ramdisk differ, kernel not)

    Android 4.4: g4776c68-v8 (2013/12/07)
    - Switched to Android 4.4: g4776c68 ; KRT16O (?) ; android-tegra3-grouper-3.1-kitkat-mr1 KRT16S is gee1a0b2 / (?)(?) android-tegra3-grouper-3.1-kitkat-mr0 (?)(?)

    Android 4.3: g1e8b3d8-v7 (2013/09/01)
    - Modules Support for Android 4.3
    - Packed all modules inside zip...
    - I go back to the old version scheme and only count up the numbers...

    Android 4.3: g1e8b3d8-v6 (2013/07/29)
    - Forgot somehow UTF8
    - Really added /proc/config.gz

    Android 4.3: g1e8b3d8-v5-km-v4 (2013/07/25)
    - Switched to Android 4.3: g1e8b3d8 ; jwr66v ; android-tegra3-grouper-3.1-jb-mr2
    - This kernel has also: /proc/config.gz and an loadable module support (Stock has not)
    - I also provided the patchset I used for Android 4.3

    Android 4.2.2: g05b777c-v4-km-v2 (2013/02/19)
    v4-Kernel (boot-grouper-vorcers-g05b777c-v4.zip):
    - Switched to different version schema: boot-grouper-vorcers-<android-kernel-hash>-v<count of changes of kernel (overall)> ; For the kernelmodules it is: kernelmodules-vorcers-<android-kernel-hash>-v<count of changes of kernel-modules (overall)>. This means for you: if the number is higher, there is something new :D Version-Number at Changelog: <android-kernel-hash>-v<count of changes of kernel (overall)> -km-v<count of changes of kernel-modules (overall)>
    - Added init.d (/system/etc/init.d/) support to the kernel/init.rc. If the directory exists, the scripts inside the directory get run via "run-parts" from busybox. This means: The script need to be runable (+x) and mustn't have an file-extension.
    - Removed the mount of /mounts out of init.rc (is now in an script called by init.rc)
    v2-Kernelmodules (kernelmodules-vorcers-g05b777c-v2.zip):
    - Made a CWM flashable package which autoloads the modules in my kernel.

    Android 4.2.1: v3 - boot-grouper-4.2.2-vorcers-v3.zip : (2013/02/15)
    - Switched to Android 4.2.2 - Kernel, jdq39, g05b777c, android-tegra3-grouper-3.1-jb-mr1.1
    - Added Modules for OTG-USB-Sound (see kernelmodules*.zip)
    Android 4.2.0: v2 (2013/01/19)
    - I added a tmpfs mount for /mounts, so you don't need to do "mount -o remount rw /" and create your inital-mountpoint yourself. /mounts is writeable by all apps. (done in init.rc)
    Android 4.2.0: v1 (2013/01/19)
    - inital release


    SuperSU Information:

    Information for SuperSU Users

    It seemed that SuperSU >= 1.50 && < 1.65 doesn't work correctly with this kernel. Well, the Version 1.65 seems to work again (The folders where empty after mount). The SuperSU Version 1.45 worked the best. If you want to use 1.45, you can download the old Flashable-Version here: http://download.chainfire.eu/343/SuperSU/UPDATE-SuperSU-v1.45.zip.

    As I said, the version 1.65 seems to work again. It maybe can happen, that the folders gets empty, after some time. This has been noticed with Version 1.60. But 1.65 not (yet).

    If you still have problems with the empty folders on my kernel, you should try superuser by koush.

    koush's superuser is opensource and is the same as in cyanogenmod. And with that, the mount-technique is working without bugs: https://play.google.com/store/apps/details?id=com.koushikdutta.superuser



    Some gimmick: One"click"mount-Shell-Script

    Because I want to get rid of stickmount, I written a little shell-script to mount all connected devices. It is very similar to stickmount, but it supports: ext, fat32, ntfs. Well, ntfs only, if you provide the path to an ntfs-3g binary. (In the variable NTFS_BINARY) I used in the script the paragon-ntfs binary. Just install the Paragon-App.

    Download V2.2: http://www.mediafire.com/download/rjmsdt06cf0cp6b/oneclickmountv22.sh.gz
    Download V3: http://www.mediafire.com/download/xppx2m3awcf3oq3/oneclickmount-v3-20130221172223.tar.gz

    glimmling created a tasker apk for this script. I but it still bases on v11 of the script.

    • from v3 on, ocm needs -m parameter. If you want the old behavior, use "-m auto"
    • from v3 on, ocm also mounts /dev/block/sdX partitons (e.g. /dev/block/sda), but only if my script can use a busybox with blkid with TYPE output. (I provided one)
    • I added in v3 an fstab-like future usable with -f <file> see my example.
    • Please be careful with the new v3. I works, but I would call it "beta"...
    • You can't run ocm >= v3 inside /mnt/sdcard. All files (except for ocm.fstab and ocm-library) need the x right. Copy the files too /data/local/, "chmod 777 *" them and run ocm from /data/local.
    example for ocm.fstab.
    syntax:
    Code:
    <device> <mountpoint> <fs-type> <options>
    example:
    It is is very importent that the options seperated by one space!
    Code:
    //192.168.100.1/username username cifs username=<username>,password=password,ro
    192.168.100.1:/home/username nfs nfs nolock,ro
    /dev/sda1 sda1 ntfs

    Thanks to:
    mkasick - for the patch
    farhanito - for the basic code in the .zip
    glimmling - for the tasker apk's running the One"click"mount-Shell-Script
    jfmcbrayer / Sgt. Meow - for the baseband_xmm_power wakelock workaround
    5
    Version 12 released (Release for Android 4.4.3)

    Hey Guys,


    If someone is still using my kernel: I just released v12. It is the same kernel as in v11, but with a different ramdisk. (Android 4.4.3 changed the ramdisk)

    Please also note, that my kernel is still using the Kernel-Version "3.1.10-g4776c68" (From Android 4.4.0), because Google did not release the actual kernel-branches for Android 4.4.2/4.4.3 in the tegra-kernel archive. ("kitkat-mr2-release", Android 4.4.3 stock kernel is: "3.1.10-g1e42d16")


    This will be also my last release, because I don't think the 2012' Nexus 7 will get updates anymore. I will maybe create a updated version, if Google unlocks the tegra-kernel-4.4.3 branch.


    In this manner... So long guys!

    Have a good life and always fun with Android! :victory:

    vorcers
    4
    I just released v8 for Android 4.4 and everything seems to work.... :victory:

    Download: http://www.mediafire.com/download/48xo4axdd2dpwnh/boot-grouper-vorcers-g4776c68-v8.zip



    I tested cifs-mounting in /mounts/, OI Filemanager and mxplayer where able to access the files.... I did that with SuperSU 1.80.

    I used with this kernel the newer kernel sources, https://android.googlesource.com/kernel/tegra/+/android-tegra3-grouper-3.1-kitkat-mr1

    I think these are the sources for KRT16O / Android 4.4.1... but it also works with KRT16S.
    3
    Release of V18 / Android 5.1

    Hey Guys,

    since Google added the Android 5.1 Tilapia Image, I now "officially" release V18. The kernel is the same build as in the untested version, so, if you flashed the untested grouper v18, you don't need to reflash this again.

    As always: Links are in the first post.

    vorcers
    3
    I attached v4. For more Information look at the first post. I am also working hard to make a better One"Click"Mount. It will get something like fstab (to mount cifs and nfs and usb-devices and maybe other...) :highfive: You can follow my development at github: https://github.com/vorcers/oneclickmount

    @ThurstonX

    If you flash the kernelmodules*.zip at my kernel you will get (currently) also support for nfs and usb-audio. But if someone want some other kernel modules, I will compile and include them.

    And v4 includes init.d support via busybox's run-parts.

    @tobiasth

    To support mounting without hjack debuggerd you just need to flash the kernel - the rom itself don't need to be changed. mkasick modified the mount function of the kernel.

    You just need to mount your devices at /data/media/0/ to see them also inside /mnt/sdcard. Android redirects it. Some same does also stickmount. Stickmount runs with debuggerd his mount commands in the same level as the kernels with mkasick's patch. I will post a final statement and how bad stickmount is written in my thread soon: http://xdaforums.com/showthread.php?t=2062768 (The reason why it doesn't work, is that we tried to mount inside of /storage, but we needed to mount inside /data/media/0.) I will post the complete mount script which is in /system/bin/debuggerd written. I need to do it, because chainfire didn't it. I can't understand that... So everyone can use that and there are not only two apps which support mounting in android 4.2. (Soon three, onecklickmount will support the debuggerd method :) )