# HG changeset patch # User Christopher Rogers # Date 1298510990 0 # Node ID b788a1c8e19d83864574f3423ae5faab6c800093 # Parent d9b5be1f9ad34be02c63319246e1a09d9e0f6880 Add /var/www/mirror-info/mirror from mirror-tools stuff. diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/favicon.ico Binary file mirror-tools/var/www/slitaz/mirror/css/favicon.ico has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/Directory Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/Directory has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/application_octet-stream Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/application_octet-stream has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_fd Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_fd has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_iso Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_iso has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_md5 Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_md5 has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_tar.gz Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_tar.gz has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_tazpkg Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/file_tazpkg has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/mime/text_plain Binary file mirror-tools/var/www/slitaz/mirror/css/pics/mime/text_plain has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/website/header-img.png Binary file mirror-tools/var/www/slitaz/mirror/css/pics/website/header-img.png has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/website/logo.png Binary file mirror-tools/var/www/slitaz/mirror/css/pics/website/logo.png has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/website/network.png Binary file mirror-tools/var/www/slitaz/mirror/css/pics/website/network.png has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/website/users.png Binary file mirror-tools/var/www/slitaz/mirror/css/pics/website/users.png has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/pics/website/xhtml10.png Binary file mirror-tools/var/www/slitaz/mirror/css/pics/website/xhtml10.png has changed diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/css/slitaz.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/css/slitaz.css Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,587 @@ +/* + CSS style for SliTaz GNU/Linux website + www.slitaz.org - (c) 2011 Pankso +*/ + +html { + min-height: 102%; +} + +body { + background: #ffffff; + color: black; + font: 13px sans-serif, vernada, arial; + margin: 0; + border-top: 34px solid #f1f1f1; +} + +/* Accessibility */ + +#access { + position: absolute; + top: 4px; + right: 0px; + text-align: right; + width: auto; + margin: 0; + padding: 4px 4px 4px 20px; + font-size: 11px; + font-weight: bold; +} + +#access a { + background: transparent; + color: #0F314E; + text-decoration: none; +} + +#access a:hover { + background: inherit; + color: #b64b22; +} + +#access img { + vertical-align: middle; +} + +/* Header and title */ + +#header { + /*background: #f0ba08 url(pics/website/header.png) repeat-x top;*/ + background: #351a0a url(pics/website/header-img.png) no-repeat top right; + color: black; + width: 100%; + height: 42px; + border-top: 1px solid black; + border-bottom: 1px solid #999; + margin-bottom: 33px; +} + +#titre { + position: absolute; + font-size: 14px; + font-weight: bolder ; + left: 180px; + top: 4px; +} + +#logo { + position: absolute; + float: left; + left: 16px; + top: -10px; + width: 200px; + height: 74px; +} + +/* Side bar Navigation */ + +#nav { + position: absolute; + top: 102px; + right: 80px; + color: #555555; + float: right; + width: 250px; + line-height: 1.5em; + text-align: left; + font-size: 12px; +} + +#nav .nav_box ul { + list-style-type: none; + margin: 0; + padding: 10px 24px 10px 0px; + background-color: inherit; +} + +#nav li { + display: inline; +} + +#nav h4 { + font-size: 120%; + color: #666666; + font-weight: bold; + margin: 0; + padding: 0 0 1px 0; + border-bottom: 1px solid #cecece; +} + +#nav a { + color: #0F314E; + background: inherit; + display: block; + text-decoration: none; + font-weight: bold; +} + +#nav a:hover { + color: #b64b22; + text-decoration: none; + display: block; +} + +#nav ul { + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + list-style-type: none; + margin: 10px 0; + padding: 10px 24px 10px 24px; + background-color: #eaeaea; +} + +.nav_box { + margin: 10px 0; + padding: 10px 24px 10px 24px; + background-color: #eaeaea; + text-align: justify; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + -moz-box-shadow: 0 1px 3px #666; + -webkit-box-shadow: 0 1px 3px #666; + box-shadow: 0 1px 3px #666; + /* CSS3 transition */ + -webkit-transition-property: background-color; + -webkit-transition-duration: 2s; + -moz-transition-property: background-color; + -moz-transition-duration: 2s; + transition-property: background-color; + transition-duration: 2s; +} + +.nav_box:hover { background-color: #f8f8f8; } + +#nav .nav_box p { + line-height: 1.3em; +} + +#nav .nav_box p a { + display: inline; + font-weight: normal; + text-decoration: underline; +} + +#nav .nav_box p a:hover { + text-decoration: none; + color: blue; + background: inherit; +} + +/* Page content */ + +#content { + background: white; + color: black; + text-align: justify; + height: auto; + margin: 6px 320px 0px 0px; + padding: 0px 40px 60px 80px; +} + +#content-full { + background: white; + color: black; + text-align: justify; + height: auto; + margin: 0; + padding: 0px 80px 40px 80px; +} + +#content li, #content-full li { + line-height: 1.5em; + text-align: left; +} + +#news li { + list-style-type: square; + border-bottom: 1px dotted #BEBEBE; + margin-left: -25px; + padding: 4px 0px 4px 0px; +} + +#news a { + text-decoration: none; +} + +#gallery { + text-align: center; +} + +/* Box and block. */ + +.infobox { + margin: 20px 60px; + padding: 12px; + background: #f8f8f8; +} + +.infobox img { vertical-align: middle; } +/* .infobox:hover { background-color: #f2b21d; } */ +.infobox:hover { background-color: #FBFBFB; } + +.block { + /*padding-bottom: 35%;*/ + color: black; + min-height: 200px; + margin-bottom: 40px; +} + +.block ul { + list-style-type: none; + margin: 0; + padding: 0 20px; +} + +.block_left { + width: 46%; + float: left; + background-color: #eaeaea; + margin: 4px 2px; + padding: 0 10px 10px 10px; +} + +.block_right { + width: 46%; + float: right; + background-color: #eaeaea; + margin: 4px 2px; + padding: 0 10px 10px 10px; +} + +#block_top { + color: black; + background-color: #eaeaea; + min-height: 180px; + margin-bottom: 40px; + margin-right: 340px; + padding: 0 10px; +} + +#block_nav { + width: 300px; + min-height: 180px; + float: right; + background-color: #eaeaea; + margin: 0; + padding: 0 10px; +} + +.infobox, .block_left, .block_right, #block_top, #block_nav, #footer { + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + -moz-box-shadow: 0 1px 3px #666; + -webkit-box-shadow: 0 1px 3px #666; + box-shadow: 0 1px 3px #666; + /* CSS3 transition */ + -webkit-transition-property: background-color; + -webkit-transition-duration: 2s; + -moz-transition-property: background-color; + -moz-transition-duration: 2s; + transition-property: background-color; + transition-duration: 2s; +} + +#block_nav { + font-weight: bold; +} + +#block_nav a { + text-decoration: none; +} + +#block_nav li a:hover { + color: #b64b22; +} + +#block_nav ul { + margin: 0; + list-style-type: none; +} + +#block_nav h3 { + font-size: 110%; +} + +.block_left:hover, .block_right:hover, #block_top:hover, +#block_nav:hover, #footer:hover { + background-color: #f8f8f8; +} + +.right_box { + width: 50%; + float: right; +} + +.floor { + color: #999999; + font-size: 20px; + -webkit-transform: rotate(-45deg) skew(15deg, 15deg); + -moz-transform: rotate(-45deg) skew(15deg, 15deg); + -o-transform: rotate(-45deg) skew(15deg, 15deg); + -ms-transform: rotate(-45deg) skew(15deg, 15deg); + transform: rotate(-45deg) skew(15deg, 15deg); +} + +/* Button */ + +.button { margin-left: 20px; } + +.button a { + background-color: #b64b22; + color: #ffffff; + margin-right: 6px; + padding: 6px 10px; + font-size: 14px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 0 1px 3px #666; + -webkit-box-shadow: 0 1px 3px #666; + box-shadow: 0 1px 3px #666; +} + +.button a:hover, input[type=submit]:hover { + background-color: #a3431f; + color: #ffffff; +} + +input[type=submit] { + border: 1px solid #b64b22; + background-color: #b64b22; + color: white; + font-weight: bold; + cursor: pointer; + padding: 2px 10px; + font-size: 14px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: 0 0 5px #666; + -webkit-box-shadow: 0 0 5px#666; + box-shadow: 0 0 5px #666; +} + +input[type=text] { + border: 1px solid #333333; + padding: 3px; + width: 100%; + max-width: 500px; +} + +/* Clouds */ + +#cloud { + padding: 10px 0px; + line-height: 3em; + text-align: center; +} +#cloud a { padding: 0 2px; color: #956411; } +#cloud a.tag1 { font-size: 0.7em; font-weight: 100; } +#cloud a.tag2 { font-size: 0.8em; font-weight: 200; } +#cloud a.tag3 { font-size: 0.9em; font-weight: 300; } +#cloud a.tag4 { font-size: 1.0em; font-weight: 400; } +#cloud a.tag5 { font-size: 1.2em; font-weight: 500; } +#cloud a.tag6 { font-size: 1.4em; font-weight: 600; } +#cloud a.tag7 { font-size: 1.6em; font-weight: 700; } +#cloud a.tag8 { font-size: 1.8em; font-weight: 800; } +#cloud a.tag9 { font-size: 2.2em; font-weight: 900; } +#cloud a.tag10 { font-size: 2.5em; font-weight: 900; } + +/* Slideshow. */ + +#slideshow +{ + overflow: hidden; + margin: 10px auto 10px; + position: relative; + width: 260px; + height: 163px; +} + +#slideshow img +{ + border: 0; + width: 260px; + height: 163px; +} + +#twitter { + margin-top: 20px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + -moz-box-shadow: 0 1px 3px #666; + -webkit-box-shadow: 0 1px 3px #666; + box-shadow: 0 1px 3px #666; +} + +/* HTML styles */ + +h1 { + color: #444444; + background: transparent; + text-align: left; + margin: 0px 0px 4px 0px; + font-size: 150%; + font-weight: bold; + padding: 5px 0 0 10px; +} + +h2 { + color: #b64b22; + padding: 0; + margin: 20px 0 0 0; + font-size: 130%; + font-weight: bold; +} + +h3 { + font-weight: bold; + color: #666666; + background: transparent; +} + +h3 img { + vertical-align: middle; + width: 20px; + height: 20px; + padding-right: 4px; +} + +a { + text-decoration: underline; + color: #103A5E; + background: inherit; +} + +a:hover { + text-decoration: none; + color: blue; + background: inherit; +} + +code { + font-size: 12px; + color: #669900; + background: inherit; +} + +tt { + color: #15EE15; + background: inherit; +} + +img { + border: 0pt none; +} + +fieldset { + background: #E2ECf6; + color: black; + margin-top: 25px; + border: 1px solid black; +} + +legend { + border: 1px solid black; + color: #6c0023; + background: #eaeaea; + font-weight: bold; +} + +pre { + padding: 5px; + color: black; + background: #E1E0B0; +} + +pre.script { + padding: 10px; + color: black; + background: #E8E8E8; + border: 1px inset #606060; +} + +textarea { + background: #E5E5E5; + margin-top: 12px; +} + +/* Packages pages */ + +.pkg_nav { + border-top: 1px solid black; + margin-top: 10px; + padding-top: 10px; +} + +pre.package { + padding: 0px; + color: black; + background: white; +} + +p.get { + text-align: center; + padding: 10px; + color: black; + background: #F3F3F3; + border: 1px solid #DEDEDE; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} + +p.get a { + font-weight: bold; + text-decoration: none; +} + +.pkgs-search { + text-align: center; + padding: 40px 20px 80px 20px; +} + +.year:after { + /* content: "2007-2011"; */ + content: "2011"; +} + +/* Footer */ + +#footer { + margin: 0px 80px 80px 80px; + padding: 10px; + background: #eaeaea; + color: #666666; + height: 180px; + clear: both; + border-radius: 8px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -moz-box-shadow: 0 1px 3px #666; + -webkit-box-shadow: 0 1px 3px #666; + box-shadow: 0 1px 3px #666; +} +#footer a { + background: inherit; + color: #666666; +} +#footer a:hover { + background: inherit; + color: #333333; +} +#footer ul { + list-style-type: none; +} +#footer li { + padding: 2px; +} +#footer h4 { + margin: 0 20px; + font-size: 125%; +} diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/dir-generator.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/dir-generator.php Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,442 @@ + + + + + SliTaz mirror redirection + + + + + + +, + * Pascal Bellard + * Christophe Lincoln + * + * + * GNU License Agreement + * --------------------- + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * http://www.gnu.org/licenses/gpl.txt + */ + +// Get the path (cut out the query string from the request_uri) +list($path) = explode('?', $_SERVER['REQUEST_URI']); + + +// Get the path that we're supposed to show. +$path = ltrim(rawurldecode($path), '/'); + + +if(strlen($path) == 0) { + $path = "./"; +} + + +// Can't call the script directly since REQUEST_URI won't be a directory +if($_SERVER['PHP_SELF'] == '/'.$path) { + redirect(); +// die("Unable to call " . $path . " directly."); +} + + +$vpath = ($path != "./")?$path:""; +// Make sure it is valid. +if(!is_dir($path)) { +// die("" . $path . " is not a valid path."); + $path = dirname($_SERVER["SCRIPT_FILENAME"]); + list($vpath) = explode('?', $_SERVER['REQUEST_URI']); + $vpath = ltrim(rawurldecode($vpath), '/'); +} + + +// +// This function returns the file size of a specified $file. +// +function format_bytes($size, $precision=1) { + $sizes = array('Y', 'Z', 'E', 'P', 'T', 'G', 'M', 'K', ''); + $total = count($sizes); + + while($total-- && $size > 1024) $size /= 1024; + if ($sizes[$total] == '') { + $size /= 1024; + $total--; + } + return sprintf('%.'.$precision.'f', $size).$sizes[$total]; +} + + +// +// Get some variables from /etc/lighttpd/lighttpd.conf +// +$conf_lightty = file_get_contents("/etc/lighttpd/lighttpd.conf"); + +function get_conf($var,$start,$stop,$default='') { + global $conf_lightty; + + if (!preg_match('/'.$var.'/',$conf_lightty)) return $default; + $filter = '/(.*\n)*'.$var.'\s*=\s*'.$start.'(([^'.$stop.']*\n*)*)'.$stop.'(.*\n)*/'; + return preg_replace($filter,'$2',$conf_lightty); +} + +$encoding = get_conf('dir-listing.encoding','"','"','ascii'); +$external_css = get_conf('dir-listing.external-css','"','"'); + +$show_hidden_files = false; +if (get_conf('dir-listing.hide-dotfile','"','"','disable') == "disable") { + $show_hidden_files = true; +} +// get_conf('dir-listing.exclude','\(','\)'); +// get_conf('dir-listing.set-footer','"','"'); + +$mime_types = array(); +foreach (explode(',',get_conf('mimetype.assign','\(','\)')) as $item) { + $filter = '/\s*"(.*)"\s*=>\s*"(.*)".*/'; + $val = explode(',',preg_replace($filter,'$1,$2',$item)); + if (isset($val[1])) $mime_types[$val[0]] = $val[1]; +} + +// +// This function returns the mime type of $file. +// +function get_file_type($file) { + global $mime_types; + + $file = basename($file); + $default_type = "application/octet-stream"; + if (isset($mime_types[$file])) { + return $mime_types[$file]; + } + $pos = strrpos($file, "."); + if ($pos === false) { + return $default_type; + } +//FIXME .tar.gz + $ext = '.'.rtrim(substr($file, $pos+1), "~"); + if (isset($mime_types[$ext])) { + return $mime_types[$ext]; + } + return $default_type; +} + +//$slitaz_style = (dirname($_SERVER["PHP_SELF"]) == '/'); +$slitaz_style = ($_SERVER["SERVER_NAME"] == "mirror.slitaz.org"); +if ($slitaz_style) { + $fvalue = ""; + if (isset($_GET[f])) $fvalue = 'value="'.$_GET[f].'"'; + print << + + + Index of /$vpath + + + + + + + + + + + + + + +
+ + +
+ +
+

