@@ -232,7 +232,7 @@ See ``test/py/tests/fs_helper.py`` for the ``FsHelper`` class::
# Create encrypted filesystem
with FsHelper(config, 'ext4', 30, 'test',
part_mb=60,
- encrypt_passphrase='mypassword') as fsh:
+ passphrase='mypassword') as fsh:
# Add files to fsh.srcdir
with open(os.path.join(fsh.srcdir, 'hello.txt'), 'w') as f:
f.write('Hello from LUKS!\n')
@@ -82,7 +82,7 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir,
ext4 = FsHelper(config, 'ext4', max(1, part2_size - 30), prefix=basename,
part_mb=part2_size,
- encrypt_passphrase='test' if use_fde else None,
+ passphrase='test' if use_fde else None,
luks_version=use_fde if use_fde else 2)
ext4.setup()
@@ -41,7 +41,7 @@ class FsHelper:
To create an encrypted LUKS2 partition (default):
with FsHelper(ubman.config, 'ext4', 10, 'mmc1',
- encrypt_passphrase='test') as fsh:
+ passphrase='test') as fsh:
# create files in the fsh.srcdir directory
fsh.mk_fs() # Creates and encrypts the filesystem with LUKS2
...
@@ -49,7 +49,7 @@ class FsHelper:
To create an encrypted LUKS1 partition:
with FsHelper(ubman.config, 'ext4', 10, 'mmc1',
- encrypt_passphrase='test', luks_version=1) as fsh:
+ passphrase='test', luks_version=1) as fsh:
# create files in the fsh.srcdir directory
fsh.mk_fs() # Creates and encrypts the filesystem with LUKS1
...
@@ -59,7 +59,7 @@ class FsHelper:
default value but can be overwritten
"""
def __init__(self, config, fs_type, size_mb, prefix, part_mb=None,
- encrypt_passphrase=None, luks_version=2):
+ passphrase=None, luks_version=2):
"""Set up a new object
Args:
@@ -71,7 +71,7 @@ class FsHelper:
part_mb (int, optional): Size of partition in MB. If None, defaults
to size_mb. This can be used to make the partition larger than
the filesystem, to create space for disk-encryption metadata
- encrypt_passphrase (str, optional): If provided, encrypt the
+ passphrase (str, optional): If provided, encrypt the
filesystem with LUKS using this passphrase
luks_version (int): LUKS version to use (1 or 2). Defaults to 2.
"""
@@ -85,7 +85,7 @@ class FsHelper:
self.partition_mb = part_mb if part_mb is not None else size_mb
self.prefix = prefix
self.quiet = True
- self.encrypt_passphrase = encrypt_passphrase
+ self.passphrase = passphrase
self.luks_version = luks_version
# Use a default filename; the caller can adjust it
@@ -159,8 +159,8 @@ class FsHelper:
shell=True)
# Encrypt the filesystem if requested
- if self.encrypt_passphrase:
- self.encrypt_luks(self.encrypt_passphrase)
+ if self.passphrase:
+ self.encrypt_luks(self.passphrase)
def setup(self):
"""Set up the srcdir ready to receive files"""