Skip to content

Commit

Permalink
deploy: Make bwrap dependency soft
Browse files Browse the repository at this point in the history
Let's support people who are building with SELinux enabled, but aren't
shipping bwrap.

(Though, those people probably want this to work)
  • Loading branch information
cgwalters committed Jul 13, 2022
1 parent 0d911bf commit faecb9f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2967,9 +2967,20 @@ sysroot_finalize_selinux_policy (int deployment_dfd, GError **error)
"semodule", "--help"
};
static const gsize SEMODULE_HELP_ARGC = sizeof (SEMODULE_HELP_ARGV) / sizeof (*SEMODULE_HELP_ARGV);
if (!run_in_deployment (deployment_dfd, SEMODULE_HELP_ARGV,
SEMODULE_HELP_ARGC, &exit_status, &stdout, error))
return FALSE;
{
g_autoptr(GError) local_error = NULL;
if (!run_in_deployment (deployment_dfd, SEMODULE_HELP_ARGV,
SEMODULE_HELP_ARGC, &exit_status, &stdout, &local_error))
{
if (g_error_matches (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
{
ot_journal_print (LOG_INFO, "Skipping `semodule --rebuild-if-modules-changed`: no bwrap available");
return TRUE;
}
g_propagate_error (error, g_steal_pointer (&local_error));
return glnx_prefix_error (error, "failed to run semodule (via bwrap)");
}
}
if (!g_spawn_check_exit_status (exit_status, error))
return glnx_prefix_error (error, "failed to run semodule");
if (!strstr(stdout, "--rebuild-if-modules-changed"))
Expand Down

0 comments on commit faecb9f

Please sign in to comment.