New upstream version 2020.6

This commit is contained in:
Simon McVittie committed 2020-09-08 10:53:08 +01:00
commit 12212491d5
22 files changed
+127 -59

No files matched your search

+1 -1
View File
@@ -5,6 +5,6 @@ build() {
add_binary /usr/lib/ostree/ostree-remount
add_file /usr/lib/systemd/system/ostree-prepare-root.service
add_symlink /usr/lib/systemd/system/initrd-switch-root.target.wants/ostree-prepare-root.service \
add_symlink /usr/lib/systemd/system/initrd-root-fs.target.wants/ostree-prepare-root.service \
/usr/lib/systemd/system/ostree-prepare-root.service
}
+2 -2
View File
@@ -30,6 +30,6 @@ Before=initrd-root-fs.target
Type=oneshot
ExecStart=/usr/lib/ostree/ostree-prepare-root /sysroot
StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
StandardOutput=journal
StandardError=journal+console
RemainAfterExit=yes
+2 -2
View File
@@ -35,8 +35,8 @@ Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/ostree/ostree-remount
StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
StandardOutput=journal
StandardError=journal+console
[Install]
WantedBy=local-fs.target
+9 -6
View File
@@ -89,15 +89,15 @@ append_config_from_loader_entries (OstreeBootloaderSyslinux *self,
val = ostree_bootconfig_parser_get (config, "linux");
if (!val)
return glnx_throw (error, "No \"linux\" key in bootloader config");
g_ptr_array_add (new_lines, g_strdup_printf ("\tKERNEL %s", val));
g_ptr_array_add (new_lines, g_strdup_printf ("\tKERNEL /boot%s", val));
val = ostree_bootconfig_parser_get (config, "initrd");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("\tINITRD %s", val));
g_ptr_array_add (new_lines, g_strdup_printf ("\tINITRD /boot%s", val));
val = ostree_bootconfig_parser_get (config, "devicetree");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("\tDEVICETREE %s", val));
g_ptr_array_add (new_lines, g_strdup_printf ("\tDEVICETREE /boot%s", val));
val = ostree_bootconfig_parser_get (config, "options");
if (val)
@@ -150,10 +150,13 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader *bootloader,
if (kernel_arg == NULL)
return glnx_throw (error, "No KERNEL argument found after LABEL");
/* If this is a non-ostree kernel, just emit the lines
* we saw.
/* If this is a non-ostree kernel, just emit the lines we saw.
*
* We check for /ostree (without /boot prefix) as well to support
* upgrading ostree from <v2020.4.
*/
if (!g_str_has_prefix (kernel_arg, "/ostree/"))
if (!g_str_has_prefix (kernel_arg, "/ostree/") &&
!g_str_has_prefix (kernel_arg, "/boot/ostree/"))
{
for (guint i = 0; i < tmp_lines->len; i++)
{
+4 -4
View File
@@ -134,19 +134,19 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self,
"No \"linux\" key in bootloader config");
return FALSE;
}
g_ptr_array_add (new_lines, g_strdup_printf ("kernel_image%s=%s", index_suffix, val));
g_ptr_array_add (new_lines, g_strdup_printf ("kernel_image%s=/boot%s", index_suffix, val));
val = ostree_bootconfig_parser_get (config, "initrd");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("ramdisk_image%s=%s", index_suffix, val));
g_ptr_array_add (new_lines, g_strdup_printf ("ramdisk_image%s=/boot%s", index_suffix, val));
val = ostree_bootconfig_parser_get (config, "devicetree");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("fdt_file%s=%s", index_suffix, val));
g_ptr_array_add (new_lines, g_strdup_printf ("fdt_file%s=/boot%s", index_suffix, val));
val = ostree_bootconfig_parser_get (config, "fdtdir");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("fdtdir%s=%s", index_suffix, val));
g_ptr_array_add (new_lines, g_strdup_printf ("fdtdir%s=/boot%s", index_suffix, val));
val = ostree_bootconfig_parser_get (config, "options");
if (val)
+1 -1
View File
@@ -55,7 +55,7 @@ _ostree_linuxfs_fd_alter_immutable_flag (int fd,
if (g_atomic_int_get (&no_alter_immutable))
return TRUE;
unsigned long flags;
int flags = 0;
int r = ioctl (fd, EXT2_IOC_GETFLAGS, &flags);
if (r == -1)
{
+2
View File
@@ -4332,6 +4332,8 @@ ostree_repo_commit_modifier_set_sepolicy (OstreeRepoCommitModifier
* In many cases, one wants to create a "derived" commit from base commit.
* SELinux policy labels are part of that base commit. This API allows
* one to easily set up SELinux labeling from a base commit.
*
* Since: 2020.4
*/
gboolean
ostree_repo_commit_modifier_set_sepolicy_from_commit (OstreeRepoCommitModifier *modifier,
+2 -1
View File
@@ -436,8 +436,9 @@ ensure_idle_queued (OtPullData *pull_data)
idle_src = g_idle_source_new ();
g_source_set_callback (idle_src, idle_worker, pull_data, NULL);
g_source_attach (idle_src, pull_data->main_context);
g_source_unref (idle_src);
pull_data->idle_src = idle_src;
/* Ownership is transferred to pull_data */
g_source_unref (idle_src);
}
typedef struct {
+5 -1
View File
@@ -271,7 +271,7 @@ ostree_sign_load_pk (OstreeSign *self,
* ostree_sign_data:
* @self: an #OstreeSign object
* @data: the raw data to be signed with pre-loaded secret key
* @signature: in case of success will contain signature
* @signature: (out): in case of success will contain signature
* @cancellable: A #GCancellable
* @error: a #GError
*
@@ -305,6 +305,7 @@ ostree_sign_data (OstreeSign *self,
* @self: an #OstreeSign object
* @data: the raw data to check
* @signatures: the signatures to be checked
* @out_success_message: (out) (nullable) (optional): success message returned by the signing engine
* @error: a #GError
*
* Verify given data against signatures with pre-loaded public keys.
@@ -372,6 +373,7 @@ _sign_detached_metadata_append (OstreeSign *self,
* @self: an #OstreeSign object
* @repo: an #OsreeRepo object
* @commit_checksum: SHA256 of given commit to verify
* @out_success_message: (out) (nullable) (optional): success message returned by the signing engine
* @cancellable: A #GCancellable
* @error: a #GError
*
@@ -593,6 +595,8 @@ ostree_sign_get_by_name (const gchar *name, GError **error)
* Based on ostree_repo_add_gpg_signature_summary implementation.
*
* Returns: @TRUE if summary file has been signed with all provided keys
*
* Since: 2020.2
*/
gboolean
ostree_sign_summary (OstreeSign *self,
+2
View File
@@ -52,6 +52,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
/**
* OSTREE_SIGN_NAME_ED25519:
* The name of the default ed25519 signing type.
*
* Since: 2020.4
*/
#define OSTREE_SIGN_NAME_ED25519 "ed25519"
+6
View File
@@ -1994,6 +1994,12 @@ prepare_new_bootloader_link (OstreeSysroot *sysroot,
g_assert ((current_bootversion == 0 && new_bootversion == 1) ||
(current_bootversion == 1 && new_bootversion == 0));
/* This allows us to support both /boot on a seperate filesystem to / as well
* as on the same filesystem. */
if (TEMP_FAILURE_RETRY (symlinkat (".", sysroot->sysroot_fd, "boot/boot")) < 0)
if (errno != EEXIST)
return glnx_throw_errno_prefix (error, "symlinkat");
g_autofree char *new_target = g_strdup_printf ("loader.%d", new_bootversion);
/* We shouldn't actually need to replace but it's easier to reuse
+3 -3
View File
@@ -43,7 +43,7 @@
*
* Since: 2017.4
*/
#define OSTREE_RELEASE_VERSION (5)
#define OSTREE_RELEASE_VERSION (6)
/**
* OSTREE_VERSION
@@ -52,7 +52,7 @@
*
* Since: 2017.4
*/
#define OSTREE_VERSION (2020.5)
#define OSTREE_VERSION (2020.6)
/**
* OSTREE_VERSION_S:
@@ -62,7 +62,7 @@
*
* Since: 2017.4
*/
#define OSTREE_VERSION_S "2020.5"
#define OSTREE_VERSION_S "2020.6"
#define OSTREE_ENCODE_VERSION(year,release) \
((year) << 16 | (release))
+8 -1
View File
@@ -55,7 +55,14 @@ ot_admin_builtin_pin (int argc, char **argv, OstreeCommandInvocation *invocation
for (unsigned int i = 1; i < argc; i++)
{
const char *deploy_index_str = argv[i];
const int deploy_index = atoi (deploy_index_str);
char *endptr = NULL;
errno = 0;
const guint64 deploy_index = g_ascii_strtoull (deploy_index_str, &endptr, 10);
if (*endptr != '\0')
return glnx_throw (error, "Invalid index: %s", deploy_index_str);
if (errno == ERANGE)
return glnx_throw (error, "Index too large: %s", deploy_index_str);
g_autoptr(OstreeDeployment) target_deployment = ot_admin_get_indexed_deployment (sysroot, deploy_index, error);
if (!target_deployment)
+2 -3
View File
@@ -101,10 +101,9 @@ sysroot_is_configured_ro (const char *sysroot)
bool ret = false;
char *line = NULL;
size_t len = 0;
ssize_t nread;
/* Note getline() will reuse the previous buffer */
bool in_sysroot = false;
while ((nread = getline (&line, &len, f)) != -1)
while (getline (&line, &len, f) != -1)
{
/* This is an awful hack to avoid depending on GLib in the
* initramfs right now.
@@ -252,7 +251,7 @@ main(int argc, char *argv[])
* sysroot, we still need a writable /etc. And to avoid race conditions
* we ensure it's writable in the initramfs, before we switchroot at all.
*/
if (mount ("/etc", "/etc", NULL, MS_BIND, NULL) < 0)
if (mount ("etc", "etc", NULL, MS_BIND, NULL) < 0)
err (EXIT_FAILURE, "failed to make /etc a bind mount");
/* Pass on the fact that we discovered a readonly sysroot to ostree-remount.service */
int fd = open (_OSTREE_SYSROOT_READONLY_STAMP, O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
+5
View File
@@ -112,6 +112,11 @@ main(int argc, char *argv[])
bool sysroot_configured_readonly = unlink (_OSTREE_SYSROOT_READONLY_STAMP) == 0;
do_remount ("/sysroot", !sysroot_configured_readonly);
/* And also make sure to make /etc rw again. We make this conditional on
* sysroot_configured_readonly because only in that case is it a bind-mount. */
if (sysroot_configured_readonly)
do_remount ("/etc", true);
/* If /var was created as as an OSTree default bind mount (instead of being a separate filesystem)
* then remounting the root mount read-only also remounted it.
* So just like /etc, we need to make it read-write by default.