Skip to content

Commit

Permalink
wip test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jun 19, 2024
1 parent 2b4659b commit dbd8839
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
18 changes: 15 additions & 3 deletions src/libostree/ostree-repo-static-delta-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,18 +406,30 @@ ostree_repo_static_delta_execute_offline_with_signature (OstreeRepo *self, GFile
if (dfd < 0)
{
if (errno != ENOTDIR)
return glnx_throw_errno_prefix (error, "openat(O_DIRECTORY)");
{
return glnx_throw_errno_prefix (error, "openat(O_DIRECTORY)");
}
else
{
g_autofree char *dir = g_path_get_dirname (dir_or_file_path);
g_autofree char *dir = "";
if (dir_or_file_path[strlen (dir_or_file_path) - 1] == G_DIR_SEPARATOR)
{
g_autofree char *modifed_dir = g_strdup (dir_or_file_path);
modifed_dir[strlen (modifed_dir) - 1] = '\0';
dir = g_path_get_dirname (modifed_dir);
}
else
dir = g_path_get_dirname (dir_or_file_path);
basename = g_path_get_basename (dir_or_file_path);

if (!glnx_opendirat (AT_FDCWD, dir, TRUE, &dfd, error))
return FALSE;
}
}
else
basename = g_strdup ("superblock");
{
basename = g_strdup ("superblock");
}

glnx_autofd int meta_fd = openat (dfd, basename, O_RDONLY | O_CLOEXEC);
if (meta_fd < 0)
Expand Down
3 changes: 1 addition & 2 deletions src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,12 @@ main (int argc, char *argv[])

g_autofree char *ovl_options
= g_strdup_printf ("lowerdir=%s,upperdir=%s,workdir=%s", lowerdir, upperdir, workdir);
if (mount ("overlay", TMP_SYSROOT "/etc", "overlay", MS_SILENT, ovl_options) < 0)
if (mount ("overlay", tmp_sysroot_etc, "overlay", MS_SILENT, ovl_options) < 0)
err (EXIT_FAILURE, "failed to mount transient etc overlayfs");
}
else
{
/* Bind-mount /etc (at deploy path), and remount as writable. */
static const char *tmp_sysroot_etc = TMP_SYSROOT "/etc";
if (mount ("etc", tmp_sysroot_etc, NULL, MS_BIND | MS_SILENT, NULL) < 0)
err (EXIT_FAILURE, "failed to prepare /etc bind-mount at /sysroot.tmp/etc");
if (mount (tmp_sysroot_etc, tmp_sysroot_etc, NULL, MS_BIND | MS_REMOUNT | MS_SILENT,
Expand Down

0 comments on commit dbd8839

Please sign in to comment.