diff options
Diffstat (limited to 'remote/modules/vmware/module.build')
-rw-r--r-- | remote/modules/vmware/module.build | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/remote/modules/vmware/module.build b/remote/modules/vmware/module.build index e7c9a2e2..71df1432 100644 --- a/remote/modules/vmware/module.build +++ b/remote/modules/vmware/module.build @@ -21,8 +21,15 @@ fetch_source() { } build() { - local DELETE_FILES - DELETE_FILES=$(for LINE in $REQUIRED_VMWARE_DELETIONS;do echo rm -rf $LINE; done) + local DELETE_FILES=$(for LINE in $REQUIRED_VMWARE_DELETIONS;do echo "rm -rf -- $LINE"; done) + + local OFFICIAL_VERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 3 -d '-') + local BUILD_VERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 4 -d '-') + BUILD_VERSION=${BUILD_VERSION%%.*} + [ -z "$OFFICIAL_VERSION" ] && perror "Could not determine vmware version from downloaded file (expected eg. 12.0.0)" + if [ -z "$BUILD_VERSION" ] || [ "$BUILD_VERSION" -lt 10000 ]; then + perror "Could not determine vmware build number from downloaded file" + fi # prepare the build directory with the files needed during the chroot cp "${MODULE_DIR}/src/$VMWARE_BUNDLE_FILE" "${MODULE_BUILD_DIR}/$VMWARE_BUNDLE_FILE" @@ -53,7 +60,12 @@ build() { pinfo "*NOT* applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$TARGET_KERNEL_SHORT)" continue # Not suitable for our kernel fi - pinfo "Applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$TARGET_KERNEL_SHORT)" + if version_lt "$OFFICIAL_VERSION" "$MIN_VMWARE" || version_gt "$OFFICIAL_VERSION" "$MAX_VMWARE"; then + pinfo "*NOT* applying $PATCH (min=$MIN_VMWARE max=$MAX_VMWARE cmp=$OFFICIAL_VERSION)" + continue # Not suitable for our kernel + fi + pinfo "Kernel: Applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$TARGET_KERNEL_SHORT)" + pinfo "VMware: Applying $PATCH (min=$MIN_VMWARE max=$MAX_VMWARE cmp=$OFFICIAL_VERSION)" [ ! -d "${SHORT}-only" ] && tar xf "$KMOD" [ ! -d "${SHORT}-only" ] && perror "untar of $KMOD failed." cd "${SHORT}-only" || perror "Where is ${SHORT}-only?" @@ -75,7 +87,7 @@ build() { # now build modules inside the chroot chroot_run "${MODULE_BUILD_DIR}" <<-EOF vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmnet $(which gcc) "${KERNEL_HEADERS_DIR}/include" vmplayer vmnet - vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmmon $(which gcc) "${KERNEL_HEADERS_DIR}/include" vmplayer vmmon + vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmmon $(which gcc) "${KERNEL_HEADERS_DIR}/include" vmplayer vmmon EOF # cleanup unneeded files @@ -88,9 +100,6 @@ build() { # This file was formerly stored in data/opt/openslx/vmchooser/vmware/vmware.conf. mkdir -p "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/vmware/" || perror "could not mkdir "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/vmware/"." - - OFFICIALVERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 3 -d '-') - BUILD_VERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 4 -d '-') cat > "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/vmware/vmware.conf" <<-EOF # configuration file written by vmware/module.build @@ -98,9 +107,9 @@ build() { vmnet1=192.168.101.1/24 vmnet1nat=true vmnet8=192.168.102.1/24 - version=$OFFICIALVERSION - buildversion=${BUILD_VERSION%%.*} - maxhardwareversion=${OFFICIALVERSION%%.*} + vmware_version=$OFFICIAL_VERSION + vmware_build=${BUILD_VERSION} + maxhardwareversion=${OFFICIAL_VERSION%%.*} EOF } @@ -129,7 +138,6 @@ parse_patch_name() { [[ "$MAX_KERN" == /* ]] && MAX_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)__[^_]+\.patch$/\1/g') [[ "$MIN_KERN" == /* ]] && MIN_KERN= [[ "$MAX_KERN" == /* ]] && MAX_KERN= - # TODO: Parse min and max vmplayer/workstation version # vmware restriction MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)-[^_]+\.patch$/\1/g') [[ "$MIN_VMWARE" == /* ]] && MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)\.patch$/\1/g') |