Skip to content

Add script to build NVIDIA Linux modules #97

Merged
merged 1 commit into from
Aug 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);