Skip to content

Commit 354e8b1

Browse files
committed
add build_late, update docs
Signed-off-by: Zen <[email protected]>
1 parent f23c17e commit 354e8b1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

docs/dev_manual.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Modules only require a toml definition, and can import other modules to act as m
66

77
Python functions can be added imported into `init` and `build` runlevels to execute build tasks or output init lines.
88

9+
> `build` functions are allowed to mutate config, init functions are not. Init is the final build task where bash files are generated.
10+
911
Within modules, all config values are imported, then processed according to the order of the `custom_parameters` list.
1012

1113
`_module_name` can be set within a module for logging purposes, it is verified to be accurate when imported but optional.
@@ -49,11 +51,19 @@ Build imports are used to mutate config and build the base structure of the init
4951

5052
### build_tasks
5153

52-
`build_tasks` are functions which will be executed after `build_pre`, such as dependency pulling.
54+
`build_tasks` are functions which will be executed after `build_pre`, which make up the majority of the build process.
5355

5456
### build_late
5557

56-
`build_late` functions are executed after the init has been generated.
58+
`build_late` are finalizing build functions, immediately before files are deployed
59+
60+
### build_deploy
61+
62+
`build_deploy` is mostly for builtin functions and is where components are actually copied into the build directory.
63+
64+
### build_final
65+
66+
`build_final` is the last build hook, where finalizing tasks take place.
5767

5868
## Init imports
5969

src/ugrd/initramfs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, config='/etc/ugrd/config.toml', *args, **kwargs):
1616
self.included_functions = {}
1717

1818
# Used for functions that are run as part of the build process
19-
self.build_tasks = ['build_pre', 'build_tasks', 'build_deploy', 'build_final']
19+
self.build_tasks = ['build_pre', 'build_tasks', 'build_late', 'build_deploy', 'build_final']
2020

2121
# init_pre and init_final are run as part of generate_initramfs_main
2222
self.init_types = ['init_debug', 'init_early', 'init_main', 'init_late', 'init_premount', 'init_mount', 'init_mount_late', 'init_cleanup']

src/ugrd/kmod/kmod.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ no_kmod = "bool" # Disables kernel modules entirely
2626
[imports.build_pre]
2727
"ugrd.kmod.kmod" = [ "get_kernel_metadata", "autodetect_modules" ]
2828

29-
[imports.build_tasks]
29+
[imports.build_late]
3030
"ugrd.kmod.kmod" = [ "process_modules", "process_ignored_modules", "process_module_metadata" ]
3131

3232
[imports.build_final]

0 commit comments

Comments
 (0)