You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

7 years ago
<?php
/*
Example:
http://www.neutrino-images.de/neutrino-images/get-kernel.php?boxtype=armbox&boxmodel=hd51
7 years ago
*/
$boxtype = trim($_GET["boxtype"]);
$boxtype_sc = ""; # autofilled
$boxseries = trim($_GET["boxseries"]);
$boxmodel = trim($_GET["boxmodel"]);
$kernel_prefix = "";
$image_type = "nightly";
7 years ago
# convert strings to lower case
$boxtype = strtolower($boxtype);
$boxtype_sc = strtolower($boxtype_sc);
$boxseries = strtolower($boxseries);
$boxmodel = strtolower($boxmodel);
$image_type = strtolower($image_type);
if ($boxtype == "coolstream" || $boxtype == "cst")
{
$boxtype_sc = "cst";
if ($boxmodel == "nevis")
{
$kernel_prefix = "-zImage.img";
7 years ago
}
elseif ($boxmodel == "apollo" || $boxmodel == "shiner" || $boxmodel == "kronos" || $boxmodel == "kronos_v2")
{
$kernel_prefix = "-vmlinux.ub.gz";
7 years ago
}
}
elseif ($boxtype == "armbox" || $boxtype == "arm")
{
$boxtype_sc = "arm";
$kernel_prefix = ".bin";
}
7 years ago
# release/kernel-cst-kronos-vmlinux.ub.gz
$directory = $image_type;
$kernel = $directory . "/kernel-" . $boxtype_sc . "-" . $boxmodel . $kernel_prefix;
7 years ago
if (!file_exists($kernel))
{
# send error
header('HTTP/1.0 404 Not Found');
die("<h1>404</h1>\nKernel not found.");
}
else
{
# send kernel
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($kernel) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($kernel));
7 years ago
readfile($kernel);
}
?>