From cd5382ad4982731a7b7584173e9e4ee5108bc16e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Oct 2010 14:44:06 -0700 Subject: Fix serial console setup functions Problems found during basic testing of new serial console config --- scripts/system/vyatta_update_console.pl | 4 ++-- templates/system/console/node.def | 1 - templates/system/console/node.tag/speed/node.def | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/system/vyatta_update_console.pl b/scripts/system/vyatta_update_console.pl index 84cf7488..a6c08916 100644 --- a/scripts/system/vyatta_update_console.pl +++ b/scripts/system/vyatta_update_console.pl @@ -38,7 +38,7 @@ sub update_inittab { or die "Can't open $TMPTAB"; # Clone original inittab but remove all references to serial lines - print {$tmp} grep { ~ /^T/ } <$inittab>; + print {$tmp} grep { ! /^T/ } <$inittab>; close $inittab; my $config = new Vyatta::Config; @@ -49,7 +49,7 @@ sub update_inittab { my $speed = $config->returnValue("$tty speed"); $speed = 9600 unless $speed; - print {$tmp} "T$id:23:respawn:/sbin/getty $speed $tty"; + print {$tmp} "T$id:23:respawn:/sbin/getty $speed $tty\n"; ++$id; } close $tmp; diff --git a/templates/system/console/node.def b/templates/system/console/node.def index 9e946c7e..b3c11f2a 100644 --- a/templates/system/console/node.def +++ b/templates/system/console/node.def @@ -1,7 +1,6 @@ tag: type: txt help: Serial console configuration -allowed: (cd $dev; echo tty*) syntax:expression: pattern $VAR(@) "^tty[A-Z0-9]+$" \ ; "console $VAR(@): not a valid tty name" end: /opt/vyatta/sbin/vyatta_update_console.pl diff --git a/templates/system/console/node.tag/speed/node.def b/templates/system/console/node.tag/speed/node.def index cf2a0d09..637f12c7 100644 --- a/templates/system/console/node.tag/speed/node.def +++ b/templates/system/console/node.tag/speed/node.def @@ -1,6 +1,6 @@ type: u32 help: Console baud rate allowed: echo 1200 2400 4800 9600 19200 38400 57600 115200 -syntax:expression: $VAR(@) in 1200 2400 4800 9600 19200 38400 57600 115200 ; - "unknown baud rate" +syntax:expression: $VAR(@) in 1200, 2400, 4800, 9600, 19200, 38400, \ + 57600, 115200 ; "unknown baud rate" val_help: u32: 1200-115200: Baud rate for console port -- cgit v1.2.3