Skip to content
Snippets Groups Projects
  • Kamil Rytarowski's avatar
    cb77f0d6
    scripts: Switch to more portable Perl shebang · cb77f0d6
    Kamil Rytarowski authored
    
    The default NetBSD package manager is pkgsrc and it installs Perl
    along other third party programs under custom and configurable prefix.
    The default prefix for binary prebuilt packages is /usr/pkg, and the
    Perl executable lands in /usr/pkg/bin/perl.
    
    This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
    the most portable solution that should work for almost everybody.
    Perl's executable is detected automatically.
    
    This change switches -w option passed to the executable with more
    modern "use warnings;" approach. There is no functional change to the
    default behavior.
    
    While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).
    
    Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    cb77f0d6
    History
    scripts: Switch to more portable Perl shebang
    Kamil Rytarowski authored
    
    The default NetBSD package manager is pkgsrc and it installs Perl
    along other third party programs under custom and configurable prefix.
    The default prefix for binary prebuilt packages is /usr/pkg, and the
    Perl executable lands in /usr/pkg/bin/perl.
    
    This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
    the most portable solution that should work for almost everybody.
    Perl's executable is detected automatically.
    
    This change switches -w option passed to the executable with more
    modern "use warnings;" approach. There is no functional change to the
    default behavior.
    
    While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).
    
    Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
get_dvb_firmware 25.22 KiB
#!/usr/bin/env perl
#     DVB firmware extractor
#
#     (c) 2004 Andrew de Quincey
#
#     This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#
#     This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

use File::Temp qw/ tempdir /;
use IO::Handle;

@components = ( "sp8870", "sp887x", "tda10045", "tda10046",
		"tda10046lifeview", "av7110", "dec2000t", "dec2540t",
		"dec3000s", "vp7041", "vp7049", "dibusb", "nxt2002", "nxt2004",
		"or51211", "or51132_qam", "or51132_vsb", "bluebird",
		"opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
		"af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
		"lme2510c_s7395_old", "drxk", "drxk_terratec_h5",
		"drxk_hauppauge_hvr930c", "tda10071", "it9135", "drxk_pctv",
		"drxk_terratec_htc_stick", "sms1xxx_hcw", "si2165");

# Check args
syntax() if (scalar(@ARGV) != 1);
$cid = $ARGV[0];

# Do it!
for ($i=0; $i < scalar(@components); $i++) {
    if ($cid eq $components[$i]) {
	$outfile = eval($cid);
	die $@ if $@;
	print STDERR <<EOF;
Firmware(s) $outfile extracted successfully.
Now copy it(them) to either /usr/lib/hotplug/firmware or /lib/firmware
(depending on configuration of firmware hotplug).
EOF
	exit(0);
    }
}

# If we get here, it wasn't found
print STDERR "Unknown component \"$cid\"\n";
syntax();




# ---------------------------------------------------------------
# Firmware-specific extraction subroutines

sub sp8870 {
    my $sourcefile = "tt_Premium_217g.zip";
    my $url = "http://www.softwarepatch.pl/9999ccd06a4813cb827dbb0005071c71/$sourcefile";
    my $hash = "53970ec17a538945a6d8cb608a7b3899";
    my $outfile = "dvb-fe-sp8870.fw";
    my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);

    checkstandard();