summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-10-02 14:21:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-08 08:36:58 +0200
commit65e3be9af4434785adb87be87c9cafb6bfdbb65e (patch)
treecf932903199d511cf350b5e2ea095d9f9033ad47 /fs/ubifs/ubifs.c
parent6ddc8ca036d002ed95e13609aaeb57600d9199b5 (diff)
downloadbarebox-65e3be9af4434785adb87be87c9cafb6bfdbb65e.tar.gz
barebox-65e3be9af4434785adb87be87c9cafb6bfdbb65e.tar.xz
fs: ubifs: optionally allow to mount UBIFS images with encrypted files
Currently we do not support the UBIFS file encryption feature. Nevertheless we can allow read clear files from UBIFS to be able to boot an unencrypted kernel. This differs from the Kernel behaviour, so add a globalvar to make that configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ubifs/ubifs.c')
-rw-r--r--fs/ubifs/ubifs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 11fb3187ad..bbe382dab0 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -15,6 +15,8 @@
#include <common.h>
#include <init.h>
#include <fs.h>
+#include <globalvar.h>
+#include <magicvar.h>
#include <linux/stat.h>
#include <linux/zlib.h>
#include <linux/mtd/mtd.h>
@@ -501,6 +503,8 @@ static int zlib_decomp_init(void)
return 0;
}
+int ubifs_allow_encrypted;
+
static int ubifs_init(void)
{
int ret;
@@ -511,7 +515,12 @@ static int ubifs_init(void)
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");