Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARCHIVE_FORMAT_CPIO_SVR4_CRC not working #54

Open
Mk-arc opened this issue Jul 29, 2022 · 0 comments
Open

ARCHIVE_FORMAT_CPIO_SVR4_CRC not working #54

Mk-arc opened this issue Jul 29, 2022 · 0 comments

Comments

@Mk-arc
Copy link

Mk-arc commented Jul 29, 2022

Hi,

I am basically trying to create a. Before i used cpio directly "cpio -ov -A -H crc -F" to create the archive, which works fine. Now I want to use libarchive from python to achieve the same result. Howver there are some issues with the Archive Format. With the format "ARCHIVE_FORMAT_CPIO" I can create the archive, but SWU-Update claims the archive has not the correct format. I think "ARCHIVE_FORMAT_CPIO_SVR4_CRC" needs to be used, but with this format, libarchive somehow exits with an error.

    for entry in libarchive.public.create_file(
            self._strUpdateFileName,
            libarchive.constants.ARCHIVE_FORMAT_CPIO_SVR4_CRC,
            lstCopyFile):
        pass
Traceback (most recent call last):
  File "swufilecreator.py", line 355, in <module>
    swuCreator.CreateUpdateFile('./output/')
  File "swufilecreator.py", line 100, in CreateUpdateFile
    strSha256 = swuCreatorRec.CreateUpdateFile(self._strBuildDirectory + '/')
  File "swufilecreator.py", line 140, in CreateUpdateFile
    self.__CreateOutputFile()
  File "swufilecreator.py", line 320, in __CreateOutputFile
    lstFilesToAdd):
  File "/usr/local/lib/python3.6/dist-packages/libarchive/adapters/archive_write.py", line 284, in create_file
    return _create(opener, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/libarchive/adapters/archive_write.py", line 198, in _create
    _set_write_context(a, format_code, filter_code)
  File "/usr/local/lib/python3.6/dist-packages/libarchive/adapters/archive_write.py", line 183, in _set_write_context
    format_code)
  File "/usr/local/lib/python3.6/dist-packages/libarchive/adapters/archive_write_set_format.py", line 6, in archive_write_set_format
    code)
  File "/usr/local/lib/python3.6/dist-packages/libarchive/calls/archive_write_set_format.py", line 8, in _check_zero_success
    raise ValueError("Function returned failure: (%d)" % (value))
ValueError: Function returned failure: (-30)

The same code works well to create an archive with the option "ARCHIVE_FORMAT_CPIO". I wonder what is the problem here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant