Skip to content

Commit 53fbb24

Browse files
committed
rename check_usr to handle_usr_symlinks, validate config after building
Signed-off-by: Zen <[email protected]>
1 parent e42c918 commit 53fbb24

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/ugrd/base/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'desultory'
2-
__version__ = '3.7.3'
2+
__version__ = '3.7.4'
33

44
from pathlib import Path
55
from typing import Union
@@ -67,9 +67,8 @@ def calculate_dependencies(self, binary: str) -> list[Path]:
6767
return dependency_paths
6868

6969

70-
def check_usr(self) -> None:
71-
""" Checks for /bin and /sbin in the build directory.
72-
If the are not present, it will symlink them to /usr/bin and /usr/sbin. """
70+
def handle_usr_symlinks(self) -> None:
71+
""" Adds symlinks for /usr/bin and /usr/sbin to /bin and /sbin. """
7372
build_dir = self._get_build_path('/')
7473

7574
if not (build_dir / 'bin').is_dir():

src/ugrd/base/core.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ minor = 1
4747
"deploy_symlinks" ]
4848

4949
[imports.build_final]
50-
"ugrd.base.core" = [ "check_usr" ]
50+
"ugrd.base.core" = [ "handle_usr_symlinks" ]
5151

5252
[custom_parameters]
5353
hostonly = "bool" # If true, the initramfs will be built specifically for the host building it

src/ugrd/initramfs_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def __init__(self, config='/etc/ugrd/config.toml', *args, **kwargs):
3030
self.logger.warning("[%s] Config file not found, using the base config." % config)
3131
except TOMLDecodeError as e:
3232
raise ValueError("[%s] Error decoding config file: %s" % (config, e))
33-
self.config_dict.validate()
3433

3534
def load_config(self, config_filename) -> None:
3635
"""
@@ -76,6 +75,8 @@ def build(self) -> None:
7675
for hook in self.build_tasks:
7776
self.logger.debug("Running build hook: %s" % hook)
7877
self.run_hook(hook, force_exclude=True)
78+
self.config_dict.validate()
79+
7980
self.generate_init()
8081
self.run_hook('build_final')
8182
self.pack_build()

0 commit comments

Comments
 (0)