hoooo doggie

This commit is contained in:
brent s 2020-06-18 18:24:13 -04:00
parent 9ec5bee035
commit 5b537e3531
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
4 changed files with 136 additions and 2 deletions

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../types/unix.xsd"/>
<xs:include schemaLocation="../types/ipxe.xsd"/>

<xs:complexType name="e_ipxe_opts">
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="enable" maxOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="opt" minOccurs="1" type="t_ipxe_patchopt"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="disable" maxOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="opt" minOccurs="1" type="t_ipxe_patchopt"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="file" type="t_unix_anyfile" use="required"/>
</xs:complexType>

<xs:complexType name="e_ipxe_optswitch">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="opts" minOccurs="1" maxOccurs="unbounded" type="e_ipxe_opts"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="e_ipxe_patch">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="patchFile" minOccurs="1" maxOccurs="unbounded" type="t_unix_filepath"/>
</xs:sequence>
</xs:complexType>

</xs:schema>

15
schema/lib/types/ipxe.xsd Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../types/unix.xsd"/>

<xs:simpleType name="t_ipxe_patchopt">
<xs:restriction base="xs:token">
<xs:pattern value="[A-Z0-9_]+"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -20,7 +20,14 @@
</xs:choice>
</xs:complexType>

<!-- This is more or less the same as t_unix_filepath with the exception of it allowing "/". -->
<!-- These were a pain to figure out. -->
<!-- wtf. doesn't seem to work?
dir: ^\s*(~?/[^/]*)+/?\s*$
file: ^\s*(~?/[^/]+)+\s*$
reldir: ^\s*[^/](([^/]*)+/?)+\s*$
relfile: ^\s*[^/]+([^/]*)+[^/]\s*$
-->
<!-- ABSOLUTE directory path -->
<xs:simpleType name="t_unix_dirpath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*(~?/[^/]*)+/?\s*"/>
@ -28,13 +35,55 @@
</xs:restriction>
</xs:simpleType>

<!-- RELATIVE directory path -->
<xs:simpleType name="t_unix_reldirpath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*[^/](([^/]*)+/?)+\s*"/>
</xs:restriction>
</xs:simpleType>

<!-- ABSOLUTE file path -->
<xs:simpleType name="t_unix_filepath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*(~?/[^/]+)+/?\s*"/>
<xs:pattern value="\s*(~?/[^/]+)+\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

<!-- RELATIVE file path -->
<xs:simpleType name="t_unix_relfilepath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*[^/]+([^/]*)+[^/]\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

<!-- ABSOLUTE path (file or directory) -->
<xs:simpleType name="t_unix_path">
<xs:union memberTypes="t_unix_dirpath t_unix_filepath"/>
</xs:simpleType>

<!-- RELATIVE path (file or directory) -->
<xs:simpleType name="t_unix_relpath">
<xs:union memberTypes="t_unix_reldirpath t_unix_relfilepath"/>
</xs:simpleType>

<!-- ANY valid value for the above types. -->
<xs:simpleType name="t_unix_anypath">
<xs:union memberTypes="t_unix_path t_unix_relpath"/>
</xs:simpleType>

<!-- RELATIVE or ABSOLUTE file path -->
<xs:simpleType name="t_unix_anyfile">
<xs:union memberTypes="t_unix_filepath t_unix_relfilepath"/>
</xs:simpleType>

<!-- RELATIVE or ABSOLUTE dir path -->
<xs:simpleType name="t_unix_anydir">
<xs:union memberTypes="t_unix_dirpath t_unix_reldirpath"/>
</xs:simpleType>
<!-- END of regex silliness. What an ugly annoyance. -->

<xs:complexType name="t_unix_nixpass">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="passwordPlain">

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="https://router.r00t2.io/boootbox/ipxe/build/"
xmlns="https://router.r00t2.io/boootbox/ipxe/build/"
xmlns:ipxe="https://router.r00t2.io/boootbox/ipxe/build/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="../../lib/types/unix.xsd"/>
<xs:include schemaLocation="../../lib/types/ipxe.xsd"/>
<xs:include schemaLocation="../../lib/elements/ipxe.xsd"/>

<xs:element name="ipxe">
<xs:complexType>
<xs:all minOccurs="1">
<xs:element name="patchSet">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="2">
<xs:element name="switchOpts" maxOccurs="1" type="e_ipxe_optswitch"/>
<xs:element name="patch" maxOccurs="1" type="e_ipxe_patch"/>
</xs:sequence>
<xs:attribute name="root" type="t_unix_dirpath" use="optional"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>

</xs:schema>