To disable Long file name support with VFAT/FAT32 in linaro linux kernel

kuppurajs

New Member
Joined
May 11, 2021
Messages
2
Reaction score
0
Credits
20
Hi,

We need to disable Long file name (LFN) support in USB pendrive in linaro linux kernel version 3.10.23 with VFAT/FAT32 file systems.

Do we have any available patch to apply to disable LFN support?
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
3,892
Reaction score
2,631
Credits
28,116
I'm not a coder but it looks like it should be possible.
Code:
#define FF_USE_LFN        0
#define FF_MAX_LFN        255
/* The FF_USE_LFN switches the support for LFN (long file name).
/
/   0: Disable LFN. FF_MAX_LFN has no effect.
/   1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
/   2: Enable LFN with dynamic working buffer on the STACK.
/   3: Enable LFN with dynamic working buffer on the HEAP.
/
/  To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
/  requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
/  additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
/  The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
/  be in range of 12 to 255. It is recommended to be set 255 to fully support LFN
/  specification.
/  When use stack for the working buffer, take care on stack overflow. When use heap
/  memory for the working buffer, memory management functions, ff_memalloc() and
/  ff_memfree() in ffsystem.c, need to be added to the project. */


#define FF_LFN_UNICODE    0
 
OP
K

kuppurajs

New Member
Joined
May 11, 2021
Messages
2
Reaction score
0
Credits
20
Hi,

I don't see any macro like as mentioned in your post FF_USE_LFN to switch the support for LFN.
Also, i don't see any source file ffunicode.c to enable LFN. May be, is it required to add this and integrate across my project? Is it Mandatory?

Instead FF_USE_LFN, I see FAT_LFN_MAX set to 255 in the code in msdos_fs.h Shall i reduce the value to 32 instead of 255 to disable LFN? Is that ok?
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
3,892
Reaction score
2,631
Credits
28,116
No idea, like I said I'm not a coder I only try to understand from what I can read. I would try creating an issue on one of those github projects maybe that will be able to help you out.
 
Last edited:

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
6,620
Reaction score
5,378
Credits
19,579
@kuppurajs welcome to linux.org .

Just in case of any misapprehension on your part, we are not an official arm nor organ of Linux, just scored the dot org name - we are manned by volunteer staff who share a love of Linux and have varying skills in various departments.

That being said, unless we have a user of Linaro here, you are unlikely to get an answer here.

If you Google

how contact linaro linux

you will find links to their website and an email address.

Good luck

Chris Turner
wizardfromoz
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top