Skip to content

extractor.sh: Handle symlink image files #36

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ elif [[ $(7z l -ba "$romzip" | grep rawprogram) ]]; then
partitionsonzip=$(7z l -ba $romzip | gawk '{ print $NF }' | grep $partition)
if [[ ! $partitionsonzip == "" ]]; then
7z e -y $romzip $partitionsonzip 2>/dev/null >> $tmpdir/zip.log
if [[ -L "$partition.img" ]]; then
partitionlink=$(7z l -ba $romzip | gawk '{ print $NF }' | grep `readlink "$partition.img"`)
7z e -y $romzip $partitionlink -so > "$partition.img"
fi
if [[ ! -f "$partition.img" ]]; then
if [[ -f "$partition.raw.img" ]]; then
mv "$partition.raw.img" "$partition.img"
Expand Down Expand Up @@ -430,7 +434,7 @@ elif [[ $(7z l -ba "$romzip" | grep payload.bin) ]]; then
[[ -f "payload.bin" ]] && rm payload.bin
rm -rf "$tmpdir"
exit
elif [[ $(7z l -ba "$romzip" | grep ".*.rar\|.*.zip") ]]; then
elif [[ $(7z l -ba "$romzip" | grep ".*.rar\|.*.zip" | tr -s ' ' | cut -d' ' -f4 | awk '$0>300M') ]]; then
echo "Image zip firmware detected"
mkdir -p $tmpdir/zipfiles
7z e -y "$romzip" -o$tmpdir/zipfiles 2>/dev/null >> $tmpdir/zip.log
Expand Down