Merge lp:~pitti/ubiquity/ubuntu-drivers-common into lp:ubiquity

Proposed by Martin Pitt
Status: Merged
Merged at revision: 5493
Proposed branch: lp:~pitti/ubiquity/ubuntu-drivers-common
Merge into: lp:ubiquity
Diff against target: 140 lines (+18/-52)
5 files modified
debian/changelog (+9/-0)
debian/control (+1/-1)
scripts/plugininstall.py (+0/-37)
scripts/simple-plugins (+4/-2)
ubiquity/plugins/ubi-prepare.py (+4/-12)
To merge this branch: bzr merge lp:~pitti/ubiquity/ubuntu-drivers-common
Reviewer Review Type Date Requested Status
Evan (community) Approve
Martin Pitt (community) Needs Resubmitting
Review via email: mp+107744@code.launchpad.net

Description of the change

As per https://blueprints.launchpad.net/ubuntu/+spec/desktop-q-third-party-driver-installation this branch switches ubiquity from Jockey (which we want to deprecate) to the new ubuntu-drivers-common package.

The main change is in scripts/simple-plugins which now calls "ubuntu-drivers autoinstall" instead of "jockey -a". The changes in ubiquity/plugins/ubi-prepare.py merely change the "is this program available" tests, and drop the now obsolete restarting of the Jockey backend. (ubuntu-drivers does not use any D-BUS mechanism)

scripts/plugininstall.py drops the "jockey -C" call. The --check-composite call is obsolete, as the free video drivers now provide 3D/compositing as well. "ubuntu-drivers autoinstall" is supposed to install all drivers which we want to automatically install already, so there is no reason to handle it in two places.

Unfortunately I cannot test this on real iron, as the current quantal daily gets a kernel oops when I select "install 3rd party drivers" and click continue (oopsing on rmmod, presumably it tries to install bcmwl-kernel-source). So I tested it in a VM and hacked ubuntu-drivers to pretend it wants to install bcmwl-kernel-source. That does happen in the live system, however it stumbles over an unrelated error:

May 29 09:04:04 ubuntu ubiquity: The following NEW packages will be installed:
May 29 09:04:04 ubuntu ubiquity: bcmwl-kernel-source dkms fakeroot
May 29 09:04:04 ubuntu ubiquity: debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another
 process: Resource temporarily unavailable
[...]
May 29 09:04:05 ubuntu ubiquity: Processing triggers for man-db ...
May 29 09:04:05 ubuntu ubiquity: /var/lib/dpkg/info/man-db.postinst: 44: /var/lib/dpkg/info/man-db.postinst:
May 29 09:04:05 ubuntu ubiquity: 3: Bad file descriptor
May 29 09:04:05 ubuntu ubiquity: dpkg: error processing man-db (--unpack):
May 29 09:04:05 ubuntu ubiquity: subprocess installed post-installation script returned error exit status 2
May 29 09:04:05 ubuntu ubiquity: No apport report written because MaxReports is reached already
May 29 09:04:05 ubuntu ubiquity: Errors were encountered while processing:
May 29 09:04:05 ubuntu ubiquity: man-db
May 29 09:04:05 ubuntu ubiquity: E: Sub-process /usr/bin/dpkg returned an error code (1)
May 29 09:04:05 ubuntu ubiquity: ubuntu-drivers autoinstall failed with code: 100

After that, bcmwl-kernel-source is installed but unconfigured; sudo dpkg --configure -a fixes that. However, bcmwl-kernel-source is not installed in the target system after ubiquity finishes; is ubiquity meant to copy the installed package from the live system, or does the plugin get called again in the /target/ chroot for a fresh install? (In that case that would use the unhacked ubuntu-drivers in /target, which of course would not pull in bcmwl for a KVM system).

To post a comment you must log in.
Revision history for this message
Evan (ev) wrote :

Repeating this from IRC, so we have a record.

Debconf does not like multiple things talking to it. Since ubiquity is already talking to it, you need to do something like:

DEBCONF_DB_REPLACE=configdb DEBCONF_DB_OVERRIDE="Pipe{infd:none outfd:none}" ubuntu-drivers autoinstall

You'll also need to replicate jockey/debian/jockey.ubiquity to get the installed packages in /target. Colin mentioned that you can subclass plugin.InstallPlugin to have post-install tasks, though he also suggested that target-config hooks (like the existing Jockey one) are preferable.

Thanks for this work!

review: Needs Fixing
5495. By Martin Pitt

Run "ubuntu-drivers autoinstall" with Ubiquity friendly debconf environment

5496. By Martin Pitt

scripts/simple-plugins: Save package list, so that ubuntu-driver-common's ubiquity plugin can use it to copy the drivers to /target

Revision history for this message
Martin Pitt (pitti) wrote :

r5495 fixes the "3: Bad file descriptor" error. r5496 keeps the auto-installed package list around for the /target plugin.

This goes together with the latest u-d-c which I just uploaded:

