diff --git a/linux-update b/linux-update index 988663a..9bfc2e8 100755 --- a/linux-update +++ b/linux-update @@ -108,8 +108,18 @@ module LinuxUpdate class Fetched attr_reader :dir - def initialize dir - @dir = Pathname.new dir + def initialize( dir) @dir = Pathname.new dir end + def config() dir + '.config' end + def <=>( other) version <=> other.version end + def info( text) STDERR.puts "[#{version}] #{text}" end + + def linux_sources? + begin + version + true + rescue Base::MakeFailed + false + end end def make *opts, &block @@ -138,17 +148,11 @@ module LinuxUpdate end end - def config - dir + '.config' - end - def configured? return @configured if @configured @configured = config.exist? end - def <=>( other) version <=> other.version end - def to_s r = "#{dir}" r += " #{version}" if @version @@ -165,7 +169,9 @@ module LinuxUpdate end end - def import_config_from_io( io) open_config('w') {|c| io.each_line {|l| c.print l } } end + def import_config_from_io io + open_config('w') {|c| io.each_line {|l| c.print l } } + end def import_config file_or_io_or_fetched info "Import config #{file_or_io_or_fetched}" @@ -194,12 +200,8 @@ module LinuxUpdate end def install - info 'make modules_install install' - make 'modules_install', 'install' - end - - def info text - STDERR.puts "[#{version}] #{text}" + info 'make firmware_install modules_install install' + make 'firmware_install', 'modules_install', 'install' end end @@ -207,6 +209,18 @@ module LinuxUpdate class Error /dev/null 2>&1 || exit 0 [ -d "${NVDSRC}" ] || exit 0 V="${1:-`uname -r`}" +SYSSRC="/lib/modules/${V}/source" echo "Build NVIDIA module..." >&2 cd "${NVDSRC}" -exec make module-install PWD="${NVDSRC}" +exec make module-install SYSSRC="${SYSSRC}" PWD="${NVDSRC}"