As David Zeuthen suggested in http://lists.freedesktop.org/archives/consolekit/2009-September/000044.html, it's good for ConsoleKit to support retrieving available operating systems and rebooting into one of them.
He suggested the following 2 D-Bus methods should be added.
with something like
where os_vendor ('fedora', 'ubuntu', 'kubuntu', 'suse', 'sun',
'microsoft'), os_version ('11', '6.06', 'Vista', '7', ...) and os_name
('Fedora 11', 'Ubunty Dapper', 'Microsoft XP', ...) being defined in
the CK docs. And 'id' would be an opaque identifier (with few
guarantees - might change after a reboot / reconfiguration) that is
supposed to be used with
RebootIntoOperatingSystem(in string os_id, boolean make_default);
Because it's hard to pass multi parameters by using check_polkit_permissions/check_rbac_permissions because AuthorizedCallback does not take any argument. So I modified
RebootIntoOperatingSystem(in string os_id, boolean make_default)
a little. The new interface I use in my code is
RebootWithParameters(in string parameter)
The parameter is something like "id:0 default:1" which is OS specific.
I have already have a patch for OpenSolaris and I will post it soon.
Created attachment 30765 [details] [review]
patch to fix the problem
Patch to implement 2 D-Bus method for OpenSolaris. For Linux, GetAvailableOperatingSystems just return an empty array and RestartWithParameters just do the same thing as Restart.
For OpenSolaris, GetAvailableOperatingSystem returns available BEs (BE stands for Boot Environment) and RestartWithParameters takes parameter string like "id:0 fast". "id" is the id of the BE you want to restart into and "fast" means you want to do a fast reboot.
For more information about fast reboot and BE on OpenSolaris, please refer to http://hub.opensolaris.org/bin/view/Project+intel-platform/fastrebootdocs