What's new

Setting mount options for USB drive filesystem

EmeraldDeer

Very Senior Member
I would like to set mount options for USB drive filesystems.
I tried setting "usb_ext_opt" to "data=journal,discard" according to the snippet of rc/usb.c below but it did not take effect and the nvram variable is now empty.
Does anyone know the sprintf syntax below? Perhaps I have it wrong.
Code:
        if (strcmp(type, "swap") == 0 || strcmp(type, "mbr") == 0) {
            /* not a mountable partition */
            flags = 0;
        }
        else if (!strcmp(type, "unknown")) {
            /* Usually should be EFI, and not a mountable partition */
            flags = 0;
        }
        else if(!strncmp(type, "ext", 3)){
            sprintf(options, "user_xattr");

            if (nvram_invmatch("usb_ext_opt", ""))
                sprintf(options + strlen(options), "%s%s", options[0] ? "," : "", nvram_safe_get("usb_ext_opt"));
        }
        else if (strcmp(type, "vfat") == 0) {
            sprintf(options, "umask=0000");
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top