Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 46.35 KB | None | 0 0
  1. #! /bin/sh
  2. CRCsum=135947311
  3. MD5=16b6c939e15c2d201daa5decc95c7cb1
  4. skip=1146
  5. skip_decompress=1104
  6. size_decompress=42
  7. label="NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.35"
  8. version_string=346.35
  9. pkg_version=0
  10. script=./nvidia-installer
  11. targetdir=NVIDIA-Linux-x86_64-346.35
  12. scriptargs=""
  13. keep=n
  14. add_this_kernel=n
  15. apply_patch=n
  16. TMPROOT=${TMPDIR:=/tmp}
  17. TARGET_OS="Linux"
  18. TARGET_ARCH="x86_64"
  19.  
  20. #
  21. # NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.35
  22. # Generated by Makeself 1.6.0-nv2
  23. # Do not edit by hand.
  24.  
  25. # NVIDIA Driver Installation .run file
  26. #
  27. # If you were trying to download this file through a web browser, and
  28. # instead are seeing this, please click your browser's back button,
  29. # left click on the link, and select "Save as..." (or do whatever is
  30. # appropriate for your web browser to download a file, rather than view
  31. # it).
  32.  
  33. # print usage information
  34.  
  35. if [ "$1" = "-help" -o "$1" = "--help" -o "$1" = "-h" ]; then
  36.     echo ""
  37.     echo "$0 [options]"
  38.     echo ""
  39.     echo "This program will install the NVIDIA Accelerated Graphics Driver for"
  40.     echo "Linux-x86_64 346.35 by unpacking the embedded tarball and executing"
  41.     echo "the ./nvidia-installer  installation utility."
  42.     echo ""
  43.     echo "Below are the most common options; for a complete list use"
  44.     echo "'--advanced-options'."
  45.     echo ""
  46.     echo "--info"
  47.     echo "  Print embedded info (title, default target directory) and exit."
  48.     echo ""
  49.     echo "--check"
  50.     echo "  Check integrity of the archive and exit."
  51.     echo ""
  52.     echo "-x, --extract-only"
  53.     echo "  Extract the contents of $0, but do not"
  54.     echo "  run 'nvidia-installer'."
  55.     echo ""
  56.     echo ""
  57.     echo "The following arguments will be passed on to the ./nvidia-installer"
  58.     echo "utility:"
  59.     echo ""
  60.     echo "  -a, --accept-license"
  61.     echo "      Bypass the display and prompting for acceptance of the"
  62.     echo "      NVIDIA Software License Agreement.  By passing this option"
  63.     echo "      to nvidia-installer, you indicate that you have read and"
  64.     echo "      accept the License Agreement contained in the file"
  65.     echo "      'LICENSE' (in the top level directory of the driver"
  66.     echo "      package)."
  67.     echo ""
  68.     echo "  --update"
  69.     echo "      Connect to the NVIDIA FTP server '"
  70.     echo "      ftp://download.nvidia.com ' and determine the latest"
  71.     echo "      available driver version.  If there is a more recent driver"
  72.     echo "      available, automatically download and install it.  Any"
  73.     echo "      other options given on the commandline will be passed on to"
  74.     echo "      the downloaded driver package when installing it."
  75.     echo ""
  76.     echo "  -v, --version"
  77.     echo "      Print the nvidia-installer version and exit."
  78.     echo ""
  79.     echo "  -h, --help"
  80.     echo "      Print usage information for the common commandline options"
  81.     echo "      and exit."
  82.     echo ""
  83.     echo "  -A, --advanced-options"
  84.     echo "      Print usage information for the common commandline options"
  85.     echo "      as well as the advanced options, and then exit."
  86.     echo ""
  87.     echo ""
  88.     exit 0;
  89. fi
  90.  
  91. if [ "$1" = "-A" -o "$1" = "--advanced-options" ]; then
  92.     echo ""
  93.     echo "$0 [options]"
  94.     echo ""
  95.     echo "This program will install the NVIDIA Accelerated Graphics Driver for"
  96.     echo "Linux-x86_64 346.35 by unpacking the embedded tarball and executing"
  97.     echo "the ./nvidia-installer  installation utility."
  98.     echo ""
  99.     echo "--info"
  100.     echo "  Print embedded info (title, default target directory) and exit."
  101.     echo ""
  102.     echo "--lsm"
  103.     echo "  Print embedded lsm entry (or no LSM) and exit."
  104.     echo ""
  105.     echo "--pkg-history"
  106.     echo "  Print the package history of this file and exit."
  107.     echo ""
  108.     echo "--list"
  109.     echo "  Print the list of files in the archive and exit."
  110.     echo ""
  111.     echo "--check"
  112.     echo "  Check integrity of the archive and exit."
  113.     echo ""
  114.     echo "-x, --extract-only"
  115.     echo "  Extract the contents of $0, but do not"
  116.     echo "  run 'nvidia-installer'."
  117.     echo ""
  118.     echo "--add-this-kernel"
  119.     echo "  Build a precompiled kernel interface for the currently running"
  120.     echo "  kernel and repackage the .run file to include this newly built"
  121.     echo "  precompiled kernel interface.  The new .run file will be placed"
  122.     echo "  in the current directory and the string \"-custom\" appended"
  123.     echo "  to its name, unless already present, to distinguish it from the"
  124.     echo "  original .run file."
  125.     echo ""
  126.     echo "--apply-patch [Patch]"
  127.     echo "  Apply the patch 'Patch' to the kernel interface files included"
  128.     echo "  in the .run file, remove any precompiled kernel interfaces"
  129.     echo "  and then repackage the .run file.  The new .run file will be"
  130.     echo "  placed in the current directory and the string \"-custom\""
  131.     echo "  appended to its name, unless already present, to distinguish it"
  132.     echo "  from the original .run file."
  133.     echo ""
  134.     echo "--keep"
  135.     echo "  Do not delete target directory when done."
  136.     echo ""
  137.     echo "--target [NewDirectory]"
  138.     echo "  Extract contents in 'NewDirectory'"
  139.     echo ""
  140.     echo "--extract-decompress"
  141.     echo "  Extract the embedded decompression program to stdout"
  142.     echo ""
  143.     echo ""
  144.     echo "The following arguments will be passed on to the ./nvidia-installer"
  145.     echo "utility:"
  146.     echo ""
  147.     echo "COMMON OPTIONS:"
  148.     echo ""
  149.     echo "  -a, --accept-license"
  150.     echo "      Bypass the display and prompting for acceptance of the"
  151.     echo "      NVIDIA Software License Agreement.  By passing this option"
  152.     echo "      to nvidia-installer, you indicate that you have read and"
  153.     echo "      accept the License Agreement contained in the file"
  154.     echo "      'LICENSE' (in the top level directory of the driver"
  155.     echo "      package)."
  156.     echo ""
  157.     echo "  --update"
  158.     echo "      Connect to the NVIDIA FTP server '"
  159.     echo "      ftp://download.nvidia.com ' and determine the latest"
  160.     echo "      available driver version.  If there is a more recent driver"
  161.     echo "      available, automatically download and install it.  Any"
  162.     echo "      other options given on the commandline will be passed on to"
  163.     echo "      the downloaded driver package when installing it."
  164.     echo ""
  165.     echo "  -v, --version"
  166.     echo "      Print the nvidia-installer version and exit."
  167.     echo ""
  168.     echo "  -h, --help"
  169.     echo "      Print usage information for the common commandline options"
  170.     echo "      and exit."
  171.     echo ""
  172.     echo "  -A, --advanced-options"
  173.     echo "      Print usage information for the common commandline options"
  174.     echo "      as well as the advanced options, and then exit."
  175.     echo ""
  176.     echo ""
  177.     echo "ADVANCED OPTIONS:"
  178.     echo ""
  179.     echo "  -a, --accept-license"
  180.     echo "      Bypass the display and prompting for acceptance of the"
  181.     echo "      NVIDIA Software License Agreement.  By passing this option"
  182.     echo "      to nvidia-installer, you indicate that you have read and"
  183.     echo "      accept the License Agreement contained in the file"
  184.     echo "      'LICENSE' (in the top level directory of the driver"
  185.     echo "      package)."
  186.     echo ""
  187.     echo "  --update"
  188.     echo "      Connect to the NVIDIA FTP server '"
  189.     echo "      ftp://download.nvidia.com ' and determine the latest"
  190.     echo "      available driver version.  If there is a more recent driver"
  191.     echo "      available, automatically download and install it.  Any"
  192.     echo "      other options given on the commandline will be passed on to"
  193.     echo "      the downloaded driver package when installing it."
  194.     echo ""
  195.     echo "  -v, --version"
  196.     echo "      Print the nvidia-installer version and exit."
  197.     echo ""
  198.     echo "  -h, --help"
  199.     echo "      Print usage information for the common commandline options"
  200.     echo "      and exit."
  201.     echo ""
  202.     echo "  -A, --advanced-options"
  203.     echo "      Print usage information for the common commandline options"
  204.     echo "      as well as the advanced options, and then exit."
  205.     echo ""
  206.     echo "  -i, --driver-info"
  207.     echo "      Print information about the currently installed NVIDIA"
  208.     echo "      driver version."
  209.     echo ""
  210.     echo "  --uninstall"
  211.     echo "      Uninstall the currently installed NVIDIA driver."
  212.     echo ""
  213.     echo "  --skip-module-unload"
  214.     echo "      When uninstalling the driver, skip unloading of the NVIDIA"
  215.     echo "      kernel module. This option is ignored when the driver is"
  216.     echo "      being installed."
  217.     echo ""
  218.     echo "  --sanity"
  219.     echo "      Perform basic sanity tests on an existing NVIDIA driver"
  220.     echo "      installation."
  221.     echo ""
  222.     echo "  -e, --expert"
  223.     echo "      Enable 'expert' installation mode; more detailed questions"
  224.     echo "      will be asked, and more verbose output will be printed;"
  225.     echo "      intended for expert users.  The questions may be suppressed"
  226.     echo "      with the '--no-questions' commandline option."
  227.     echo ""
  228.     echo "  -q, --no-questions"
  229.     echo "      Do not ask any questions; the default (normally 'yes') is"
  230.     echo "      assumed for all yes/no questions, and the default string is"
  231.     echo "      assumed in any situation where the user is prompted for"
  232.     echo "      string input.  The one question that is not bypassed by"
  233.     echo "      this option is license acceptance; the license may be"
  234.     echo "      accepted with the commandline option '--accept-license'."
  235.     echo ""
  236.     echo "  -s, --silent"
  237.     echo "      Run silently; no questions are asked and no output is"
  238.     echo "      printed, except for error messages to stderr.  This option"
  239.     echo "      implies '--ui=none --no-questions --accept-license'."
  240.     echo ""
  241.     echo "  --x-prefix=X-PREFIX"
  242.     echo "      The prefix under which the X components of the NVIDIA"
  243.     echo "      driver will be installed; the default is '/usr/X11R6'"
  244.     echo "      unless nvidia-installer detects that X.Org >= 7.0 is"
  245.     echo "      installed, in which case the default is '/usr'.  Only under"
  246.     echo "      rare circumstances should this option be used."
  247.     echo ""
  248.     echo "  --xfree86-prefix=XFREE86-PREFIX"
  249.     echo "      This is a deprecated synonym for --x-prefix."
  250.     echo ""
  251.     echo "  --x-module-path=X-MODULE-PATH"
  252.     echo "      The path under which the NVIDIA X server modules will be"
  253.     echo "      installed.  If this option is not specified,"
  254.     echo "      nvidia-installer uses the following search order and"
  255.     echo "      selects the first valid directory it finds: 1) \`X"
  256.    echo "      -showDefaultModulePath\`, 2) \`pkg-config"
  257.    echo "      --variable=moduledir xorg-server\`, or 3) the X library path"
  258.     echo "      (see the '--x-library-path' option) plus either 'modules'"
  259.     echo "      (for X servers older than X.Org 7.0) or 'xorg/modules' (for"
  260.     echo "      X.Org 7.0 or later)."
  261.     echo ""
  262.     echo "  --x-library-path=X-LIBRARY-PATH"
  263.     echo "      The path under which the NVIDIA X libraries will be"
  264.     echo "      installed.  If this option is not specified,"
  265.     echo "      nvidia-installer uses the following search order and"
  266.     echo "      selects the first valid directory it finds: 1) \`X"
  267.    echo "      -showDefaultLibPath\`, 2) \`pkg-config --variable=libdir"
  268.    echo "      xorg-server\`, or 3) the X prefix (see the '--x-prefix'"
  269.     echo "      option) plus 'lib' on 32bit systems, and either 'lib64' or"
  270.     echo "      'lib' on 64bit systems, depending on the installed Linux"
  271.     echo "      distribution."
  272.     echo ""
  273.     echo "  --x-sysconfig-path=X-SYSCONFIG-PATH"
  274.     echo "      The path under which X system configuration files will be"
  275.     echo "      installed.  If this option is not specified,"
  276.     echo "      nvidia-installer uses the following search order and"
  277.     echo "      selects the first valid directory it finds: 1) \`pkg-config"
  278.    echo "      --variable=sysconfigdir xorg-server\`, or 2)"
  279.     echo "      /usr/share/X11/xorg.conf.d."
  280.     echo ""
  281.     echo "  --opengl-prefix=OPENGL-PREFIX"
  282.     echo "      The prefix under which the OpenGL components of the NVIDIA"
  283.     echo "      driver will be installed; the default is: '/usr'.  Only"
  284.     echo "      under rare circumstances should this option be used.  The"
  285.     echo "      Linux OpenGL ABI"
  286.     echo "      (http://oss.sgi.com/projects/ogl-sample/ABI/) mandates this"
  287.     echo "      default value."
  288.     echo ""
  289.     echo "  --opengl-libdir=OPENGL-LIBDIR"
  290.     echo "      The path relative to the OpenGL library installation prefix"
  291.     echo "      under which the NVIDIA OpenGL components will be installed."
  292.     echo "      The default is 'lib' on 32bit systems, and 'lib64' or 'lib'"
  293.     echo "      on 64bit systems, depending on the installed Linux"
  294.     echo "      distribution.  Only under very rare circumstances should"
  295.     echo "      this option be used."
  296.     echo ""
  297.     echo "  --installer-prefix=INSTALLER-PREFIX"
  298.     echo "      The prefix under which the installer binary will be"
  299.     echo "      installed; the default is: '/usr'.  Note: please use the"
  300.     echo "      '--utility-prefix' option instead."
  301.     echo ""
  302.     echo "  --utility-prefix=UTILITY-PREFIX"
  303.     echo "      The prefix under which the NVIDIA utilities"
  304.     echo "      (nvidia-installer, nvidia-settings, nvidia-xconfig,"
  305.     echo "      nvidia-bug-report.sh) and the NVIDIA utility libraries will"
  306.     echo "      be installed; the default is: '/usr'."
  307.     echo ""
  308.     echo "  --utility-libdir=UTILITY-LIBDIR"
  309.     echo "      The path relative to the utility installation prefix under"
  310.     echo "      which the NVIDIA utility libraries will be installed.  The"
  311.     echo "      default is 'lib' on 32bit systems, and 'lib64' or 'lib' on"
  312.     echo "      64bit systems, depending on the installed Linux"
  313.     echo "      distribution."
  314.     echo ""
  315.     echo "  --documentation-prefix=DOCUMENTATION-PREFIX"
  316.     echo "      The prefix under which the documentation files for the"
  317.     echo "      NVIDIA driver will be installed.  The default is: '/usr'."
  318.     echo ""
  319.     echo "  --application-profile-path=APPLICATION-PROFILE-PATH"
  320.     echo "      The directory under which default application profiles for"
  321.     echo "      the NVIDIA driver will be installed. The default is:"
  322.     echo "      '/usr/share/nvidia'."
  323.     echo ""
  324.     echo "  --kernel-include-path=KERNEL-INCLUDE-PATH"
  325.     echo "      The directory containing the kernel include files that"
  326.     echo "      should be used when compiling the NVIDIA kernel module. "
  327.     echo "      This option is deprecated; please use"
  328.     echo "      '--kernel-source-path' instead."
  329.     echo ""
  330.     echo "  --kernel-source-path=KERNEL-SOURCE-PATH"
  331.     echo "      The directory containing the kernel source files that"
  332.     echo "      should be used when compiling the NVIDIA kernel module. "
  333.     echo "      When not specified, the installer will use"
  334.     echo "      '/lib/modules/\`uname -r\`/build', if that directory exists. "
  335.     echo "      Otherwise, it will use '/usr/src/linux'."
  336.     echo ""
  337.     echo "  --kernel-output-path=KERNEL-OUTPUT-PATH"
  338.     echo "      The directory containing any KBUILD output files if either"
  339.     echo "      one of the 'KBUILD_OUTPUT' or 'O' parameters were passed to"
  340.     echo "      KBUILD when building the kernel image/modules.  When not"
  341.     echo "      specified, the installer will assume that no separate"
  342.     echo "      output directory was used."
  343.     echo ""
  344.     echo "  --kernel-install-path=KERNEL-INSTALL-PATH"
  345.     echo "      The directory in which the NVIDIA kernel module should be"
  346.     echo "      installed.  The default value is either"
  347.     echo "      '/lib/modules/\`uname -r\`/kernel/drivers/video' (if"
  348.     echo "      '/lib/modules/\`uname -r\`/kernel' exists) or"
  349.     echo "      '/lib/modules/\`uname -r\`/video'."
  350.     echo ""
  351.     echo "  --proc-mount-point=PROC-MOUNT-POINT"
  352.     echo "      The mount point for the proc file system; if not specified,"
  353.     echo "      then this value defaults to '/proc' (which is normally"
  354.     echo "      correct).  The mount point of the proc filesystem is needed"
  355.     echo "      because the contents of '<proc filesystem>/version' is used"
  356.     echo "      when identifying if a precompiled kernel interface is"
  357.     echo "      available for the currently running kernel.  This option"
  358.     echo "      should only be needed in very rare circumstances."
  359.     echo ""
  360.     echo "  --log-file-name=LOG-FILE-NAME"
  361.     echo "      File name of the installation log file (the default is:"
  362.     echo "      '/var/log/nvidia-installer.log')."
  363.     echo ""
  364.     echo "  --tmpdir=TMPDIR"
  365.     echo "      Use the specified directory as a temporary directory when"
  366.     echo "      downloading files from the NVIDIA ftp site; if not given,"
  367.     echo "      then the following list will be searched, and the first one"
  368.     echo "      that exists will be used: $TMPDIR, /tmp, ., $HOME."
  369.     echo ""
  370.     echo "  -m FTP-MIRROR, --ftp-mirror=FTP-MIRROR"
  371.     echo "      Use the specified FTP mirror rather than the default '"
  372.     echo "      ftp://download.nvidia.com ' when downloading driver"
  373.     echo "      updates."
  374.     echo ""
  375.     echo "  -l, --latest"
  376.     echo "      Connect to the NVIDIA FTP server '"
  377.     echo "      ftp://download.nvidia.com ' (or use the ftp mirror"
  378.     echo "      specified with the '--ftp-mirror' option) and query the"
  379.     echo "      most recent Linux-x86_64 driver version number."
  380.     echo ""
  381.     echo "  -f, --force-update"
  382.     echo "      Forces an update to proceed, even if the installer thinks"
  383.     echo "      the latest driver is already installed; this option implies"
  384.     echo "      '--update'."
  385.     echo ""
  386.     echo "  --ui=UI"
  387.     echo "      Specify what user interface to use, if available.  Valid"
  388.     echo "      values for UI are 'ncurses' (the default) or 'none'. If the"
  389.     echo "      ncurses interface fails to initialize, or 'none' is"
  390.     echo "      specified, then a simple printf/scanf interface will be"
  391.     echo "      used."
  392.     echo ""
  393.     echo "  -c, --no-ncurses-color"
  394.     echo "      Disable use of color in the ncurses user interface."
  395.     echo ""
  396.     echo "  --opengl-headers"
  397.     echo "      Normally, installation will not install NVIDIA's OpenGL"
  398.     echo "      header files; the OpenGL header files packaged by the Linux"
  399.     echo "      distribution or available from"
  400.     echo "      http://www.opengl.org/registry/ should be preferred."
  401.     echo "      However, http://www.opengl.org/registry/ does not yet"
  402.     echo "      provide a glx.h or gl.h.  Until that is resolved, NVIDIA's"
  403.     echo "      OpenGL header files can still be chosen, through this"
  404.     echo "      installer option."
  405.     echo ""
  406.     echo "  --no-nvidia-modprobe"
  407.     echo "      Skip installation of 'nvidia-modprobe', a setuid root"
  408.     echo "      utility which nvidia-installer installs by default. "
  409.     echo "      nvidia-modprobe can be used by user-space NVIDIA driver"
  410.     echo "      components to load the NVIDIA kernel module, and create the"
  411.     echo "      NVIDIA device files, when those components run without"
  412.     echo "      sufficient privileges to do so on their own, e.g., the CUDA"
  413.     echo "      driver run within the permissions of a non-privileged user."
  414.     echo "      This utility is only needed if other means of loading the"
  415.     echo "      NVIDIA kernel module and creating the NVIDIA device files"
  416.     echo "      are unavailable."
  417.     echo ""
  418.     echo "  --force-tls=FORCE-TLS"
  419.     echo "      NVIDIA's OpenGL libraries are compiled with one of two"
  420.     echo "      different thread local storage (TLS) mechanisms: 'classic"
  421.     echo "      tls' which is used on systems with glibc 2.2 or older, and"
  422.     echo "      'new tls' which is used on systems with tls-enabled glibc"
  423.     echo "      2.3 or newer.  nvidia-installer will select the OpenGL"
  424.     echo "      libraries appropriate for your system; however, you may use"
  425.     echo "      this option to force the installer to install one library"
  426.     echo "      type or another.  Valid values for FORCE-TLS are 'new' and"
  427.     echo "      'classic'."
  428.     echo ""
  429.     echo "  -k KERNEL-NAME, --kernel-name=KERNEL-NAME"
  430.     echo "      Build and install the NVIDIA kernel module for the"
  431.     echo "      non-running kernel specified by KERNEL-NAME (KERNEL-NAME"
  432.     echo "      should be the output of \`uname -r\` when the target kernel"
  433.     echo "      is actually running).  This option implies"
  434.     echo "      '--no-precompiled-interface'.  If the options"
  435.     echo "      '--kernel-install-path' and '--kernel-source-path' are not"
  436.     echo "      given, then they will be inferred from KERNEL-NAME; eg:"
  437.     echo "      '/lib/modules/KERNEL-NAME/kernel/drivers/video/' and"
  438.     echo "      '/lib/modules/KERNEL-NAME/build/', respectively."
  439.     echo ""
  440.     echo "  -n, --no-precompiled-interface"
  441.     echo "      Disable use of precompiled kernel interfaces."
  442.     echo ""
  443.     echo "  --no-abi-note"
  444.     echo "      The NVIDIA OpenGL libraries contain an OS ABI note tag,"
  445.     echo "      which identifies the minimum kernel version needed to use"
  446.     echo "      the library.  This option causes the installer to remove"
  447.     echo "      this note from the OpenGL libraries during installation."
  448.     echo ""
  449.     echo "  --no-rpms"
  450.     echo "      Normally, the installer will check for several rpms that"
  451.     echo "      conflict with the driver (specifically: NVIDIA_GLX and"
  452.     echo "      NVIDIA_kernel), and remove them if present.  This option"
  453.     echo "      disables this check."
  454.     echo ""
  455.     echo "  -b, --no-backup"
  456.     echo "      During driver installation, conflicting files are backed"
  457.     echo "      up, so that they can be restored when the driver is"
  458.     echo "      uninstalled.  This option causes the installer to simply"
  459.     echo "      delete conflicting files, rather than back them up."
  460.     echo ""
  461.     echo "  -N, --no-network"
  462.     echo "      This option instructs the installer to not attempt to"
  463.     echo "      access the network."
  464.     echo ""
  465.     echo "  --no-recursion"
  466.     echo "      Normally, nvidia-installer will recursively search for"
  467.     echo "      potentially conflicting libraries under the default OpenGL"
  468.     echo "      and X server installation locations.  With this option set,"
  469.     echo "      the installer will only search in the top-level"
  470.     echo "      directories."
  471.     echo ""
  472.     echo "  -K, --kernel-module-only"
  473.     echo "      Install a kernel module only, and do not uninstall the"
  474.     echo "      existing driver.  This is intended to be used to install"
  475.     echo "      kernel modules for additional kernels (in cases where you"
  476.     echo "      might boot between several different kernels).  To use this"
  477.     echo "      option, you must already have a driver installed, and the"
  478.     echo "      version of the installed driver must match the version of"
  479.     echo "      this kernel module."
  480.     echo ""
  481.     echo "  --no-kernel-module"
  482.     echo "      Install everything but the kernel module, and do not remove"
  483.     echo "      any existing, possibly conflicting kernel modules.  This"
  484.     echo "      can be useful in some DEBUG environments.  If you use this"
  485.     echo "      option, you must be careful to ensure that a NVIDIA kernel"
  486.     echo "      module matching this driver version is installed"
  487.     echo "      seperately."
  488.     echo ""
  489.     echo "  --no-x-check"
  490.     echo "      Do not abort the installation if nvidia-installer detects"
  491.     echo "      that an X server is running.  Only under very rare"
  492.     echo "      circumstances should this option be used."
  493.     echo ""
  494.     echo "  --precompiled-kernel-interfaces-path=PRECOMPILED-KERNEL-INTERFA"
  495.     echo "  CES-PATH"
  496.     echo "      Before searching for a precompiled kernel interface in the"
  497.     echo "      .run file, search in the specified directory."
  498.     echo ""
  499.     echo "  --precompiled-kernel-interfaces-url=PRECOMPILED-KERNEL-INTERFAC"
  500.     echo "  ES-URL"
  501.     echo "      If no precompiled kernel interfaces are found within the"
  502.     echo "      driver package or provided on the file system by the Linux"
  503.     echo "      distribution, check the specified URL for updates.  NVIDIA"
  504.     echo "      does not intend to provide updated precompiled kernel"
  505.     echo "      interfaces, but system administrators might use this for"
  506.     echo "      distributing precompiled kernel interfaces in a local area"
  507.     echo "      network."
  508.     echo ""
  509.     echo "  -z, --no-nouveau-check"
  510.     echo "      Normally, nvidia-installer aborts installation if the"
  511.     echo "      nouveau kernel driver is in use.  Use this option to"
  512.     echo "      disable this check."
  513.     echo ""
  514.     echo "  -Z, --disable-nouveau"
  515.     echo "      If the nouveau kernel module is detected by"
  516.     echo "      nvidia-installer, the installer offers to attempt to"
  517.     echo "      disable nouveau. The default action is to not attempt to"
  518.     echo "      disable nouveau; use this option to change the default"
  519.     echo "      action to attempt to disable nouveau."
  520.     echo ""
  521.     echo "  -X, --run-nvidia-xconfig"
  522.     echo "      nvidia-installer can optionally invoke the nvidia-xconfig"
  523.     echo "      utility.  This will update the system X configuration file"
  524.     echo "      so that the NVIDIA X driver is used.  The pre-existing X"
  525.     echo "      configuration file will be backed up.  At the end of"
  526.     echo "      installation, nvidia-installer will ask the user if they"
  527.     echo "      wish to run nvidia-xconfig; the default response is 'no'. "
  528.     echo "      Use this option to make the default response 'yes'.  This"
  529.     echo "      is useful with the '--no-questions' or '--silent' options,"
  530.     echo "      which assume the default values for all questions."
  531.     echo ""
  532.     echo "  --force-selinux=FORCE-SELINUX"
  533.     echo "      Linux installations using SELinux (Security-Enhanced Linux)"
  534.     echo "      require that the security type of all shared libraries be"
  535.     echo "      set to 'shlib_t' or 'textrel_shlib_t', depending on the"
  536.     echo "      distribution. nvidia-installer will detect when to set the"
  537.     echo "      security type, and set it using chcon(1) on the shared"
  538.     echo "      libraries it installs.  If the execstack(8) system utility"
  539.     echo "      is present, nvidia-installer will use it to also clear the"
  540.     echo "      executable stack flag of the libraries.  Use this option to"
  541.     echo "      override nvidia-installer's detection of when to set the"
  542.     echo "      security type.  Valid values for FORCE-SELINUX are 'yes'"
  543.     echo "      (force setting of the security type), 'no' (prevent setting"
  544.     echo "      of the security type), and 'default' (let nvidia-installer"
  545.     echo "      decide when to set the security type)."
  546.     echo ""
  547.     echo "  --selinux-chcon-type=SELINUX-CHCON-TYPE"
  548.     echo "      When SELinux support is enabled, nvidia-installer will try"
  549.     echo "      to determine which chcon argument to use by first trying"
  550.     echo "      'textrel_shlib_t', then 'texrel_shlib_t', then 'shlib_t'. "
  551.     echo "      Use this option to override this detection logic."
  552.     echo ""
  553.     echo "  --no-sigwinch-workaround"
  554.     echo "      Normally, nvidia-installer ignores the SIGWINCH signal"
  555.     echo "      before it forks to execute commands, e.g. to build the"
  556.     echo "      kernel module, and restores the SIGWINCH signal handler"
  557.     echo "      after the child process has terminated.  This option"
  558.     echo "      disables this behavior."
  559.     echo ""
  560.     echo "  --no-cc-version-check"
  561.     echo "      The NVIDIA kernel module should be compiled with the same"
  562.     echo "      compiler that was used to compile the currently running"
  563.     echo "      kernel. The layout of some Linux kernel data structures may"
  564.     echo "      be dependent on the version of gcc used to compile it. The"
  565.     echo "      Linux 2.6 kernel modules are tagged with information about"
  566.     echo "      the compiler and the Linux kernel's module loader performs"
  567.     echo "      a strict version match check. nvidia-installer checks for"
  568.     echo "      mismatches prior to building the NVIDIA kernel module and"
  569.     echo "      aborts the installation in case of failures. Use this"
  570.     echo "      option to override this check."
  571.     echo ""
  572.     echo "  --no-distro-scripts"
  573.     echo "      Normally, nvidia-installer will run scripts from"
  574.     echo "      /usr/lib/nvidia before and after installing or uninstalling"
  575.     echo "      the driver.  Use this option to disable execution of these"
  576.     echo "      scripts."
  577.     echo ""
  578.     echo "  --no-opengl-files"
  579.     echo "      Do not install any of the OpenGL-related driver files."
  580.     echo ""
  581.     echo "  --kernel-module-source-prefix=KERNEL-MODULE-SOURCE-PREFIX"
  582.     echo "      Specify a path where the source directory for the kernel"
  583.     echo "      module will be installed. Default: install source directory"
  584.     echo "      at /usr/src"
  585.     echo ""
  586.     echo "  --kernel-module-source-dir=KERNEL-MODULE-SOURCE-DIR"
  587.     echo "      Specify the name of the directory where the kernel module"
  588.     echo "      sources will be installed. Default: directory name is"
  589.     echo "      "nvidia-VERSION""
  590.     echo ""
  591.     echo "  --no-kernel-module-source"
  592.     echo "      Skip installation of the kernel module source."
  593.     echo ""
  594.     echo "  --dkms"
  595.     echo "      nvidia-installer can optionally register the NVIDIA kernel"
  596.     echo "      module sources, if installed, with DKMS, then build and"
  597.     echo "      install a kernel module using the DKMS-registered sources. "
  598.     echo "      This will allow the DKMS infrastructure to automatically"
  599.     echo "      build a new kernel module when changing kernels.  During"
  600.     echo "      installation, if DKMS is detected, nvidia-installer will"
  601.     echo "      ask the user if they wish to register the module with DKMS;"
  602.     echo "      the default response is 'no'.  Use this option to make the"
  603.     echo "      default response 'yes'.  This is useful with the"
  604.     echo "      '--no-questions' or '--silent' options, which assume the"
  605.     echo "      default values for all questions."
  606.     echo ""
  607.     echo "  --module-signing-secret-key=MODULE-SIGNING-SECRET-KEY"
  608.     echo "      Specify a path to a private key to use for signing the"
  609.     echo "      NVIDIA kernel module. The corresponding public key must"
  610.     echo "      also be provided."
  611.     echo ""
  612.     echo "  --module-signing-public-key=MODULE-SIGNING-PUBLIC-KEY"
  613.     echo "      Specify a path to a public key to use for verifying the"
  614.     echo "      signature of the NVIDIA kernel module. The corresponding"
  615.     echo "      private key must also be provided."
  616.     echo ""
  617.     echo "  --module-signing-script=MODULE-SIGNING-SCRIPT"
  618.     echo "      Specify a path to a program to use for signing the NVIDIA"
  619.     echo "      kernel module. The program will be called with the"
  620.     echo "      arguments: program-name <HASH> <PRIVATEKEY> <PUBLICKEY>"
  621.     echo "      <MODULE>; if the program returns an error status, it will"
  622.     echo "      be called again with the arguments: program-name"
  623.     echo "      <PRIVATEKEY> <PUBLICKEY> <MODULE>. Default: use the"
  624.     echo "      "sign-file" script in the kernel source directory."
  625.     echo ""
  626.     echo "  --module-signing-key-path=MODULE-SIGNING-KEY-PATH"
  627.     echo "      Specify a path where signing keys generated by"
  628.     echo "      nvidia-installer will be installed. Default: install keys"
  629.     echo "      to '/usr/share/nvidia'."
  630.     echo ""
  631.     echo "  --module-signing-hash=MODULE-SIGNING-HASH"
  632.     echo "      Specify a cryptographic hash algorithm to use for signing"
  633.     echo "      kernel modules. This requires a module signing tool that"
  634.     echo "      allows explicit selection of the hash algorithm, and the"
  635.     echo "      hash algorithm name must be recognizable by the module"
  636.     echo "      signing tool. Default: select a hash algorithm"
  637.     echo "      automatically, based on the kernel's configuration."
  638.     echo ""
  639.     echo "  --module-signing-x509-hash=MODULE-SIGNING-X509-HASH"
  640.     echo "      Specify a cryptographic hash algorithm to use for signing"
  641.     echo "      X.509 certificates generated by nvidia-installer. The hash"
  642.     echo "      algorithm name must be one of the message digest algorithms"
  643.     echo "      recognized by the x509(1) command."
  644.     echo ""
  645.     echo "  --install-vdpau-wrapper, --no-install-vdpau-wrapper"
  646.     echo "      The NVIDIA driver package includes a VDPAU wrapper library"
  647.     echo "      for convenience. By default, the wrapper library provided"
  648.     echo "      with the driver package will not be installed if an"
  649.     echo "      existing wrapper library is detected. Setting the"
  650.     echo "      '--install-vdpau-wrapper' option will force the wrapper"
  651.     echo "      library to be installed; setting the"
  652.     echo "      '--no-install-vdpau-wrapper' option will force the wrapper"
  653.     echo "      library to be excluded from the installation."
  654.     echo ""
  655.     echo "  --no-check-for-alternate-installs"
  656.     echo "      Maintainers of alternate driver installation methods can"
  657.     echo "      report the presence and/or availability of an alternate"
  658.     echo "      driver installation to nvidia-installer. Setting this"
  659.     echo "      option skips the check for alternate driver installations."
  660.     echo ""
  661.     echo "  --multiple-kernel-modules=MULTIPLE-KERNEL-MODULES"
  662.     echo "      Build and install multiple NVIDIA kernel modules. The"
  663.     echo "      maximum number of NVIDIA kernel modules that may be built"
  664.     echo "      is 8. '--multiple-kernel-modules' implies"
  665.     echo "      '--no-unified-memory'."
  666.     echo ""
  667.     echo "  --no-unified-memory"
  668.     echo "      Do not install the NVIDIA Unified Memory kernel module."
  669.     echo "      This kernel module is required for CUDA on 64-bit systems,"
  670.     echo "      and if it is not installed, the CUDA driver and CUDA"
  671.     echo "      applications will not be able to run. The"
  672.     echo "      '--no-unified-memory' option should only be used to work"
  673.     echo "      around failures to build or install the Unified Memory"
  674.     echo "      kernel module on systems that do not need to run CUDA."
  675.     echo ""
  676.     echo "  -j CONCURRENCY-LEVEL, --concurrency-level=CONCURRENCY-LEVEL"
  677.     echo "      Set the concurrency level for operations such as building"
  678.     echo "      the kernel module which may be parallelized on SMP systems."
  679.     echo "      By default, this will be set to the number of detected"
  680.     echo "      CPUs, or to '1', if nvidia-installer fails to detect the"
  681.     echo "      number of CPUs."
  682.     echo ""
  683.     echo ""
  684.     exit 0;
  685. fi
  686.  
  687. if [ "$1" = "-lsm" -o "$1" = "--lsm" ]; then
  688.     cat << EOF_LSM
  689. Begin3
  690. Title:          NVIDIA Accelerated Graphics Driver Set for Linux-x86_64
  691. Version:        346.35
  692. Description:    The NVIDIA Accelerated Graphics Driver Set for Linux-x86_64
  693.                 provides accelerated 2D and 3D support for Linux-x86_64
  694.                 using NVIDIA GPUs.
  695. Keywords:       OpenGL XFree86 NVIDIA
  696. Author:         NVIDIA Corporation Linux Development Team (linux-bugs 'at' nvidia.com)
  697. Maintained-by:  NVIDIA Corporation Linux Development Team (linux-bugs 'at' nvidia.com)
  698. Original-site:  http://www.nvidia.com
  699. Platform:       Linux
  700. Copying-policy: NVIDIA Software License
  701. End
  702. EOF_LSM
  703.     exit 0;
  704. fi
  705.  
  706. if [ "$1" = "--pkg-history" ]; then
  707.     cat << EOF_PKG_HISTORY
  708.  
  709. Package history for NVIDIA-Linux-x86_64-346.35-internal:
  710.  
  711. NVIDIA-Linux-x86_64-346.35-internal: Initial package
  712.  
  713. NVIDIA-Linux-x86_64-346.35: Added 32 bit compatibility libraries
  714.  
  715.  
  716. EOF_PKG_HISTORY
  717.     exit 0;
  718. fi
  719.  
  720. if [ "$1" = "--label" ]; then
  721.     echo "$label";
  722.     exit 0;
  723. fi
  724.  
  725. if [ "$1" = "--version-string" ]; then
  726.     echo "$version_string";
  727.     exit 0;
  728. fi
  729.  
  730. if [ "$1" = "--pkg-version" ]; then
  731.     echo "$pkg_version";
  732.     exit 0;
  733. fi
  734.  
  735. if [ "$1" = "--target-os" ]; then
  736.     echo "$TARGET_OS";
  737.     exit 0;
  738. fi
  739.  
  740. if [ "$1" = "--target-arch" ]; then
  741.     echo "$TARGET_ARCH";
  742.     exit 0;
  743. fi
  744.  
  745. if [ "$1" = "--target-directory" ]; then
  746.     echo "$targetdir";
  747.     exit 0;
  748. fi
  749.  
  750. if [ "$1" = "--script" ]; then
  751.    echo "$script $scriptargs"
  752.    exit 0
  753. fi
  754.  
  755. if [ "$1" = "--info" ]; then
  756.     echo
  757.     echo "  Identification    : $label"
  758.     echo "  Target directory  : $targetdir"
  759.     echo "  Uncompressed size : 332125 KB"
  760.     echo "  Compression       : xz"
  761.     echo "  Date of packaging : Sat Jan 10 22:23:14 PST 2015"
  762.     echo "  Application run after extraction : $script $scriptargs"
  763.     echo
  764.     if [ x"$keep" = xy ]; then
  765.         echo "  The directory $targetdir will not be removed after extraction."
  766.     else
  767.         echo "  The directory $targetdir will be removed after extraction."
  768.     fi
  769.     echo
  770.     exit 0;
  771. fi
  772.  
  773. location="`pwd`"
  774. catDecompress() {
  775.     tail -n +${skip_decompress} $0 | head -n ${size_decompress}
  776. }
  777.  
  778. if ! which "xz" > /dev/null 2>&1; then
  779.     decompressDir=`mktemp -d "$TMPDIR/makeself.XXXXXXXX" 2> /dev/null`
  780.     decompress="$decompressDir/xz"
  781.     (cd "$location"; catDecompress) > "$decompress"
  782.     chmod +x "$decompress"
  783.     PATH="$decompressDir:$PATH"
  784.     trap cleanupDecompress EXIT
  785. fi
  786.  
  787. cleanupDecompress() {
  788.     if [ -d "$decompressDir" ]; then
  789.         rm -r "$decompressDir"
  790.     fi
  791.     decompressDir=""
  792. }
  793.  
  794. if [ "$1" = "--list" ]; then
  795.     echo "Target directory: $targetdir"
  796.     tail -n +$skip $0  | xz -d | tar tvf - 2> /dev/null
  797.     exit 0;
  798. fi
  799.  
  800. if [ "$1" = "--extract-decompress" ]; then
  801.     catDecompress
  802.     exit 0
  803. fi
  804.  
  805. if [ "$1" = "--check" ]; then
  806.     sum1=`tail -n +4 $0 | cksum | awk '{print $1}'`
  807.     [ "$sum1" != "$CRCsum" ] && {
  808.         echo "Error in checksums $sum1 $CRCsum"
  809.         exit 2;
  810.     }
  811.     if [ $MD5 != "00000000000000000000000000000000" ]; then
  812.         # space separated list of directories
  813.         [ x"$GUESS_MD5_PATH" = "x" ] && GUESS_MD5_PATH="/usr/local/ssl/bin /usr/local/bin /usr/bin /bin"
  814.         MD5_PATH=""
  815.         for a in $GUESS_MD5_PATH; do
  816.             #if which $a/md5 >/dev/null 2>&1 ; then
  817.             if [ -x "$a/md5sum" ]; then
  818.                 MD5_PATH=$a;
  819.             fi
  820.         done
  821.         if [ -x $MD5_PATH/md5sum ]; then
  822.             md5sum=`tail -n +4 $0 | $MD5_PATH/md5sum | cut -b-32`;
  823.             [ $md5sum != $MD5 ] && {
  824.                 echo "Error in md5 sums $md5sum $MD5"
  825.                 exit 2
  826.             } || { echo "check sums and md5 sums are ok"; exit 0; }
  827.         fi
  828.         if [ ! -x $MD5_PATH/md5sum ]; then
  829.             echo "an embedded md5 sum of the archive exists but no md5 program was found in $GUESS_MD5_PATH"
  830.             echo "if you have md5 on your system, you should try :"
  831.             echo "env GUESS_MD5_PATH=\"FirstDirectory SecondDirectory ...\" $0 -check"
  832.         fi
  833.     else
  834.         echo "check sums are OK ; echo $0 does not contain embedded md5 sum" ;
  835.     fi
  836.     exit 0;
  837. fi
  838.  
  839. run_script=y
  840. keep=n
  841. apply_patch=n
  842.  
  843. while [ "$1" ]; do
  844.    case "$1" in
  845.        "--extract-only"|"-x")
  846.            run_script=n;
  847.            keep=y;
  848.            ;;
  849.        "--keep")
  850.            keep=y;
  851.            ;;
  852.        "--target")
  853.            if [ "$2" ]; then
  854.                targetdir="$2";
  855.                keep=y;
  856.                shift;
  857.            else
  858.                echo "ERROR: --target: no target directory specified."
  859.                exit 1;
  860.            fi
  861.            ;;
  862.        "--add-this-kernel")
  863.            add_this_kernel=y;
  864.            scriptargs="$scriptargs $1"
  865.            ;;
  866.        "--tmpdir")
  867.            scriptargs="$scriptargs $1 $2"
  868.            if [ "$2" ]; then
  869.                TMPROOT="$2";
  870.                shift;
  871.            else
  872.                echo "ERROR: --tmpdir: no temporary directory specified."
  873.                exit 1;
  874.            fi
  875.            ;;
  876.        "--apply-patch")
  877.            if [ "$2" ]; then
  878.                if [ "`dirname $2`" != "." ]; then
  879.                    patchfile="$2";
  880.                else
  881.                    patchfile="`pwd`/$2"
  882.                fi
  883.                run_script=n;
  884.                apply_patch=y;
  885.                shift;
  886.            else
  887.                echo "ERROR: --apply-patch: no patch file specified."
  888.                exit 1;
  889.            fi
  890.            ;;
  891.        *)
  892.            scriptargs="$scriptargs $1"
  893.            ;;
  894.     esac
  895.     shift
  896. done
  897.  
  898.  
  899. # Check that the tmp directory is executable
  900. # Make path absolute if not already
  901. if ! echo "$TMPROOT" | grep -q "^/"; then
  902.     TMPROOT=`pwd`/"$TMPROOT";
  903. fi
  904.  
  905. if [ ! -d "$TMPROOT" ]; then
  906.     mkdir -p "$TMPROOT" || {
  907.         echo "Unable to create temp directory $TMPROOT"
  908.         exit 1
  909.     }
  910. fi
  911.  
  912. TMPDIR="$TMPROOT"
  913. TMPFILE=`mktemp "$TMPDIR/makeself.XXXXXXXX" 2> /dev/null`
  914.  
  915. if [ "a$TMPFILE" = "a" ]; then
  916.     echo "Unable to create temporary file in $TMPDIR"
  917.     exit 1
  918. fi
  919.  
  920. chmod +x "$TMPFILE"
  921.  
  922. # Try to execute, see what happens
  923. "$TMPFILE" > /dev/null 2>&1 || {
  924.     echo "ERROR: Temporary directory $TMPDIR is not executable - use the " \
  925.          "--tmpdir option to specify a different one."
  926.     rm "$TMPFILE"
  927.     exit 1;
  928. }
  929.  
  930. rm "$TMPFILE"
  931.  
  932.  
  933. # Perform a platform check
  934.  
  935. LOCAL_OS=`uname 2> /dev/null`
  936. LOCAL_ARCH=`uname -m 2> /dev/null`
  937.  
  938. [ "$LOCAL_ARCH" = "i386" ] && LOCAL_ARCH="x86"
  939. [ "$LOCAL_ARCH" = "i486" ] && LOCAL_ARCH="x86"
  940. [ "$LOCAL_ARCH" = "i586" ] && LOCAL_ARCH="x86"
  941. [ "$LOCAL_ARCH" = "i686" ] && LOCAL_ARCH="x86"
  942.  
  943. if [ -z "$LOCAL_OS" -o -z "$LOCAL_ARCH" ]; then
  944.     echo "ERROR: missing/broken uname.  Cannot perform platform check."
  945.     exit 1;
  946. fi
  947.  
  948. if [ "$LOCAL_ARCH" != "$TARGET_ARCH" -o "$LOCAL_OS" != "$TARGET_OS" ]; then
  949.     if [ "$run_script" = "y" ]; then
  950.         echo ""
  951.         echo "ERROR: this .run file is intended for the"
  952.         echo "${TARGET_OS}-${TARGET_ARCH} platform, but you appear to be"
  953.         echo "running on ${LOCAL_OS}-${LOCAL_ARCH}.  Aborting installation."
  954.         echo ""
  955.         exit 1;
  956.     fi
  957. fi
  958.  
  959.  
  960. if [ "$keep" = "y" ]; then
  961.     echo "Creating directory $targetdir"; tmpdir=$targetdir;
  962. else
  963.     workingdir="$TMPROOT/selfgz$$"
  964.     tmpdir="$workingdir/$targetdir";
  965.     rm -rf $tmpdir
  966. fi
  967.  
  968. if [ -d "$tmpdir" -o -f "$tmpdir" ]; then
  969.     echo "The directory '$tmpdir' already exists.  Please either"
  970.     echo "move the existing directory out of the way, or specify a"
  971.     echo "different directory with the '--target' option."
  972.     exit 1
  973. fi
  974.  
  975. mkdir -p $tmpdir || {
  976.     echo "Unable to create the target directory '$tmpdir'."
  977.     exit 1
  978. }
  979.  
  980. echo=echo; [ -x /usr/ucb/echo ] && echo=/usr/ucb/echo
  981. if [ x$SETUP_NOCHECK != x1 ]; then
  982.     $echo -n "Verifying archive integrity... "
  983.     sum1=`tail -n +4 $0 | cksum | awk '{print $1}'`
  984.     [ $sum1 != $CRCsum ] && {
  985.         $echo "Error in check sums $sum1 $CRCsum"
  986.         exit 2;
  987.     }
  988.     echo "OK"
  989. fi
  990. if [ $MD5 != \"00000000000000000000000000000000\" ]; then
  991.     # space separated list of directories
  992.     [ x"$GUESS_MD5_PATH" = "x" ] && GUESS_MD5_PATH="/usr/local/ssl/bin /usr/local/bin /usr/bin /bin"
  993.     MD5_PATH=""
  994.     for a in $GUESS_MD5_PATH; do
  995.         #if which $a/md5 >/dev/null 2>&1 ; then
  996.         if [ -x "$a/md5sum" ]; then
  997.             MD5_PATH=$a;
  998.         fi
  999.     done
  1000.     if [ -x $MD5_PATH/md5sum ]; then
  1001.         md5sum=`tail -n +4 $0 | $MD5_PATH/md5sum | cut -b-32`;
  1002.         [ $md5sum != $MD5 ] && {
  1003.             $echo "Error in md5 sums $md5sum $MD5"
  1004.             exit 2;
  1005.         }
  1006.     fi
  1007. fi
  1008.  
  1009. UnTAR() {
  1010.     tar xvf - 2> /dev/null || {
  1011.         echo "Extraction failed." > /dev/tty; kill -15 $$;
  1012.     };
  1013. }
  1014.  
  1015. $echo -n "Uncompressing $label"
  1016. cd $tmpdir ; res=3
  1017.  
  1018. [ "$keep" = "y" ] || trap '$echo "Signal caught, cleaning up" > /dev/tty; cd $TMPROOT; rm -rf $tmpdir; exit 15' 1 2 15
  1019.  
  1020. if (cd "$location"; tail -n +$skip $0; ) | xz -d | UnTAR | (while read a; do $echo -n "."; done; $echo; ); then
  1021.     chown -Rf `id -u`:`id -g` .
  1022.     res=0;
  1023.     if [ "$script" -a "$run_script" = "y" ]; then
  1024.         $script $scriptargs $*; res=$?
  1025.     fi
  1026.  
  1027.     if [ "$add_this_kernel" = "y" -a "$res" = "0" ]; then
  1028.         repackage_file=y;
  1029.     fi
  1030.  
  1031.     if [ "$apply_patch" = "y" ]; then
  1032.         patch=`which patch 2> /dev/null | head -n 1`
  1033.         if [ $? -eq 0 -a "$patch" ]; then
  1034.             if [ "$keep" = "y" ]; then
  1035.                 cp -pR usr/src/nv usr/src/nv.orig
  1036.             fi
  1037.             $patch -p0 < "$patchfile"
  1038.             if [ $? -ne 0 ]; then
  1039.                 $echo "Failed to apply patch file \"$patchfile\"."
  1040.                 if [ "$keep" = "y" ]; then
  1041.                     rm -rf usr/src/nv
  1042.                     mv usr/src/nv.orig usr/src/nv
  1043.                 fi
  1044.             else
  1045.                 if [ "$keep" = "y" ]; then
  1046.                     rm -rf usr/src/nv.orig
  1047.                 fi
  1048.                 rm -rf usr/src/nv/*.orig usr/src/nv/precompiled
  1049.                 repackage_file=y
  1050.             fi
  1051.         else
  1052.             $echo "Couldn't locate the 'patch' utility."
  1053.         fi
  1054.     fi
  1055.  
  1056.     if [ "$repackage_file" = "y" ]; then
  1057.  
  1058.         cd ..
  1059.  
  1060.         new_targetdir="`basename $targetdir | sed -e \"s/-custom//\"`"
  1061.         new_targetdir="${new_targetdir}-custom"
  1062.  
  1063.         if [ "$targetdir" != "$new_targetdir" ]; then
  1064.             mv $targetdir $new_targetdir
  1065.         fi
  1066.  
  1067.         # update the pkg-history.txt file
  1068.         chmod 644 ./$new_targetdir/pkg-history.txt
  1069.  
  1070.         if [ "$add_this_kernel" = "y" ]; then
  1071.             $echo "$new_targetdir: Added precompiled kernel interface for: " >> ./$new_targetdir/pkg-history.txt
  1072.             $echo "`uname -s -r -v -m 2> /dev/null`" >> ./$new_targetdir/pkg-history.txt
  1073.         else
  1074.             $echo "$new_targetdir: Applied patch file: $patchfile" >> ./$new_targetdir/pkg-history.txt
  1075.         fi
  1076.  
  1077.         $echo "" >> ./$new_targetdir/pkg-history.txt
  1078.  
  1079.         # retrieve the lsm file
  1080.         tmplsm="$TMPDIR/nvidia.lsm.$$"
  1081.         if [ "`dirname $0`" != "." ]; then
  1082.             sh $0 --lsm > $tmplsm
  1083.         else
  1084.             sh $location/$0 --lsm > $tmplsm
  1085.         fi
  1086.  
  1087.         sh ./$new_targetdir/makeself.sh                 --lsm $tmplsm               --version-string $version_string                --pkg-version $pkg_version              --pkg-history ./$new_targetdir/pkg-history.txt              --target-os $TARGET_OS              --target-arch $TARGET_ARCH              $new_targetdir $new_targetdir.run               "$label" "$script"
  1088.  
  1089.         rm -f $tmplsm
  1090.  
  1091.         [ "$keep" = "y" ] || mv $new_targetdir.run $location
  1092.     fi
  1093.  
  1094.     [ "$keep" = "y" ] || { cd $TMPROOT; rm -rf $workingdir; }
  1095. else
  1096.     $echo "Cannot decompress $0"; exit 1
  1097. fi
  1098.  
  1099.         cleanupDecompress
  1100.  
  1101. exit $res
  1102.  
  1103. END_OF_STUB
  1104. ... binary blob goes here...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement