Skip to content

Commit

Permalink
Merge pull request #97 from mariux64/add-script-to-build-nvidia-linux…
Browse files Browse the repository at this point in the history
…-kernel-modules

Add script to build NVIDIA Linux modules
  • Loading branch information
donald authored Aug 22, 2016
2 parents 148c6b4 + 52a1120 commit 0a77bc9
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions scripts/build-nvidia.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#! /usr/local/bin/perl
use strict;
use warnings;

our $B='/src/mariux/beeroot/bee-files';

our $TEMPLATE_CURRENT = "nvidia_linux-4.6.4-93-367.18-0.bee";
our $TEMPLATE_LEGACY5 = "nvidia_legacy5-340.96-1.bee";
##our $TEMPLATE_LEGACY4 = "nvidia_legacy4-304.131-1.bee";
our $TEMPLATE_KERNEL="nvidia_linux-4.6.4-93-367.18-0.bee";

$ENV{BEE_MAKEFLAGS}='-j';
chdir ("/scratch/local") or die "/scratch/local: $!\n";


sub want_current{
my ($version,$build)=@_;
my $name="nvidia_current-$version-$build";

if (-e "$B/$name.bee") {
print "$B/$name.bee: already there\n";
return;
}

sys ('cp',"$B/$TEMPLATE_CURRENT",".");
sys ('mv',$TEMPLATE_CURRENT,"$name.bee");
sys ("./$name.bee");
}

sub want_legacy5{
my ($version,$build)=@_;
my $name="nvidia_legacy5-$version-$build";

if (-e "$B/$name.bee") {
print "$B/$name.bee: already there\n";
return;
}
sys ('cp',"$B/$TEMPLATE_LEGACY5",".");
sys ('mv',$TEMPLATE_LEGACY5,"$name.bee");
sys ("./$name.bee");
}

##sub want_legacy4 {
## my ($version,$build)=@_;
## my $name="nvidia_legacy4-$version-$build";
##
## if (-e "$B/$name.bee") {
## print "$B/$name.bee: already there\n";
## return;
## }
## sys ('cp',"$B/$TEMPLATE_LEGACY4",".");
## sys ('mv',$TEMPLATE_LEGACY4,"$name.bee");
## sys ("./$name.bee");
##}

sub want_kernel {
my ($kernel,$version,$build)=@_;
my $name="nvidia_linux-$kernel-$version-$build";
if (-e "$B/$name.bee") {
print "$B/$name.bee: already there\n";
return;
}
sys ('cp',"$B/$TEMPLATE_KERNEL",".");
sys ('mv',$TEMPLATE_KERNEL,"$name.bee");
sys ("./$name.bee");
}

sub sys {
print(join(' ',@_),"\n");
system @_ and exit 1;
}

# http://www.nvidia.com/object/unix.html

our $kernel='4.7-94';
our $current="367.35"; # latest long live branch
our $legacy5="340.96"; # 340.xx serie
##our $legacy4="304.131"; # 304.xx serie

# increase build number if you want a rebuild:

want_current($current,0);
want_legacy5($legacy5,1);
##want_legacy4($legacy4,0);
want_kernel($kernel,$current,0);
want_kernel($kernel,$legacy5,0);
##want_kernel($kernel,$legacy4,0);

0 comments on commit 0a77bc9

Please sign in to comment.