some more groundwork
This commit is contained in:
parent
ca1f12f5bd
commit
d36368c4df
2
aif.xsd
2
aif.xsd
@ -810,7 +810,7 @@
|
||||
</xs:element>
|
||||
<!-- END SCRIPTS -->
|
||||
</xs:all>
|
||||
<xs:attribute name="version" type="aif:t_nonempty" use="required"/>
|
||||
<xs:attribute name="version" type="aif:t_nonempty" use="optional" default="master"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
2
aif/config/__init__.py
Normal file
2
aif/config/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from . import parser
|
||||
# from . import generator # pending API
|
@ -1,3 +1,4 @@
|
||||
arch_releng_key = '4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC'
|
||||
version = '0.2.0'
|
||||
external_deps = ['blkinfo',
|
||||
'gpg',
|
||||
|
@ -3,9 +3,7 @@
|
||||
# https://github.com/dcantrell/pyparted/blob/master/examples/query_device_capacity.py
|
||||
# TODO: Remember to replicate genfstab behaviour.
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
try:
|
||||
# https://stackoverflow.com/a/34812552/733214
|
||||
# https://github.com/karelzak/util-linux/blob/master/libmount/python/test_mount_context.py#L6
|
||||
@ -14,7 +12,6 @@ except ImportError:
|
||||
# We should never get here. util-linux is part of core (base) in Arch and uses "libmount".
|
||||
import pylibmount as mount
|
||||
##
|
||||
# import blkinfo
|
||||
import parted # https://www.gnu.org/software/parted/api/index.html
|
||||
import psutil
|
||||
##
|
||||
|
@ -25,20 +25,24 @@ _mod_dir = os.path.join('/lib/modules',
|
||||
os.uname().release,
|
||||
'kernel/fs')
|
||||
_strip_mod_suffix = re.compile(r'(?P<fsname>)\.ko(\.(x|g)?z)?$', re.IGNORECASE)
|
||||
for i in os.listdir(_mod_dir):
|
||||
path = os.path.join(_mod_dir, i)
|
||||
fs_name = None
|
||||
if os.path.isdir(path):
|
||||
fs_name = i
|
||||
elif os.path.isfile(path):
|
||||
mod_name = _strip_mod_suffix.search(i)
|
||||
fs_name = mod_name.group('fsname')
|
||||
if fs_name:
|
||||
# The kernel *probably* has autoloading enabled, but in case it doesn't...
|
||||
# TODO: logging!
|
||||
if os.getuid() == 0:
|
||||
subprocess.run(['modprobe', fs_name])
|
||||
FS_FSTYPES.append(fs_name)
|
||||
try:
|
||||
for i in os.listdir(_mod_dir):
|
||||
path = os.path.join(_mod_dir, i)
|
||||
fs_name = None
|
||||
if os.path.isdir(path):
|
||||
fs_name = i
|
||||
elif os.path.isfile(path):
|
||||
mod_name = _strip_mod_suffix.search(i)
|
||||
fs_name = mod_name.group('fsname')
|
||||
if fs_name:
|
||||
# The kernel *probably* has autoloading enabled, but in case it doesn't...
|
||||
# TODO: logging!
|
||||
if os.getuid() == 0:
|
||||
subprocess.run(['modprobe', fs_name])
|
||||
FS_FSTYPES.append(fs_name)
|
||||
except FileNotFoundError:
|
||||
# We're running on a kernel that doesn't have modules
|
||||
pass
|
||||
|
||||
|
||||
class FS(object):
|
||||
|
Loading…
Reference in New Issue
Block a user