yoctoproject / bmaptool

BMAP Tools
GNU General Public License v2.0
25 stars 13 forks source link

bmaptool does not work on ecryptfs #22

Open gschwaer opened 6 months ago

gschwaer commented 6 months ago

Hi,

My home partition is encrypted with ecryptfs

$ mount | grep /home
/home/.ecryptfs/gschwaer/.Private on /home/gschwaer type ecryptfs (rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=1234567890123456,ecryptfs_sig=1234567890123456,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)

When I try to run bmaptool like so:

cd ~/.tmp
git clone git@github.com:yoctoproject/bmaptool.git
cd bmaptool
python3.9 -m venv .venv
source .venv/bin/activate
pip install .[dev]
bmaptool create README.md

I get the following error:

bmaptool create README.md 
bmaptool: ERROR: An error occurred, here is the traceback:
Traceback (most recent call last):
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 412, in _invoke_fiemap
    fcntl.ioctl(self._f_image, _FIEMAP_IOCTL, self._buf, 1)
OSError: [Errno 95] Operation not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 568, in filemap
    return FilemapFiemap(image)
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 376, in __init__
    self.block_is_mapped(0)
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 437, in block_is_mapped
    struct_fiemap = self._invoke_fiemap(block, 1)
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 422, in _invoke_fiemap
    raise ErrorNotSupp(errstr)
bmaptool.Filemap.ErrorNotSupp: FilemapFiemap: the FIEMAP ioctl is not supported by the file-system

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/BmapCreate.py", line 177, in __init__
    self.filemap = Filemap.filemap(self._f_image)
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 570, in filemap
    return FilemapSeek(image)
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 216, in __init__
    self._probe_seek_hole()
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/Filemap.py", line 253, in _probe_seek_hole
    raise ErrorNotSupp(
bmaptool.Filemap.ErrorNotSupp: the file-system does not support "SEEK_HOLE" and "SEEK_DATA" but only provides a stub implementation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/CLI.py", line 640, in create_command
    creator = BmapCreate.BmapCreate(args.image, output, "sha256")
  File "/home/gschwaer/.tmp/bmaptool/.venv/lib/python3.9/site-packages/bmaptool/BmapCreate.py", line 179, in __init__
    raise Error(

bmaptool: ERROR: cannot generate bmap for file 'README.md': the file-system does not support "SEEK_HOLE" and "SEEK_DATA" but only provides a stub implementation

Is this expected behavior? Or is it an issue with my ecryptfs setup?

Versions: