wcampbell0x2a / backhand

Library and binaries for the reading, creating, and modification of SquashFS file systems
Apache License 2.0
112 stars 8 forks source link

The command add doesn't work in some situations #160

Closed rbran closed 1 year ago

rbran commented 1 year ago

Reproduce:

mkdir tmp
touch tmp/file1 tmp/file2 empty
mksquashfs tmp test.squashfs
~/src/backhand/target/debug/add test.squashfs empty ./

Don't add the file empty, instead unsquashfs -l added.squashfs only outputs:

squashfs-root
squashfs-root/file1
squashfs-root/file2
wcampbell0x2a commented 1 year ago

add expects the full path of the file in the image is preset as <FILE_PATH>. So this works:

$ /target/release/add test.squashfs empty /empty

if the following usage can be improved, lmk.

tool to add files to squashfs filesystems

Usage: add [OPTIONS] <FILESYSTEM> <FILE> <FILE_PATH>

Arguments:
  <FILESYSTEM>  Squashfs input image
  <FILE>        Path of file to read, to write into squashfs
  <FILE_PATH>   Path of file inserted into squashfs

Options:
  -o, --out <OUT>  Squashfs output image [default: added.squashfs]
  -h, --help       Print help
  -V, --version    Print version