users.pngCommunity

+ +

Search

+ + +
+ +
+

About Mirror

+

Welcome to Open Source! +EOT; + if ($_SERVER["SERVER_NAME"] == "mirror.slitaz.org") print <<ADS. +EOT; + print << +

.pngMirrors: +EOT; + $mirrors = array(); + $fp = @fopen(dirname($_SERVER["SCRIPT_FILENAME"])."/mirrors","r"); + if ($fp) { + while (($line = fgets($fp)) !== false) { + $line = chop($line); + $url = parse_url($line); + if ($_SERVER["SERVER_NAME"] == $url['host']) continue; + $host = explode('.',$url['host']); + $mirrors[$host[count($host)-2].".". + $host[count($host)-1]] = $line; + } + } + fclose($fp); + foreach($mirrors as $name => $url) { + echo "$name\n"; + } + print << + +

+ +
+ +EOT; +} +else { + +// Print the heading stuff +print " + + + + Index of /" .$vpath. " +"; +if ($external_css != '') { +print " +"; +} +else { +print " +"; +} +print " + +

Index of /" . $vpath ."

+"; +} + +print "
+ +"; + + + +// Get all of the folders and files. +$folderlist = array(); +$filelist = array(); +if($handle = @opendir($path)) { + while(($item = readdir($handle)) !== false) { + if ($item == "index.php") continue; + if ($item == "dir-generator.php") continue; + if (isset($_GET['f'])) { + $filter = $_GET['f']; + if (substr($filter,0,1) != '/') + $filter = '/'.$filter.'/i'; + if (!preg_match($filter,$item)) continue; + } + if(is_dir($path.'/'.$item) and $item != '.' and $item != '..') { + $folderlist[] = array( + 'name' => $item, + 'size' => 0, + 'modtime'=> filemtime($path.'/'.$item), + 'file_type' => "Directory" + ); + } + elseif(is_file($path.'/'.$item)) { + if(!$show_hidden_files) { + if(substr($item, 0, 1) == "." or substr($item, -1) == "~") { + continue; + } + } + $filelist[] = array( + 'name'=> $item, + 'size'=> filesize($path.'/'.$item), + 'modtime'=> filemtime($path.'/'.$item), + 'file_type' => get_file_type($path.'/'.$item) + ); + } + } + closedir($handle); +} + + +if(!isset($_GET['s'])) { + $_GET['s'] = 'name'; +} + +// Figure out what to sort files by +$file_order_by = array(); +foreach ($filelist as $key=>$row) { + $file_order_by[$key] = $row[$_GET['s']]; +} + +// Figure out what to sort folders by +$folder_order_by = array(); +foreach ($folderlist as $key=>$row) { + $folder_order_by[$key] = $row[$_GET['s']]; +} + +// Order the files and folders +$sort_type = SORT_ASC; +$order = "&o=d"; +if(isset($_GET['o'])) { + $sort_type = SORT_DESC; + $order = ""; +} +array_multisort($folder_order_by, $sort_type, $folderlist); +array_multisort($file_order_by, $sort_type, $filelist); + + +// Show sort methods +print ""; + +$sort_methods = array(); +$sort_methods['name'] = "Name"; +$sort_methods['modtime'] = "Last Modified"; +$sort_methods['size'] = "Size"; +$sort_methods['file_type'] = "Type"; + +foreach($sort_methods as $key=>$item) { + if ($_GET['s'] == $key) $key = "$key$order"; + print ""; +} +print "\n\n"; + + + +// Parent directory link +if($path != "./") { + print ""; + print ""; + print ""; + print "\n"; +} + + + +// Print folder information +foreach($folderlist as $folder) { + print ""; + print ""; + print ""; + print "\n"; +} + + +// Print file information +foreach($filelist as $file) { + print ""; + print ""; + print ""; + print "\n"; +} + +// Print ending stuff +$soft = explode('/',$_SERVER["SERVER_SOFTWARE"]); +$tag = get_conf('server.tag','"','"',$soft[0].' <'.$soft[1].'>'); +print " +
$item
Parent Directory/ -  Directory
" .htmlentities($folder['name']). "/" . date('Y-M-d H:m:s', $folder['modtime']) . "-  " . $folder['file_type'] . "
" .htmlentities($file['name']). "" . date('Y-M-d H:m:s', $file['modtime']) . "" . format_bytes($file['size']) . "" . $file['file_type'] . "
+
"; +if ($slitaz_style) { ?> + + +
+ + + + + +
".$tag." + + +
+ +"; +print " + "; +?> diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/floppies/builder/bootloader --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/floppies/builder/bootloader Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,211 @@ +#!/bin/sh +# +# This script creates a floppy image set from a linux bzImage and can merge +# a cmdline and/or one or more initramfs. +# The total size can not exceed 15M because INT 15H function 87H limitations. +# +# (C) 2009 Pascal Bellard - GNU General Public License v3. + +usage() +{ +cat < /dev/null + [ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2 +} + +# write a 32 bits data +# usage: storelong offset data32 file +storelong() +{ + echo $2 | awk '{ printf "\\\\x%02X\\\\x%02X\\\\x%02X\\\\x%02X", + $1%256,($1/256)%256,($1/256/256)%256,($1/256/256/256)%256 }' | \ + xargs echo -en | \ + dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null + [ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2 +} + +# read a 32 bits data +# usage: getlong offset file +getlong() +{ + dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \ + hexdump -e '"" 1/4 "%d" "\n"' +} + +floppyset() +{ + # bzImage offsets + CylinderCount=496 + SetupSzOfs=497 + FlagsOfs=498 + SyssizeOfs=500 + VideoModeOfs=506 + RootDevOfs=508 + CodeAdrOfs=0x214 + RamfsAdrOfs=0x218 + RamfsLenOfs=0x21C + ArgPtrOfs=0x228 + + # boot+setup address + SetupBase=0x90000 + + stacktop=0x9E00 + + bs=/tmp/bs$$ + + # Get and patch boot sector + # See http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u + dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null + uudecode < /dev/null +begin-base64 644 - +/L+6nWgAkAcGF4n8McC5HQDzq1sfD6mg8X1ABlfFd3ixBvOlZWaPR3gGH8ZF ++D/6l1hB6DQBvgACA3QO6HYBWwseKAJ0LFNH6AoBXuhmAbAgzRCwCM0QTuhl +ATwIdAOIBK05NigCdPDoPgE8CnXgiHz+ieb/TBD/TBi/9AGBTRz/gMdFMACc +sBCxBUi0k4lEHLABiUQUmGaY0+BIZgMFZtPoaAAQB7+AACn4nHMCAccx21BW +6J4AXrkAgLSH/kQczRVYnXfcoRoCvxwCsQk4RBxyuJPNE+oAACCQsEYoyL7b +AejSAF3rI4D5E3IEOMF3a4D+AnIEOOZ3bGCB/QAGdCoGUlFTlrQCULEGtQTB +xQSwDyHoBJAnFEAn6IwA/s117LAgzRDitOiWAJjNE2FSUCjIdwKwAZg5+HIC +ifhQtALNE5VeWFpyoJVBjuGAxwJPdFFOdfSM4ZU4wXVFiMj+xrEBOOZ1O4j0 +/sW2AID9UHIwOi7wAXIqtQBgvt4B/kQMU+gxAFvoOAB1FlKYzRO4AQLNE1rQ +1Dpk/nXqRgjkdeVh64sWB7AxLAO0DrsHAM0QPA1088OwDejv/6wIwHX4w79s +BLFbZQINuA0BZToNdArNFnT0mM0Wju9Hw1g6AEluc2VydCBkaXNrIDEuBw0A +AA== +==== +EOT + + # Get setup + setupsz=$(getlong $SetupSzOfs $bs) + setupszb=$(( $setupsz & 255 )) + dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs + + if [ -n "$TRACKS" ]; then + [ -n "$DEBUG" ] && echo -n "--tracks " 1>&2 + n=$(getlong $CylinderCount $bs) + store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs + fi + if [ -n "$FLAGS" ]; then + [ -n "$DEBUG" ] && echo -n "--flags " 1>&2 + store16 $FlagsOfs $FLAGS $bs + fi + if [ -n "$VIDEO" ]; then + [ -n "$DEBUG" ] && echo -n "--video " 1>&2 + store16 $VideoModeOfs $VIDEO $bs + fi + if [ -n "$RDEV" ]; then + if [ "$(dirname $RDEV)" == "/dev" -a -b $RDEV ]; then + [ -n "$DEBUG" ] && echo -n "--rdev " 1>&2 + RDEV=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null) + store16 $RootDevOfs $RDEV $bs + fi + fi + + # Store cmdline after setup + if [ -n "$CMDLINE" ]; then + [ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2 + echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs + storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs + fi + + # Compute initramfs size + initrdlen=0 + for i in $( echo $INITRD | sed 's/,/ /' ); do + [ -s "$i" ] || continue + [ -n "$DEBUG" ] && echo "--initrd $i " 1>&2 + initrdlen=$(( ($initrdlen + $(stat -c %s $i) + 3) & -4 )) + done + if [ $initrdlen -ne 0 ]; then + [ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2 + storelong $RamfsAdrOfs \ + $(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs + storelong $RamfsLenOfs $initrdlen $bs + fi + + # Output boot sector + setup + cmdline + dd if=$bs 2> /dev/null + + # Output kernel code + dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null + + # Pad to next sector + Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) )) + [ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null + + # Output initramfs + padding=0 + for i in $( echo $INITRD | sed 's/,/ /' ); do + [ -s "$i" ] || continue + [ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null + dd if=$i 2> /dev/null + padding=$(( 4 - ($(stat -c %s $i) & 3) )) + [ $padding -eq 4 ] && padding=0 + done + + # Cleanup + rm -f $bs +} + +if [ "$FORMAT" == "0" ]; then # unsplitted + floppyset > $PREFIX + exit +fi +floppyset | split -b ${FORMAT}k /dev/stdin floppy$$ +i=1 +ls floppy$$* | while read file ; do + output=$PREFIX$(printf "%03d" $i) + cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null + echo $output + rm -f $file + i=$(( $i + 1 )) +done diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/floppies/builder/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/floppies/builder/index.php Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,440 @@ + + + + + SliTaz Boot Floppies redirection + + + + + + + 1) + $cmd .= " skip=".($_GET['n']-1); + } + echo `$cmd 2> /dev/null`; + exit; +} +?> + + + + SliTaz Boot Floppies + + + + + + + + + + + + + + +EOT; +} + + $size = 0; + $initrd_size = 0; + + // Upload kernel + + foreach($_FILES as $data) { + $msg="The file ".$_FILES["kernel"]['name']." "; + switch ($data["error"]) { + case UPLOAD_ERR_INI_SIZE : + error($msg."exceeds upload_max_filesize."); + break; + case UPLOAD_ERR_FORM_SIZE : + error($msg."exceeds max_post_size."); + break; + case UPLOAD_ERR_PARTIAL : + error($msg."was only partially uploaded."); + break; + case UPLOAD_ERR_NO_TMP_DIR : + error("Missing a temporary folder."); + break; + case UPLOAD_ERR_CANT_WRITE : + error("Failed to write file to disk."); + break; + } + } + if (isset($_FILES["kernel"]['tmp_name']) && + is_uploaded_file($_FILES["kernel"]['tmp_name'])) { + $tmp_dir = tempnam('','fdbuild'); + if (file_exists($tmp_dir)) unlink($tmp_dir); + mkdir($tmp_dir); + $tmp_dir .= '/'; + move_uploaded_file($_FILES["kernel"]['tmp_name'], + $tmp_dir."kernel"); + $kernel = $tmp_dir."kernel"; + $boot_version = get_long($kernel,0x206) & 255; + $size = get_long($kernel,0x1F4); // syssize paragraphs + if ($boot_version < 4) $size &= 0xFFFF; // 16 bits before 2.4 + $size = ($size + 0xFFF) & 0xFFFF000; // round up to 64K + $size <<= 4; // paragraphs -> bytes + if (get_long($kernel,0x202) != 0x53726448 || // 'HdrS' magic + (get_long($kernel,0x211) & 1 != 1)) { // bzImage flag + error("The file ".$_FILES["kernel"]['name']. + " is not a bzImage Linux kernel."); + $size = 0; + } + else if ($boot_version < 2 && $_POST['cmdline']) { // before 2.2 + unset($_POST['cmdline']); + error("This boot loader does not support Linux kernel ". + "prior 2.4.0-test3-pre3 command line.", + "Warning"); + } + $msg = "The size of the file ".$_FILES["kernel"]['name']; + } + + // Upload initrd + + if ($size && isset($_FILES["initrd"]['tmp_name']) && + is_uploaded_file($_FILES["initrd"]['tmp_name'])) { + move_uploaded_file($_FILES["initrd"]['tmp_name'], + $tmp_dir."initrd"); + $initrd_size = $_FILES["initrd"]['size']; + $size += $initrd_size; + $msg = "The total size of the files ".$_FILES["kernel"]['name']. + " and ".$_FILES["initrd"]['name']; + } + if ($initrd_size && isset($_FILES["initrd2"]['tmp_name']) && + is_uploaded_file($_FILES["initrd2"]['tmp_name'])) { + move_uploaded_file($_FILES["initrd2"]['tmp_name'], + $tmp_dir."initrd2"); + $initrd2_size = $_FILES["initrd2"]['size']; + $size += $initrd2_size; + $msg = "The total size of the files ".$_FILES["kernel"]['name']. + ", ".$_FILES["initrd"]['name']. + " and ".$_FILES["initrd2"]['name']; + } + if ($size >= 15 * 1024 * 1024) { + error($msg." exceeds 15 MB."); + $size = 0; + } + if ($size == 0) { + if (isset($tmp_dir)) + system("rm -f $tmp_dir"); + } + else { + $cmd = "./bootloader ".$tmp_dir."kernel --prefix " + . $tmp_dir."fd --format 0 --flags ".$_POST['flags'] + . " --video ".$_POST['video']; + if ($_POST['cmdline']) + $cmd .= " --cmdline '".$_POST['cmdline']."'"; + if (file_exists($_POST['rdev'])) + $cmd .= " --rdev ".$_POST['rdev']; + if ($initrd_size) + $cmd .= " --initrd ".$tmp_dir."initrd"; + if ($initrd2_size) + $cmd .= " --initrd ".$tmp_dir."initrd2"; + switch ($_POST['size']) { + case 1763328 : + case 2015232 : + case 3526656 : + case 4030464 : + $cmd .= " --tracks 82"; break; + case 1784832 : + $cmd .= " --tracks 83"; break; + } + shell_exec($cmd); + $count = 1; + if ($_POST['size'] != 0) { + $count += (filesize($tmp_dir."fd") -1) / $_POST['size']; + $padding = $_POST['size'] - + (filesize($tmp_dir."fd") % $_POST['size']); + } + } + $sizes = array( + "368640" => "360 KB", "737280" => "720 KB", + "1228800" => "1.20 MB", + "1474560" => "1.44 MB", "1638400" => "1.60 MB", + "1720320" => "1.68 MB", "1763328" => "1.72 MB", + "1784832" => "1.74 MB", "1802240" => "1.76 MB", + "1884160" => "1.84 MB", "1966080" => "1.92 MB", + "2015232" => "1.96 MB", "2949120" => "2.88 MB", + "3440640" => "3.36 MB", "3526656" => "3.44 MB", + "3932160" => "3.84 MB", "4030464" => "3.92 MB", + "0" => "no limit" + ); + +function show_size($size) +{ + global $sizes; + if ($size != 0) return " ".$sizes[$size]; +} + if (!isset($count)) { +?> + + + + + + + + + +
+
+
+
+ + +
+ +

Boot

+

Floppy image set builder

+ + +
"> + + + + + + + + + + + + + + + + + + + + + + + + + +
Linux kernel: required
Initramfs / Initrd: optional
Extra initramfs: optional
Default cmdline:/> optional
Root device:" /> +   Root flags: +   VGA mode: +
Floppy size: + +
+
+ +Note 1: $msg of files (kernel and initramfs) in memory. +

+

+Note 2: the extra initramfs may be useful to add your own configuration files. +

+EOT; + } + else { +?> + +

+You can write floppies with SliTaz bootfloppybox, +Windows rawrite or simply dd: +

+
# dd if=fd001.img of=/dev/fd0
+
+ +

+Start your computer with fd001.img. It will show the kernel version string and +the kernel cmdline line. You can edit the cmdline. Most users can just press Enter. +

+ += 2) { +?> +

+The floppy is then loaded into memory (one dot each 64k) and you will be prompted to +insert the next floppy, fd002.img. And so on. +

+ +

+The floppy set detects disk swaps and can be used without keyboard. +

+ +

+Good luck. +

+ + + +
+
+
+
+
+ + +
+

+Copyright © SliTaz - +GNU General Public License +

+ +
+ + +
+

+Valid XHTML 1.0 +

+
+ + + diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/floppies/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/floppies/index.html Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,206 @@ + + + + SliTaz Boot Floppies + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ +

Boot

+

Floppy image set

+ +

+This floppy set will boot a Slitaz stable version. You can write floppies +with SliTaz bootfloppybox, +Windows rawrite or simply dd: +

# dd if=fd001.img of=/dev/fd0
+
+ +

+If you have a CD-ROM, an USB port and an USB key or a network card, but you +can't boot these devices directly, then try +floppy-grub4dos +first. This 1.44Mb floppy provides tiny programs to boot these devices without BIOS +support and some other tools. +

+

+You can start with one of the 3 following flavors : +

    +
  • + base needs 32Mb of RAM and 5 floppies: fd001.img to fd005.img.
    + base provides the minimum slitaz distribution subset in text mode. +
  • +
  • + justx needs 96M of RAM and 11 floppies: fd001.img to fd105.img.
    + justx provides the minimum slitaz distribution subset with X11 support. +
  • +
  • + core needs 160M of RAM and 22 floppies: fd001.img to fd210.img.
    + core provides the default slitaz distribution. +
  • +
+ +Start your computer with fd001.img. It will show the kernel version string and +the kernel cmdline line. You can edit the cmdline. Most users can just press Enter. + +

+The floppy is then loaded into memory (one dot each 64k) and you will be prompted to +insert the next floppy, fd002.img. And so on up to fd005.img. +

+

+The base flavor will then start and you will be prompted to insert extra floppies +for justx and core flavors. You can bypass this by using Q and Enter. +

+

+Each floppy set detects disk swaps and can be used without a keyboard. +

+

+Good luck. +

+ + +
+
+
+
+
+ + +
+

+Copyright © SliTaz - +GNU General Public License +

+ +
+ + +
+

+Valid XHTML 1.0 +

+
+ + + diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/floppies/loram/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/floppies/loram/index.html Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,155 @@ + + + + SliTaz Boot Floppies + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ +

Boot

+

Floppy image set

+ +

+This floppy set will boot a Slitaz stable loram version. You can write floppies +with SliTaz bootfloppybox, +Windows rawrite or simply dd: +

# dd if=fd001.img of=/dev/fd0
+
+ +

+If you have a CD-ROM, an USB port and an USB key or a network card, but you +can't boot these devices directly, then try +floppy-grub4dos +first. This 1.44Mb floppy provides tiny programs to boot these devices without BIOS +support and some other tools. +

+

+You can start with one of the 3 following flavors : +

    +
  • + base needs 22Mb of RAM and 7 floppies: fd001.img to fd103.img.
    + base provides the minimum slitaz distribution subset in text mode. +
  • +
  • + justx needs 64M of RAM and 14 floppies: fd001.img to fd206.img.
    + justx provides the minimum slitaz distribution subset with X11 support. +
  • +
  • + core needs 92M of RAM and 26 floppies: fd001.img to fd311.img.
    + core provides the default slitaz distribution. +
  • +
+ +Start your computer with fd001.img. It will show the kernel version string and +the kernel cmdline line. You can edit the cmdline. Most users can just press Enter. + +

+The floppy is then loaded into memory (one dot each 64k) and you will be prompted to +insert the next floppy, fd002.img. And so on up to fd003.img. +

+

+The loram bootstrap will then start and you will be prompted to insert extra floppies +for base, justx and core flavors. You can bypass this by using Q and Enter. +

+

+Each floppy set detects disk swaps and can be used without a keyboard. +

+

+Good luck. +

+ + +
+
+
+
+
+ + +
+

+Copyright © SliTaz - +GNU General Public License +

+ +
+ + +
+

+Valid XHTML 1.0 +

+
+ + + diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/mirrors --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/mirrors Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,10 @@ +http://mirror.slitaz.org/ +http://mirror.switch.ch/ftp/mirror/slitaz/ +http://www.gtlib.gatech.edu/pub/slitaz/ +http://download.tuxfamily.org/slitaz/ +http://mirror.lupaworld.com/slitaz/ +http://slitaz.c3sl.ufpr.br/ +ftp://ftp.pina.si/slitaz/ +http://distro.ibiblio.org/pub/linux/distributions/slitaz/ +http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/ +http://slitaz.mirror.garr.it/mirrors/slitaz/ diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/pxe/defaults.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/pxe/defaults.cfg Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,17 @@ +default menu.c32 +prompt 0 + +MENU TITLE Slitaz Web boot http://www.slitaz.org/ +ALLOWOPTIONS 0 +MENU MARGIN 0 +MENU ROWS 17 +MENU COLOR BORDER 37;44 #40000000 #00000000 std +MENU COLOR TITLE 1;33;44 #c00090f0 #00000000 std +MENU COLOR SCROLLBAR 37;44 #40000000 #00000000 std + +#MENU COLOR TIMEOUT_MSG 1;33;44 #c00090f0 #00000000 std +#MENU COLOR TIMEOUT 37;40 #80ffffff #00000000 std +MENU TIMEOUTROW 25 +MENU AUTOBOOT Start cooking in # second{,s} +timeout 100 +TOTALTIMEOUT 9000 diff -r d9b5be1f9ad3 -r b788a1c8e19d mirror-tools/var/www/slitaz/mirror/pxe/mkcfg.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/var/www/slitaz/mirror/pxe/mkcfg.sh Thu Feb 24 01:29:50 2011 +0000 @@ -0,0 +1,176 @@ +#!/bin/sh + +#usage: +# copy /boot/isolinux/* +# remove *.cfg +# copy then update /boot/isolinux/isolinux.cfg core.cfg + +cd $(dirname $0) + +# Status functions. +status() +{ + local CHECK=$? + echo -en "\\033[70G[ " + if [ $CHECK = 0 ]; then + echo -en "\\033[1;33mOK" + else + echo -en "\\033[1;31mFailed" + fi + echo -e "\\033[0;39m ]" +} + +directlinks() +{ + mkdir $1/$2 + ln -s .. $1/$2/$1 + ln -s ../$2.cfg $1/$2/default + ln -s ../../pxelinux.0 $1/$2/pxelinux.0 + ln -s . $1/$2/pxelinux.cfg + [ -e $1/boot ] || ln -s ../../boot $1/boot +} +for version in cooking $(ls ../boot | grep 0$) ; do + +[ "$version" = "1.0" ] && continue +echo -n "Building $version" +for i in splash.lss isolinux.msg core.cfg ; do + [ -s $version/$i ] && continue + echo -n " $version/$i not found !" + false + status + continue 2 +done +if ! grep -q $version/splash.lss $version/isolinux.msg ; then + echo "WARNING: please update $version/isolinux.msg with $version/splash.lss" +fi +rm -f $version/*-*.cfg +( cd ../boot/$version ; ls rootfs-*.gz 2> /dev/null ) | \ +sed 's/rootfs-\(.*\).gz/\1/' | while read flavor; do + lowcased=$(echo $flavor | tr [A-Z] [a-z]) + if [ "$lowcased" != "$flavor" ]; then + echo "" + echo "Warning : renaming ../boot/$version/rootfs-$flavor.gz to ../boot/$version/rootfs-$lowcased.gz" + mv ../boot/$version/rootfs-$flavor.gz ../boot/$version/rootfs-$lowcased.gz + flavor=$lowcased + fi + [ -f $version/$flavor.cfg ] && continue + cp $version/core.cfg $version/$flavor.cfg + sed -i -e "s/core-common/$flavor-common/" \ + -e "s/^label slitaz$/say Using $flavor flavor.\nlabel slitaz/" \ + -e "s/rootfs.gz/rootfs-$flavor.gz/" $version/$flavor.cfg + directlinks $version $flavor +done +for flavor in $(cd $version ; ls *.cfg | sed 's/.cfg//') ; do + echo -n " $flavor" + cat > $version/$flavor-common.cfg < $version/$flavor-$cfg.cfg + cat >> $version/$flavor-common.cfg < /dev/null ) | \ +sed 's/rootfs-\(.*\).gz/\1/' | while read flavor; do + [ -f 1.0/$flavor.cfg ] && continue + cp 1.0/core.cfg 1.0/$flavor.cfg + sed -i -e "s/core-common/$flavor-common/" \ + -e "s/rootfs.gz/rootfs-$flavor.gz/" 1.0/$flavor.cfg + directlinks 1.0 $flavor +done +directlinks 1.0 core +for flavor in $(cd 1.0; ls *.cfg | sed 's/.cfg//') ; do + echo -n " $flavor" + cat > 1.0/$flavor-common.cfg < 1.0/$flavor-$cfg.cfg + cat >> 1.0/$flavor-common.cfg <