diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 48bfb24..a13f092 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -357,7 +357,7 @@ } #ifndef CONFIG_UBIFS_FS_ENCRYPTION - if (c->encrypted) { + if (c->encrypted && !ubifs_allow_encrypted) { ubifs_err(c, "file system contains encrypted files but UBIFS" " was built without crypto support."); err = -EINVAL; diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 11fb318..bbe382d 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include #include @@ -501,6 +503,8 @@ return 0; } +int ubifs_allow_encrypted; + static int ubifs_init(void) { int ret; @@ -511,7 +515,12 @@ return ret; } + globalvar_add_simple_bool("ubifs.allow_encrypted", &ubifs_allow_encrypted); + return register_fs_driver(&ubifs_driver); } coredevice_initcall(ubifs_init); + +BAREBOX_MAGICVAR_NAMED(global_ubifs_allow_encrypted, global.ubifs.allow_encrypted, + "If true, allow to mount UBIFS with encrypted files"); diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 900cc31..01aa898 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -48,6 +48,7 @@ struct iattr; struct kstat; +extern int ubifs_allow_encrypted; /* uapi/linux/limits.h */ #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */