-
Notifications
You must be signed in to change notification settings - Fork 231
Pass system version to bundle install hooks #1368
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
base: master
Are you sure you want to change the base?
Pass system version to bundle install hooks #1368
Conversation
launcher = g_subprocess_launcher_new(G_SUBPROCESS_FLAGS_STDERR_PIPE); | ||
|
||
g_subprocess_launcher_setenv(launcher, "RAUC_SYSTEM_COMPATIBLE", r_context()->config->system_compatible, TRUE); | ||
g_subprocess_launcher_setenv(launcher, "RAUC_SYSTEM_VARIANT", r_context()->config->system_variant ?: "", TRUE); | ||
g_subprocess_launcher_setenv(launcher, "RAUC_SYSTEM_VERSION", system_version ?: "", TRUE); |
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.
@jluebbe suggests it would be better to include this in prepare_environment
.
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.
By now, that part was factored out to add_system_environment
, which you could use in run_bundle_hook
.
|
||
g_assert_nonnull(manifest->hook_name); | ||
|
||
hook_name = g_build_filename(bundledir, manifest->hook_name, NULL); | ||
|
||
g_message("Running bundle hook %s", hook_cmd); | ||
|
||
/* Pass the version of the currently running slot to the hook script */ |
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.
This (4 year old!) logic is a bit awful, but it seems to work.
Pass installed system version to bundle install-check hook script. Fixes: rauc#531 Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
80730ae
to
b4d2558
Compare
/* Pass the version of the currently running slot to the hook script */ | ||
s = find_config_slot_by_device(r_context()->config, r_context()->bootslot); | ||
if (s) { | ||
load_slot_status(s); |
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.
This is the wrong API, from an older version of RAUC. I will fix it.
As mentioned in #531 (comment), If I understood your request correctly, you need the version of the currently booted slot. With the info suggested in the linked comment, you could do something like this:
Alternatively I'd also be fine with exporting a |
Pass installed system version to bundle install-check hook script.
Fixes: #531
(This has been collecting dust downstream for a while now; time to get it upstreamed)