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

CramFS extraction failed due to missing cleaning up #134

Open
GoogleCodeExporter opened this issue May 30, 2015 · 0 comments
Open

CramFS extraction failed due to missing cleaning up #134

GoogleCodeExporter opened this issue May 30, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

While trying to extract a CramFS filesystem with binwalk, I narrowed down the 
extraction failure to one script: uncramfs_all.sh

Here is what happens (traced through a "bash -x"):
1. the script tries to extract it with LZMA compression and fails because this 
particular one is not compressed with LZMA.
2. then a cramfsck occurs and returns an exit code of 4
3. It tries to extract it with uncramfs which, launched manually succeeds but 
as the script did not cleaned up the extracted files from the LZMA attempt, it 
fails because files already exists.

Unsure about the need of cleaning also before calling cramfsck.

Here is a working patch:
diff --git a/uncramfs_all.sh b/uncramfs_all.sh
index 7b8a7af..f67242d 100755
--- a/uncramfs_all.sh
+++ b/uncramfs_all.sh
@@ -105,6 +105,7 @@ then
      exit 0
   fi

+  rm -rf "$ROOTFS"
   ./src/uncramfs/uncramfs "$ROOTFS" "$FSIMG.le" 2>/dev/null
   if [ $? -eq 0 ]
   then


Original issue reported on code.google.com by jmiche...@gmail.com on 21 Jul 2014 at 8:14

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

No branches or pull requests

1 participant