stages: 2/02-squashfs: apply some patches from Debian to make the ISO more reliable
[dragora.git] / stages / 2 / 02-squashfs
bloba342052de3751928c3a310c348439543b1de6175
1 # Build script for squashfs4.3+.
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
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
9 #    http://www.apache.org/licenses/LICENSE-2.0
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.
17 # From http://github.com/plougher/squashfs-tools
18 # commit 6e242dc
19 version=master
21 cd -- "$TMPDIR"
22 rm -rf squashfs-tools-${version} \
23        "${rootdir}/squashfs-tools_lzip"
24 unpack "${worktree}/sources/squashfs-tools-${version}.zip"
26 # Build instructions
27 cd squashfs-tools-${version}
29 # Note:
30 # The build environment for cross-compilation is not imported,
31 # the squashfs-tools installation must work from the host system,
32 # this will produce the compressed squash-image
34 # Apply a patch to include LZIP support
35 patch -p1 < "${worktree}/patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff"
37 # Apply some patches from http://sources.debian.org/patches/squashfs-tools/1:4.3-12/
38 # to make it the final ISO more reliable
39 for file in "${worktree}/patches/squashfs-tools"/????-*.patch
41     echo "Applying patch: $file ..."
42     patch -p1 < "$file"
43 done
44 unset file
46 cd squashfs-tools
48 make -j${jobs} \
49  CC=cc LDFLAGS="" all INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
51 make -j${jobs} \
52  CC=cc LDFLAGS="" install INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
54 cleanup()
56     cd -- "$TMPDIR" && rm -rf squashfs-tools-${version}