=== modified file 'ubiquity/misc.py' --- ubiquity/misc.py 2010-09-24 15:44:31 +0000 +++ ubiquity/misc.py 2010-10-05 08:36:56 +0000 @@ -267,6 +267,10 @@ # grub-installer is run. Pursuant to that, we intentionally run this in # the installer root as /target might not yet be available. + bootremovable = is_removable(boot_device()) + if bootremovable is not None: + return bootremovable + subp = subprocess.Popen(['grub-mkdevicemap', '--no-floppy', '-m', '-'], stdout=subprocess.PIPE) devices = subp.communicate()[0].splitlines() @@ -281,7 +285,12 @@ target = '(hd0)' cdsrc, cdfs, type = mount_info('/cdrom') - if (cdsrc == target or target == '(hd0)') and cdfs and cdfs != 'iso9660': + try: + same = os.path.samefile(cdsrc, target) + except OSError: + same = False + if ((cdsrc == target or target == '(hd0)' or same) + and cdfs and cdfs != 'iso9660'): # Installing from removable media other than a CD. Make sure that # we don't accidentally install GRUB to it. boot = boot_device() @@ -290,10 +299,6 @@ target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/[a-z]+).*', r'\1', target) - bootremovable = is_removable(boot_device()) - if bootremovable is not None: - target = bootremovable - return target @raise_privileges