0

I want use the encrypt UBIFS which supported in the linux 4.10 and latter. And I use the linux 4.18.4 to do the test. I have done everything OK, and when I use the fscryptctl to set the encrypt policy, I get this error:

fscryptctl set_policy 6de1ee71051bd470 /var/ubifs/

UBIFS error (ubi0:0 pid 1400): ubifs_enable_encryption: on-flash format version 5 is needed for encryption.

I find place where the error message printed in the kernel, and I try to print the current version for the UBIFS version, and I get the version is 4.

int ubifs_enable_encryption(struct ubifs_info *c)
{
    ......
    if (c->fmt_version < 5) {
        ubifs_err(c, "on-flash format version 5 is needed for encryption, current is version %d.", c->fmt_version);
        return -EINVAL;
    }
    ......
    return err;
}

After I modify the code, And I get the following error message:

UBIFS error (ubi0:0 pid 1400): ubifs_enable_encryption: on-flash format version 5 is needed for encryption, current is version 4.

So, that means the kernel need version 5 for encrypt, but I use the version 4. And I need a tool to make the UBIFS with version.

Currently, I use the mtd-utils-2.0.2 which download from http://www.linux-mtd.infradead.org/ to build the ubifs image. And it make the UBIFS with version 4.

I have searched many information about the UBIFS version by google, but get nothing.

Does anyone know how to create a UBIFS with version 5?

Jimmy
  • 223
  • 1
  • 11

1 Answers1

1

Looks like it got added at mtd utils 2.1

Changes from 2.0.2 to `2.1.0:

Features:
 - mkfs.ubifs: Implement support for file system encryption
 - mkfs.ubifs: Implement selinux labelling support
 - ubinize: add support for skipping CRC check of a static volume when opening
 - ubimkvol: add support for skipping CRC check of a static volume when opening
 - Add lsmtd program
NM Pennypacker
  • 6,704
  • 11
  • 36
  • 38
xeniter
  • 11
  • 1
  • and you have to provide to mkfs.ubifs the key otherwise it will be still a unecrypted ubifs 4 image (also provide cipher as parameter even if you use standard one, because there is a bug mtd utils 2.1 (floating pointer)) – xeniter May 21 '19 at 10:18