[KERNEL] CIFS + UTF8 NLS support for the official HTC Desire Froyo kernel

Search This thread

snq-

Retired Recognized Developer
Aug 13, 2010
581
853
with the release of the source code for the bravo kernel this has become redundant

to be able to directly access my stuff on samba shares i made a _patch_ for the cifs code in 2.6.32.15 and built cifs.ko and nls_utf8.ko with arm-eabi-4.4.0

i thought i'd share them here in case it was of use to anyone else


this is how i installed them:
Code:
(boot into recovery mode)
$ adb shell mount /system
$ adb push cifs.ko /system/lib/modules
$ adb push nls_utf8.ko /system/lib/modules
$ adb shell chmod 644 /system/lib/modules/*.ko
$ adb shell "cd /system/lib/modules; ln -s . 2.6.32.15-gf9c0527"
$ adb shell umount /system
(reboot)

this is how i tested them:
Code:
sh-3.2$ su
sh-3.2# modprobe nls_utf8
sh-3.2# modprobe cifs
sh-3.2# busybox mount -t cifs -o user=<username>,password=<password>,uid=1000,gid=1015,file_mode=0775,dir_mode=0775,iocharset=utf8,nodfs //10.0.1.2/public2 /sdcard/smb/public2
(1015 is the gid of 'sdcard_rw')




--
cifs_bravo_2.6.32.15-gf9c0527.zip
cifs_bravo_2.6.32.15-gd96f2c0.zip
 
Last edited:
  • Like
Reactions: alwin006

snq-

Retired Recognized Developer
Aug 13, 2010
581
853
Thx find htc kernel is 2.6.32.15-g1fc4045 @ NexTSense Rom

afaik the current nextsense comes with Myshkinbob's cifs module (although not with the latest one) - it's module version id was simply patched to suppress the version mismatch error message you got

here is mine if still interested:
(be sure to type "ln -s . 2.6.32.15-g1fc4045" instead of "ln -s . 2.6.32.15-gf9c0527" when installing)

--
cifs_bravo_2.6.32.15-g1fc4045.zip
 
Last edited:

adambot

Member
Jan 18, 2007
17
0
Greetings,

I tried using your patch on the source for the supersonic (evo) and it went in and compiled perfectly, i was able to do an insmod and loaded the driver fine, but when i go to do a mount the phone crashes.

any ideas?

(i have tried both the arm-eabi-4.4.0 and the arm-2010q1 toolchains)

Thanks!!
 

snq-

Retired Recognized Developer
Aug 13, 2010
581
853
I tried using your patch on the source for the supersonic (evo) and it went in and compiled perfectly, i was able to do an insmod and loaded the driver fine, but when i go to do a mount the phone crashes.

any ideas?

(i have tried both the arm-eabi-4.4.0 and the arm-2010q1 toolchains)


the patch does not cleanly apply to supersonic-2.6.32.15-g746f4f0, as it is for vanilla 2.6.32.15
please overwrite fs/cifs with the vanilla sources before you apply it

just tried and was able to build the very same .ko published in the first post (except for the buildstamp of course):

  • pulled the supersonic kernel source from developer.htc.com
  • overwrote fs/cifs/* with vanilla
  • pulled & applied the patch from pastebin
  • pulled .config from my phone
  • in menuconfig
    • set the localversion (general setup)
    • selected cifs + nls_utf8 to be built as module
    • did _not_ touch the debug options already set
  • did 'make modules'
  • stripped the modules with arm-eabi-strip --strip-debug

insmod worked, mount worked, browsing the share worked


if you get crashes, check /proc/last_kmsg after reboot
 

adambot

Member
Jan 18, 2007
17
0
the patch does not cleanly apply to supersonic-2.6.32.15-g746f4f0, as it is for vanilla 2.6.32.15
please overwrite fs/cifs with the vanilla sources before you apply it

What is considered "vanilla sources"?

I used git and pulled the whole android repo but am not finding the vanilla sources there...

do you mean the vanilla linux sources??


[edit]
i tried the cifs files from the vanilla linux source (same version) but the phone still crashes (even after the debug strip)

Should i try to use a different config (rather than the one from the supersonic templates?)

Do you have an evo that you tested this on?

Thanks again!!!
[/edit]
 
Last edited:

snq-

Retired Recognized Developer
Aug 13, 2010
581
853
do you mean the vanilla linux sources??

sorry if i wasn't clear enough. linux-2.6.32.15.tar.bz2 (kernel.org)

Should i try to use a different config

i pulled the config from the device ($adb shell zcat /proc/config.gz > .config)
i do not own an evo, the only reason for me to use evo/incredible sources is that htc haven't released bravo-froyo kernel sources yet
 

adambot

Member
Jan 18, 2007
17
0
adambot, please let me know if this works for you

WOW!!! That worked PERFECTLY!!!!!


Thanks SO MUCH!!!

(now i just have to figure out why mine wasn't working... I'll try again with your steps and compare the good one to mine with diff)

if you don't mind just to recap:
  • get linux vanilla kernel source
  • get supersonic kernel source
  • replace supersonic fs/cifs with vanilla
  • edit Makefile with extra EXTRAVERSION info
  • get .config from running device
  • make CROSS_COMPILE=CROSS_COMPILE=arm-eabi-4.4.0/bin/arm-eabi- oldconfig (accept defaults)
  • edit .config and make cifs and nls_utf8 modules
  • make CROSS_COMPILE=arm-eabi-4.4.0/bin/arm-eabi- modules
  • arm-eabi-4.4.0/bin/arm-eabi-strip fs/cifs/cifs.ko and fs/nls/nls_utf8.ko
 

snq-

Retired Recognized Developer
Aug 13, 2010
581
853
WOW!!! That worked PERFECTLY!!!!! Thanks SO MUCH!!!

no problem, glad it worked out :)

if you don't mind just to recap: ...

- i don't see the step where you applied the patch
- i didn't edit the makefile per hand
- i didn't edit .config per hand
- as i don't own an evo, instead of pulling the config from the device i did a 'make supersonic_defconfig' before 'make menuconfig'
 

adambot

Member
Jan 18, 2007
17
0
no problem, glad it worked out :)



- i don't see the step where you applied the patch
- i didn't edit the makefile per hand
- i didn't edit .config per hand
- as i don't own an evo, instead of pulling the config from the device i did a 'make supersonic_defconfig' before 'make menuconfig'

I got it to work FINALLY!!! I will be posting the step by step (copy/paste) directions in the evo section. Do you mind if i post the patch here as an attachment? also -- how do you want credit -- do snq- or do a different name?

thanks again!!
Adam
 

adambot

Member
Jan 18, 2007
17
0
feel free to use it for whatever you want
you might however want to post the patch directly applicable to the supersonic source (attached)

thanks for crediting me, using the nick is fine

What did you do differently? (or what is the difference between cifs-supersonic and cifs-vanilla) -- I would look myself, but i'm not the best at coding... (that's what i get for being a sysadmin and not a dev -- but i can script until the cows come home ;))
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    with the release of the source code for the bravo kernel this has become redundant

    to be able to directly access my stuff on samba shares i made a _patch_ for the cifs code in 2.6.32.15 and built cifs.ko and nls_utf8.ko with arm-eabi-4.4.0

    i thought i'd share them here in case it was of use to anyone else


    this is how i installed them:
    Code:
    (boot into recovery mode)
    $ adb shell mount /system
    $ adb push cifs.ko /system/lib/modules
    $ adb push nls_utf8.ko /system/lib/modules
    $ adb shell chmod 644 /system/lib/modules/*.ko
    $ adb shell "cd /system/lib/modules; ln -s . 2.6.32.15-gf9c0527"
    $ adb shell umount /system
    (reboot)

    this is how i tested them:
    Code:
    sh-3.2$ su
    sh-3.2# modprobe nls_utf8
    sh-3.2# modprobe cifs
    sh-3.2# busybox mount -t cifs -o user=<username>,password=<password>,uid=1000,gid=1015,file_mode=0775,dir_mode=0775,iocharset=utf8,nodfs //10.0.1.2/public2 /sdcard/smb/public2
    (1015 is the gid of 'sdcard_rw')




    --
    cifs_bravo_2.6.32.15-gf9c0527.zip
    cifs_bravo_2.6.32.15-gd96f2c0.zip
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone