Skip to content

Commit

Permalink
Add support for xz compression
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentRiou committed Jun 14, 2018
1 parent c782792 commit 333ed3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.pyc

# Generated files
cleanup.log
src/Makefile
src/config.log
src/config.status
Expand Down Expand Up @@ -97,3 +98,9 @@ src/wrt_vx_imgtool/wrt_vx_imgtool
src/yaffs2utils/mkyaffs2
src/yaffs2utils/unspare2
src/yaffs2utils/unyaffs2

# work directory
/fmk/

# standard IDE
/.idea/
4 changes: 3 additions & 1 deletion build-firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ rm -rf "$FWOUT" "$FSOUT"
case $FS_TYPE in
"squashfs")
# Check for squashfs 4.0 realtek, which requires the -comp option to build lzma images.
if [ "$FS_COMPRESSION" == "lzma" ]; then
if [ "$FS_COMPRESSION" == "xz" ]; then
COMP="-comp xz"
elif [ "$FS_COMPRESSION" == "lzma" ]; then
if [ "$(echo $MKFS | grep 'squashfs-4.0-realtek')" != "" ] || [ "$(echo $MKFS | grep 'squashfs-4.2')" != "" ]; then
COMP="-comp lzma"
else
Expand Down
2 changes: 2 additions & 0 deletions extract-firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ for LINE in IFS='
# Check for compression type of the file system. Default to LZMA
if [ "$(echo ${LINE} | grep -i 'gzip')" != "" ]; then
FS_COMPRESSION="gzip"
elif [ "$(echo ${LINE} | grep -i 'xz')" != "" ]; then
FS_COMPRESSION="xz"
else
FS_COMPRESSION="lzma"
fi
Expand Down

0 comments on commit 333ed3a

Please sign in to comment.