Skip to content

Commit 6587f27

Browse files
committed
move banner into its own function, print kver if found
Signed-off-by: Zen <[email protected]>
1 parent 9cca2f6 commit 6587f27

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ugrd"
7-
version = "1.23.1"
7+
version = "1.24.0"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

src/ugrd/base/core.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
__author__ = 'desultory'
2-
__version__ = '3.7.4'
2+
__version__ = '3.8.0'
33

44
from pathlib import Path
55
from typing import Union
66

77
from zenlib.util import contains, unset, NoDupFlatList
88

99

10+
def print_banner(self) -> list[str]:
11+
""" Prints the banner. Prints the kernel version if set """
12+
banner = [self.banner]
13+
if kver := self.get('kernel_version'):
14+
banner.append(f"einfo 'Kernel version: {kver}'")
15+
return banner
16+
17+
1018
def detect_tmpdir(self) -> None:
1119
""" Reads TMPDIR from the environment, sets it as the temporary directory. """
1220
from os import environ

src/ugrd/base/core.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ minor = 1
4949
[imports.build_final]
5050
"ugrd.base.core" = [ "handle_usr_symlinks" ]
5151

52+
[imports.init_pre]
53+
"ugrd.base.core" = [ "print_banner" ]
54+
5255
[custom_parameters]
5356
hostonly = "bool" # If true, the initramfs will be built specifically for the host building it
5457
validate = "bool" # If true, the configuration of the initramfs will be validated against the host

src/ugrd/initramfs_generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def generate_init(self) -> None:
180180
self.run_hook('functions', force_include=True)
181181

182182
init.extend(self.run_init_hook('init_pre'))
183-
init += [self.banner]
184183

185184
if self['imports'].get('custom_init') and self.get('_custom_init_file'):
186185
init += ["\n# !!custom_init"]

0 commit comments

Comments
 (0)