Exemple #1
0
gboolean test_make_slot_user_writable(const gchar* path, const gchar* file) {
	gboolean res = FALSE;
	gchar *slotpath;
	gchar *mountpath;
	
	slotpath = g_build_filename(path, file, NULL);
	g_assert_nonnull(slotpath);

	mountpath = g_build_filename(path, "tmpmount", NULL);
	g_assert_nonnull(mountpath);

	if (!g_file_test(mountpath, G_FILE_TEST_IS_DIR)) {
		g_assert(test_mkdir_relative(path, "tmpmount", 0777) == 0);
	}

	test_mount(slotpath, mountpath);

	test_do_chmod(mountpath);

	r_umount(mountpath, NULL);

	res = TRUE;

	return res;
}
Exemple #2
0
gboolean r_umount_slot(RaucSlot *slot, GError **error) {
	GError *ierror = NULL;
	gboolean res = FALSE;

	g_assert_nonnull(slot);
	g_assert_nonnull(slot->mount_point);
	g_assert_true(slot->mount_internal);

	res = r_umount(slot->mount_point, &ierror);
	if (!res) {
		res = FALSE;
		g_propagate_prefixed_error(
				error,
				ierror,
				"failed to unmount slot: ");
		goto out;
	}

	g_rmdir(slot->mount_point);
	g_clear_pointer(&slot->mount_point, g_free);
	slot->mount_internal = FALSE;

out:
	return res;
}
Exemple #3
0
gboolean test_umount(const gchar *dirname, const gchar *mountpoint) {
	gchar *path;
	
	path = g_build_filename(dirname, mountpoint, NULL);

	g_assert_true(r_umount(path, NULL));

	return TRUE;
}
Exemple #4
0
gboolean umount_bundle(const gchar *bundlename, GError **error) {
	GError *ierror = NULL;
	gboolean res = FALSE;

	res = r_umount(bundlename, &ierror);
	if (!res) {
		g_propagate_error(error, ierror);
		goto out;
	}

	res = TRUE;
out:
	return res;
}