I'm submitting the following fast-track on behalf of Jan Setje-Eilers.

The project believes this qualifies for automatic approval and I've
filed it as such, but can promote to a full fast-track if anyone
prefers.

The proposal is to add a command-line -u option to installboot and
installgrub with Consolidation Private commitment and minor release
binding.

----


1) Summary

        Updating the boot block on a pool with multiple zfs boot
        environments during upgrades should involve a check to avoid
        potentially downgrading the boot block.

2) Technical Details

  2.0) Background

        With the advent of zfs boot, multiple versions of the OS
        can reside in a single area of a device (entire device, partition
        or slice). This forces them to share a single boot loader which
        imposes the following issues:

                a) Newer boot loaders must be able to load older versions
                   of the OS.

                        This is ultimately an implementation issue and
                        is not part of this case.

                b) During upgrade care must be taken to avoid replacing
                   what might be a newer copy of a boot loader with an
                   older one.

                        This issue can arise if a BE is cloned and
                        updated to a newer version and is subsequently
                        fallen back to and then again cloned and updated
                        to an intermediate version.

  2.1) Current state

        2.1.1) SPARC

                In order to avoid potentially downgrading the loader on SPARC
                it is simply never updated. This is poor.

        2.1.2) x86

                On x86 the private concept of a capability file was
                introduced to attempt to capture both a version and
                features a specific copy of GRUB might supply. This
                relied on being able to see all the capability files
                of available BEs. It also required manual updates of
                the file.

  2.2 Proposed Solution

        2.2.1) Mechanism

                A version string is embedded into the installed boot block
                when it is installed. That string can then be parsed and
                compared against a potentially newer string on subsequent
                installs.

        2.2.2) Implementation details

                The string is supplied by the packaging information and is
                ultimately a consolidation private bit of information that
                is generated in the same place that the tools to parse and
                compare it are built.

                For the sake of the current bits this will be the package
                fmri which will gain minor and micro version numbers
                to allow some manual control in addition to the release
                and build numbers as well as time-stamps.

                However the SVR4 package version could have been used
                just as well, and the tool could explicitly handle a
                transition to a new type of string if the need were to
                arise.

                For the sake of this case package fmris are treated
                as external and may evolve.

                However at the moment an fmri might look like this:

 pkg://opensolaris.org/system/boot/[email protected],5.11-0.136:20100316T170914Z

                In this example each of the following are tested to
                be greater, equal or lower. A result of greater (newer) will
                force an install (update). A result of equal will move on to
                the next check (or in the final case result in no install).
                A result of lower will block an install.

                0.97    external version
                123     minor version (Solaris specific features)
                456     micro version (Solaris specific changes/fixes)
                5       major OS version
                11      minor OS version
                0       release number
                136     build number
                20100316T170914Z        time stamp

                The publisher is ignored when computing newerness, but
                is written to the installed boot block.

                Lack of an embedded version (or complete lack of a booter)
                is treated as an event worthy of getting the booter onto
                a more supportable train and loader is installed and the
                version string is written. This covers situations such
                as a developer modification (bfu, manual installboot
                invocation) of one BE followed by falling back to another
                and then updating from there.

                The version string is validated to be parsable and comparable
                and the entire operation returns failure if the string
                can not be worked with. This is done to avoid creating
                a situation where installed bits can not be updated from.

3) Consolidation Private Interfaces

        This interface is being developed for libbe which is bound for
        the OS/Net consolidation, so the commitment level is consolidation
        private.

        Both installboot and installgrub gain a -u option that
        takes the version string.

        3.1) installboot

                installboot [-F fstype] [-u<version>] bootblk raw-device

        3.2) installgrub

                installgrub [-fm] [-u<version>] stage1 stage2 raw-device

        Both check the version against a version supplied by a previously
        installed boot block and will only update the boot block if the
        install is deemed to be an upgrade.

        Lack of an embedded version (or complete lack of a booter) will
        result in an install.


_______________________________________________
opensolaris-arc mailing list
[email protected]

Reply via email to