1) $cmd .= " skip=".($_GET['n']-1); } echo `$cmd 2> /dev/null`; exit; } ?> SliTaz Boot Floppies EOT; } $size = 0; $initrd_size = 0; $info_size = 0; // Upload kernel foreach($_FILES as $data) { $msg="The file ".$data['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; if (get_long($kernel,0x202) != 0x53726448) // 'HdrS' magic $boot_version = 0; $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 $msg = "The size of the file ".$_FILES["kernel"]['name']; } if ($size && isset($_FILES["info"]['tmp_name']) && is_uploaded_file($_FILES["info"]['tmp_name'])) { move_uploaded_file($_FILES["info"]['tmp_name'], $tmp_dir."info"); $info_size = $_FILES["info"]['size']; } // 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']." --mem ".$_POST['ram']; if ($_POST['edit'] == "") $cmd .= " --dont-edit-cmdline"; if ($_POST['cmdline']) $cmd .= " --cmdline '".$_POST['cmdline']."'"; if ($info_size) $cmd .= " --info ".$tmp_dir."info"; 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]; } ?>

Floppy image set builder

">
Linux kernel: required
Initramfs / Initrd: optional
Extra initramfs: optional
Boot message: optional
Default cmdline: /> edit optional
Root device: " />   Flags:   VESA:
Floppy size:   RAM used  
Note 1: $msg of files (kernel and initramfs) in memory.

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

Note 3: the keyboard is read for ESC or ENTER on every form feed (ASCII 12) in the boot message.

EOT; } else { ?>

Download image= 2) echo "s"; ?>

\n".floor($padding/1024)."KB padding.\n"; ?>

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 a keyboard.

Good luck.

Copyright © SliTaz - GNU General Public License

Valid XHTML 1.0