<storage> done
This commit is contained in:
parent
f7404b0aa3
commit
130d5214e0
2
TODO
2
TODO
@ -9,6 +9,8 @@ bf566e594a2ad3e488fef7cfa6832d4ba857d8129b0c00fe3a096e9fbb85e92c268368a201f12f22
|
|||||||
...
|
...
|
||||||
|
|
||||||
- use sgdisk? scripting (generated by python) for disk partitioning (part types listed at http://www.rodsbooks.com/gdisk/walkthrough.html )
|
- use sgdisk? scripting (generated by python) for disk partitioning (part types listed at http://www.rodsbooks.com/gdisk/walkthrough.html )
|
||||||
|
-- actually, might want to use parted --script instead? then we can do percentages. https://www.gnu.org/software/parted/manual/parted.html
|
||||||
|
https://unix.stackexchange.com/questions/200582/scripteable-gpt-partitions-using-parted
|
||||||
- add mkfs-ing
|
- add mkfs-ing
|
||||||
|
|
||||||
-support serverside "autoconfig"- a mechanism to let servers automatically generate xml build configs. e.g.:
|
-support serverside "autoconfig"- a mechanism to let servers automatically generate xml build configs. e.g.:
|
||||||
|
50
aif.xsd
50
aif.xsd
@ -3,36 +3,66 @@
|
|||||||
targetNamespace="https://aif.square-r00t.net"
|
targetNamespace="https://aif.square-r00t.net"
|
||||||
xmlns="https://aif.square-r00t.net"
|
xmlns="https://aif.square-r00t.net"
|
||||||
elementFormDefault="qualified">
|
elementFormDefault="qualified">
|
||||||
<!-- GLOBAL CUSTOM DATA TYPES -->
|
<!-- GLOBAL CUSTOM DATA TYPES -->
|
||||||
<xs:simpleType name="diskdev">
|
<xs:simpleType name="diskdev">
|
||||||
<xs:restriction base="xs:string">
|
<xs:restriction base="xs:string">
|
||||||
<xs:pattern value="^/dev/[A-Za-z_/]+[0-9]+" />
|
<xs:pattern value="^/dev/[A-Za-z_/]+[0-9]+" />
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|
||||||
<xs:attribute name="device" type="diskdev" />
|
<xs:simpleType name="diskfmt">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="(gpt|bios)" />
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
|
||||||
|
<xs:simpleType name="disksize">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="^(\+|-)[0-9]+([KMGTP]|%)" />
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
|
||||||
|
<xs:simpleType name="fstype">
|
||||||
|
<xs:restriction base="xs:token">
|
||||||
|
<xs:pattern value="^[a-z0-9]+$" />
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<!-- ROOT -->
|
||||||
<xs:element name="aif">
|
<xs:element name="aif">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
|
<!-- BEGIN STORAGE -->
|
||||||
<xs:element name="storage" minOccurs="1">
|
<xs:element name="storage" minOccurs="1">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="disk" maxOccurs="unbounded" minOccurs="1">
|
<xs:element name="disk" maxOccurs="unbounded" minOccurs="1">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute ref="device"/>
|
<xs:sequence>
|
||||||
<xs:complexContent>
|
<xs:element name="part" minOccurs="1">
|
||||||
<xs:choice minOccurs="1">
|
<xs:complexType>
|
||||||
<xs:element name="gpt" type="diskfmt" />
|
<xs:attribute name="num" type="xs:positiveInteger" />
|
||||||
<xs:element name="bios" type="diskfmt" />
|
<xs:attribute name="name" type="xs:token" />
|
||||||
</xs:choice>
|
<xs:attribute name="size" type="disksize" />
|
||||||
</xs:complexContent>
|
<xs:attribute name="fstype" type="fstype" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
<xs:unique name="unique-partnum">
|
||||||
|
<xs:selector xpath="part"/>
|
||||||
|
<xs:field xpath="@num"/>
|
||||||
|
</xs:unique>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="device" type="diskdev" />
|
||||||
|
<xs:attribute name="diskfmt" type="diskfmt" />
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:unique name="unique-diskdev">
|
||||||
|
<xs:selector xpath="disk"/>
|
||||||
|
<xs:field xpath="@device"/>
|
||||||
|
</xs:unique>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<!-- END STORAGE -->
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
<xs:element ref="mount" maxOccurs="unbounded" minOccurs="1" />
|
<xs:element ref="mount" maxOccurs="unbounded" minOccurs="1" />
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<xs:element name="storage"><!-- storage media related things. -->
|
<xs:element name="storage"><!-- storage media related things. -->
|
||||||
<xs:element name="disk"><!-- a disk device. -->
|
<xs:element name="disk"><!-- a disk device. -->
|
||||||
<xs:element name="type" type="xs:string" /><!-- TODO: custom type. gpt, bios, etc. -->
|
<xs:element name="type" type="xs:string" /><!-- TODO: custom type. gpt, bios, etc. -->
|
||||||
<xs:element name="name" type="xs:string" /><!-- device, e.g. 'sda' -->
|
<xs:element name="device" type="xs:string" /><!-- device, e.g. 'sda' -->
|
||||||
<xs:element name="part"><!-- define a partition -->
|
<xs:element name="part"><!-- define a partition -->
|
||||||
<xs:element name="num" type="xs:positiveInteger" /><!-- partition number -->
|
<xs:element name="num" type="xs:positiveInteger" /><!-- partition number -->
|
||||||
<xs:element name="name" type="xs:string" /><!-- TODO: custom type. the filesystem or partition label. optional. -->
|
<xs:element name="name" type="xs:string" /><!-- TODO: custom type. the filesystem or partition label. optional. -->
|
||||||
|
Loading…
Reference in New Issue
Block a user