~yuningdodo/usb-creator/usb-creator.lp1325801v2-sync-syslinux-c32-files

« back to all changes in this revision

Viewing changes to usbcreator/install.py

  • Committer: Yu Ning
  • Date: 2015-02-15 05:13:16 UTC
  • Revision ID: ning.yu@canonical.com-20150215051316-r259yt11kjafhw02
Make sure we use the same version of mbr.bin and syslinux *.c32 files. (LP: #1325801)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from usbcreator.misc import (
20
20
    USBCreatorProcessException,
21
21
    callable,
 
22
    find_on_path,
22
23
    fs_size,
23
24
    popen,
24
25
    )
323
324
                if f:
324
325
                    f.close()
325
326
        self.check()
 
327
        if self.need_syslinux_legacy() and find_on_path('syslinux-legacy'):
 
328
            syslinux = 'syslinux-legacy'
 
329
        else:
 
330
            syslinux = 'syslinux'
 
331
        for dstname in glob.iglob(os.path.join(self.target, 'syslinux', '*.c32')):
 
332
            filename = os.path.basename(dstname)
 
333
            for pathname in ['', os.path.join('modules', 'bios')]:
 
334
                srcname = os.path.join(os.sep, 'usr', 'lib',
 
335
                                       syslinux, pathname, filename)
 
336
                if os.path.isfile(srcname):
 
337
                    shutil.copyfile(srcname, dstname)
 
338
                    break
 
339
        self.check()
326
340
 
327
341
    def create_persistence(self):
328
342
        logging.debug('create_persistence')