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
=== modified file 'debian/changelog'
--- debian/changelog 2012-05-28 14:37:16 +0000
+++ debian/changelog 2012-05-29 13:56:21 +0000
@@ -6,6 +6,15 @@
6 [ Dmitrijs Ledkovs ]6 [ Dmitrijs Ledkovs ]
7 * Remove migration-assistant's UI definitions.7 * Remove migration-assistant's UI definitions.
88
9 [ Martin Pitt ]
10 * scripts/simple-plugins, ubiquity/plugins/ubi-prepare.py: Move from Jockey
11 to "ubuntu-drivers autoinstall". Add ubuntu-drivers-common Recommends: for
12 this.
13 * scripts/plugininstall.py: Drop jockey --check-composite call. It is
14 obsolete as the free drivers now provide 3D support. Automatic
15 installation of graphics drivers is controlled and covered by
16 ubuntu-drivers autoinstall now.
17
9 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Mon, 28 May 2012 15:35:55 +010018 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Mon, 28 May 2012 15:35:55 +0100
1019
11ubiquity (2.11.3) quantal; urgency=low20ubiquity (2.11.3) quantal; urgency=low
1221
=== modified file 'debian/control'
--- debian/control 2012-05-24 10:44:21 +0000
+++ debian/control 2012-05-29 13:56:21 +0000
@@ -11,7 +11,7 @@
11Package: ubiquity11Package: ubiquity
12Architecture: any12Architecture: any
13Depends: ${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-six13Depends: ${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
14Recommends: 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-tools14Recommends: 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
15Conflicts: ubuntu-express, espresso, espresso-utils, espresso-locale, espresso-keyboard-setup, espresso-kbd-chooser, espresso-timezone, user-setup (<< 0.05ubuntu6), partman, espresso-grub, espresso-yaboot15Conflicts: ubuntu-express, espresso, espresso-utils, espresso-locale, espresso-keyboard-setup, espresso-kbd-chooser, espresso-timezone, user-setup (<< 0.05ubuntu6), partman, espresso-grub, espresso-yaboot
16Replaces: 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)16Replaces: 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)
17Description: Ubuntu live CD installer17Description: Ubuntu live CD installer
1818
=== modified file 'scripts/plugininstall.py'
--- scripts/plugininstall.py 2012-05-24 10:44:21 +0000
+++ scripts/plugininstall.py 2012-05-29 13:56:21 +0000
@@ -1195,43 +1195,6 @@
1195 self.db.progress('INFO', 'ubiquity/install/nonfree')1195 self.db.progress('INFO', 'ubiquity/install/nonfree')
1196 packages = self.db.get('ubiquity/nonfree_package').split()1196 packages = self.db.get('ubiquity/nonfree_package').split()
1197 self.do_install(packages)1197 self.do_install(packages)
1198 try:
1199 install_misc.chrex(self.target,'dpkg-divert', '--package',
1200 'ubiquity', '--rename', '--quiet', '--add',
1201 '/usr/sbin/update-initramfs')
1202 try:
1203 os.symlink(
1204 '/bin/true',
1205 self.target_file('usr/sbin/update-initramfs'))
1206 except OSError:
1207 pass
1208 env = os.environ.copy()
1209 env['LC_ALL'] = 'C'
1210 misc.execute('mount', '--bind', '/proc', self.target + '/proc')
1211 misc.execute('mount', '--bind', '/sys', self.target + '/sys')
1212 misc.execute('mount', '--bind', '/dev', self.target + '/dev')
1213 inst_composite = ['chroot', self.target, 'jockey-text',
1214 '-C', '--no-dbus', '-k', self.kernel_version]
1215 p = subprocess.Popen(inst_composite, stdin=subprocess.PIPE,
1216 stdout=sys.stderr, env=env,
1217 universal_newlines=True)
1218 p.communicate('y\n')
1219 except OSError:
1220 syslog.syslog(syslog.LOG_WARNING,
1221 'Could not install a composited driver:')
1222 for line in traceback.format_exc().split('\n'):
1223 syslog.syslog(syslog.LOG_WARNING, line)
1224 finally:
1225 misc.execute('umount', '-f', self.target + '/proc')
1226 misc.execute('umount', '-f', self.target + '/sys')
1227 misc.execute('umount', '-f', self.target + '/dev')
1228 osextras.unlink_force(
1229 self.target_file('usr/sbin/update-initramfs'))
1230 install_misc.chrex(self.target,'dpkg-divert', '--package',
1231 'ubiquity', '--rename', '--quiet', '--remove',
1232 '/usr/sbin/update-initramfs')
1233 install_misc.chrex(self.target,'update-initramfs', '-c', '-k',
1234 self.kernel_version)
12351198
1236 def install_extras(self):1199 def install_extras(self):
1237 """Try to install additional packages requested by installer1200 """Try to install additional packages requested by installer
12381201
=== modified file 'scripts/simple-plugins'
--- scripts/simple-plugins 2010-09-24 10:52:01 +0000
+++ scripts/simple-plugins 2012-05-29 13:56:21 +0000
@@ -6,8 +6,10 @@
6 db_input high ubiquity/use_nonfree || true6 db_input high ubiquity/use_nonfree || true
7 db_get ubiquity/use_nonfree7 db_get ubiquity/use_nonfree
8 if [ "$RET" = "true" ]; then8 if [ "$RET" = "true" ]; then
9 jockey-text -a || \9 env -u DEBIAN_HAS_FRONTEND -u DEBCONF_REDIR \
10 logger -t ubiquity "Jockey auto-install failed with code: $?"10 DEBCONF_DB_REPLACE=configdb DEBCONF_DB_OVERRIDE="Pipe{infd:none outfd:none}" \
11 ubuntu-drivers autoinstall --package-list /run/ubuntu-drivers.autoinstall || \
12 logger -t ubiquity "ubuntu-drivers autoinstall failed with code: $?"
11 fi13 fi
12elif [ "$1" = "wireless" ]; then14elif [ "$1" = "wireless" ]; then
13 db_get ubiquity/online15 db_get ubiquity/online
1416
=== modified file 'ubiquity/plugins/ubi-prepare.py'
--- ubiquity/plugins/ubi-prepare.py 2012-05-03 12:26:22 +0000
+++ ubiquity/plugins/ubi-prepare.py 2012-05-29 13:56:21 +0000
@@ -118,10 +118,10 @@
118 self.prepare_foss_disclaimer_extra.set_property('visible', False)118 self.prepare_foss_disclaimer_extra.set_property('visible', False)
119119
120 def set_use_nonfree(self, val):120 def set_use_nonfree(self, val):
121 if osextras.find_on_path('jockey-text'):121 if osextras.find_on_path('ubuntu-drivers'):
122 self.prepare_nonfree_software.set_active(val)122 self.prepare_nonfree_software.set_active(val)
123 else:123 else:
124 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)125 self.set_allow_nonfree(False)
126126
127 def get_use_nonfree(self):127 def get_use_nonfree(self):
@@ -193,10 +193,10 @@
193 self.prepare_foss_disclaimer.setVisible(False)193 self.prepare_foss_disclaimer.setVisible(False)
194194
195 def set_use_nonfree(self, val):195 def set_use_nonfree(self, val):
196 if osextras.find_on_path('jockey-text'):196 if osextras.find_on_path('ubuntu-drivers'):
197 self.prepare_nonfree_software.setChecked(val)197 self.prepare_nonfree_software.setChecked(val)
198 else:198 else:
199 self.debug('Could not find jockey-text on the executable path.')199 self.debug('Could not find ubuntu-drivers on the executable path.')
200 self.set_allow_nonfree(False)200 self.set_allow_nonfree(False)
201201
202 def get_use_nonfree(self):202 def get_use_nonfree(self):
@@ -263,12 +263,4 @@
263 if self.db.fget('ubiquity/nonfree_package', 'seen') != 'true':263 if self.db.fget('ubiquity/nonfree_package', 'seen') != 'true':
264 self.preseed('ubiquity/nonfree_package',264 self.preseed('ubiquity/nonfree_package',
265 self.ui.restricted_package_name)265 self.ui.restricted_package_name)
266 bus = dbus.SystemBus()
267 obj = bus.get_object(JOCKEY, JOCKEY_PATH)
268 i = dbus.Interface(obj, JOCKEY)
269 i.shutdown(timeout=MAX_DBUS_TIMEOUT)
270 env = os.environ.copy()
271 env['DEBCONF_DB_REPLACE'] = 'configdb'
272 env['DEBCONF_DB_OVERRIDE'] = 'Pipe{infd:none outfd:none}'
273 subprocess.Popen(['/usr/share/jockey/jockey-backend', '--timeout=120'], env=env)
274 plugin.Plugin.ok_handler(self)266 plugin.Plugin.ok_handler(self)

Subscribers

People subscribed via source and target branches

to status/vote changes: