From 7fcb98754581d6195ba58a49595a5dfedb60ce49 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Oct 2010 14:56:43 -0700 Subject: Change syntax for console config Use: system console device ttyS1 speed 115200 To allow top level node to be one transaction with one update --- scripts/system/vyatta_update_console.pl | 2 +- templates/system/console/device/node.def | 6 ++++++ templates/system/console/device/node.tag/speed/node.def | 6 ++++++ templates/system/console/node.def | 5 +---- templates/system/console/node.tag/speed/node.def | 6 ------ 5 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 templates/system/console/device/node.def create mode 100644 templates/system/console/device/node.tag/speed/node.def delete mode 100644 templates/system/console/node.tag/speed/node.def diff --git a/scripts/system/vyatta_update_console.pl b/scripts/system/vyatta_update_console.pl index a6c08916..fabfc242 100644 --- a/scripts/system/vyatta_update_console.pl +++ b/scripts/system/vyatta_update_console.pl @@ -42,7 +42,7 @@ sub update_inittab { close $inittab; my $config = new Vyatta::Config; - $config->setLevel("system console"); + $config->setLevel("system console device"); my $id = 0; foreach my $tty ($config->listNodes()) { diff --git a/templates/system/console/device/node.def b/templates/system/console/device/node.def new file mode 100644 index 00000000..76ce02bc --- /dev/null +++ b/templates/system/console/device/node.def @@ -0,0 +1,6 @@ +tag: +type: txt +help: Serial console device name +val_help: ; Serial device name +syntax:expression: pattern $VAR(@) "^tty[A-Z0-9]+$" \ + ; "console $VAR(@): not a valid tty name" diff --git a/templates/system/console/device/node.tag/speed/node.def b/templates/system/console/device/node.tag/speed/node.def new file mode 100644 index 00000000..637f12c7 --- /dev/null +++ b/templates/system/console/device/node.tag/speed/node.def @@ -0,0 +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" +val_help: u32: 1200-115200: Baud rate for console port diff --git a/templates/system/console/node.def b/templates/system/console/node.def index b3c11f2a..992cf4e5 100644 --- a/templates/system/console/node.def +++ b/templates/system/console/node.def @@ -1,6 +1,3 @@ -tag: -type: txt +priority: 100 help: Serial console configuration -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 deleted file mode 100644 index 637f12c7..00000000 --- a/templates/system/console/node.tag/speed/node.def +++ /dev/null @@ -1,6 +0,0 @@ -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" -val_help: u32: 1200-115200: Baud rate for console port -- cgit v1.2.3