Skip to content

prepare-root: Don't hardcode sysroot#3447

Merged
cgwalters merged 1 commit into
ostreedev:mainfrom
cgwalters:prepare-root-sysroot-prep
Jun 24, 2025
Merged

prepare-root: Don't hardcode sysroot#3447
cgwalters merged 1 commit into
ostreedev:mainfrom
cgwalters:prepare-root-sysroot-prep

Conversation

@cgwalters

Copy link
Copy Markdown
Member

Follow to previous change to factor out composefs mounting; prep for soft reboots.

Follow to previous change to factor out composefs mounting;
prep for soft reboots.

Signed-off-by: Colin Walters <walters@verbum.org>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes a hardcoded /sysroot path in otcore_mount_composefs, making the function more generic and reusable.

return TRUE;

const char *objdirs[] = { "/sysroot/ostree/repo/objects" };
g_autofree char *sysroot_objects = g_strdup_printf ("%s/ostree/repo/objects", root_mountpoint);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider using g_build_filename() instead of g_strdup_printf() for constructing file paths. g_build_filename() correctly handles path separators, preventing potential issues like double slashes if root_mountpoint has a trailing slash.

g_autofree char *sysroot_objects = g_build_filename (root_mountpoint, "ostree", "repo", "objects", NULL);

@cgwalters cgwalters merged commit 36417fe into ostreedev:main Jun 24, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants