IPSers,

For the opensolaris May release the install team is integrating snap upgrade 
which is comprised of a Boot Environment CLI, a C library to manage the BE's 
and a glue library to convert Python calls -> C for interfacing with the C 
library. This is the Live Upgrade replacement. See 
http://www.opensolaris.org/os/project/caiman/Snap_Upgrade for more details.

My proposal is to modify pkg(1) to make use of the Snap Upgrade tools. So I am 
in the process of modifying pkg(1) to support the following scenarios:

pkg image_update
    - Take a snapshot of the BE before the attempted update
    - Clone and mount the snapshot
    - Update the clone
    - If there are update errors:
        ~ destroy the snapshot, unmount and destroy clone
            leaving the live BE untouched.
        ~ display appropriate note to user
    - If there are no errors:
        ~ activate the clone but do not force a reboot
        ~ destroy the snapshot
        ~ display note to user that on the next reboot
             the clone will be the live BE 

pkg -R <dir> image_update
    - Take a snapshot of the BE before the attempted update
    - Update the BE mounted at <dir>
    - If there are update errors:
        ~ clone the snapshot
        ~ unmount and destroy original BE
        ~ promote, rename and mount the clone at original BE
        ~ destroy the snapshot
        ~ display to user that the attempt failed
    - If there are no errors:
        destroy the snapshot

pkg install & uninstall ...
    - Take a snapshot before the attempted install/uninstall
    - install/uninstall to the live BE (see Note below)
    - If there are install/uninstall errors:
        ~ clone the snapshot
        ~ mount it but do not activate. 
        ~ display to user that the failed attempt
            can be restored by activating the clone and rebooting
    - If there are no installation errors:
        destroy the snapshot.

pkg -R <dir> install @ uninstall ...
    - Take a snapshot of the BE before the attempted install/uninstall
    - install/uninstall to the BE mounted at <dir>
    - If there are install/uninstall errors:
        ~ clone the snapshot
        ~ unmount and destroy original BE
        ~ promote, rename and mount the clone to original BE
        ~ destroy the snapshot
        ~ display to user that the failed attempt
             can be restored by activating the clone and rebooting
    - If there are no installation errors:
        destroy the snapshot.

Note that after talking with Bart and others there still needs to be a 
determination on whether an install or uninstall will require a reboot. This 
proposal does not make any assumptions about requiring a reboot for the 
install/uninstall operation to a live BE and does not propose to solve this 
issue. It is providing generic support for pkg operation failures and recovery 
methods.

Thanks
Tim

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to