diff --git a/repos/base/xsd/base_types.xsd b/repos/base/xsd/base_types.xsd new file mode 100644 index 0000000000..7a8fa74e56 --- /dev/null +++ b/repos/base/xsd/base_types.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/repos/os/src/app/ping/config.xsd b/repos/os/src/app/ping/config.xsd index 0ceaca0640..f8c6e92b7c 100644 --- a/repos/os/src/app/ping/config.xsd +++ b/repos/os/src/app/ping/config.xsd @@ -1,23 +1,9 @@ - - - - - - - - - - - - - - - - - + + + @@ -26,25 +12,6 @@ - - - - - - - - - - - - - - - - - - - diff --git a/repos/os/src/app/trace_logger/config.xsd b/repos/os/src/app/trace_logger/config.xsd index dbe7bfdaa0..0df673acdb 100644 --- a/repos/os/src/app/trace_logger/config.xsd +++ b/repos/os/src/app/trace_logger/config.xsd @@ -1,36 +1,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -39,13 +11,6 @@ - - - - - - - diff --git a/repos/os/src/init/config.xsd b/repos/os/src/init/config.xsd index e5da52ba87..8193d6e3f6 100644 --- a/repos/os/src/init/config.xsd +++ b/repos/os/src/init/config.xsd @@ -1,28 +1,30 @@ + + - - + + - - - - - - + + + + + + - + @@ -33,7 +35,7 @@ - + @@ -52,7 +54,7 @@ - + @@ -67,22 +69,22 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -98,18 +100,18 @@ - - - + + + - - - + + + @@ -143,17 +145,17 @@ - - - + + + - - + + diff --git a/repos/os/src/server/nic_bridge/config.xsd b/repos/os/src/server/nic_bridge/config.xsd index 9c9bf057a6..f13e2f33b2 100644 --- a/repos/os/src/server/nic_bridge/config.xsd +++ b/repos/os/src/server/nic_bridge/config.xsd @@ -1,35 +1,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/repos/os/src/server/nic_dump/config.xsd b/repos/os/src/server/nic_dump/config.xsd index ad0e2aafee..dbfc9083c7 100644 --- a/repos/os/src/server/nic_dump/config.xsd +++ b/repos/os/src/server/nic_dump/config.xsd @@ -1,6 +1,8 @@ + + @@ -8,17 +10,6 @@ - - - - - - - - - - - diff --git a/repos/os/src/server/nic_router/config.xsd b/repos/os/src/server/nic_router/config.xsd index 5aedd8b47d..c71b959163 100644 --- a/repos/os/src/server/nic_router/config.xsd +++ b/repos/os/src/server/nic_router/config.xsd @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -40,24 +12,12 @@ - - - - + + + + - - - - - - - - - - - - - + diff --git a/repos/os/src/test/net_flood/config.xsd b/repos/os/src/test/net_flood/config.xsd index e558a90718..95f4b13907 100644 --- a/repos/os/src/test/net_flood/config.xsd +++ b/repos/os/src/test/net_flood/config.xsd @@ -1,16 +1,8 @@ - - - - - - - - - - + + @@ -20,18 +12,6 @@ - - - - - - - - - - - - diff --git a/repos/os/xsd/net_types.xsd b/repos/os/xsd/net_types.xsd new file mode 100644 index 0000000000..7d88cdc28f --- /dev/null +++ b/repos/os/xsd/net_types.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/repos/os/xsd/timeout_types.xsd b/repos/os/xsd/timeout_types.xsd new file mode 100644 index 0000000000..8adf0fecfe --- /dev/null +++ b/repos/os/xsd/timeout_types.xsd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tool/run/run b/tool/run/run index 96d5122ea7..dd8f84f38b 100755 --- a/tool/run/run +++ b/tool/run/run @@ -115,7 +115,7 @@ proc check_xml_syntax {xml_file} { # configurations of children of the component # \param nesting_level level of recursive calls of this procedure # -proc check_config {bin xml_file xsd_file label avail_xsd_files nesting_level} { +proc check_config {bin xml_file xsd_file label avail_xsd_files xsd_inc nesting_level} { # check prerequisites if this is not a recursive call if {$nesting_level == 0} { @@ -130,7 +130,7 @@ proc check_config {bin xml_file xsd_file label avail_xsd_files nesting_level} { # check the given component configuration itself puts " CHECK $label" - if {[catch {exec xmllint --noout -schema $xsd_file $xml_file} result]} { + if {[catch {exec xmllint --noout --path $xsd_inc -schema $xsd_file $xml_file} result]} { if {$result != "$xml_file validates"} { @@ -199,7 +199,8 @@ proc check_config {bin xml_file xsd_file label avail_xsd_files nesting_level} { # call this procedure again on the child config file set child_label "$label -> $child_name" check_config $child_bin $child_xml_file $child_xsd_file \ - $child_label $avail_xsd_files [expr $nesting_level+1] + $child_label $avail_xsd_files $xsd_inc \ + [expr $nesting_level+1] # clean up exec rm -f $child_xml_file @@ -246,9 +247,16 @@ proc build_boot_image {binaries} { set init_xsd_file $xsd_file } } + # determine include directories that can be used by the XSD files + global repositories; + set xsd_inc "" + foreach repo $repositories { + if {[file exists $repo/xsd]} { + append xsd_inc "$repo/xsd " } + } # check configurations of init and its children puts "checking configuration syntax" - check_config init [run_dir]/genode/config $init_xsd_file init $xsd_files 0 + check_config init [run_dir]/genode/config $init_xsd_file init $xsd_files $xsd_inc 0 run_boot_dir $binaries }