#!/usr/bin/env bash # # Copyright (C) 2011-2021 Intel Corporation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # * Neither the name of Intel Corporation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # set -e PKG_NAME="Intel SGX Driver" if test $(id -u) -ne 0; then echo "Root privilege is required to install $PKG_NAME." exit 4 fi PATH=/usr/bin:/bin umask 022 DRIVERPKG=`mktemp -t sgx-driver-pkg.XXXXXX` DRIVER_TEMP_FOLDER=`mktemp -d sgx-driver-XXXXXX -p /tmp` trap "rm -fr $DRIVERPKG $DRIVER_TEMP_FOLDER 2>/dev/null; /bin/sed -i '/^isgx$/d' /etc/modules; exit 3" HUP INT QUIT TERM EXIT # The number of lines in this script (plus 1). Using this number to # calculate the start address of the payload. NR_SCRIPT_LINES=93 # Run /usr/bin/md5sum on the binary payload to get the MD5 check sum. CHKSUM=8c5e0f24bb4afd50b755e8518bcf7d7a # Get the install payload from this shell script. echo -n "Unpacking $PKG_NAME ..." tail -n +$NR_SCRIPT_LINES "$0" > $DRIVERPKG echo " done." echo -n "Verifying the integrity of the install package ..." if test $(md5sum $DRIVERPKG | awk '{print $1}') != $CHKSUM; then echo " The install package appears to be corrupted." exit 1 fi echo " done." echo "Installing $PKG_NAME ..." tar zxf $DRIVERPKG -C $DRIVER_TEMP_FOLDER >/dev/null 2>&1 retcode=$? # Save the return code # Clean-up the temporary tarball. rm -f $DRIVERPKG 2>/dev/null if test $retcode -ne 0; then echo " failed." exit 2 fi pushd $DRIVER_TEMP_FOLDER source scripts/installConfig make install popd ${SGX_PACKAGES_PATH}/${DRIVER_PKG_NAME}/scripts/install.sh rm -fr ${DRIVER_TEMP_FOLDER} trap - EXIT exit 0 LOOfըr8.nR;oԚ_l4K)KDTjD}:^w鸰 8vs@=RȚR|ךI@bIJ\e=:+/CwV> Y85 6W.%K.,ߧ&Y2ƿ}C||1۴pHp؂/YH3 i2`_Z>qȄ!!v|ˠe<2|&$ &5:lne!0 `\q?4cPiz\}Z܋%hDn e!>, z@=P4$`!6M ǧ  12n.ϙ_$+#ޒhd0BsѼlnhY,KE%j|5 wJG)vq\\eۑ*i: ?T~KH?$ՠ:?lFkwwQ&#Ue6qv 韓+yؾ֙UFٌʨEHi!*dnK;f%;7"eM h{Y%g2:8c y @ [<@n+p 2c930$U,>*PO{SGhCPlڗR(,ۘ` ZޡeϜێ=f۲vΖn3ZPCe0R`lT6h._ؑHYvC&.f7Ĝ">QL_&~lTR`ҩ(,wIy 9s 0iZE!ɝ[E<{M;+8KT=5G<=cjv6WƏ@ZH/Կ@騶+ww޿ݵ'_pOZjG]g\r@F*40|@tb99S;Z"sˠG+6Yyar\ .hCerX:t\Q mpj ?=Qh4e99IS+f dlR%NIn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