Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 198587 Details for
Bug 278223
app-emulation/vmware-modules-1.0.0.24 need to check if kernel-2.6.30 has CONFIG_COMPAT_NET_DEV_OPS enabled
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
upstream patch script
vmware-6.5.2-newkernmods.sh (text/plain), 5.64 KB, created by
renato gallo
on 2009-07-20 11:45:24 UTC
(
hide
)
Description:
upstream patch script
Filename:
MIME Type:
Creator:
renato gallo
Created:
2009-07-20 11:45:24 UTC
Size:
5.64 KB
patch
obsolete
>#!/bin/sh ># VMWare 6.5.2 New Kernel Modules ># The purpose of this script is to help people install the accompanying ># patch, which corrects for bit rot in some VMware kernel modules, ># allowing them to compile and run on newer versions of the Linux kernel. ># It is only intended for VMware Workstation version 6.5.2 (but should ># be adaptable to any similar version, just change the MD5SUM variables ># below). ># Josh Lehan (krellan) 7/2009 >### TODO handle VMware Server >### TODO handle VMware Player > ># Strict error handling >set -e > ># Change these if desired >VMWAREVER="6.5.2" >MODSRCDIR="/var/tmp/portage/app-emulation/vmware-modules-1.0.0.24/work/vmware-modules-1.0.0.24" >PATCHFILE="vmware-${VMWAREVER}-newkernmods.patch" >BACKEXT=".backup-${VMWAREVER}" > ># Known good MD5SUM values for VMware Workstation 6.5.2 ># If you change these, be sure to also change VMWAREVER above >KGFILE=`mktemp -t` >cat <<-EOF >"$KGFILE" > 08894c1edd8c7c1c45846768102f3700 vmblock.tar > ce33586383ef575107fdbf198267db4b vmci.tar > c8e574ae63a2d8c84ddbd2dffc6ce212 vmmon.tar > c4d92fb78ad30950e2b8ae37e39cff44 vmnet.tar > d70497dbb937e47b978b7af0d86ab1a7 vmppuser.tar > 9e636de7e7bc1116d81492b9f91acd50 vsock.tar >EOF > ># Files contained in patch ># Note: Ignore vmppuser as it is not necessary >TARS="vmblock vmci vmmon vmnet vsock" > ># Sanity checks >OLDDIR=`pwd` >PATCHPATH="${OLDDIR}/${PATCHFILE}" >if [ ! -f "$PATCHPATH" ]; then > echo "Sorry, patch file $PATCHPATH not found." > exit 2 >fi >if [ ! -d "$MODSRCDIR" ]; then > echo "Sorry, VMware Workstation directory $MODSRCDIR not found." > exit 2 >fi >USERID=`id -u` >if [ "0" != "$USERID" ]; then > echo "Sorry, you must be root in order to run this script." > exit 2 >fi >LINUXVER=`uname -r` > >cd "$MODSRCDIR" > ># Make sure pristine tarballs exist >for TAR in $TARS >do > TARNAME="${TAR}.tar" > WORKTAR="${MODSRCDIR}/$TARNAME" > PRISTINETAR="${WORKTAR}${BACKEXT}" > if [ -f "$PRISTINETAR" ]; then > # The MD5 must match, as these are the backup files, we have no recourse if they are wrong > PRISTINEMD5=`cat "$KGFILE" | grep "$TARNAME" | awk '{ print $1 }'` > TESTMD5=`md5sum "$PRISTINETAR" | awk '{ print $1 }'` > if [ "$TESTMD5" != "$PRISTINEMD5" ]; then > echo "Sorry, backup file content does not match what was expected" > echo "for VMware Workstation $VMWAREVER $PRISTINETAR file." > echo " Your checksum: $TESTMD5" > echo "Expected checksum: $PRISTINEMD5" > exit 3 > fi > else > # Script has never been ran yet, existing tarballs installed to work location should be pristine > PRISTINEMD5=`cat "$KGFILE" | grep "$TARNAME" | awk '{ print $1 }'` > TESTMD5=`md5sum "$WORKTAR" | awk '{ print $1 }'` > if [ "$TESTMD5" != "$PRISTINEMD5" ]; then > echo "Sorry, installed file content does not match what was expected" > echo "for VMware Workstation $VMWAREVER $WORKTAR file." > echo " Your checksum: $TESTMD5" > echo "Expected checksum: $PRISTINEMD5" > exit 3 > fi > > # Back up the freshly installed tarball to pristine location > echo "Found pristine $WORKTAR" > echo "Backing it up to $PRISTINETAR" > rm -f "$PRISTINETAR" > cp -a "$WORKTAR" "$PRISTINETAR" > fi >done > ># Copy pristine tarballs to working location, and extract them >for TAR in $TARS >do > # Files must now exist, they were validated in previous step > TARNAME="${TAR}.tar" > WORKTAR="${MODSRCDIR}/$TARNAME" > PRISTINETAR="${WORKTAR}${BACKEXT}" > WORKDIR="${MODSRCDIR}/${TAR}-only" > > # Create working directories from pristine content > echo "Found backup $PRISTINETAR" > echo "Restoring it to $WORKTAR" > rm -f "$WORKTAR" > cp -a "$PRISTINETAR" "$WORKTAR" > > # Blow away remains of old directory > echo "Unpacking $WORKDIR" > rm -rf "$WORKDIR" > tar -xf "$WORKTAR" > if [ ! -d "$WORKDIR" ]; then > echo "Sorry, tarball $TARNAME did not create directory" > echo "$WORKDIR as expected." > exit 4 > fi >done > ># Test patch first, so we can exit cleanly if any error >echo "Testing patch" >if ! patch --dry-run -N -p1 < "$PATCHPATH" ; then > echo "Sorry, validation of the patch has failed." > echo "Check VMware product name: only Workstation is supported (for now)." > echo "Check VMware Workstation version: only $VMWAREVER is supported (for now)." > exit 5 >fi > ># Apply patch >echo "Applying patch!" >if ! patch -N -p1 < "$PATCHPATH" ; then > # This should never happen, as dry run must have succeeded earlier > echo "Sorry, applying the patch has failed." > exit 5 >fi > ># Repack tarballs after applying patch >for TAR in $TARS >do > # Files must now exist, they were validated in previous steps > TARNAME="${TAR}.tar" > WORKTAR="${MODSRCDIR}/$TARNAME" > WORKBASE="${TAR}-only" > > # Avoid putting absolute paths into the tarball > echo "Repacking $WORKBASE" > rm -f "$WORKTAR" > tar -cf "$WORKTAR" "$WORKBASE" >done > ># Make sure it makes >for TAR in $TARS >do > # Directories must now exist, they were validated in previous steps > TARNAME="${TAR}.tar" > WORKBASE="${TAR}-only" > > # Try "make" inside each toplevel module directory > echo "Testing compilation of $TAR module to see if it works" > if ! make -C "$WORKBASE" ; then > echo "Sorry, problem compiling the $TAR module after it was patched." > echo "Please check that Linux kernel version $LINUXVER is supported." > exit 6 > fi >done > ># Clean up build directories >for TAR in $TARS >do > # We no longer care if these directories exist or not > WORKBASE="${TAR}-only" > > # Also remove modules that get placed outside the work directories > rm -f "${TAR}.o" > rm -rf "$WORKBASE" >done > ># Clean up temporary files >rm -f "$KGFILE" > ># All appears good, remind user about next step >echo "Done!" >echo >echo "The VMware tar files in here have been changed:" >echo "$MODSRCDIR" >echo >echo "Those files have been backed up therein, with this extension:" >echo "$BACKEXT" >echo >echo "This command should work now, to install the modules:" >echo "vmware-modconfig --console --install-all" >echo > >exit 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 278223
: 198587 |
198589