Projet

Général

Profil

« Précédent | Suivant » 

Révision 4887afa1

Ajouté par Renato Botelho il y a presque 10 ans

Set default serial speed to 115200 for 2.2, fixes #3715

Voir les différences:

etc/inc/pfsense-utils.inc
988 988
	else
989 989
		$boot_config = "";
990 990

  
991
	$serialspeed = (is_numeric($config['system']['serialspeed'])) ? $config['system']['serialspeed'] : "115200";
991 992
	if(($g['platform'] != "cdrom") && ($g['platform'] != "nanobsd")) {
992 993
		$boot_config_split = explode("\n", $boot_config);
993 994
		$fd = fopen($boot_config_file,"w");
......
1001 1002
				}
1002 1003
			}
1003 1004
			if(isset($config['system']['enableserial']) || $g['enableserial_force']) {
1004
				fwrite($fd, "-D");
1005
				fwrite($fd, "-S{$serialspeed} -D");
1005 1006
			}
1006 1007
			fclose($fd);
1007 1008
		}
......
1024 1025
					&& (stripos($bcs, "hw.usb.no_pf") === false))
1025 1026
					$new_boot_config[] = $bcs;
1026 1027

  
1027
			$serialspeed = (is_numeric($config['system']['serialspeed'])) ? $config['system']['serialspeed'] : "9600";
1028 1028
			if(isset($config['system']['enableserial']) || $g['enableserial_force']) {
1029 1029
				$new_boot_config[] = 'boot_multicons="YES"';
1030 1030
				$new_boot_config[] = 'boot_serial="YES"';
1031
				$new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
1032 1031
				$primaryconsole = isset($g['primaryconsole_force']) ? $g['primaryconsole_force'] : $config['system']['primaryconsole'];
1033 1032
				switch ($primaryconsole) {
1034 1033
					case "video":
......
1038 1037
					default:
1039 1038
						$new_boot_config[] = 'console="comconsole,vidconsole"';
1040 1039
				}
1041
			} elseif ($g['platform'] == "nanobsd") {
1042
				$new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
1043 1040
			}
1044

  
1041
			$new_boot_config[] = 'comconsole_speed="' . $serialspeed . '"';
1045 1042
			$new_boot_config[] = 'hw.usb.no_pf="1"';
1046 1043

  
1047 1044
			file_put_contents($loader_conf_file, implode("\n", $new_boot_config) . "\n");
usr/local/www/system_advanced_admin.php
539 539
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Terminal"); ?></td>
540 540
								<td width="78%" class="vtable">
541 541
									<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked=\"checked\""; ?> />
542
									<strong><?=gettext("Enables the first serial port with 9600/8/N/1 by default, or another speed selectable below."); ?></strong>
542
									<strong><?=gettext("Enables the first serial port with 115200/8/N/1 by default, or another speed selectable below."); ?></strong>
543 543
									<span class="vexpl"><?=gettext("Note:  This will redirect the console output and messages to the serial port. You can still access the console menu from the internal video card/keyboard. A <b>null modem</b> serial cable or adapter is required to use the serial console."); ?></span>
544 544
								</td>
545 545
							</tr>
......
548 548
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Speed")?></td>
549 549
								<td width="78%" class="vtable">
550 550
									<select name="serialspeed" id="serialspeed" class="formselect">
551
										<option value="9600"   <?php if ($pconfig['serialspeed'] == "9600")   echo "selected=\"selected\"";?>>9600</option>
552
										<option value="14400"  <?php if ($pconfig['serialspeed'] == "14400")  echo "selected=\"selected\"";?>>14400</option>
553
										<option value="19200"  <?php if ($pconfig['serialspeed'] == "19200")  echo "selected=\"selected\"";?>>19200</option>
554
										<option value="38400"  <?php if ($pconfig['serialspeed'] == "38400")  echo "selected=\"selected\"";?>>38400</option>
555
										<option value="57600"  <?php if ($pconfig['serialspeed'] == "57600")  echo "selected=\"selected\"";?>>57600</option>
556 551
										<option value="115200" <?php if ($pconfig['serialspeed'] == "115200") echo "selected=\"selected\"";?>>115200</option>
552
										<option value="57600"  <?php if ($pconfig['serialspeed'] == "57600")  echo "selected=\"selected\"";?>>57600</option>
553
										<option value="38400"  <?php if ($pconfig['serialspeed'] == "38400")  echo "selected=\"selected\"";?>>38400</option>
554
										<option value="19200"  <?php if ($pconfig['serialspeed'] == "19200")  echo "selected=\"selected\"";?>>19200</option>
555
										<option value="14400"  <?php if ($pconfig['serialspeed'] == "14400")  echo "selected=\"selected\"";?>>14400</option>
556
										<option value="9600"   <?php if ($pconfig['serialspeed'] == "9600")   echo "selected=\"selected\"";?>>9600</option>
557 557
									</select> bps
558 558
									<br /><?=gettext("Allows selection of different speeds for the serial console port."); ?>
559 559
								</td>

Formats disponibles : Unified diff