Changeset 75580 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Nov 19, 2018 3:40:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/linux/export_modules.sh
r69500 r75580 30 30 MY_DIR="${TARGET%/[!/]*}" 31 31 32 if [ -z "$1" ]; then 33 echo "Usage: $0 <filename.tar.gz> [--without-hardening]" 34 echo " Export VirtualBox kernel modules to <filename.tar.gz>" 32 # What this script does: 33 usage_msg="\ 34 Usage: `basename ${0}` --file <path>|--folder <path> [--without-hardening] 35 36 Exports the VirtualBox host kernel modules to the tar.gz archive or folder in \ 37 <path>, optionally adjusting the Make files to build them without hardening. 38 39 Examples: 40 `basename ${0}` --file /tmp/vboxhost.tar.gz 41 `basename ${0}` --folder /tmp/tmpdir --without-hardening" 42 43 usage() 44 { 45 case "${1}" in 46 0) 47 echo "${usage_msg}" | fold -s -w80 ;; 48 *) 49 echo "${usage_msg}" | fold -s -w80 >&2 ;; 50 esac 51 exit "${1}" 52 } 53 54 fail() 55 { 56 echo "${1}" | fold -s -w80 >&2 35 57 exit 1 36 fi 37 58 } 59 60 unset FILE FOLDER 38 61 VBOX_WITH_HARDENING=1 39 if [ "$2" = "--without-hardening" ]; then 40 VBOX_WITH_HARDENING= 41 fi 42 43 PATH_TMP="`cd \`dirname $1\`; pwd`/.vbox_modules" 62 while test -n "${1}"; do 63 case "${1}" in 64 --file) 65 FILE="${2}" 66 shift 2 ;; 67 --folder) 68 FOLDER="${2}" 69 shift 2 ;; 70 --without-hardening) 71 unset VBOX_WITH_HARDENING 72 shift ;; 73 -h|--help) 74 usage 0 ;; 75 *) 76 echo "Unknown parameter ${1}" >&2 77 usage 1 ;; 78 esac 79 done 80 test -z "$FILE" || test -z "$FOLDER" || 81 fail "Only one of --file and --folder may be used" 82 test -n "$FILE" || test -n "$FOLDER" || usage 1 83 84 if test -n "$FOLDER"; then 85 PATH_TMP="$FOLDER" 86 else 87 PATH_TMP="`cd \`dirname $FILE\`; pwd`/.vbox_modules" 88 FILE_OUT="`cd \`dirname $FILE\`; pwd`/`basename $FILE`" 89 fi 44 90 PATH_OUT=$PATH_TMP 45 FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"46 91 PATH_ROOT="`cd ${MY_DIR}/../../../..; pwd`" 47 92 PATH_LOG=/tmp/vbox-export-host.log … … 64 109 65 110 # Temporary path for creating the modules, will be removed later 111 rm -rf "$PATH_TMP" 66 112 mkdir $PATH_TMP || exit 1 67 113 … … 160 206 rm $PATH_TMP/product-generated.h 161 207 208 # If we are exporting to a folder then stop now. 209 test -n "SFOLDER" && exit 0 210 162 211 # Do a test build 163 212 echo Doing a test build, this may take a while.
Note:
See TracChangeset
for help on using the changeset viewer.