Skip to content

Commit c4f0d45

Browse files
committed
updated mounts to include kernel modules, removed ebuild, made module definitions of internal variables warn instead of fail
Signed-off-by: Zen <[email protected]>
1 parent aef7c8c commit c4f0d45

File tree

5 files changed

+13
-31
lines changed

5 files changed

+13
-31
lines changed

Manifest

Lines changed: 0 additions & 1 deletion
This file was deleted.

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Creates `/dev/console` with permissions `0o644`
8989

9090
Each mount has the following available parameters:
9191

92-
* `type` (auto) the mount or filesystem type.
92+
* `type` (auto) the mount or filesystem type. Setting the `type` to `vfat` includes the `vfat` kernel module automatically.
9393
* `destination` (/mount name) the mountpoint for the mount, if left unset will use /mount_name.
9494
* `source` The source string or a dict with a key containing the source type, where the value is the target.
9595
- `uuid` Mount by the filesystem UUID.

ugrd-0.6.3.ebuild

Lines changed: 0 additions & 26 deletions
This file was deleted.

ugrd/base/mounts.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'desultory'
2-
__version__ = '1.0.0'
2+
__version__ = '1.0.1'
33

44

55
def generate_fstab(self):
@@ -86,6 +86,12 @@ def _process_mounts_multi(self, key, mount_config):
8686
if 'destination' not in mount_config:
8787
mount_config['destination'] = f"/{key}" # prepend a slash
8888

89+
if mount_type := mount_config.get('type'):
90+
if mount_type == 'vfat':
91+
self['_kmod_depend'] = 'vfat'
92+
elif mount_type == 'btrfs':
93+
self['_kmod_depend'] = 'btrfs'
94+
8995
try:
9096
self['mounts'][key] = Mount(**mount_config)
9197
self['paths'].append(mount_config['destination'])

ugrd/initramfs_dict.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
__author__ = "desultory"
3-
__version__ = "0.8.1"
3+
__version__ = "0.8.2"
44

55
from tomllib import load
66
from pathlib import Path
@@ -58,7 +58,10 @@ def __setitem__(self, key, value):
5858
else:
5959
super().__setitem__(key, expected_type(value))
6060
else: # Otherwise set it like a normal dict item
61-
raise ValueError("Detected undefined parameter type '%s' with value: %s" % (key, value))
61+
if key.startswith('_'):
62+
self.logger.warning("Setting unknown internal paramaters '%s' with value: %s" % (key, value))
63+
else:
64+
raise ValueError("Detected undefined parameter type '%s' with value: %s" % (key, value))
6265

6366
@handle_plural
6467
def update_dict(self, name: str, key: str, value: dict):

0 commit comments

Comments
 (0)