diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2024-10-13 16:40:19 +0200 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2024-10-13 22:30:35 +0200 |
commit | 6a33ab1cbe0e2a6b237a7dc1b4cb3184f145b8d2 (patch) | |
tree | e9efbaf728c38a55a63bcb3be950360f8a57cea9 | |
parent | Add directory for diskimage helper files (so far unneeded) (diff) | |
download | catalyst-6a33ab1cbe0e2a6b237a7dc1b4cb3184f145b8d2.tar.gz catalyst-6a33ab1cbe0e2a6b237a7dc1b4cb3184f145b8d2.tar.bz2 catalyst-6a33ab1cbe0e2a6b237a7dc1b4cb3184f145b8d2.zip |
Clone livecd_stage1.py to diskimage_stage1.py, only cosmetic changes
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r-- | catalyst/targets/diskimage_stage1.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/catalyst/targets/diskimage_stage1.py b/catalyst/targets/diskimage_stage1.py new file mode 100644 index 00000000..9cbf81df --- /dev/null +++ b/catalyst/targets/diskimage_stage1.py @@ -0,0 +1,58 @@ +""" +Disk image stage1 target +""" +# NOTE: That^^ docstring has influence catalyst-spec(5) man page generation. + +from catalyst.support import normpath + +from catalyst.base.stagebase import StageBase + + +class diskimage_stage1(StageBase): + """ + Builder class for disk image stage1. + """ + required_values = frozenset([ + "diskimage/packages", + ]) + valid_values = required_values | frozenset([ + "diskimage/use", + ]) + + def __init__(self, spec, addlargs): + StageBase.__init__(self, spec, addlargs) + + def set_action_sequence(self): + self.build_sequence.extend([ + self.build_packages, + ]) + self.finish_sequence.extend([ + self.clean, + ]) + self.set_completion_action_sequences() + + def set_spec_prefix(self): + self.settings["spec_prefix"] = "diskimage" + + def set_catalyst_use(self): + StageBase.set_catalyst_use(self) + if "catalyst_use" in self.settings: + self.settings["catalyst_use"].append("diskimage") + else: + self.settings["catalyst_use"] = ["diskiage"] + + def set_packages(self): + StageBase.set_packages(self) + if self.settings["spec_prefix"]+"/packages" in self.settings: + if isinstance(self.settings[self.settings['spec_prefix']+'/packages'], str): + self.settings[self.settings["spec_prefix"]+"/packages"] = \ + self.settings[self.settings["spec_prefix"] + + "/packages"].split() + + def set_pkgcache_path(self): + if "pkgcache_path" in self.settings: + if not isinstance(self.settings['pkgcache_path'], str): + self.settings["pkgcache_path"] = normpath( + ' '.join(self.settings["pkgcache_path"])) + else: + StageBase.set_pkgcache_path(self) |