| 1 | #!/bin/bash |
| 2 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | # You may not use this file except in compliance with the License. |
| 6 | # A copy of the License is located at |
| 7 | # |
| 8 | # http://aws.amazon.com/apache2.0 |
| 9 | # |
| 10 | # or in the "license" file accompanying this file. This file is distributed |
| 11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | # express or implied. See the License for the specific language governing |
| 13 | # permissions and limitations under the License. |
| 14 | # |
| 15 | |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | usage() { |
| 20 | echo "install_prlimit.sh download_dir install_dir" |
| 21 | exit 1 |
| 22 | } |
| 23 | |
| 24 | if [ "$#" -ne "2" ]; then |
| 25 | usage |
| 26 | fi |
| 27 | |
| 28 | BUILD_DIR=$1 |
| 29 | INSTALL_DIR=$2 |
| 30 | source codebuild/bin/jobs.sh |
| 31 | |
| 32 | sudo apt-get install -y libncurses5-dev |
| 33 | |
| 34 | cd "$BUILD_DIR" |
| 35 | # Originally from: https://www.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.2.tar.gz |
| 36 | curl --retry 3 https://s3-us-west-2.amazonaws.com/s2n-public-test-dependencies/2017-08-29_util-linux-2.25.2.tar.gz --output util-linux-2.25.2.tar.gz |
| 37 | tar -xzvf util-linux-2.25.2.tar.gz |
| 38 | cd util-linux-2.25.2 |
| 39 | ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ |
| 40 | --disable-chfn-chsh \ |
| 41 | --disable-login \ |
| 42 | --disable-nologin \ |
| 43 | --disable-su \ |
| 44 | --disable-setpriv \ |
| 45 | --disable-runuser \ |
| 46 | --disable-pylibmount \ |
| 47 | --disable-static \ |
| 48 | --without-python \ |
| 49 | --without-systemd \ |
| 50 | --disable-makeinstall-chown \ |
| 51 | --without-systemdsystemunitdir \ |
| 52 | --without-ncurses \ |
| 53 | --prefix="$INSTALL_DIR" || cat config.log |
| 54 | |
| 55 | make -j $JOBS > /dev/null |
| 56 | make -j $JOBS install > /dev/null |