diff -Nru ostree-2020.5/apidoc/html/ostree.devhelp2 ostree-2020.6/apidoc/html/ostree.devhelp2 --- ostree-2020.5/apidoc/html/ostree.devhelp2 2020-08-18 18:46:58.000000000 +0000 +++ ostree-2020.6/apidoc/html/ostree.devhelp2 2020-09-03 18:46:44.000000000 +0000 @@ -172,7 +172,7 @@ - + @@ -378,7 +378,7 @@ - + diff -Nru ostree-2020.5/apidoc/html/ostree-OstreeRepo.html ostree-2020.6/apidoc/html/ostree-OstreeRepo.html --- ostree-2020.5/apidoc/html/ostree-OstreeRepo.html 2020-08-18 18:46:58.000000000 +0000 +++ ostree-2020.6/apidoc/html/ostree-OstreeRepo.html 2020-09-03 18:46:44.000000000 +0000 @@ -5279,6 +5279,7 @@ +

Since: 2020.4


diff -Nru ostree-2020.5/apidoc/html/ostree-Signature-management.html ostree-2020.6/apidoc/html/ostree-Signature-management.html --- ostree-2020.5/apidoc/html/ostree-Signature-management.html 2020-08-18 18:46:58.000000000 +0000 +++ ostree-2020.6/apidoc/html/ostree-Signature-management.html 2020-09-03 18:46:44.000000000 +0000 @@ -290,6 +290,11 @@   +

out_success_message

+

success message returned by the signing engine.

+[out][nullable][optional] + +

cancellable

A GCancellable

  @@ -346,8 +351,8 @@

signature

-

in case of success will contain signature

-  +

in case of success will contain signature.

+[out]

cancellable

@@ -411,6 +416,11 @@   +

out_success_message

+

success message returned by the signing engine.

+[out][nullable][optional] + +

error

a GError

  @@ -849,6 +859,7 @@

TRUE if summary file has been signed with all provided keys

+

Since: 2020.2