ubuntu-drivers-common (1:0.2.52) quantal; urgency=low

  * ubuntu-drivers: Add --package-list option to create a file with the list
    of installed packages in "autoinstall" mode.
  * Add ubiquity/target-config/31ubuntu_driver_packages: Ubiquity plugin to
    install all packages that "ubuntu-drivers autoinstall" installed into the
    live system. Install it in setup.py.
  * ubuntu-drivers: Stop meddling with the debconf environment variables. It
    is wrong (and too late anyway for Ubiquity) to do it here. The complete
    environment setting is now done in Ubiquity's simple-plugins.

 -- Martin Pitt <email address hidden> Tue, 29 May 2012 16:00:21 +0200

With this ubiquity branch and this u-d-common version I get bcmwl-kernel-source installed cleanly in both the live system as well as the installed target.

review: Needs Resubmitting
Revision history for this message
Evan (ev) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-05-28 14:37:16 +0000
3+++ debian/changelog 2012-05-29 13:56:21 +0000
4@@ -6,6 +6,15 @@
5 [ Dmitrijs Ledkovs ]
6 * Remove migration-assistant's UI definitions.
7
8+ [ Martin Pitt ]
9+ * scripts/simple-plugins, ubiquity/plugins/ubi-prepare.py: Move from Jockey
10+ to "ubuntu-drivers autoinstall". Add ubuntu-drivers-common Recommends: for
11+ this.
12+ * scripts/plugininstall.py: Drop jockey --check-composite call. It is
13+ obsolete as the free drivers now provide 3D support. Automatic
14+ installation of graphics drivers is controlled and covered by
15+ ubuntu-drivers autoinstall now.
16+
17 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Mon, 28 May 2012 15:35:55 +0100
18
19 ubiquity (2.11.3) quantal; urgency=low
20
21=== modified file 'debian/control'
22--- debian/control 2012-05-24 10:44:21 +0000
23+++ debian/control 2012-05-29 13:56:21 +0000
24@@ -11,7 +11,7 @@
25 Package: ubiquity
26 Architecture: any
27 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, debconf (>= 1.5.43), ubiquity-frontend-${mangled-version}, ubiquity-artwork-${mangled-version}, laptop-detect, lsb-release, ubiquity-casper, python3-apt (>= 0.7.100.3~), ${console-setup-depends}, iso-codes, passwd, adduser, os-prober, rdate, ntfs-3g (>= 1:2011.1.15AR.4+2011.4.12-1) [any-alpha any-amd64 any-i386] | ntfsprogs [any-alpha any-amd64 any-i386], ecryptfs-utils, cryptsetup, python3-pyicu (>= 1.0), reiserfsprogs, language-selector-common (>= 0.4.16), archdetect-deb, dpkg-repack, apt-clone, wget, grub-common [any-amd64 any-i386], realpath, dbus-x11, python3-six
28-Recommends: grub-pc [any-amd64 any-i386] | grub [any-amd64 any-i386] | grub-efi [any-amd64 any-i386], flash-kernel [armel armhf], uboot-mkimage [armel armhf], uboot-envtools [armel armhf], redboot-tools [armel armhf], yaboot [powerpc], hfsutils [powerpc], dmraid, btrfs-tools
29+Recommends: grub-pc [any-amd64 any-i386] | grub [any-amd64 any-i386] | grub-efi [any-amd64 any-i386], flash-kernel [armel armhf], uboot-mkimage [armel armhf], uboot-envtools [armel armhf], redboot-tools [armel armhf], yaboot [powerpc], hfsutils [powerpc], dmraid, btrfs-tools, ubuntu-drivers-common
30 Conflicts: ubuntu-express, espresso, espresso-utils, espresso-locale, espresso-keyboard-setup, espresso-kbd-chooser, espresso-timezone, user-setup (<< 0.05ubuntu6), partman, espresso-grub, espresso-yaboot
31 Replaces: ubuntu-express, espresso, espresso-utils, espresso-locale, espresso-keyboard-setup, espresso-kbd-chooser, espresso-timezone, user-setup (<< 0.05ubuntu6), partman, espresso-grub, espresso-yaboot, ubiquity-frontend-gtk (<< 2.3.8)
32 Description: Ubuntu live CD installer
33
34=== modified file 'scripts/plugininstall.py'
35--- scripts/plugininstall.py 2012-05-24 10:44:21 +0000
36+++ scripts/plugininstall.py 2012-05-29 13:56:21 +0000
37@@ -1195,43 +1195,6 @@
38 self.db.progress('INFO', 'ubiquity/install/nonfree')
39 packages = self.db.get('ubiquity/nonfree_package').split()
40 self.do_install(packages)
41- try:
42- install_misc.chrex(self.target,'dpkg-divert', '--package',
43- 'ubiquity', '--rename', '--quiet', '--add',
44- '/usr/sbin/update-initramfs')
45- try:
46- os.symlink(
47- '/bin/true',
48- self.target_file('usr/sbin/update-initramfs'))
49- except OSError:
50- pass
51- env = os.environ.copy()
52- env['LC_ALL'] = 'C'
53- misc.execute('mount', '--bind', '/proc', self.target + '/proc')
54- misc.execute('mount', '--bind', '/sys', self.target + '/sys')
55- misc.execute('mount', '--bind', '/dev', self.target + '/dev')
56- inst_composite = ['chroot', self.target, 'jockey-text',
57- '-C', '--no-dbus', '-k', self.kernel_version]
58- p = subprocess.Popen(inst_composite, stdin=subprocess.PIPE,
59- stdout=sys.stderr, env=env,
60- universal_newlines=True)
61- p.communicate('y\n')
62- except OSError:
63- syslog.syslog(syslog.LOG_WARNING,
64- 'Could not install a composited driver:')
65- for line in traceback.format_exc().split('\n'):
66- syslog.syslog(syslog.LOG_WARNING, line)
67- finally:
68- misc.execute('umount', '-f', self.target + '/proc')
69- misc.execute('umount', '-f', self.target + '/sys')
70- misc.execute('umount', '-f', self.target + '/dev')
71- osextras.unlink_force(
72- self.target_file('usr/sbin/update-initramfs'))
73- install_misc.chrex(self.target,'dpkg-divert', '--package',
74- 'ubiquity', '--rename', '--quiet', '--remove',
75- '/usr/sbin/update-initramfs')
76- install_misc.chrex(self.target,'update-initramfs', '-c', '-k',
77- self.kernel_version)
78
79 def install_extras(self):
80 """Try to install additional packages requested by installer
81
82=== modified file 'scripts/simple-plugins'
83--- scripts/simple-plugins 2010-09-24 10:52:01 +0000
84+++ scripts/simple-plugins 2012-05-29 13:56:21 +0000
85@@ -6,8 +6,10 @@
86 db_input high ubiquity/use_nonfree || true
87 db_get ubiquity/use_nonfree
88 if [ "$RET" = "true" ]; then
89- jockey-text -a || \
90- logger -t ubiquity "Jockey auto-install failed with code: $?"
91+ env -u DEBIAN_HAS_FRONTEND -u DEBCONF_REDIR \
92+ DEBCONF_DB_REPLACE=configdb DEBCONF_DB_OVERRIDE="Pipe{infd:none outfd:none}" \
93+ ubuntu-drivers autoinstall --package-list /run/ubuntu-drivers.autoinstall || \
94+ logger -t ubiquity "ubuntu-drivers autoinstall failed with code: $?"
95 fi
96 elif [ "$1" = "wireless" ]; then
97 db_get ubiquity/online
98
99=== modified file 'ubiquity/plugins/ubi-prepare.py'
100--- ubiquity/plugins/ubi-prepare.py 2012-05-03 12:26:22 +0000
101+++ ubiquity/plugins/ubi-prepare.py 2012-05-29 13:56:21 +0000
102@@ -118,10 +118,10 @@
103 self.prepare_foss_disclaimer_extra.set_property('visible', False)
104
105 def set_use_nonfree(self, val):
106- if osextras.find_on_path('jockey-text'):
107+ if osextras.find_on_path('ubuntu-drivers'):
108 self.prepare_nonfree_software.set_active(val)
109 else:
110- self.debug('Could not find jockey-text on the executable path.')
111+ self.debug('Could not find ubuntu-drivers on the executable path.')
112 self.set_allow_nonfree(False)
113
114 def get_use_nonfree(self):
115@@ -193,10 +193,10 @@
116 self.prepare_foss_disclaimer.setVisible(False)
117
118 def set_use_nonfree(self, val):
119- if osextras.find_on_path('jockey-text'):
120+ if osextras.find_on_path('ubuntu-drivers'):
121 self.prepare_nonfree_software.setChecked(val)
122 else:
123- self.debug('Could not find jockey-text on the executable path.')
124+ self.debug('Could not find ubuntu-drivers on the executable path.')
125 self.set_allow_nonfree(False)
126
127 def get_use_nonfree(self):
128@@ -263,12 +263,4 @@
129 if self.db.fget('ubiquity/nonfree_package', 'seen') != 'true':
130 self.preseed('ubiquity/nonfree_package',
131 self.ui.restricted_package_name)
132- bus = dbus.SystemBus()
133- obj = bus.get_object(JOCKEY, JOCKEY_PATH)
134- i = dbus.Interface(obj, JOCKEY)
135- i.shutdown(timeout=MAX_DBUS_TIMEOUT)
136- env = os.environ.copy()
137- env['DEBCONF_DB_REPLACE'] = 'configdb'
138- env['DEBCONF_DB_OVERRIDE'] = 'Pipe{infd:none outfd:none}'
139- subprocess.Popen(['/usr/share/jockey/jockey-backend', '--timeout=120'], env=env)
140 plugin.Plugin.ok_handler(self)

Subscribers

People subscribed via source and target branches

to status/vote changes: