[installation] Init with inital config for global

This commit is contained in:
2025-10-30 15:08:17 +01:00
commit 7640b452ed
3678 changed files with 2200095 additions and 0 deletions

26
etc/init/kernel.py Normal file
View File

@ -0,0 +1,26 @@
import os, sys
import seiscomp.config, seiscomp.kernel
class Module(seiscomp.kernel.CoreModule):
def __init__(self, env):
seiscomp.kernel.CoreModule.__init__(
self, env, env.moduleName(__file__))
# High priority
self.order = -100
# This is a config module which writes the setup config to kernel.cfg
self.isConfigModule = True
def setup(self, setup_config):
cfgfile = os.path.join(self.env.SEISCOMP_ROOT, "etc", self.name + ".cfg")
cfg = seiscomp.config.Config()
cfg.readConfig(cfgfile)
try:
cfg.setString("organization", setup_config.getString(
"kernel.global.organization"))
except:
cfg.remove("organization")
cfg.writeConfig()
return 0