2

I am looking for something that will find the squashed filesystem, and the pass the output to unsquash the fs and it would have to be an absolute path outside the squashfs.

example

/tmp/mnt/live/filesystem.squashfs

desired output

/tmp/unsquashedfs/files

I am fooling with lines of code like

find /tmp/mnt -iname '*.squashfs' -exec unsqaushfs '*.squashfs' {} \;

find /tmp/mnt -print0 -iname "*.squashfs" | unsquashfs "*.squashfs" -T - 

But can't get it to work. Any help from somebody would be appreciated!

2 Answers2

2

You're basically looking for

find /tmp/mnt -iname '*.squashfs' -exec unsquashfs {} \;

{} is replaced by the path to the matched file.

If you want to specify which directory to extract to, pass the -d option.

find /tmp/mnt -iname '*.squashfs' -exec unsquashfs -d /tmp/unsquashedfs/files {} \;
don_crissti
  • 82,805
0

So I figured i was working backwards, and this has worked for me

sudo find . -type f \( -name '*.squashfs' -o -name "*.SQFS" \) -exec cp {}  /tmp/fs.squashfs  \; && sudo unsquashfs /tmp/fs.squashfs

What I finally ended with thanks to users help! (I needed ability to search for different parameters and be able to add more in future)

find /tmp/mnt \( -iname '*.squashfs' -o -iname "*.SQFS" \) -exec unsquashfs -d /tmp/squashfs-root/ {} \;