=== modified file 'debian/changelog' --- debian/changelog 2010-08-03 15:37:17 +0000 +++ debian/changelog 2010-08-30 22:06:36 +0000 @@ -1,3 +1,10 @@ +usb-creator (0.2.24) UNRELEASED; urgency=low + + * Mangle whether the 'ui' keyword is in syslinux.cfg based on the OS version. + (LP: #608382) + + -- Mario Limonciello Mon, 30 Aug 2010 17:00:20 -0500 + usb-creator (0.2.23) maverick; urgency=low [ Evan Dandrea ] === modified file 'usbcreator/install.py' --- usbcreator/install.py 2010-03-30 16:35:56 +0000 +++ usbcreator/install.py 2010-08-30 22:42:07 +0000 @@ -235,10 +235,28 @@ # Mangle the configuration files based on the options we've selected. import glob + import lsb_release 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 = float(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: + try: + target_os_ver = float(contents[1]) + except ValueError: + pass + #might be a point release + if not target_os_ver: + try: + target_os_ver = float(contents[1].rpartition('.')[0]) + except ValueError: + pass try: f = open(filename, 'r') label = '' @@ -256,6 +274,23 @@ line.insert(1, 'cdrom-detect/try-usb=true') if label not in ('memtest', 'hd'): line.insert(1, 'noprompt') + #OS version specific mangles + #The syntax in syslinux changed with the version + #shipping in Ubuntu 10.10 + elif target_os_ver and our_os_ver and \ + target_os_ver != our_os_ver: + #10.10 or newer image, burning on 10.04 or lower + if command.lower() == 'ui' and \ + 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 >= 10.10 and \ + # target_os_ver <= 10.04: + # line.insert(0, 'ui') + to_write.append(' '.join(line) + '\n') f.close() f = open(filename, 'w')