diff -Nru ostree-2020.5/configure ostree-2020.6/configure --- ostree-2020.5/configure 2020-08-18 18:46:47.000000000 +0000 +++ ostree-2020.6/configure 2020-09-03 18:46:23.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libostree 2020.5. +# Generated by GNU Autoconf 2.69 for libostree 2020.6. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libostree' PACKAGE_TARNAME='libostree' -PACKAGE_VERSION='2020.5' -PACKAGE_STRING='libostree 2020.5' +PACKAGE_VERSION='2020.6' +PACKAGE_STRING='libostree 2020.6' PACKAGE_BUGREPORT='walters@verbum.org' PACKAGE_URL='' @@ -1561,7 +1561,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libostree 2020.5 to adapt to many kinds of systems. +\`configure' configures libostree 2020.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1631,7 +1631,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libostree 2020.5:";; + short | recursive ) echo "Configuration of libostree 2020.6:";; esac cat <<\_ACEOF @@ -1896,7 +1896,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libostree configure 2020.5 +libostree configure 2020.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2368,7 +2368,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libostree $as_me 2020.5, which was +It was created by libostree $as_me 2020.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3236,7 +3236,7 @@ # Define the identity of the package. PACKAGE='libostree' - VERSION='2020.5' + VERSION='2020.6' # Some tools Automake needs. @@ -5970,9 +5970,9 @@ YEAR_VERSION=2020 -RELEASE_VERSION=5 +RELEASE_VERSION=6 -PACKAGE_VERSION=2020.5 +PACKAGE_VERSION=2020.6 if echo "$CFLAGS" | grep -q -E -e '-Werror($| )'; then : @@ -19025,7 +19025,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libostree $as_me 2020.5, which was +This file was extended by libostree $as_me 2020.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19091,7 +19091,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libostree config.status 2020.5 +libostree config.status 2020.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru ostree-2020.5/configure.ac ostree-2020.6/configure.ac --- ostree-2020.5/configure.ac 2020-08-18 18:45:20.000000000 +0000 +++ ostree-2020.6/configure.ac 2020-09-03 18:46:13.000000000 +0000 @@ -7,7 +7,7 @@ dnl `git-evtag` to create the tag and push it. Finally, create a GitHub release and attach dnl the tarball from `make dist`. m4_define([year_version], [2020]) -m4_define([release_version], [5]) +m4_define([release_version], [6]) m4_define([package_version], [year_version.release_version]) AC_INIT([libostree], [package_version], [walters@verbum.org]) is_release_build=yes diff -Nru ostree-2020.5/debian/changelog ostree-2020.6/debian/changelog --- ostree-2020.5/debian/changelog 2020-08-21 07:41:27.000000000 +0000 +++ ostree-2020.6/debian/changelog 2020-09-08 10:00:40.000000000 +0000 @@ -1,3 +1,11 @@ +ostree (2020.6-1) unstable; urgency=medium + + * New upstream release + * ostree-boot-examples: Update for ostree-boot being in Debian 10 + * Update documentation: separate /boot should no longer be required + + -- Simon McVittie Tue, 08 Sep 2020 11:00:40 +0100 + ostree (2020.5-1) unstable; urgency=medium * New upstream release diff -Nru ostree-2020.5/debian/control ostree-2020.6/debian/control --- ostree-2020.5/debian/control 2020-08-21 07:41:27.000000000 +0000 +++ ostree-2020.6/debian/control 2020-09-08 10:00:40.000000000 +0000 @@ -176,7 +176,6 @@ integration currently has some limitations: . - the initramfs must have been made using dracut - - /boot must be a separate partition - the boot loader must be one that is supported by libostree, currently GNU GRUB 2, syslinux/extlinux or Das U-Boot diff -Nru ostree-2020.5/debian/ostree-boot-examples/README.md ostree-2020.6/debian/ostree-boot-examples/README.md --- ostree-2020.5/debian/ostree-boot-examples/README.md 2020-08-21 07:41:27.000000000 +0000 +++ ostree-2020.6/debian/ostree-boot-examples/README.md 2020-09-08 10:00:40.000000000 +0000 @@ -1,22 +1,27 @@ # Testing ostree-boot on an existing system -Start from an amd64 Debian system (9 or newer, as long as a backported -ostree-boot package is available) - it will be switched to a Debian -unstable (sid) OSTree-based installation as part of following these -instructions. A VM is obviously most convenient, but bare metal should -work equally. +Start from an amd64 system running Debian 10 or later - it will be +switched to a Debian unstable (sid) OSTree-based installation as part +of following these instructions. A VM is obviously most convenient, +but bare metal should work equally. The installation needs to satisfy the following requirements: -* It must have a separate /boot partition (this is a general libostree - limitation, see [ostree issue 1452][]). * The root partition must not be encrypted. * It must use GRUB and BIOS booting. Other bootloaders or EFI may require different bootloader setup steps; see [old Fedora instructions][] +* If you start from Debian 10 or older, it must have a separate + /boot partition due to limitations in ostree 2020.5 and older. + If the initial installation was with ostree 2020.6 or later, this + is no longer required. -[ostree issue 1452]: https://github.com/ostreedev/ostree/issues/1452 [old Fedora instructions]: https://pagure.io/workstation-ostree-config/blob/5b574d39c63b82b397df789eb4a75a5bdcc13dd0/f/README-install-inside.md +Using a caching apt proxy is suggested; in these examples it's +assumed to be http://192.168.122.1:3142 (apt-cacher-ng on the host system, +as seen from a virtual machine in a default libvirt configuration). +Remove or amend the `http_proxy` if your configuration does not match. + We need the bootloader integration files on the non-OSTree system from which we are switching, as well as in the OSTree-based installation, so the bootloader gets configured properly when we "ostree admin deploy": @@ -34,17 +39,10 @@ script: # chmod +x ./deb-ostree-builder - # ./deb-ostree-builder ./ostree-1.conf sid-1 /ostree/repo - # ./deb-ostree-builder ./ostree-2.conf sid-2 /ostree/repo - -If ostree-boot is not available in the target suite in the Debian -archive yet, then you will need to edit ostree-1.conf and ostree-2.conf to -remove ostree-boot from the bootstrap, and instead put the ostree-boot, -ostree and libostree-1-1 packages in /root/extra-packages, and use -modified-deb-ostree-builder instead of deb-ostree-builder. This is a -temporary hack to solve the chicken-and-egg situation of not adding -ostree-boot to the Debian archive until it is testable, but not being -able to test it until it is in the archive. + # http_proxy=http://192.168.122.1:3142 ./deb-ostree-builder \ + ./ostree-1.conf sid-1 /ostree/repo + # http_proxy=http://192.168.122.1:3142 ./deb-ostree-builder \ + ./ostree-2.conf sid-2 /ostree/repo Then we deploy the first of those commits: diff -Nru ostree-2020.5/debian/ostree-boot.README.Debian ostree-2020.6/debian/ostree-boot.README.Debian --- ostree-2020.5/debian/ostree-boot.README.Debian 2020-08-21 07:41:27.000000000 +0000 +++ ostree-2020.6/debian/ostree-boot.README.Debian 2020-09-08 10:00:40.000000000 +0000 @@ -5,6 +5,5 @@ - the root filesystem must be one that dracut can mount without a root= command-line argument (an EFI partition with the GUID defined in the Discoverable Partitions specification[1]) - - /boot must be a separate partition [1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ diff -Nru ostree-2020.5/debian/patches/debian/Skip-test-pull-repeated-during-CI.patch ostree-2020.6/debian/patches/debian/Skip-test-pull-repeated-during-CI.patch --- ostree-2020.5/debian/patches/debian/Skip-test-pull-repeated-during-CI.patch 2020-08-21 07:41:27.000000000 +0000 +++ ostree-2020.6/debian/patches/debian/Skip-test-pull-repeated-during-CI.patch 2020-09-08 10:00:40.000000000 +0000 @@ -18,7 +18,7 @@ 1 file changed, 4 insertions(+) diff --git a/tests/test-pull-repeated.sh b/tests/test-pull-repeated.sh -index 237a863..c646c13 100755 +index f0ea157..e068e0f 100755 --- a/tests/test-pull-repeated.sh +++ b/tests/test-pull-repeated.sh @@ -23,6 +23,10 @@ set -euo pipefail diff -Nru ostree-2020.5/src/boot/mkinitcpio/ostree ostree-2020.6/src/boot/mkinitcpio/ostree --- ostree-2020.5/src/boot/mkinitcpio/ostree 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/boot/mkinitcpio/ostree 2020-08-26 18:41:39.000000000 +0000 @@ -5,6 +5,6 @@ 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 } diff -Nru ostree-2020.5/src/boot/ostree-prepare-root.service ostree-2020.6/src/boot/ostree-prepare-root.service --- ostree-2020.5/src/boot/ostree-prepare-root.service 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/boot/ostree-prepare-root.service 2020-08-23 20:16:58.000000000 +0000 @@ -30,6 +30,6 @@ Type=oneshot ExecStart=/usr/lib/ostree/ostree-prepare-root /sysroot StandardInput=null -StandardOutput=syslog -StandardError=syslog+console +StandardOutput=journal +StandardError=journal+console RemainAfterExit=yes diff -Nru ostree-2020.5/src/boot/ostree-remount.service ostree-2020.6/src/boot/ostree-remount.service --- ostree-2020.5/src/boot/ostree-remount.service 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/boot/ostree-remount.service 2020-08-23 20:16:58.000000000 +0000 @@ -35,8 +35,8 @@ 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 diff -Nru ostree-2020.5/src/libostree/ostree-bootloader-syslinux.c ostree-2020.6/src/libostree/ostree-bootloader-syslinux.c --- ostree-2020.5/src/libostree/ostree-bootloader-syslinux.c 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-bootloader-syslinux.c 2020-08-21 22:01:49.000000000 +0000 @@ -89,15 +89,15 @@ 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 @@ 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 len; i++) { diff -Nru ostree-2020.5/src/libostree/ostree-bootloader-uboot.c ostree-2020.6/src/libostree/ostree-bootloader-uboot.c --- ostree-2020.5/src/libostree/ostree-bootloader-uboot.c 2020-08-05 13:59:11.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-bootloader-uboot.c 2020-08-21 22:01:49.000000000 +0000 @@ -134,19 +134,19 @@ "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) diff -Nru ostree-2020.5/src/libostree/ostree-linuxfsutil.c ostree-2020.6/src/libostree/ostree-linuxfsutil.c --- ostree-2020.5/src/libostree/ostree-linuxfsutil.c 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-linuxfsutil.c 2020-08-23 20:16:58.000000000 +0000 @@ -55,7 +55,7 @@ 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) { diff -Nru ostree-2020.5/src/libostree/ostree-repo-commit.c ostree-2020.6/src/libostree/ostree-repo-commit.c --- ostree-2020.5/src/libostree/ostree-repo-commit.c 2020-08-05 13:59:11.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-repo-commit.c 2020-08-27 17:07:32.000000000 +0000 @@ -4332,6 +4332,8 @@ * 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, diff -Nru ostree-2020.5/src/libostree/ostree-repo-pull.c ostree-2020.6/src/libostree/ostree-repo-pull.c --- ostree-2020.5/src/libostree/ostree-repo-pull.c 2020-08-16 15:49:25.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-repo-pull.c 2020-08-21 22:01:49.000000000 +0000 @@ -436,8 +436,9 @@ 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 { diff -Nru ostree-2020.5/src/libostree/ostree-sign.c ostree-2020.6/src/libostree/ostree-sign.c --- ostree-2020.5/src/libostree/ostree-sign.c 2020-08-05 13:59:11.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-sign.c 2020-08-27 17:07:32.000000000 +0000 @@ -271,7 +271,7 @@ * 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 @@ * @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 @@ * @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 @@ * 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, diff -Nru ostree-2020.5/src/libostree/ostree-sign.h ostree-2020.6/src/libostree/ostree-sign.h --- ostree-2020.5/src/libostree/ostree-sign.h 2020-08-05 13:59:11.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-sign.h 2020-08-27 17:07:32.000000000 +0000 @@ -52,6 +52,8 @@ /** * OSTREE_SIGN_NAME_ED25519: * The name of the default ed25519 signing type. + * + * Since: 2020.4 */ #define OSTREE_SIGN_NAME_ED25519 "ed25519" diff -Nru ostree-2020.5/src/libostree/ostree-sysroot-deploy.c ostree-2020.6/src/libostree/ostree-sysroot-deploy.c --- ostree-2020.5/src/libostree/ostree-sysroot-deploy.c 2020-08-18 15:54:25.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-sysroot-deploy.c 2020-08-21 22:01:49.000000000 +0000 @@ -1994,6 +1994,12 @@ 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 diff -Nru ostree-2020.5/src/libostree/ostree-version.h ostree-2020.6/src/libostree/ostree-version.h --- ostree-2020.5/src/libostree/ostree-version.h 2020-08-18 18:46:52.000000000 +0000 +++ ostree-2020.6/src/libostree/ostree-version.h 2020-09-03 18:46:26.000000000 +0000 @@ -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)) diff -Nru ostree-2020.5/src/ostree/ot-admin-builtin-pin.c ostree-2020.6/src/ostree/ot-admin-builtin-pin.c --- ostree-2020.5/src/ostree/ot-admin-builtin-pin.c 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/ostree/ot-admin-builtin-pin.c 2020-08-21 22:01:49.000000000 +0000 @@ -55,7 +55,14 @@ 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) diff -Nru ostree-2020.5/src/switchroot/ostree-prepare-root.c ostree-2020.6/src/switchroot/ostree-prepare-root.c --- ostree-2020.5/src/switchroot/ostree-prepare-root.c 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/src/switchroot/ostree-prepare-root.c 2020-09-03 16:56:43.000000000 +0000 @@ -101,10 +101,9 @@ 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 @@ * 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); diff -Nru ostree-2020.5/src/switchroot/ostree-remount.c ostree-2020.6/src/switchroot/ostree-remount.c --- ostree-2020.5/src/switchroot/ostree-remount.c 2020-08-06 00:16:58.000000000 +0000 +++ ostree-2020.6/src/switchroot/ostree-remount.c 2020-08-31 21:13:12.000000000 +0000 @@ -112,6 +112,11 @@ 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. diff -Nru ostree-2020.5/tests/bootloader-entries-crosscheck.py ostree-2020.6/tests/bootloader-entries-crosscheck.py --- ostree-2020.5/tests/bootloader-entries-crosscheck.py 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/tests/bootloader-entries-crosscheck.py 2020-08-21 22:01:49.000000000 +0000 @@ -73,36 +73,56 @@ syslinux_entry = None syslinux_default = None for line in f: - line = line.strip() - if line.startswith('DEFAULT '): + try: + k, v = line.strip().split(" ", 1) + except ValueError: + continue + if k == 'DEFAULT': if syslinux_entry is not None: - syslinux_default = line.split(' ', 1)[1] - elif line.startswith('LABEL '): + syslinux_default = v + elif k == 'LABEL': if syslinux_entry is not None: syslinux_entries.append(syslinux_entry) syslinux_entry = {} - syslinux_entry['title'] = line.split(' ', 1)[1] - elif line.startswith('KERNEL '): - syslinux_entry['linux'] = line.split(' ', 1)[1] - elif line.startswith('INITRD '): - syslinux_entry['initrd'] = line.split(' ', 1)[1] - elif line.startswith('APPEND '): - syslinux_entry['options'] = line.split(' ', 1)[1] + syslinux_entry['title'] = v + elif k == 'KERNEL': + syslinux_entry['linux'] = v + elif k == 'INITRD': + syslinux_entry['initrd'] = v + elif k == 'APPEND': + syslinux_entry['options'] = v if syslinux_entry is not None: syslinux_entries.append(syslinux_entry) if len(entries) != len(syslinux_entries): fatal("Found {0} loader entries, but {1} SYSLINUX entries\n".format(len(entries), len(syslinux_entries))) -def assert_matches_key(a, b, key): + +def assert_eq(a, b): + assert a == b, "%r == %r" % (a, b) + + +def assert_key_same_file(a, b, key): aval = a[key] bval = b[key] - if aval != bval: - fatal("Mismatch on {0}: {1} != {2}".format(key, aval, bval)) + sys.stderr.write("aval: %r\nbval: %r\n" % (aval, bval)) + + # Paths in entries are always relative to /boot + entry = os.stat(sysroot + "/boot" + aval) + + # Syslinux entries can be relative to /boot (if it's on another filesystem) + # or relative to / if /boot is on /. + s1 = os.stat(sysroot + bval) + s2 = os.stat(sysroot + "/boot" + bval) + + # A symlink ensures that no matter what they point at the same file + assert_eq(entry, s1) + assert_eq(entry, s2) + for i,(entry,syslinuxentry) in enumerate(zip(entries, syslinux_entries)): - assert_matches_key(entry, syslinuxentry, 'linux') - assert_matches_key(entry, syslinuxentry, 'initrd') + assert_key_same_file(entry, syslinuxentry, 'linux') + assert_key_same_file(entry, syslinuxentry, 'initrd') entry_ostree = get_ostree_option(entry['options']) syslinux_ostree = get_ostree_option(syslinuxentry['options']) if entry_ostree != syslinux_ostree: diff -Nru ostree-2020.5/tests/test-admin-deploy-2.sh ostree-2020.6/tests/test-admin-deploy-2.sh --- ostree-2020.5/tests/test-admin-deploy-2.sh 2020-07-13 09:48:56.000000000 +0000 +++ ostree-2020.6/tests/test-admin-deploy-2.sh 2020-08-21 22:01:49.000000000 +0000 @@ -26,7 +26,7 @@ # Exports OSTREE_SYSROOT so --sysroot not needed. setup_os_repository "archive" "syslinux" -echo "1..7" +echo "1..8" ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) @@ -102,6 +102,13 @@ assert_n_pinned 0 echo "ok pin unpin" +for p in medal 0medal '' 5000 9999999999999999999999999999999999999; do + if ${CMD_PREFIX} ostree admin pin ${p}; then + fatal "created invalid pin ${p}" + fi +done +echo "ok invalid pin" + ${CMD_PREFIX} ostree admin pin 0 1 assert_n_pinned 2 assert_n_deployments 2