Bug 24749 - Extend ConsoleKit to support GetAvailableOperatingSystems and RebootWithParameters
Summary: Extend ConsoleKit to support GetAvailableOperatingSystems and RebootWithParam...
Status: NEW
Alias: None
Product: ConsoleKit
Classification: Unclassified
Component: Daemon (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: william.jon.mccann
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-27 01:02 UTC by Jedy Wang
Modified: 2009-10-28 02:06 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to fix the problem (16.03 KB, patch)
2009-10-28 02:00 UTC, Jedy Wang
Details | Splinter Review

Description Jedy Wang 2009-10-27 01:02:09 UTC
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.

 GetAvailableOperatingSystems(out array<OperatingSystem>);

with something like

 struct OperatingSystem
 {
   string os_id;
   string os_vendor;
   string os_version;
   string os_name;
   boolean default;
 };

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);

or something.

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.
Comment 1 Jedy Wang 2009-10-27 01:03:10 UTC
I have already have a patch for OpenSolaris and I will post it soon.
Comment 2 Jedy Wang 2009-10-28 02:00:13 UTC
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.
Comment 3 Jedy Wang 2009-10-28 02:06:15 UTC
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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.