Copying file into initramfs fails
I'm trying to copy a file into the initramfs to make it available for the key_file argument of cryptsetup.
[copies.key]
source = "/boot/volume.key"
destination = "/boot/volume.key"
complains that AttributeError: 'str' has no attribute 'parent', looking at the line in the backtrace:
self.logger.debug("Parent directory for '%s' does not exist: %s" % (dest_path.name, dest.parent))
Seems like a bug since dest is of type str.
I'm trying to copy a file into the initramfs to make it available for the key_file argument of cryptsetup.
[copies.key] source = "/boot/volume.key" destination = "/boot/volume.key"complains that
AttributeError: 'str' has no attribute 'parent', looking at the line in the backtrace:self.logger.debug("Parent directory for '%s' does not exist: %s" % (dest_path.name, dest.parent))Seems like a bug since dest is of type str.
can you share the whole backtrace? if this is about including the encryption key, the validation bit checks if you specified to include the key, otherwise it won't check the copies dict. The key will still be copied but you have to disable validation for that to work.
The best way is to use the "include_key" option which adds the key to the "dependencies". "dependencies" will copy a file into the initramfs using the same path as on the host, "copies" is for doing that with different destinations.
I think this should be fixed, I made path usage more consistent, and made the parent dir checks more robust. Please let me know if there are still issues.