-
Notifications
You must be signed in to change notification settings - Fork 449
T8445: add support for extension of activation system #1156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,8 @@ def build(): | |
|
|
||
| from utils import cmd, rc_cmd | ||
| from utils import directories | ||
| from utils import activation_hint | ||
| from utils import activation_init | ||
|
|
||
| ## Check if there are missing build dependencies | ||
| deps = { | ||
|
|
@@ -490,6 +492,13 @@ DOCUMENTATION_URL="{build_config['documentation_url']}" | |
| with open(os.path.join(binary_includes_dir, 'version.json'), 'w') as f: | ||
| json.dump(version_data, f) | ||
|
|
||
| # For initialization of activation scripts, we need to know if we | ||
| # are building with create_raw_image | ||
| if build_config["image_format"] != ["iso"]: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason I find this check aesthetically unsatisfying, although it does the job for sure and I don't see an alternative at the moment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that it is unsatisfying, and yes, we do not have a clean alternative. |
||
| raw_build_hint = os.path.join(vyos_data_dir, os.path.basename(activation_hint)) | ||
| with open(raw_build_hint, 'w') as f: | ||
| pass | ||
|
|
||
| # For backwards compatibility with 'add system image' script from older versions | ||
| # we need a file in the old format so that script can find out the version of the image | ||
| # for upgrade | ||
|
|
@@ -628,6 +637,16 @@ DOCUMENTATION_URL="{build_config['documentation_url']}" | |
| with open(file_path, 'w') as f: | ||
| f.write(build_config["default_config"]) | ||
|
|
||
| ## Allow override of which activation scripts are enabled at boot | ||
| if has_nonempty_key(build_config, "activation_init"): | ||
| file_path = os.path.join( | ||
| chroot_includes_dir, | ||
| activation_init.lstrip(os.sep) | ||
| ) | ||
| os.makedirs(os.path.dirname(file_path), exist_ok=True) | ||
| with open(file_path, 'w') as f: | ||
| f.write(build_config["activation_init"]) | ||
|
|
||
| ## Configure live-build | ||
| lb_config_tmpl = jinja2.Template(""" | ||
| lb config noauto \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two different imports: '_hint' vs '_init'