2019-12-08 00:29:43 -05:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2019-12-08 00:36:53 -05:00
|
|
|
<xs:schema targetNamespace="http://schema.xml.r00t2.io/linux.xsd"
|
|
|
|
xmlns="http://schema.xml.r00t2.io/linux.xsd"
|
|
|
|
xmlns:linux="http://schema.xml.r00t2.io/linux.xsd"
|
|
|
|
xmlns:std="http://schema.xml.r00t2.io/std.xsd"
|
2019-12-08 01:42:33 -05:00
|
|
|
xmlns:unix="http://schema.xml.r00t2.io/unix.xsd"
|
|
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
2019-12-08 00:29:43 -05:00
|
|
|
elementFormDefault="qualified"
|
|
|
|
attributeFormDefault="qualified">
|
|
|
|
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:simpleType name="t_console_pageformats">
|
|
|
|
<xs:restriction base="xs:positiveInteger">
|
|
|
|
<xs:enumeration value="8"/>
|
|
|
|
<xs:enumeration value="14"/>
|
|
|
|
<xs:enumeration value="16"/>
|
2019-12-08 00:29:43 -05:00
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:simpleType name="t_diskdev">
|
2019-12-08 00:29:43 -05:00
|
|
|
<xs:restriction base="xs:string">
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:pattern value="(/dev/([A-Za-z0-9_]+/)?[A-Za-z0-9_]+[0-9]?|auto)"/>
|
2019-12-08 00:29:43 -05:00
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
|
|
|
<xs:simpleType name="t_fstype">
|
|
|
|
<xs:union memberTypes="std:t_UUID4">
|
|
|
|
<xs:simpleType>
|
|
|
|
<!-- parted names -->
|
|
|
|
<!-- https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs -->
|
|
|
|
<!-- ', '.join(sorted(list(dict(vars(parted.filesystem))['fileSystemType'].keys()))) -->
|
|
|
|
<xs:restriction base="xs:token">
|
|
|
|
<xs:enumeration value="affs0"/>
|
|
|
|
<xs:enumeration value="affs1"/>
|
|
|
|
<xs:enumeration value="affs2"/>
|
|
|
|
<xs:enumeration value="affs3"/>
|
|
|
|
<xs:enumeration value="affs4"/>
|
|
|
|
<xs:enumeration value="affs5"/>
|
|
|
|
<xs:enumeration value="affs6"/>
|
|
|
|
<xs:enumeration value="affs7"/>
|
|
|
|
<xs:enumeration value="amufs"/>
|
|
|
|
<xs:enumeration value="amufs0"/>
|
|
|
|
<xs:enumeration value="amufs1"/>
|
|
|
|
<xs:enumeration value="amufs2"/>
|
|
|
|
<xs:enumeration value="amufs3"/>
|
|
|
|
<xs:enumeration value="amufs4"/>
|
|
|
|
<xs:enumeration value="amufs5"/>
|
|
|
|
<xs:enumeration value="apfs1"/>
|
|
|
|
<xs:enumeration value="apfs2"/>
|
|
|
|
<xs:enumeration value="asfs"/>
|
|
|
|
<xs:enumeration value="btrfs"/>
|
|
|
|
<xs:enumeration value="ext2"/>
|
|
|
|
<xs:enumeration value="ext3"/>
|
|
|
|
<xs:enumeration value="ext4"/>
|
|
|
|
<xs:enumeration value="fat16"/>
|
|
|
|
<xs:enumeration value="fat32"/>
|
|
|
|
<xs:enumeration value="hfs"/>
|
|
|
|
<xs:enumeration value="hfs+"/>
|
|
|
|
<xs:enumeration value="hfsx"/>
|
|
|
|
<xs:enumeration value="hp-ufs"/>
|
|
|
|
<xs:enumeration value="jfs"/>
|
|
|
|
<xs:enumeration value="linux-swap(v0)"/>
|
|
|
|
<xs:enumeration value="linux-swap(v1)"/>
|
|
|
|
<xs:enumeration value="nilfs2"/>
|
|
|
|
<xs:enumeration value="ntfs"/>
|
|
|
|
<xs:enumeration value="reiserfs"/>
|
|
|
|
<xs:enumeration value="sun-ufs"/>
|
|
|
|
<xs:enumeration value="swsusp"/>
|
|
|
|
<xs:enumeration value="udf"/>
|
|
|
|
<xs:enumeration value="xfs"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
</xs:union>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:simpleType name="t_iface_name">
|
|
|
|
<xs:restriction base="xs:token">
|
|
|
|
<!-- https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c.
|
|
|
|
I have no idea if this will work. TODO: simplify, validate in-code. -->
|
|
|
|
<xs:pattern
|
|
|
|
value="((en|sl|wl|ww)(b[0-9]+|c[a-z0-9]|o[0-9]+(n.*(d.*)?)?|s[0-9]+(f.*)?([nd].*)?|x([A-Fa-f0-9]:){5}[A-Fa-f0-9]|(P.*)?p[0-9]+s[0-9]+(([fnd].*)|u.*)?))"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
|
|
|
<xs:simpleType name="t_lvsize">
|
|
|
|
<!-- If no suffix is provided, program should assume the size is in *extents*. -->
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:pattern value="\s*([0-9]+)\s*(%|((k|Ki)|[MGTPEZY]i?)?B?|)\s*"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-08 00:29:43 -05:00
|
|
|
<xs:simpleType name="t_part_flags">
|
|
|
|
<xs:union>
|
|
|
|
<xs:simpleType>
|
|
|
|
<!-- parted.partition.partitionFlag -->
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:enumeration value="atvrecv"/>
|
|
|
|
<xs:enumeration value="bios_grub"/>
|
|
|
|
<xs:enumeration value="boot"/>
|
|
|
|
<xs:enumeration value="diag"/>
|
|
|
|
<xs:enumeration value="esp"/>
|
|
|
|
<xs:enumeration value="hidden"/>
|
|
|
|
<xs:enumeration value="hp-service"/>
|
|
|
|
<xs:enumeration value="irst"/>
|
|
|
|
<xs:enumeration value="lba"/>
|
|
|
|
<xs:enumeration value="legacy_boot"/>
|
|
|
|
<xs:enumeration value="lvm"/>
|
|
|
|
<xs:enumeration value="msftdata"/>
|
|
|
|
<xs:enumeration value="msftres"/>
|
|
|
|
<xs:enumeration value="palo"/>
|
|
|
|
<xs:enumeration value="prep"/>
|
|
|
|
<xs:enumeration value="raid"/>
|
|
|
|
<xs:enumeration value="root"/>
|
|
|
|
<xs:enumeration value="swap"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType>
|
|
|
|
<!-- These deviate from the parted flags (and in the case of the gpt_* ones, have no parted
|
|
|
|
equivalent it seems).
|
|
|
|
fdisk's "e(x)pert mode" has numerical GUID identifers for these ("Attrs").
|
|
|
|
Details on these are at:
|
|
|
|
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries_(LBA_2%E2%80%9333)
|
|
|
|
|
|
|
|
BD_PART_FLAGS = BlockDev.PartFlag(-1)
|
|
|
|
BD_PART_FLAGS_FRIENDLY = dict(zip(BD_PART_FLAGS.value_nicks, BD_PART_FLAGS.value_names))
|
|
|
|
sorted(list(BD_PART_FLAGS_FRIENDLY.keys()))
|
|
|
|
-->
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:enumeration value="apple_tv_recovery"/>
|
|
|
|
<xs:enumeration value="cpalo"/>
|
|
|
|
<xs:enumeration value="gpt_hidden"/><!-- No parted equivalent -->
|
|
|
|
<xs:enumeration value="gpt_no_automount"/><!-- No parted equivalent -->
|
|
|
|
<xs:enumeration value="gpt_read_only"/><!-- No parted equivalent -->
|
|
|
|
<xs:enumeration value="gpt_system_part"/><!-- No parted equivalent -->
|
|
|
|
<xs:enumeration value="hpservice"/>
|
|
|
|
<xs:enumeration value="msft_data"/>
|
|
|
|
<xs:enumeration value="msft_reserved"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
</xs:union>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-08 01:42:33 -05:00
|
|
|
<xs:simpleType name="t_passwd_hashtypes">
|
|
|
|
<xs:union memberTypes="unix:t_passwd_hashtypes">
|
|
|
|
<xs:simpleType>
|
|
|
|
<xs:restriction>
|
|
|
|
<!-- Unsupported in glibc. libxcrypt (https://github.com/besser82/libxcrypt/) has additional support. -->
|
|
|
|
<!-- bcrypt/blowfish are the same. -->
|
|
|
|
<!-- <xs:enumeration value="bcrypt"/> -->
|
|
|
|
<!-- <xs:enumeration value="blowfish"/> -->
|
|
|
|
<!-- <xs:enumeration value="scrypt"/> -->
|
|
|
|
<xs:enumeration value="sha256"/>
|
|
|
|
<xs:enumeration value="sha512"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
</xs:union>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
|
|
|
<xs:simpleType name="t_pesize">
|
|
|
|
<!-- This is *basically* t_lvsize except we don't allow percentages. -->
|
|
|
|
<!-- If no suffix is provided, we assume the size is in sectors
|
|
|
|
UNLESS it's "0", which means use the default (which I *think* is dynamically generated). -->
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:pattern value="\s*([0-9]+)\s*(((k|Ki)|[MGTPEZY]i?)?B?|)\s*"/>
|
|
|
|
<xs:whiteSpace value="collapse"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
|
|
|
<xs:simpleType name="t_shadowhash">
|
|
|
|
<xs:union memberTypes="unix:t_shadowhash">
|
|
|
|
<xs:simpleType>
|
|
|
|
<xs:restriction>
|
|
|
|
<xs:pattern value="($5)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{43}"/><!-- sha256 -->
|
|
|
|
<xs:pattern value="($6)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{86}"/><!-- sha512 -->
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
</xs:union>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
2019-12-08 00:29:43 -05:00
|
|
|
</xs:schema>
|