Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | set -eo pipefail |
| 3 | |
| 4 | if [ ! -d "$root/linux" ] ; then |
| 5 | echo "Please first call scripts/fetch_third_party.sh" |
| 6 | fi |
| 7 | |
| 8 | root=$(git rev-parse --show-toplevel)/third_party |
| 9 | |
| 10 | # nasm + Python 3.7 + iasl |
| 11 | if [ ! -d "$root/edk2" ] ; then |
| 12 | git clone --recurse-submodules https://github.com/tianocore/edk2 $root/edk2 |
| 13 | fi |
| 14 | cd $root/edk2 |
| 15 | git checkout --recurse-submodules edk2-stable201908 |
| 16 | . edksetup.sh |
| 17 | make -C $root/edk2/BaseTools/Source/C |
| 18 | build -DTPM2_ENABLE -DSECURE_BOOT_ENABLE -t GCC5 -a X64 -b RELEASE -p $PWD/OvmfPkg/OvmfPkgX64.dsc |
| 19 | |
| 20 | musl_prefix=$root/musl-prefix |
| 21 | |
| 22 | cd $root/linux |
| 23 | make headers_install ARCH=x86_64 INSTALL_HDR_PATH=$musl_prefix |
| 24 | |
| 25 | mkdir -p $root/musl |
| 26 | curl -L https://www.musl-libc.org/releases/musl-1.1.23.tar.gz | tar -xzf - -C $root/musl --strip-components 1 |
| 27 | cd $root/musl |
| 28 | |
| 29 | ./configure --prefix=$musl_prefix --syslibdir=$musl_prefix/lib |
| 30 | make -j8 |
| 31 | make install |
| 32 | |
| 33 | mkdir -p $root/util-linux |
| 34 | curl -L https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-2.34.tar.gz | tar -xzf - -C $root/util-linux --strip-components 1 |
| 35 | cd $root/util-linux |
| 36 | ./autogen.sh |
| 37 | ./configure CC=$musl_prefix/bin/musl-gcc --without-systemd --without-udev --without-btrfs --disable-pylibmount --without-tinfo --prefix=$musl_prefix --disable-makeinstall-chown --disable-makeinstall-setuid --with-bashcompletiondir=$musl_prefix/usr/share/bash-completion |
| 38 | make -j8 |
| 39 | make install |
| 40 | |
| 41 | mkdir -p $root/xfsprogs-dev |
| 42 | curl -L https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/snapshot/xfsprogs-dev-5.2.1.tar.gz | tar -xzf - -C $root/xfsprogs-dev --strip-components 1 |
| 43 | cd $root/xfsprogs-dev |
| 44 | patch -p1 < ../../patches/xfsprogs-dev/*.patch |
| 45 | ./configure CC=$musl_prefix/bin/musl-gcc "CFLAGS=-static -I$musl_prefix/include -L$musl_prefix/lib" "LDFLAGS=-L$musl_prefix/lib" |
| 46 | make -j8 mkfs |
| 47 | cp $root/xfsprogs-dev/mkfs/mkfs.xfs |