Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37757874
en ru br
ALT Linux repos
S:0.6.0-alt1

Group :: System/Configuration/Packaging
RPM: apt-scripts-nvidia

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

scripts-nvidia-0.1.2/000075500000000000000000000000001230307663600144555ustar00rootroot00000000000000scripts-nvidia-0.1.2/install-nvidia.conf000064400000000000000000000001501230307663600202360ustar00rootroot00000000000000Scripts::AptGet::Command:: "install-nvidia.lua";
Scripts::AptGet::Help::Command:: "install-nvidia.lua";
scripts-nvidia-0.1.2/install-nvidia.lua000075500000000000000000000044731230307663600201110ustar00rootroot00000000000000#!/usr/bin/apt-get script
-- This script will install NVIDIA driver
-- Author: Sergey V Turchin <zerg@altlinux.org>

function os.getexecout(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
return s
end

if script_slot == "Scripts::AptGet::Help::Command" then
print(_(" install-nvidia - Install NVIDIA driver"))
return
end

if command_args and command_args[1] ~= "install-nvidia" then return end
command_consume = 1

kernel_pkg_nameversion = os.getexecout("rpmquery -f --qf '%{NAME}#%{EPOCH}:%{VERSION}-%{RELEASE}' /boot/vmlinuz-`uname -r`")
pkg_kernel = pkgfind(kernel_pkg_nameversion)
if pkg_kernel == nil then
kernel_pkg_nameversion = os.getexecout("rpmquery -f --qf '%{NAME}' /boot/vmlinuz-`uname -r`")
pkg_kernel = pkgfind(kernel_pkg_nameversion)
if pkg_kernel == nil then
apterror(_("Package not found for your current kernel."))
return
end
end
-- print("Kernel " .. kernel_pkg_nameversion)
pkg_kernel_name = pkgname(pkg_kernel)
pkg_kernel_ver = pkgvercur(pkg_kernel)

pkg_kernel_prov_name = {}
pkg_kernel_prov_verstr = {}
kernel_provlist = verprovlist(pkg_kernel_ver)
for i, kprov in ipairs(kernel_provlist) do
if string.find(kprov.name, "kernel-image-", 0, true) ~= nil then
pkg_kernel_prov_name = kprov.name
pkg_kernel_prov_verstr = kprov.verstr
-- print("Kernel provide " .. kprov.name .. "#" .. kprov.verstr)
end
end

-- Find kernel-modules-nvidia package
nvidia_pkg = nil
for i, pkg in ipairs(pkglist()) do
if string.find(pkgname(pkg), "kernel-modules-nvidia-", 0, true) ~= nil then
-- print("Package " .. pkgname(pkg))
ver = pkgvercand(pkg)
if ver == nil then
ver = pkgvercur(pkg)
end
if ver ~= nil then
for i, dep in ipairs(verdeplist(ver)) do
if dep.name == pkg_kernel_prov_name and dep.verstr == pkg_kernel_prov_verstr then
-- print("Package " .. pkgname(pkg) .. " require " .. dep.name .. "#" .. dep.verstr)
markinstall(pkg)
nvidia_pkg = pkg
break
end
end
end
end
end

if nvidia_pkg ~= nil then
if statkeep(nvidia_pkg) then
print("NVIDIA driver already installed.")
print(_("Be sure you did `apt-get update`."))
else
print(pkgname(nvidia_pkg) .. " " .. statstr(nvidia_pkg))
end
else
print(_("NVIDIA driver not found for your kernel."))
print(_("Be sure you did `apt-get update`."))
end
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin