After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691546 - Automatically install QXL drivers for Windows XP
Automatically install QXL drivers for Windows XP
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: installer
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks: 686781
 
 
Reported: 2013-01-11 13:15 UTC by Alexander Larsson
Modified: 2016-03-31 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
installer: Get rid of get_unattended_disk_info() method (3.52 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Set bus on unattended disk config (1.39 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Update progress on error to setup driver (1.44 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Add a secondary unattended disk (8.42 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Add get_post_installer_scripts() (1.55 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Add get_post_installable_drivers() (1.59 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Generalize setup_pre_install_driver*() (5.45 KB, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
configure: Require libosinfo >= 0.2.4 (712 bytes, patch)
2013-01-28 03:21 UTC, Zeeshan Ali
none Details | Review
installer: Ensure compatability between driver and scripts (3.86 KB, patch)
2013-01-28 03:22 UTC, Zeeshan Ali
none Details | Review
installer: Setup post-installation drivers (3.37 KB, patch)
2013-01-28 03:22 UTC, Zeeshan Ali
none Details | Review
installer: Get rid of get_unattended_disk_info() method (3.52 KB, patch)
2013-02-11 03:48 UTC, Zeeshan Ali
committed Details | Review
installer: Set bus on unattended disk config (1.51 KB, patch)
2013-02-11 04:01 UTC, Zeeshan Ali
committed Details | Review
installer: Update progress on error to setup driver (1.44 KB, patch)
2013-02-11 04:01 UTC, Zeeshan Ali
accepted-commit_now Details | Review
installer: Add a secondary unattended disk (8.43 KB, patch)
2013-02-11 04:02 UTC, Zeeshan Ali
none Details | Review
installer: Add get_post_installer_scripts() (1.56 KB, patch)
2013-02-11 04:02 UTC, Zeeshan Ali
none Details | Review
installer: Add get_post_installable_drivers() (1.59 KB, patch)
2013-02-11 04:02 UTC, Zeeshan Ali
none Details | Review
installer: Generalize setup_pre_install_driver*() (5.77 KB, patch)
2013-02-11 04:03 UTC, Zeeshan Ali
reviewed Details | Review
configure: Require libosinfo >= 0.2.4 (714 bytes, patch)
2013-02-11 04:03 UTC, Zeeshan Ali
none Details | Review
installer: Ensure compatibility between drivers and scripts (4.86 KB, patch)
2013-02-11 04:03 UTC, Zeeshan Ali
none Details | Review
installer: Disable driver signing checks (1.29 KB, patch)
2013-02-11 04:03 UTC, Zeeshan Ali
none Details | Review
installer: Setup post-installation drivers (4.38 KB, patch)
2013-02-11 04:04 UTC, Zeeshan Ali
none Details | Review
installer: Add a secondary unattended disk (8.62 KB, patch)
2013-02-15 16:10 UTC, Zeeshan Ali
reviewed Details | Review
installer: Add get_post_installer_scripts() (1.56 KB, patch)
2013-02-15 16:11 UTC, Zeeshan Ali
committed Details | Review
installer: Add get_post_installable_drivers() (1.59 KB, patch)
2013-02-15 16:11 UTC, Zeeshan Ali
committed Details | Review
installer: Ensure compatibility between drivers and scripts (4.46 KB, patch)
2013-02-15 16:16 UTC, Zeeshan Ali
none Details | Review
installer: Setup post-installation drivers (3.95 KB, patch)
2013-02-15 16:17 UTC, Zeeshan Ali
none Details | Review
installer: Setup post-installation drivers (3.09 KB, patch)
2013-02-18 16:08 UTC, Zeeshan Ali
accepted-commit_now Details | Review
installer: Update progress on error to setup driver (1.99 KB, patch)
2013-02-19 19:37 UTC, Zeeshan Ali
committed Details | Review
installer: Add a secondary unattended disk (7.44 KB, patch)
2013-02-19 19:38 UTC, Zeeshan Ali
committed Details | Review
installer: Generalize setup_pre_install_driver*() (5.84 KB, patch)
2013-02-19 19:39 UTC, Zeeshan Ali
committed Details | Review
installer: Setup post-installation drivers (3.08 KB, patch)
2013-02-19 20:06 UTC, Zeeshan Ali
committed Details | Review
configure: Require libosinfo >= 0.2.6 (710 bytes, patch)
2013-03-15 01:51 UTC, Zeeshan Ali
committed Details | Review
installer: Disable driver signing (1.18 KB, patch)
2013-03-15 01:51 UTC, Zeeshan Ali
needs-work Details | Review
installer: Ensure compatibility between drivers and scripts (4.26 KB, patch)
2013-03-15 01:51 UTC, Zeeshan Ali
none Details | Review
installer: Filter drivers by architecture first (1.90 KB, patch)
2013-03-15 01:51 UTC, Zeeshan Ali
committed Details | Review
installer: Ensure compatibility between drivers and scripts (3.15 KB, patch)
2013-03-15 15:42 UTC, Zeeshan Ali
accepted-commit_now Details | Review
installer: Disable driver signing for unsigned drivers (3.36 KB, patch)
2013-03-15 15:42 UTC, Zeeshan Ali
reviewed Details | Review
installer: Ensure compatibility between drivers and scripts (3.26 KB, patch)
2013-03-18 16:18 UTC, Zeeshan Ali
accepted-commit_now Details | Review
installer: Disable driver signing for unsigned drivers (2.93 KB, patch)
2013-03-18 16:18 UTC, Zeeshan Ali
needs-work Details | Review
installer: Ensure compatibility between drivers and scripts (4.62 KB, patch)
2013-03-18 22:57 UTC, Zeeshan Ali
committed Details | Review
installer: Disable driver signing for unsigned drivers (3.05 KB, patch)
2013-03-19 14:49 UTC, Zeeshan Ali
committed Details | Review

Description Alexander Larsson 2013-01-11 13:15:17 UTC
boxes is kinda useless without QXL drivers, so our express installers should install it automatically.
Comment 1 Zeeshan Ali 2013-01-18 02:14:17 UTC
Just FYI, I'm working on this..
Comment 2 Zeeshan Ali 2013-01-23 00:47:58 UTC
So in the end I failed to get this working in a nice/acceptable way. :( Here are the approaches I took:

* Install QXL driver during pre-installation just like the viostor driver. Windows XP and 7 simply ignore the QXL and there is no indication in the several installation log files about qxl. It only needed changes in libosinfo:

https://gitorious.org/libosinfo/libosinfo/commits/preinst-all-virtio

* Install QXL driver during post-installation:
  * using the all-in-one spice-guest-tools-0.3.exe . This is the only one I was successful in getting to work but Boxes changes requires are ugly. More details in the commit logs:
https://gitorious.org/libosinfo/libosinfo/commits/posinst-drivers
https://gitorious.org/gnome-boxes/gnome-boxes/commits/postinstall-drivers
  * using individual driver files put in the right place on the unattended disk and informing windows about the location of the drivers from unattended file. I failed to get windows XP (didn't try with windows 7) to install the drivers this way either. Just like the first approach above, the drivers are simply ignored and nothing in the logs that could give any clues. This approach should work according to these unofficial docs: http://unattended.msfn.org/unattended.xp/view/web/34/

Here are the commits:
https://gitorious.org/libosinfo/libosinfo/commits/posinst-drivers-only
https://gitorious.org/gnome-boxes/gnome-boxes/commits/postinstall-drivers-w/o-disk2

Suggestions on how to proceed further welcome!
Comment 3 Alexander Larsson 2013-01-23 08:48:17 UTC
Maybe just put spice-guest-tools-0.3.exe on the desktop after install? With a label that says you need to run it?
Comment 4 Christophe Fergeau 2013-01-23 11:07:00 UTC
10:35 <@teuf> I'm quite sure we should even be able to cherry pick which drivers to install/not install
10:37 <@teuf> it seems the ugly changes zeenix is talking about would be avoided by generating an iso instead of a fat image
10:44  * teuf wonders if it would be possible to cheat using target or address libvirt disk nodes

A few notes from my IRC log
Comment 5 Zeeshan Ali 2013-01-28 03:21:37 UTC
Created attachment 234574 [details] [review]
installer: Get rid of get_unattended_disk_info() method

Keeping get_unattended_disk_info() separate from
get_unattended_disk_config wasn't really helping readability much
already and more so with the changes to follow.
Comment 6 Zeeshan Ali 2013-01-28 03:21:41 UTC
Created attachment 234575 [details] [review]
installer: Set bus on unattended disk config
Comment 7 Zeeshan Ali 2013-01-28 03:21:44 UTC
Created attachment 234576 [details] [review]
installer: Update progress on error to setup driver
Comment 8 Zeeshan Ali 2013-01-28 03:21:47 UTC
Created attachment 234577 [details] [review]
installer: Add a secondary unattended disk

In the following patches, we are going to add support for
post-installation drivers and the first one to come from libosinfo is
going to take 13M more. Its time to add a secondary disk in ISO format
that we create on demand at runtime.
Comment 9 Zeeshan Ali 2013-01-28 03:21:49 UTC
Created attachment 234578 [details] [review]
installer: Add get_post_installer_scripts()

Add method to fetch scripts that can install drivers at the end of OS
installation.
Comment 10 Zeeshan Ali 2013-01-28 03:21:52 UTC
Created attachment 234579 [details] [review]
installer: Add get_post_installable_drivers()

Add method to fetch all post-installable device drivers.
Comment 11 Zeeshan Ali 2013-01-28 03:21:56 UTC
Created attachment 234580 [details] [review]
installer: Generalize setup_pre_install_driver*()

Generalize setup_pre_install_driver*() so they are no longer
specific to pre-installer drivers/scripts but rather use passed
delegate to add files to either of the unattended files list.

Naturally they are also renamed appropriately.
Comment 12 Zeeshan Ali 2013-01-28 03:21:59 UTC
Created attachment 234581 [details] [review]
configure: Require libosinfo >= 0.2.4
Comment 13 Zeeshan Ali 2013-01-28 03:22:02 UTC
Created attachment 234582 [details] [review]
installer: Ensure compatability between driver and scripts

For each driver and script, make use of new libosinfo API to ensure:

1. Either the driver is signed or script can handle unsigned drivers.
2. Driver is of the same format as script expects.
Comment 14 Zeeshan Ali 2013-01-28 03:22:05 UTC
Created attachment 234583 [details] [review]
installer: Setup post-installation drivers
Comment 15 Zeeshan Ali 2013-01-28 03:27:10 UTC
(In reply to comment #12)
> Created an attachment (id=234581) [details] [review]
> configure: Require libosinfo >= 0.2.4

This actually means the following changes require my yet-to-be-reviewed patches on libosinfo list.
Comment 16 Christophe Fergeau 2013-01-28 09:30:23 UTC
Review of attachment 234575 [details] [review]:

The commit log should indicate why we need to do this (cleaner, fixes a bug, needed by the subsequent patches, ...)
Comment 17 Christophe Fergeau 2013-01-28 09:35:19 UTC
Review of attachment 234582 [details] [review]:

s/compatability/compatibility/
Comment 18 Zeeshan Ali 2013-02-11 03:48:43 UTC
Created attachment 235662 [details] [review]
installer: Get rid of get_unattended_disk_info() method

Keeping get_unattended_disk_info() separate from
get_unattended_disk_config wasn't really helping readability much
already and more so with the changes to follow.
Comment 19 Zeeshan Ali 2013-02-11 04:01:30 UTC
Created attachment 235663 [details] [review]
installer: Set bus on unattended disk config

Don't exactly remember anymore if this is strictly needed but I don't
think it'll do any harm to be explicit about the bus.
Comment 20 Zeeshan Ali 2013-02-11 04:01:44 UTC
Created attachment 235664 [details] [review]
installer: Update progress on error to setup driver
Comment 21 Zeeshan Ali 2013-02-11 04:02:01 UTC
Created attachment 235665 [details] [review]
installer: Add a secondary unattended disk

In the following patches, we are going to add support for
post-installation drivers and the first one to come from libosinfo is
going to take 13M more. Its time to add a secondary disk in ISO format
that we create on demand at runtime.
Comment 22 Zeeshan Ali 2013-02-11 04:02:37 UTC
Created attachment 235666 [details] [review]
installer: Add get_post_installer_scripts()

Add method to fetch scripts that can install drivers at the end of OS
installation.
Comment 23 Zeeshan Ali 2013-02-11 04:02:59 UTC
Created attachment 235667 [details] [review]
installer: Add get_post_installable_drivers()

Add method to fetch all post-installable device drivers.
Comment 24 Zeeshan Ali 2013-02-11 04:03:10 UTC
Created attachment 235668 [details] [review]
installer: Generalize setup_pre_install_driver*()

Generalize setup_pre_install_driver*() so they are no longer
specific to pre-installer drivers/scripts but rather use passed
delegate to add files to either of the unattended files list.

Naturally they are also renamed appropriately.
Comment 25 Zeeshan Ali 2013-02-11 04:03:20 UTC
Created attachment 235669 [details] [review]
configure: Require libosinfo >= 0.2.4
Comment 26 Zeeshan Ali 2013-02-11 04:03:35 UTC
Created attachment 235670 [details] [review]
installer: Ensure compatibility between drivers and scripts

For each driver and script, make use of new libosinfo API to ensure:

1. Either the driver is signed, script can handle unsigned drivers or
   driver signing checks can be disabled.
2. Driver is of the same format as script expects.
Comment 27 Zeeshan Ali 2013-02-11 04:03:59 UTC
Created attachment 235671 [details] [review]
installer: Disable driver signing checks

Although this raises some security concerns as doing this for at least
Windows XP mean disabling this permanently. i-e After installation users
can shoot themselves in the feet by installing potentially dangerous
drivers. However, this is the only possible way to get virtio and QXL
device drivers installed out of the box.

Perhaps this should be configurable through build-time configure option
and/or a dconf setting?
Comment 28 Zeeshan Ali 2013-02-11 04:04:22 UTC
Created attachment 235672 [details] [review]
installer: Setup post-installation drivers
Comment 29 Zeeshan Ali 2013-02-11 04:08:36 UTC
This version 2 of patches is mostly rebase/rework on top of the version 2 of related libosinfo patches + addressing the two comments from Christophe.
Comment 30 Zeeshan Ali 2013-02-11 04:11:12 UTC
These are the required libosinfo patches:

https://www.redhat.com/archives/libosinfo/2013-February/msg00026.html
Comment 31 Zeeshan Ali 2013-02-15 16:10:35 UTC
Created attachment 236262 [details] [review]
installer: Add a secondary unattended disk

v3: Actually remove the disk from config after installation.
Comment 32 Zeeshan Ali 2013-02-15 16:11:29 UTC
Created attachment 236263 [details] [review]
installer: Add get_post_installer_scripts()

v3: Update according to latest libosinfo API proposal.
Comment 33 Zeeshan Ali 2013-02-15 16:11:56 UTC
Created attachment 236264 [details] [review]
installer: Add get_post_installable_drivers()

v3: Update according to latest libosinfo API proposal.
Comment 34 Zeeshan Ali 2013-02-15 16:16:42 UTC
Created attachment 236265 [details] [review]
installer: Ensure compatibility between drivers and scripts

v3: Update according to latest libosinfo API proposal
Comment 35 Zeeshan Ali 2013-02-15 16:17:11 UTC
Created attachment 236266 [details] [review]
installer: Setup post-installation drivers

v3: Update according to latest libosinfo API proposal
Comment 36 Zeeshan Ali 2013-02-18 16:02:17 UTC
Comment on attachment 236265 [details] [review]
installer: Ensure compatibility between drivers and scripts

NM this one for now
Comment 37 Zeeshan Ali 2013-02-18 16:06:17 UTC
Comment on attachment 235669 [details] [review]
configure: Require libosinfo >= 0.2.4

this one too
Comment 38 Zeeshan Ali 2013-02-18 16:08:20 UTC
Created attachment 236622 [details] [review]
installer: Setup post-installation drivers

Rebased after removing two patches under it.
Comment 39 Christophe Fergeau 2013-02-19 11:49:40 UTC
No clue which patches are current, which are not, I guess everything before the 15th is obsolete, but even then this does not apply to git master in the order the patches are in this bug.
Comment 40 Christophe Fergeau 2013-02-19 12:20:13 UTC
Review of attachment 236264 [details] [review]:

::: src/unattended-installer.vala
@@ +703,3 @@
+
+    private GLib.List<DeviceDriver> get_post_installable_drivers () {
+        return get_drivers ((driver) => { return !driver.get_pre_installable (); });

The asymmetry with [PATCH] installer: Add get_post_installer_scripts() which uses "return script.get_can_post_install_dri.." is a bit unexpected
Comment 41 Christophe Fergeau 2013-02-19 12:25:49 UTC
Review of attachment 236263 [details] [review]:

::: src/unattended-installer.vala
@@ +724,3 @@
+        return get_scripts ((script) => { return script.get_can_post_install_drivers (); });
+    }
+

libosinfo associating drivers with a specific script combined with OS installers needing multiple install scripts is awkward imo, it would be much nicer if there was a higher level object combining all the install scripts together and which exposes the drivers.
Comment 42 Zeeshan Ali 2013-02-19 13:23:01 UTC
(In reply to comment #39)
> No clue which patches are current, which are not, I guess everything before the
> 15th is obsolete, but even then this does not apply to git master in the order
> the patches are in this bug.

I have taken care of marking the obsolete patches as such. So all patches here needs to be reviewed.
Comment 43 Christophe Fergeau 2013-02-19 13:49:46 UTC
(In reply to comment #42)
> (In reply to comment #39)
> > No clue which patches are current, which are not, I guess everything before the
> > 15th is obsolete, but even then this does not apply to git master in the order
> > the patches are in this bug.
> 
> I have taken care of marking the obsolete patches as such. So all patches here
> needs to be reviewed.

http://bugzilla-attachments.gnome.org/attachment.cgi?id=235671 for one seems to be using non existing libosinfo API, some patches predate your v3 posting, are you 100% positive these 9 patches are needed?
Comment 44 Zeeshan Ali 2013-02-19 13:55:14 UTC
(In reply to comment #43)
> (In reply to comment #42)
> > (In reply to comment #39)
> > > No clue which patches are current, which are not, I guess everything before the
> > > 15th is obsolete, but even then this does not apply to git master in the order
> > > the patches are in this bug.
> > 
> > I have taken care of marking the obsolete patches as such. So all patches here
> > needs to be reviewed.
> 
> http://bugzilla-attachments.gnome.org/attachment.cgi?id=235671 for one seems to
> be using non existing libosinfo API, some patches predate your v3 posting, are
> you 100% positive these 9 patches are needed?

Ah, I missed that one but now its obsoleted. All others seem right.
Comment 45 Christophe Fergeau 2013-02-19 14:06:24 UTC
Review of attachment 236262 [details] [review]:

::: src/unattended-installer.vala
@@ +58,2 @@
     public File? disk_file;
+    public File? secondary_disk_file;

"drivers_disk_file" would be more descriptive (let's say preinst drivers are a bit special, and that this naming won't be too confusing)

@@ +173,3 @@
+
+                debug ("Creating secondary disk image '%s'...", secondary_disk_path);
+                string[] argv = { "mkisofs", "-graft-points", "-J", "-rock", "-o", secondary_disk_path };

"All occurrences of `\'  and  `='  characters  must  be  escaped  with  `\'  if -graft-points has been specified."

@@ +512,3 @@
         disk.set_source (disk_file.get_path ());
 
+        if (disk_file == this.disk_file) {

2 distinct functions get_unattended_disk_config and get_drivers_disk_config please, this one is just weird
Comment 46 Christophe Fergeau 2013-02-19 14:10:58 UTC
(In reply to comment #44)
> 
> Ah, I missed that one but now its obsoleted. All others seem right.

still does not apply cleanly here
Comment 47 Christophe Fergeau 2013-02-19 14:13:07 UTC
Review of attachment 235662 [details] [review]:

(-ènxdferfvg
Comment 48 Christophe Fergeau 2013-02-19 14:17:47 UTC
Review of attachment 235663 [details] [review]:

Failed to publish review: Undefined subroutine &extensions::splinter::lib::WSSplinter::ThrowCodeError called at /var/www/bugzilla.gnome.org/extensions/splinter/lib/WSSplinter.pm line 88.
Comment 49 Christophe Fergeau 2013-02-19 14:22:22 UTC
Review of attachment 235664 [details] [review]:

I'd be more verbose in the long commit log, something like 'make sure driver installation progress always reaches 100% even if an error occurs during the installation"
Comment 50 Christophe Fergeau 2013-02-19 14:31:43 UTC
Review of attachment 235668 [details] [review]:

::: src/unattended-installer.vala
@@ +635,3 @@
+
+    private async void setup_drivers (ActivityProgress progress, Cancellable? cancellable = null) {
+        progress.info = _("Downloading device drivers...");

This was not present in the old code..

@@ +659,3 @@
+            }
+        } else
+            progress.progress = 1.0;

... and this seems new as well, as both of these seem to be cosmetic improvements to the progress display, they may be better in a separate patch.
Comment 51 Christophe Fergeau 2013-02-19 14:44:06 UTC
Review of attachment 236622 [details] [review]:

ok let's anticipate splinter's requiring a comment when all I want to do is change the status. BONJOUR!!
Comment 52 Zeeshan Ali 2013-02-19 15:27:36 UTC
Review of attachment 236262 [details] [review]:

::: src/unattended-installer.vala
@@ +58,2 @@
     public File? disk_file;
+    public File? secondary_disk_file;

not sure this will always be the case, was even thinking that it might be better to put user avatar there already. You never know if someone got a 1.44 MB avatar. :)

@@ +173,3 @@
+
+                debug ("Creating secondary disk image '%s'...", secondary_disk_path);
+                string[] argv = { "mkisofs", "-graft-points", "-J", "-rock", "-o", secondary_disk_path };

Hmm.. is that just for the commandline or filenames actually have the escape sequence then on the ISO? If its latter, this won't be easy to handle correctly, at least for the scripts as they have expected filenames.
Comment 53 Zeeshan Ali 2013-02-19 15:40:04 UTC
Review of attachment 235668 [details] [review]:

::: src/unattended-installer.vala
@@ +635,3 @@
+
+    private async void setup_drivers (ActivityProgress progress, Cancellable? cancellable = null) {
+        progress.info = _("Downloading device drivers...");

It was. It was just in a different function.

@@ -641,1 @@
-        progress.info = _("Downloading device drivers...");

Here it is.
Comment 54 Christophe Fergeau 2013-02-19 16:19:19 UTC
Review of attachment 236262 [details] [review]:

::: src/unattended-installer.vala
@@ +58,2 @@
     public File? disk_file;
+    public File? secondary_disk_file;

ok, worth adding a comment indicating what goes in this secondary file then (and a similar one for the unattended disk)

@@ +173,3 @@
+
+                debug ("Creating secondary disk image '%s'...", secondary_disk_path);
+                string[] argv = { "mkisofs", "-graft-points", "-J", "-rock", "-o", secondary_disk_path };

My understanding is that it's just for mkisofs use, this way it can split on the only = that is not escaped, and then unescape the part before and the part after the "=" and use these unescaped names as filenames
Comment 55 Zeeshan Ali 2013-02-19 19:37:55 UTC
Created attachment 236823 [details] [review]
installer: Update progress on error to setup driver

Ensure driver installation progress always reaches 100% even if an error
occurs during the installation.

Also moved one hunk from 'Generalize setup_pre_install_driver*()' patch to this one as it fits here better.
Comment 56 Zeeshan Ali 2013-02-19 19:38:41 UTC
Created attachment 236824 [details] [review]
installer: Add a secondary unattended disk

Addressed review comments.
Comment 57 Zeeshan Ali 2013-02-19 19:39:51 UTC
Created attachment 236825 [details] [review]
installer: Generalize setup_pre_install_driver*()

Rebased over other changes and some review comments addressed.
Comment 58 Zeeshan Ali 2013-02-19 20:06:04 UTC
Created attachment 236827 [details] [review]
installer: Setup post-installation drivers

Rebased.
Comment 59 Alexander Larsson 2013-02-19 20:16:44 UTC
Review of attachment 236823 [details] [review]:

ack
Comment 60 Alexander Larsson 2013-02-19 20:19:34 UTC
Review of attachment 236824 [details] [review]:

ack
Comment 61 Alexander Larsson 2013-02-19 20:22:02 UTC
Review of attachment 236825 [details] [review]:

ack
Comment 62 Alexander Larsson 2013-02-19 20:26:06 UTC
Review of attachment 236827 [details] [review]:

ack
Comment 63 Zeeshan Ali 2013-02-19 20:27:38 UTC
Attachment 235662 [details] pushed as ef43977 - installer: Get rid of get_unattended_disk_info() method
Attachment 235663 [details] pushed as b381592 - installer: Set bus on unattended disk config
Attachment 236263 [details] pushed as 4014fab - installer: Add get_post_installer_scripts()
Attachment 236264 [details] pushed as ad3a050 - installer: Add get_post_installable_drivers()
Attachment 236823 [details] pushed as 443af23 - installer: Update progress on error to setup driver
Attachment 236824 [details] pushed as 4df788c - installer: Add a secondary unattended disk
Attachment 236825 [details] pushed as dfc2c37 - installer: Generalize setup_pre_install_driver*()
Attachment 236827 [details] pushed as d599f3a - installer: Setup post-installation drivers
Comment 64 Zeeshan Ali 2013-02-19 20:29:28 UTC
These changes combined with latest libosinfo automatically add QXL drivers for Windows XP. I'll open a separate bug for windows 7.
Comment 65 Zeeshan Ali 2013-03-15 01:50:39 UTC
Re-opening since it turns out that I got QXL working in neither windows 7 nor XP. It does get installed though along with vdagent and virtio drivers do work, which do work. Will attach patches to fix this but it'll need libosinfo patching as well.
Comment 66 Zeeshan Ali 2013-03-15 01:51:34 UTC
Created attachment 238951 [details] [review]
configure: Require libosinfo >= 0.2.6
Comment 67 Zeeshan Ali 2013-03-15 01:51:42 UTC
Created attachment 238952 [details] [review]
installer: Disable driver signing

In the next release (0.2.6) of libosinfo, driver signing checks in
scripts will have to be explicitly disabled if we want to use unsigned
drivers. That is something we really do want to do since QXL drivers for
windows are not signed and they are essential for an impressive user
experience.
Comment 68 Zeeshan Ali 2013-03-15 01:51:47 UTC
Created attachment 238953 [details] [review]
installer: Ensure compatibility between drivers and scripts

For each driver and script, make use of new libosinfo API to ensure that
either the driver is signed, script can handle unsigned drivers or
there is a script in the 'desktop' profile that provide a way to disable
driver signing checks.

With this and the previous ('installer: Disable driver signing') change,
QXL driver will now actually be functional in Windows XP and Windows 7.
Comment 69 Zeeshan Ali 2013-03-15 01:51:53 UTC
Created attachment 238954 [details] [review]
installer: Filter drivers by architecture first

Just like media, the usual schenerio would be for an OS to provide
multiple variants of the same driver, one for each architecture. So its
more optimal to first filter devices by compatible architecture and then
filter the resulting drivers list by other compatibility criterias.
Comment 70 Christophe Fergeau 2013-03-15 14:22:20 UTC
Review of attachment 238952 [details] [review]:

::: src/unattended-installer.vala
@@ +258,3 @@
         }
+
+        config.set_driver_signing (false);

Let's not hardcode this as libosinfo provides the api to know if we actually need to disable signing or not.
Comment 71 Zeeshan Ali 2013-03-15 15:42:04 UTC
Created attachment 238983 [details] [review]
installer: Ensure compatibility between drivers and scripts

For each driver and script, make use of new libosinfo API to ensure that
either the driver is signed or script can handle unsigned drivers.
Comment 72 Zeeshan Ali 2013-03-15 15:42:17 UTC
Created attachment 238984 [details] [review]
installer: Disable driver signing for unsigned drivers

In the next release (0.2.6) of libosinfo, driver signing checks in
scripts will have to be explicitly disabled if we want to use unsigned
drivers. We actually shouldn't be doing this since this means disabling
a security feature of Windows *permanently* but unfortunately QXL drivers
for windows are not signed and they are essential for an impressive user
experience.

To make things slightly better, we only do this if there is an unsigned
driver to be installed.

With this change QXL driver will now actually be functional in Windows XP
and Windows 7.
Comment 73 Christophe Fergeau 2013-03-18 09:44:39 UTC
Review of attachment 238983 [details] [review]:

::: src/unattended-installer.vala
@@ +754,3 @@
+                    return false;
+                }
+            }

This foreach loop is really something that should be done by a helper func provided by libosinfo.
Comment 74 Christophe Fergeau 2013-03-18 09:50:58 UTC
Review of attachment 238983 [details] [review]:

::: src/unattended-installer.vala
@@ +754,3 @@
+                    return false;
+                }
+            }

And it's not very nice that we compute this once for each driver while this value will always be the same for a call to get_installable_drivers
Comment 75 Christophe Fergeau 2013-03-18 10:05:45 UTC
Review of attachment 238984 [details] [review]:

::: src/unattended-installer.vala
@@ +771,3 @@
+                    debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                    driver_signing = false;
+                    return true;

One more loop that is needlessly ran several times.
Also, I don't think libosinfo documents the fact that if one script allows to disable signature checks, then it will disable these checks for any driver installable by any install script for the same OS (which is what you are relying on here).
Comment 76 Christophe Fergeau 2013-03-18 10:19:16 UTC
Review of attachment 238954 [details] [review]:

NACK on the 'more optimal' part, if 'test_func()' just returns 'FALSE', I doubt this will be a performance improvement (which 'optimal' makes me think of).
Use 'more logical', 'makes more sense', if you want.

s/schenerio/scenario

And to be honest, unconvinced this is a very useful improvement overall, the way the code is written before this patch seems more logical to me, we prune drivers we don't want without even looking at the arch as soon as possible rather than keeping the unwanted drivers as long as possible, and dropping them at the last minute. If the driver hash table were to be persistent across get_drivers() calls for some reason, then this would be a different story.
Comment 77 Zeeshan Ali 2013-03-18 13:20:36 UTC
Review of attachment 238983 [details] [review]:

::: src/unattended-installer.vala
@@ +754,3 @@
+                    return false;
+                }
+            }

Good point. I'll fix.
Comment 78 Zeeshan Ali 2013-03-18 13:31:51 UTC
Review of attachment 238984 [details] [review]:

::: src/unattended-installer.vala
@@ +771,3 @@
+                    debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                    driver_signing = false;
+                    return true;

* Yeah, I'll move this out of loop as well.
* Firstly we only take "desktop" profile scripts. 2ndly, check the docs for OSINFO_DEVICE_DRIVER_SIGNING_REQ_STRICT: "Script must only be given signed device drivers. Some scripts will allow overriding this requirement through osinfo_install_config_set_driver_signing function. You can query if a script supports this by checking if OSINFO_INSTALL_CONFIG_PROP_DRIVER_SIGNING configuration parameter is used by the script in question (or other scripts in the same profile)."

Trouble is that we can't guarantee the same script that uses/installs drivers will be able to disable driver signing for us (e.g in XP's case I was only able to disable through .sif file and drivers are not installed by .sif). Hence such a non-unified API.
Comment 79 Zeeshan Ali 2013-03-18 13:31:51 UTC
Review of attachment 238984 [details] [review]:

::: src/unattended-installer.vala
@@ +771,3 @@
+                    debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                    driver_signing = false;
+                    return true;

* Yeah, I'll move this out of loop as well.
* Firstly we only take "desktop" profile scripts. 2ndly, check the docs for OSINFO_DEVICE_DRIVER_SIGNING_REQ_STRICT: "Script must only be given signed device drivers. Some scripts will allow overriding this requirement through osinfo_install_config_set_driver_signing function. You can query if a script supports this by checking if OSINFO_INSTALL_CONFIG_PROP_DRIVER_SIGNING configuration parameter is used by the script in question (or other scripts in the same profile)."

Trouble is that we can't guarantee the same script that uses/installs drivers will be able to disable driver signing for us (e.g in XP's case I was only able to disable through .sif file and drivers are not installed by .sif). Hence such a non-unified API.
Comment 80 Zeeshan Ali 2013-03-18 13:47:46 UTC
Review of attachment 238954 [details] [review]:

I don't agree about "your last minute" part, we are doing a check just before adding it to the list of drivers we want, nothing very "last minute" about that. Perhaps you'll feel better if both checks remain in the same loop?  I think there is no sense in first checking if a driver is something we want or not and if we do, we check if the driver was relevant in the first place. We should simply do it the other way around: First check if driver is relevant and then do other policy-related checks.
Comment 81 Christophe Fergeau 2013-03-18 13:56:50 UTC
(switching to a saner way of answering comments)


(In reply to comment #79)
> * Firstly we only take "desktop" profile scripts. 2ndly, check the docs for
> OSINFO_DEVICE_DRIVER_SIGNING_REQ_STRICT: "Script must only be given signed
> device drivers. Some scripts will allow overriding this requirement through
> osinfo_install_config_set_driver_signing function. You can query if a script
> supports this by checking if OSINFO_INSTALL_CONFIG_PROP_DRIVER_SIGNING
> configuration parameter is used by the script in question (or other scripts in
> the same profile)."
> 
> Trouble is that we can't guarantee the same script that uses/installs drivers
> will be able to disable driver signing for us (e.g in XP's case I was only able
> to disable through .sif file and drivers are not installed by .sif). Hence such
> a non-unified API.

I know about this requirement, and I've read the doc you quote. I still think how to disable signing is not very obvious. All in all, this libosinfo API seems awkward to use, something slightly higher level seems like it would be a better fit.
Comment 82 Christophe Fergeau 2013-03-18 14:04:20 UTC
(In reply to comment #80)
> Review of attachment 238954 [details] [review]:
> 
> I don't agree about "your last minute" part, we are doing a check just before
> adding it to the list of drivers we want, nothing very "last minute" about
> that. 

s/last minute/last/ if you prefer, don't focus too much on the words ;) instead of driver check first, arch check last, you do driver check last.

>  I think there is no sense in first checking if a driver is something we want or
> not and if we do, we check if the driver was relevant in the first place. We
> should simply do it the other way around: First check if driver is relevant and
> then do other policy-related checks.

If we could get some false positive by doing the check in the 'wrong' order, then the order would matter, in this case, I'm unconvinced changing the code is worth it. This is a case where either way does not really matter imo.
Comment 83 Zeeshan Ali 2013-03-18 14:07:04 UTC
(In reply to comment #81)
> (switching to a saner way of answering comments)
> 
> 
> (In reply to comment #79)
> > * Firstly we only take "desktop" profile scripts. 2ndly, check the docs for
> > OSINFO_DEVICE_DRIVER_SIGNING_REQ_STRICT: "Script must only be given signed
> > device drivers. Some scripts will allow overriding this requirement through
> > osinfo_install_config_set_driver_signing function. You can query if a script
> > supports this by checking if OSINFO_INSTALL_CONFIG_PROP_DRIVER_SIGNING
> > configuration parameter is used by the script in question (or other scripts in
> > the same profile)."
> > 
> > Trouble is that we can't guarantee the same script that uses/installs drivers
> > will be able to disable driver signing for us (e.g in XP's case I was only able
> > to disable through .sif file and drivers are not installed by .sif). Hence such
> > a non-unified API.
> 
> I know about this requirement, and I've read the doc you quote. I still think
> how to disable signing is not very obvious. All in all, this libosinfo API
> seems awkward to use, something slightly higher level seems like it would be a
> better fit.

As I said in the libosinfo patch review, I agree about that. Although I don't think I have time to add that higher level utility API today/before release.
Comment 84 Zeeshan Ali 2013-03-18 14:13:07 UTC
(In reply to comment #82)
> (In reply to comment #80)
> > Review of attachment 238954 [details] [review] [details]:
> > 
> > I don't agree about "your last minute" part, we are doing a check just before
> > adding it to the list of drivers we want, nothing very "last minute" about
> > that. 
> 
> s/last minute/last/ if you prefer, don't focus too much on the words ;) instead
> of driver check first, arch check last, you do driver check last.
>
> >  I think there is no sense in first checking if a driver is something we want or
> > not and if we do, we check if the driver was relevant in the first place. We
> > should simply do it the other way around: First check if driver is relevant and
> > then do other policy-related checks.
> 
> If we could get some false positive by doing the check in the 'wrong' order,
> then the order would matter, in this case, I'm unconvinced changing the code is
> worth it. This is a case where either way does not really matter imo.

If we got false positives, this won't be about being optimal. There will always be at least 2 driver entries for i686 and x86_64 for each driver. That would mean that we always at least do 1 redundant check for each driver. That not a big improvement in performance at all but now that I've done the work, I don't see why you wan to block this small improvement.
Comment 85 Christophe Fergeau 2013-03-18 14:34:06 UTC
(In reply to comment #84)
> That not a
> big improvement in performance at all but now that I've done the work, I don't
> see why you wan to block this small improvement.

Ok, so once again your are pushing this for the wrong reasons, this is *not* a performance improvement to me, just some code movement that *could* make some non-critical code a bit faster. As I said, 'This is a case where either way does not really matter imo.', and no code change is generally better than unneeded code change ;)
Comment 86 Christophe Fergeau 2013-03-18 14:37:17 UTC
(In reply to comment #83)
> As I said in the libosinfo patch review, I agree about that. Although I don't
> think I have time to add that higher level utility API today/before release.

Too bad this means this suboptimal API gets set in stone while we already know it will need to be improved :(
Comment 87 Zeeshan Ali 2013-03-18 14:50:27 UTC
(In reply to comment #86)
> (In reply to comment #83)
> > As I said in the libosinfo patch review, I agree about that. Although I don't
> > think I have time to add that higher level utility API today/before release.
> 
> Too bad this means this suboptimal API gets set in stone while we already know
> it will need to be improved :(

No, I didn't say that we'll change this API but rather add new one on top that will be more high-level/convenient.
Comment 88 Zeeshan Ali 2013-03-18 14:58:17 UTC
(In reply to comment #85)
> (In reply to comment #84)
> > That not a
> > big improvement in performance at all but now that I've done the work, I don't
> > see why you wan to block this small improvement.
> 
> Ok, so once again your are pushing this for the wrong reasons, this is *not* a
> performance improvement to me, just some code movement that *could* make some
> non-critical code a bit faster.

That statement is just a play of words. Making any code faster *is* performance improvement, not matter how tiny.

> As I said, 'This is a case where either way
> does not really matter imo.', and 

You are insisting on that opinion of yours even though I already showed how this is not the case. Hence I'll ignore all future comments from you on this patch. I got better things to do then justifying simple improvement patches that should just go in w/o reivew even. In future, I'll push such patches directly.
Comment 89 Christophe Fergeau 2013-03-18 15:24:21 UTC
(In reply to comment #88)

> That statement is just a play of words. Making any code faster *is* performance
> improvement, not matter how tiny.

I've given one example where your change would not make code faster, a noop 'driver_func'.


> I got better things to do then justifying simple improvement patches
> that should just go in w/o reivew even.

This is not about 'justifying', I'm just asking you not to push code for a misleading reason.
Comment 90 Christophe Fergeau 2013-03-18 15:29:10 UTC
(In reply to comment #88)
> In future, I'll push such patches directly.

NACK, this is not something you unilaterally decide in a bug report other members of the team may not be paying attention to.
Comment 91 Christophe Fergeau 2013-03-18 15:37:11 UTC
(In reply to comment #87)
> No, I didn't say that we'll change this API but rather add new one on top that
> will be more high-level/convenient.

Yup, and I suspect we'll regret having added this low-level API in the first place...
Comment 92 Zeeshan Ali 2013-03-18 16:18:05 UTC
Created attachment 239163 [details] [review]
installer: Ensure compatibility between drivers and scripts

v2: Avoid redundant loops.
Comment 93 Zeeshan Ali 2013-03-18 16:18:33 UTC
Created attachment 239164 [details] [review]
installer: Disable driver signing for unsigned drivers

v2: Avoid redundant loops.
Comment 94 Christophe Fergeau 2013-03-18 16:37:10 UTC
Review of attachment 238954 [details] [review]:

I'd rather that you ask nicely to get such patches in rather than repeating the same invalid arguments several times, and then getting angry.
Comment 95 Christophe Fergeau 2013-03-18 16:38:17 UTC
Review of attachment 239163 [details] [review]:

Failed to publish review: Undefined subroutine &extensions::splinter::lib::WSSplinter::ThrowCodeError called at /var/www/bugzilla.gnome.org/extensions/splinter/lib/WSSplinter.pm line 88.
Comment 96 Christophe Fergeau 2013-03-18 16:46:04 UTC
Review of attachment 239164 [details] [review]:

::: src/unattended-installer.vala
@@ +124,3 @@
+            if (script.has_config_param_name (INSTALL_CONFIG_PROP_DRIVER_SIGNING)) {
+                debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                driver_signing_mutable = true;

get_installable_drivers() has a loop iterating over the install scripts, why is it not done there?
Comment 97 Christophe Fergeau 2013-03-18 16:46:30 UTC
Review of attachment 239163 [details] [review]:

Code looks much better this way btw!
Comment 98 Zeeshan Ali 2013-03-18 22:40:37 UTC
Review of attachment 239164 [details] [review]:

::: src/unattended-installer.vala
@@ +124,3 @@
+            if (script.has_config_param_name (INSTALL_CONFIG_PROP_DRIVER_SIGNING)) {
+                debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                driver_signing_mutable = true;

This is also a loop already iterating over all scripts so we can do it here or there. I would move that code in  this loop as well if it made sense but it doesn't. Moreover that loop:

* is exited as soon as we find a strict requirement.
* is run twice for each type of script (pre/post installable).

So that reminds me that I should make that loop (in get_installable_drivers()) only iterate over the scripts it should iterate on instead..
Comment 99 Zeeshan Ali 2013-03-18 22:57:17 UTC
Created attachment 239215 [details] [review]
installer: Ensure compatibility between drivers and scripts

In this version, we now only loop over relavent scripts rather than all of them.
Comment 100 Christophe Fergeau 2013-03-19 09:09:27 UTC
Review of attachment 239164 [details] [review]:

::: src/unattended-installer.vala
@@ +124,3 @@
+            if (script.has_config_param_name (INSTALL_CONFIG_PROP_DRIVER_SIGNING)) {
+                debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                driver_signing_mutable = true;

Why doesn't it make sense to have that code in that loop?
The loop you have changed here does nothing related to signing, while the one in get_installed_drivers is already doing signing related work.
Moreover, the only part of the code which needs the new 'driver_signing_mutable' attribute is the get_installed_drivers() functions, so if the loop was there, this attribute could be a local variable instead.
Comment 101 Christophe Fergeau 2013-03-19 09:20:43 UTC
Review of attachment 239215 [details] [review]:

An additional patch on top of the already ACK'ed one would have saved some review time... ;)
Comment 102 Zeeshan Ali 2013-03-19 13:57:22 UTC
Review of attachment 239164 [details] [review]:

::: src/unattended-installer.vala
@@ +124,3 @@
+            if (script.has_config_param_name (INSTALL_CONFIG_PROP_DRIVER_SIGNING)) {
+                debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                driver_signing_mutable = true;

If that loop had remained the same, the only reason to not move this code there would be efficiency (not have to loop though the whole list both times that function is called, so not really a good one. However, now that loop only iterates over the relevant scripts (pre- or post- installation scripts) with the new patch that you ACK'ed. OTOH this code needs to loop through all scripts.
Comment 103 Christophe Fergeau 2013-03-19 14:35:34 UTC
Review of attachment 239164 [details] [review]:

::: src/unattended-installer.vala
@@ +124,3 @@
+            if (script.has_config_param_name (INSTALL_CONFIG_PROP_DRIVER_SIGNING)) {
+                debug ("Script '%s' allows disabling of driver signature checks.", script.id);
+                driver_signing_mutable = true;

Then let's just have a second loop through all the scripts in get_installed_drivers() and have most of the signing code gathered in that function.
Comment 104 Zeeshan Ali 2013-03-19 14:49:02 UTC
Created attachment 239257 [details] [review]
installer: Disable driver signing for unsigned drivers

Moved the loop as per comment#103.
Comment 105 Christophe Fergeau 2013-03-19 15:36:39 UTC
Review of attachment 239257 [details] [review]:

Thanks!

::: src/unattended-installer.vala
@@ +773,3 @@
                 return false;
 
             if (!driver.get_signed () && signing_required) {

we could probably have a if (!driver_signing) return true; before this test, but that's not very important.
Comment 106 Zeeshan Ali 2013-03-19 15:46:07 UTC
Attachment 238951 [details] pushed as 1325d4b - configure: Require libosinfo >= 0.2.6
Attachment 238954 [details] pushed as 864a474 - installer: Filter drivers by architecture first
Attachment 239215 [details] pushed as c2d456c - installer: Ensure compatibility between drivers and scripts
Attachment 239257 [details] pushed as f8e88e8 - installer: Disable driver signing for unsigned drivers