Skip to content
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

Fix return value of generator on non-ostree systems #2911

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/switchroot/ostree-mount-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ get_ostree_target (void)
autofree char *ostree_cmdline = read_proc_cmdline_key ("ostree");

if (!ostree_cmdline)
errx (EXIT_FAILURE, "No ostree= cmdline");
return NULL;

if (strcmp (ostree_cmdline, "aboot") == 0)
return get_aboot_root_slot ();
Expand Down
2 changes: 2 additions & 0 deletions src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ resolve_deploy_path (const char *root_mountpoint)
struct stat stbuf;
char *deploy_path;
autofree char *ostree_target = get_ostree_target ();
if (!ostree_target)
errx (EXIT_FAILURE, "No ostree= cmdline");

if (snprintf (destpath, sizeof (destpath), "%s/%s", root_mountpoint, ostree_target) < 0)
err (EXIT_FAILURE, "failed to assemble ostree target path");
Expand Down
2 changes: 2 additions & 0 deletions src/switchroot/ostree-system-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ main (int argc, char *argv[])
* is PID 1 (and so hasn't created /run/ostree-booted).
*/
autofree char *ostree_target = get_ostree_target ();
if (!ostree_target)
exit (EXIT_SUCCESS);

/* See comments in ostree-prepare-root.c for this.
*
Expand Down
Loading