diff -Nru usb-creator-0.2.37/bin/usb-creator-helper usb-creator-0.2.38/bin/usb-creator-helper --- usb-creator-0.2.37/bin/usb-creator-helper 2012-03-11 09:06:21.000000000 +0000 +++ usb-creator-0.2.38/bin/usb-creator-helper 2012-04-16 08:28:18.000000000 +0000 @@ -130,10 +130,10 @@ # TODO return boolean success - @dbus.service.method(USBCREATOR_IFACE, in_signature='sbs', out_signature='', + @dbus.service.method(USBCREATOR_IFACE, in_signature='sbsb', out_signature='', sender_keyword='sender', connection_keyword='conn') def InstallBootloader(self, device, allow_system_internal, grub_location, - sender=None, conn=None): + syslinux_legacy, sender=None, conn=None): '''Install a bootloader to the boot code area, either grub or syslinux. The function takes a partition device file of the form /dev/sda1 @@ -174,9 +174,13 @@ popen(['dd', 'if=%s' % os.path.join(grub_location, 'core.img'), 'of=%s' % parent, 'bs=512', 'count=62', 'seek=1', 'conv=sync']) else: - popen(['syslinux', '-f', device_file]) + if syslinux_legacy and find_on_path('syslinux-legacy'): + syslinux = 'syslinux-legacy' + else: + syslinux = 'syslinux' + popen([syslinux, '-f', device_file]) # Write the syslinux MBR. - popen(['dd', 'if=/usr/lib/syslinux/mbr.bin', 'of=%s' % parent, + popen(['dd', 'if=/usr/lib/%s/mbr.bin' % syslinux, 'of=%s' % parent, 'bs=446', 'count=1', 'conv=sync']) num = deviceobj.Get(device, 'partition-number', diff -Nru usb-creator-0.2.37/.bzr-builddeb/default.conf usb-creator-0.2.38/.bzr-builddeb/default.conf --- usb-creator-0.2.37/.bzr-builddeb/default.conf 1970-01-01 00:00:00.000000000 +0000 +++ usb-creator-0.2.38/.bzr-builddeb/default.conf 2012-03-19 17:40:32.000000000 +0000 @@ -0,0 +1,2 @@ +[BUILDDEB] +native = True diff -Nru usb-creator-0.2.37/debian/changelog usb-creator-0.2.38/debian/changelog --- usb-creator-0.2.37/debian/changelog 2012-03-13 18:15:49.000000000 +0000 +++ usb-creator-0.2.38/debian/changelog 2012-04-16 10:29:39.000000000 +0000 @@ -1,3 +1,17 @@ +usb-creator (0.2.38) precise; urgency=low + + [ Colin Watson ] + * Fix production of Ubuntu <= 10.04 images on Ubuntu >= 10.10 using + syslinux-legacy (LP: #645818). + + [ Evan Dandrea ] + * When comparing against 10.04, treat its point releases the same as + the initial release. + * Drop code to insert 'ui' in front of 'gfxboot bootlogo' in 10.04. + The ui command was added after 10.04. + + -- Evan Dandrea Mon, 16 Apr 2012 11:29:30 +0100 + usb-creator (0.2.37) precise; urgency=low * debian/control: Fix dependency: python-gobject → python-gi. diff -Nru usb-creator-0.2.37/debian/control usb-creator-0.2.38/debian/control --- usb-creator-0.2.37/debian/control 2012-03-13 18:14:15.000000000 +0000 +++ usb-creator-0.2.38/debian/control 2012-04-16 08:28:18.000000000 +0000 @@ -15,7 +15,8 @@ Package: usb-creator-common Architecture: amd64 i386 -Depends: ${misc:Depends}, ${python:Depends}, python-dbus, syslinux, +Depends: ${misc:Depends}, ${python:Depends}, python-dbus, + syslinux, syslinux-legacy, udisks (>= 1.0~), udisks (<< 1.1), genisoimage, mtools, parted, python-debian Description: create a startup disk using a CD or disc image (common files) Startup Disk Creator converts a USB key or SD card into a volume from which you diff -Nru usb-creator-0.2.37/usbcreator/install.py usb-creator-0.2.38/usbcreator/install.py --- usb-creator-0.2.37/usbcreator/install.py 2012-03-11 09:06:21.000000000 +0000 +++ usb-creator-0.2.38/usbcreator/install.py 2012-04-16 10:27:00.000000000 +0000 @@ -185,6 +185,32 @@ if os.path.exists(ldlinux): os.remove(ldlinux) + def os_vers(self): + """Return a tuple of the target OS version and our OS version.""" + import lsb_release + try: + from debian import debian_support + except ImportError: + from debian_bundle import debian_support + + target_os_ver = None + our_os_ver = debian_support.Version( + lsb_release.get_distro_information()['RELEASE']) + + if os.path.exists(os.path.join(self.target, '.disk', 'info')): + with open(os.path.join(self.target, '.disk', 'info'),'r') as f: + contents = f.readline().split() + if len(contents) > 2: + # Consider point releases the same as the initial release + # (10.04.4 -> 10.04) + target_os_ver = debian_support.Version(contents[1]) + + return target_os_ver, our_os_ver + + def need_syslinux_legacy(self): + target_os_ver, our_os_ver = self.os_vers() + return our_os_ver >= '10.10' and target_os_ver <= '10.04' + def install_bootloader(self, grub_location=''): logging.debug('install_bootloader') self.progress_pulse() @@ -209,6 +235,7 @@ '/com/ubuntu/USBCreator') obj.InstallBootloader(self.device, self.allow_system_internal, grub_location, + self.need_syslinux_legacy(), dbus_interface='com.ubuntu.USBCreator', timeout=MAX_DBUS_TIMEOUT) except dbus.DBusException: @@ -236,24 +263,11 @@ # Mangle the configuration files based on the options we've selected. import glob - import lsb_release - try: - from debian import debian_support - except ImportError: - from debian_bundle import debian_support for filename in glob.iglob(os.path.join(self.target, 'syslinux', '*.cfg')): if os.path.basename(filename) == 'gfxboot.cfg': continue f = None - target_os_ver = None - our_os_ver = debian_support.Version( - lsb_release.get_distro_information()['RELEASE']) - - if os.path.exists(os.path.join(self.target, '.disk', 'info')): - with open(os.path.join(self.target, '.disk', 'info'),'r') as f: - contents = f.readline().split() - if len(contents) > 2: - target_os_ver = debian_support.Version(contents[1]) + target_os_ver, our_os_ver = self.os_vers() try: f = open(filename, 'r') label = '' @@ -276,19 +290,11 @@ #shipping in Ubuntu 10.10 elif (target_os_ver and our_os_ver and target_os_ver != our_os_ver): - lucid = debian_support.Version('10.04') - maverick = debian_support.Version('10.10') #10.10 or newer image, burning on 10.04 or lower if (command.lower() == 'ui' and - our_os_ver <= lucid and - target_os_ver >= maverick): + our_os_ver <= '10.04' and + target_os_ver >= '10.10'): line.remove('ui') - #10.04 or earlier image, burning on 10.10 or higher - #Currently still broke. - #elif (command.lower() == 'gfxboot' and - # our_os_ver >= maverick and - # target_os_ver <= lucid): - # line.insert(0, 'ui') to_write.append(' '.join(line) + '\n') f.close()