{"id":25692389,"url":"https://github.com/embetrix/bmap-writer","last_synced_at":"2025-04-24T05:14:56.536Z","repository":{"id":263628168,"uuid":"890996681","full_name":"embetrix/bmap-writer","owner":"embetrix","description":"bmaptool alternative written in C++","archived":false,"fork":false,"pushed_at":"2025-02-07T10:50:42.000Z","size":221,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T05:14:38.119Z","etag":null,"topics":["bmap","cpp","efficiency","embedded-linux","flashing-tool","lightweight","streaming-data","yocto"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embetrix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-19T14:48:18.000Z","updated_at":"2025-04-23T03:37:36.000Z","dependencies_parsed_at":"2024-11-19T15:47:10.085Z","dependency_job_id":"fa57c010-e0ba-42cf-bab0-99a971e93df7","html_url":"https://github.com/embetrix/bmap-writer","commit_stats":null,"previous_names":["embetrix/bmap-writer"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetrix%2Fbmap-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetrix%2Fbmap-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetrix%2Fbmap-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetrix%2Fbmap-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embetrix","download_url":"https://codeload.github.com/embetrix/bmap-writer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566510,"owners_count":21451233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bmap","cpp","efficiency","embedded-linux","flashing-tool","lightweight","streaming-data","yocto"],"created_at":"2025-02-24T23:09:03.307Z","updated_at":"2025-04-24T05:14:56.519Z","avatar_url":"https://github.com/embetrix.png","language":"C++","readme":"\n# bmap-writer\n\n[![CI](https://github.com/embetrix/bmap-writer/actions/workflows/integration.yml/badge.svg)](https://github.com/embetrix/bmap-writer/actions/workflows/integration.yml)\n\n`bmap-writer` is a command-line utility designed to efficiently write disk images to storage devices using block mapping (BMAP). \nIt serves as a lightweight alternative to the Yocto BMAP tool, specifically for embedded systems. \nUnlike the Yocto BMAP tool, `bmap-writer` is C++ based does not require Python and focuses solely on writing an image.\n\n\u003cp align =\"center\"\u003e\u003cimg src=bmap-writer.jpeg width=200 height=200 /\u003e\u003c/p\u003e\n\n## Key Features\n\n- Provides a lightweight alternative specifically for embedded systems.\n- Does not require Python, making it easier to integrate into various environments.\n- Handles all compression filters that are supported by `libarchive`, decompressing the data on-the-fly during the writing process.\n- Ensures data integrity by verifying checksums for each block.\n- Writes only the necessary blocks, reducing the overall write time and wear on storage devices.\n- Can use the Linux kernel crypto API to leverage hardware-accelerated hashing.\n\n## How It Works\n\n1. Create a BMAP file for your disk image using `bmaptool`.\n2. Use `bmap-writer` to write the image to your target device, specifying the BMAP file for efficient block mapping.\n\n## Requirements\n\n- C++ compiler\n- CMake\n- libarchive\n- TinyXML-2\n- libkcapi (optional)\n\n## Build and Installation\n\n### Install Dependencies\n\n#### Ubuntu\n\n```sh\nsudo apt-get update\nsudo apt-get install -y libarchive-dev libtinyxml2-dev libkcapi-dev\n```\n\n## Build\n\n```sh\ncmake .\nmake\n```\n\n### Enable support for the Linux kernel crypto API\n\nTo enable support for the Linux kernel crypto API, which is disabled by default, the `USE_KERNEL_CRYPTO_API` option\nshall be set to `ON`:\n\n```sh\ncmake -DUSE_KERNEL_CRYPTO_API=ON .\n```\n\n## Test\n\n```sh\nctest -V\n```\n\n## Install\n\n```sh\nsudo make install\n```\n\n## Usage\n\n```sh\nbmap-writer [-hvn] \u003cimage-file\u003e [\u003cbmap-file\u003e] \u003ctarget-device\u003e\n```\n\n* `-n` : Skip checksum verification\n* `-v` : Show version\n* `-h` : Show this help and exit\n* `\u003cbmap-file\u003e`: Optional. If not provided, it will be searched in the same path as the input `\u003cimage-file\u003e`.\n\nTo use stdin as source of the image file, `\u003cimage-file\u003e` shall be equal to `-` and `\u003cbmap-file\u003e` shall be present.\n\n### Streaming mode\n\nStreaming mode, i.e. writing data while it's being received, is supported through piping from external applications.\nThe BMAP file shall be present and available before the data streaming is started.\n\nSome examples are presented below:\n\n* Download from an HTTP server using `wget`:\n```bash\nwget -O - http://myserver.com/image.bmap \u003e image.bmap\nwget -O - http://myserver.com/image.gz | bmap-writer - image.bmap /dev/sdX\n```\n* Download from a FTP server using `wget`:\n```bash\nwget -O - ftp://user@myserver.com:2121/image.bmap \u003e image.bmap\nwget -O - ftp://user@myserver.com:2121/image.gz | bmap-writer - image.bmap /dev/sdX\n```\n* Download from a SFTP host using `curl`:\n```bash\ncurl -u user:password sftp://hostname/path/to/image.bmap \u003e image.bmap\ncurl -u user:password sftp://hostname/path/to/image.gz | bmap-writer - image.bmap /dev/sdX\n```\n\nNote: the [bmap-writer-stream.sh](bmap-writer-stream.sh) script can be used for stream processing tasks.\n \n## Yocto/Buildroot Integration\n\n`bmap-writer` is already available in [meta-openembedded](https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/recipes-support/bmap-writer) and [buildroot](https://github.com/buildroot/buildroot/tree/master/package/bmap-writer\n)\n\n\n## License\n\nThis project is licensed under the terms of the **GNU General Public License v3 (GPLv3)**.\nYou are free to use, modify, and distribute this software under the conditions outlined in the GPLv3 license.\n\nFor more information about the GPLv3 license, refer to the [LICENSE](LICENSE) file in this repository or visit [GNU's official page](https://www.gnu.org/licenses/gpl-3.0.html).\n\n\n## Commercial License\n\nFor organizations or individuals requiring the use of `bmap-writer` in proprietary applications or with different licensing terms, a **commercial license** is available.\n\nThe commercial license provides:\n- Freedom from the obligations imposed by the GPLv3 license.\n- Priority access to updates, integration help, and extended documentation.\n- Tailored development and deployment solutions.\n\nTo obtain a commercial license or inquire further, please contact: [info@embetrix.com](mailto:info@embetrix.com)\n\n\n## Contributor License Agreement (CLA)\n\nBy submitting a pull request to this repository, you agree to the following terms:\n\n1. You certify that your contribution is your original work or that you have the necessary rights to submit it.\n2. You grant the project maintainers a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to:\n   - Use, modify, sublicense, and distribute your contribution under the terms of the **GPLv3**.\n   - Use, modify, sublicense, and distribute your contribution under alternative licenses, including commercial licenses.\n3. You understand that you retain the copyright to your contribution but agree it may be relicensed under these terms.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembetrix%2Fbmap-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembetrix%2Fbmap-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembetrix%2Fbmap-writer/lists"}