02-squashfs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Build script for squashfs4.3+.
  2. #
  3. # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # From http://github.com/plougher/squashfs-tools
  17. version=20190415_3197524
  18. cd -- "$TMPDIR"
  19. rm -rf squashfs-tools-${version} \
  20. "${rootdir}/squashfs-tools_lzip"
  21. unpack "${worktree}/sources/squashfs-tools-${version}.tar.lz"
  22. # Build instructions
  23. cd squashfs-tools-${version}
  24. # Note:
  25. # The build environment for cross-compilation is not imported,
  26. # the squashfs-tools installation must work from the host system,
  27. # this will produce the compressed squash-image
  28. # Apply a patch to include LZIP support
  29. patch -p1 < "${worktree}/patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff"
  30. # Apply some patches from http://sources.debian.org/patches/squashfs-tools/1:4.3-12/
  31. # to make the Live ISO image more reliable
  32. for file in "${worktree}/patches/squashfs-tools"/????-*.patch
  33. do
  34. echo "Applying patch: $file ..."
  35. patch -p1 < "$file"
  36. done
  37. unset file
  38. cd squashfs-tools
  39. make -j${jobs} \
  40. CC=cc LDFLAGS="" all INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
  41. make -j${jobs} \
  42. CC=cc LDFLAGS="" install INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
  43. cleanup()
  44. {
  45. cd -- "$TMPDIR" && rm -rf squashfs-tools-${version}
  46. }