Skip to content

Commit

Permalink
Merge pull request #262 from wcampbell0x2a/release-v0.13.0
Browse files Browse the repository at this point in the history
Prepare v0.13.0 Release
  • Loading branch information
wcampbell0x2a authored Jun 19, 2023
2 parents 689b136 + 45dc80e commit 96c8372
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 13 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ jobs:
name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
path: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz

- name: Upload binary to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: svenstaro/upload-release-action@v2

# check semvar before release!
- name: Check semver
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: obi1kenobi/cargo-semver-checks-action@v2

- name: Upload binary to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,76 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# Unreleased

# [v0.13.0] - 2023-06-18
## backhand
### Changes
- Decrease in memory usage for file reader and write ([#255](https://github.com/wcampbell0x2a/backhand/pull/255))
- Remove unnecessary deconstruction/reconstruction of Vec when reading inodes ([@rbran](https://github.com/rbran)) ([#251](https://github.com/wcampbell0x2a/backhand/pull/251))
- Only store file data compressed if it results in smaller size ([@rbran](https://github.com/rbran)) ([#250](https://github.com/wcampbell0x2a/backhand/pull/250))
- Remove `lzo` being a default feature because of GPL license ([#240](https://github.com/wcampbell0x2a/backhand/pull/240))
- Add support for OpenWRT compression options ([#239](https://github.com/wcampbell0x2a/backhand/pull/239))
- Bump MSRV to `1.65.0` for latest `clap` requirements ([#253](https://github.com/wcampbell0x2a/backhand/pull/253))
### Bug Fix
- Fix bug in generating Uid and Gid's with `FilesystemWriter`. All internal representation of Gid and Uid are changed to u32 ([#254](https://github.com/wcampbell0x2a/backhand/pull/254))
- Remove case where invalid filesystem root_inode_offset would cause invalid bounds read panic. Found by fuzzer ([#245](https://github.com/wcampbell0x2a/backhand/pull/245))

### Complete API Updates
```
$ cargo public-api -ss diff v0.12.0..HEAD
```

<details>
<summary>Click to expand</summary>

```diff
Removed items from the public API
=================================
(none)

Changed items in the public API
===============================
-pub fn backhand::FilesystemWriter<'a>::set_root_gid(&mut self, gid: u16)
+pub fn backhand::FilesystemWriter<'a>::set_root_gid(&mut self, gid: u32)
-pub fn backhand::FilesystemWriter<'a>::set_root_uid(&mut self, uid: u16)
+pub fn backhand::FilesystemWriter<'a>::set_root_uid(&mut self, uid: u32)
-pub backhand::NodeHeader::gid: u16
+pub backhand::NodeHeader::gid: u32
-pub backhand::NodeHeader::uid: u16
+pub backhand::NodeHeader::uid: u32
-pub fn backhand::NodeHeader::new(permissions: u16, uid: u16, gid: u16, mtime: u32) -> Self
+pub fn backhand::NodeHeader::new(permissions: u16, uid: u32, gid: u32, mtime: u32) -> Self

Added items to the public API
=============================
+pub backhand::compression::Xz::bit_opts: core::option::Option<u16>
+pub backhand::compression::Xz::fb: core::option::Option<u16>
+pub fn backhand::kind::Kind::magic(&self) -> [u8; 4]
+impl backhand::NodeHeader
+pub fn backhand::NodeHeader::from_inode(inode_header: InodeHeader, id_table: &[backhand::Id]) -> Self
```

</details>

## All binaries
## Changes
- jemalloc is now used for `-musl` release targets for performance reasons ([#254](https://github.com/wcampbell0x2a/backhand/pull/254))
- `HAVE_DECODER_ARM`, `HAVE_DECODER_ARM64`, and `HAVE_DECODER_ARMTHUMB` filter flags are now defined for xz2. This only effects static build created in our CI. ([#254](https://github.com/wcampbell0x2a/backhand/pull/248))
- Add `RUST_LOG` and available Decompressors to `--help` of all binaries ([#242](https://github.com/wcampbell0x2a/backhand/pull/242))

## add
### Changes
- Add `--dir` to create a empty directory ([#242](https://github.com/wcampbell0x2a/backhand/pull/242))
### Bug Fix
- Add correctly reading new file metadata from `--file`, force other arguments for `--dir` ([#254](https://github.com/wcampbell0x2a/backhand/pull/254))

## unsquashfs
### Changes
- Add `--auto-offset` for automatic finding of initial SquashFS offset in image ([#241](https://github.com/wcampbell0x2a/backhand/pull/241))
- Add possible `kind` values to `--help` output ([#236](https://github.com/wcampbell0x2a/backhand/pull/236))
- Add `--path-filter` to limit file extraction to a path ([#237](https://github.com/wcampbell0x2a/backhand/pull/237))

# [v0.12.0] - 2023-05-07
Thanks [@rbran](https://github.com/rbran/) for the contributions!

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "backhand"
repository = "https://github.com/wcampbell0x2a/backhand"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
rust-version = "1.65.0"
license = "MIT OR Apache-2.0"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ backhand
Library and binaries for the reading, creating, and modification
of [SquashFS](https://en.wikipedia.org/wiki/SquashFS) file systems.

- **Library** — Backhand provides an easy way for programmatic analysis of Squashfs images,
- **Library** — Backhand provides an easy way for programmatic analysis of Squashfs 4.0 images,
including the extraction and modification of images.
- **Feature Flags** — Supported compression and decompression are feature flagged, so your final binary (or `unsquashfs`)
only needs to include code to extract one type of image.
Expand All @@ -24,7 +24,7 @@ Minimum supported rust version: `1.65.0`
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
backhand = "0.12.0"
backhand = "0.13.0"
```
### Reading/Writing/Modifying Firmware
```rust,no_run
Expand Down Expand Up @@ -102,7 +102,7 @@ Arguments:
<FILE_PATH_IN_IMAGE> Path of file once inserted into squashfs
Options:
-d, --dir Create directory
-d, --dir Create empty directory
-f, --file <FILE> Path of file to read, to write into squashfs
-o, --out <OUT> Squashfs output image [default: added.squashfs]
--mode <MODE> Overide mode read from <FILE>
Expand Down Expand Up @@ -132,11 +132,11 @@ Options:

## Performance
See `./benches` using `cargo bench` to benchmark the library, or run `./bench.bash` to benchmark against system `squashfs-tools/unsquashfs`.
While there is still work to do, in most cases our speed is comparable or better than single-threaded `squashfs-tools/unsquashfs`.
Comparing memory usage, our `unsquashfs` beats `squashfs-tools` by using `18.1MB` instead of `74.8MB`.
While there is still work to do, in most cases our speed is comparable to single-threaded `squashfs-tools/unsquashfs`.
Comparing memory usage, our `unsquashfs` beats `squashfs-tools` by using `18.1MB` instead of `74.8MB` in the case of `test_re815_xev160/870D97.squashfs`.

## Testing
This library is extensively tested with all library features and images from openwrt and extracted from manufacturers devices.

To run basic tests, use `cargo test --release`.
To run tests, use `cargo test --release`.
To start fuzzing, run `cargo fuzz list` then pick one! Then start with `cargo fuzz run [NAME]`.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! Add the following to your `Cargo.toml` file:
//! ```toml
//! [dependencies]
//! backhand = "0.12.0"
//! backhand = "0.13.0"
//! ```
//!
//! ### Reading
Expand Down

0 comments on commit 96c8372

Please sign in to comment.