~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to scripts/plugininstall.py

  • Committer: Colin Watson
  • Date: 2012-07-16 14:29:13 UTC
  • Revision ID: cjwatson@canonical.com-20120716142913-hh1qmfjejxa9dfyb
Make all Python code pass pep8(1), and add a test to enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
from ubiquity.components import apt_setup, hw_detect, check_kernels
51
51
 
52
52
 
 
53
INTERFACES_TEXT = """\
 
54
# This file describes the network interfaces available on your system
 
55
# and how to activate them. For more information, see interfaces(5).
 
56
 
 
57
# The loopback network interface
 
58
auto lo
 
59
iface lo inet loopback"""
 
60
 
 
61
 
 
62
HOSTS_TEXT = """\
 
63
 
 
64
# The following lines are desirable for IPv6 capable hosts
 
65
::1     ip6-localhost ip6-loopback
 
66
fe00::0 ip6-localnet
 
67
ff00::0 ip6-mcastprefix
 
68
ff02::1 ip6-allnodes
 
69
ff02::2 ip6-allrouters"""
 
70
 
 
71
 
 
72
IFTAB_TEXT = """\
 
73
# This file assigns persistent names to network interfaces.
 
74
# See iftab(5) for syntax.
 
75
"""
 
76
 
 
77
 
53
78
def cleanup_after(func):
54
79
    def wrapper(self):
55
80
        try:
140
165
    # Ask Colin.
141
166
    @cleanup_after
142
167
    def run(self):
143
 
        '''Main entry point.'''
 
168
        """Main entry point."""
144
169
        # We pick up where install.py left off.
145
170
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
146
171
            self.prev_count = 0
150
175
        self.start = self.prev_count
151
176
        self.end = self.start + 22 + len(self.plugins)
152
177
 
153
 
        self.db.progress('START', self.start, self.end, 'ubiquity/install/title')
 
178
        self.db.progress(
 
179
            'START', self.start, self.end, 'ubiquity/install/title')
154
180
 
155
181
        self.configure_python()
156
182
 
293
319
 
294
320
        To save space, Ubuntu excludes .pyc files from the live filesystem.
295
321
        Recreate them now to restore the appearance of a system installed
296
 
        from .debs."""
297
 
 
 
322
        from .debs.
 
323
        """
298
324
        cache = Cache()
299
325
 
300
326
        # Python standard library.
391
417
 
392
418
        Unfortunately, at present we have to duplicate a fair bit of netcfg
393
419
        here, because it's hard to drive netcfg in a way that won't try to
394
 
        bring interfaces up and down."""
395
 
 
 
420
        bring interfaces up and down.
 
421
        """
396
422
        # TODO cjwatson 2006-03-30: just call netcfg instead of doing all
397
423
        # this; requires a netcfg binary that doesn't bring interfaces up
398
424
        # and down
414
440
                # Make sure there's at least something here so that ifupdown
415
441
                # doesn't get upset at boot.
416
442
                with open('/etc/network/interfaces', 'w') as interfaces:
417
 
                    print(textwrap.dedent("""\
418
 
                        # This file describes the network interfaces available on your system
419
 
                        # and how to activate them. For more information, see interfaces(5).
420
 
 
421
 
                        # The loopback network interface
422
 
                        auto lo
423
 
                        iface lo inet loopback"""), file=interfaces)
 
443
                    print(INTERFACES_TEXT, file=interfaces)
424
444
 
425
445
        try:
426
446
            hostname = self.db.get('netcfg/get_hostname')
440
460
                      file=hosts)
441
461
            else:
442
462
                print("127.0.1.1\t%s" % hostname, file=hosts)
443
 
            print(textwrap.dedent("""\
444
 
 
445
 
                # The following lines are desirable for IPv6 capable hosts
446
 
                ::1     ip6-localhost ip6-loopback
447
 
                fe00::0 ip6-localnet
448
 
                ff00::0 ip6-mcastprefix
449
 
                ff02::1 ip6-allnodes
450
 
                ff02::2 ip6-allrouters"""), file=hosts)
 
463
            print(HOSTS_TEXT, file=hosts)
451
464
 
452
465
        # Network Manager's ifupdown plugin has an inotify watch on
453
466
        # /etc/hostname, which can trigger a race condition if /etc/hostname is
481
494
            sock.close()
482
495
 
483
496
            with open(self.target_file('etc/iftab'), 'w') as iftab:
484
 
                print(textwrap.dedent("""\
485
 
                    # This file assigns persistent names to network interfaces.
486
 
                    # See iftab(5) for syntax.
487
 
                    """), file=iftab)
 
497
                print(IFTAB_TEXT, file=iftab)
488
498
 
489
499
                for i in range(len(interfaces)):
490
500
                    dup = False
540
550
            inst = plugin.Install(None, db=self.db)
541
551
            ret = inst.install(self.target, Progress(self.db))
542
552
            if ret:
543
 
                raise install_misc.InstallStepError("Plugin %s failed with code %s" % (plugin.NAME, ret))
 
553
                raise install_misc.InstallStepError(
 
554
                    "Plugin %s failed with code %s" % (plugin.NAME, ret))
544
555
 
545
556
    def configure_apt(self):
546
557
        """Configure /etc/apt/sources.list."""
547
 
 
548
558
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
549
 
            return # apt will already be setup as the OEM wants
 
559
            return  # apt will already be setup as the OEM wants
550
560
 
551
561
        # TODO cjwatson 2007-07-06: Much of the following is
552
562
        # cloned-and-hacked from base-installer/debian/postinst. Perhaps we
626
636
        dbfilter = apt_setup.AptSetup(None, self.db)
627
637
        ret = dbfilter.run_command(auto_process=True)
628
638
        if ret != 0:
629
 
            raise install_misc.InstallStepError("AptSetup failed with code %d" % ret)
 
639
            raise install_misc.InstallStepError(
 
640
                "AptSetup failed with code %d" % ret)
630
641
 
631
642
    def run_target_config_hooks(self):
632
 
        """Run hook scripts from /usr/lib/ubiquity/target-config. This allows
633
 
        casper to hook into us and repeat bits of its configuration in the
634
 
        target system."""
 
643
        """Run hook scripts from /usr/lib/ubiquity/target-config.
635
644
 
 
645
        This allows casper to hook into us and repeat bits of its
 
646
        configuration in the target system.
 
647
        """
636
648
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
637
 
            return # These were already run once during install
 
649
            return  # These were already run once during install
638
650
 
639
651
        hookdir = '/usr/lib/ubiquity/target-config'
640
652
 
657
669
            self.db.progress('STOP')
658
670
 
659
671
    def install_language_packs(self):
660
 
 
661
672
        if not self.langpacks:
662
673
            return
663
674
 
665
676
        self.verify_language_packs()
666
677
 
667
678
    def verify_language_packs(self):
668
 
 
669
679
        if os.path.exists('/var/lib/ubiquity/no-install-langpacks'):
670
 
            return # always complete enough
 
680
            return  # always complete enough
671
681
 
672
682
        if self.db.get('pkgsel/ignore-incomplete-language-support') == 'true':
673
683
            return
717
727
                return self.traverse_for_kernel(cache, name)
718
728
 
719
729
    def remove_unusable_kernels(self):
720
 
        """Remove unusable kernels; keeping them may cause us to be unable
721
 
        to boot."""
 
730
        """Remove unusable kernels.
722
731
 
 
732
        Keeping these may cause us to be unable to boot.
 
733
        """
723
734
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
724
735
            return
725
736
 
817
828
        return biggest_partition
818
829
 
819
830
    def configure_hardware(self):
820
 
        """reconfiguring several packages which depends on the
821
 
        hardware system in which has been installed on and need some
822
 
        automatic configurations to get work."""
 
831
        """Reconfigure several hardware-specific packages.
823
832
 
 
833
        These packages depend on the hardware of the system where the live
 
834
        filesystem was built, and must be reconfigured to work properly on
 
835
        the installed system.
 
836
        """
824
837
        self.nested_progress_start()
825
838
        install_misc.chroot_setup(self.target)
826
839
        try:
827
840
            dbfilter = hw_detect.HwDetect(None, self.db)
828
841
            ret = dbfilter.run_command(auto_process=True)
829
842
            if ret != 0:
830
 
                raise install_misc.InstallStepError("HwDetect failed with code %d" % ret)
 
843
                raise install_misc.InstallStepError(
 
844
                    "HwDetect failed with code %d" % ret)
831
845
        finally:
832
846
            install_misc.chroot_cleanup(self.target)
833
847
        self.nested_progress_end()
867
881
        osextras.unlink_force(self.target_file('etc/popularity-contest.conf'))
868
882
        try:
869
883
            participate = self.db.get('popularity-contest/participate')
870
 
            install_misc.set_debconf(self.target, 'popularity-contest/participate', participate, self.db)
 
884
            install_misc.set_debconf(
 
885
                self.target, 'popularity-contest/participate', participate,
 
886
                self.db)
871
887
        except debconf.DebconfError:
872
888
            pass
873
889
 
874
890
        osextras.unlink_force(self.target_file('etc/papersize'))
875
891
        subprocess.call(['log-output', '-t', 'ubiquity', 'chroot', self.target,
876
892
                         'ucf', '--purge', '/etc/papersize'],
877
 
                        preexec_fn=install_misc.debconf_disconnect, close_fds=True)
 
893
                        preexec_fn=install_misc.debconf_disconnect,
 
894
                        close_fds=True)
878
895
        try:
879
 
            install_misc.set_debconf(self.target, 'libpaper/defaultpaper', '', self.db)
 
896
            install_misc.set_debconf(
 
897
                self.target, 'libpaper/defaultpaper', '', self.db)
880
898
        except debconf.DebconfError:
881
899
            pass
882
900
 
886
904
            self.target_file('etc/ssl/private/ssl-cert-snakeoil.key'))
887
905
 
888
906
        install_misc.chroot_setup(self.target, x11=True)
889
 
        install_misc.chrex(self.target,'dpkg-divert', '--package', 'ubiquity', '--rename',
890
 
                   '--quiet', '--add', '/usr/sbin/update-initramfs')
 
907
        install_misc.chrex(
 
908
            self.target, 'dpkg-divert', '--package', 'ubiquity', '--rename',
 
909
            '--quiet', '--add', '/usr/sbin/update-initramfs')
891
910
        try:
892
911
            os.symlink(
893
912
                '/bin/true', self.target_file('usr/sbin/update-initramfs'))
907
926
        finally:
908
927
            osextras.unlink_force(
909
928
                self.target_file('usr/sbin/update-initramfs'))
910
 
            install_misc.chrex(self.target,'dpkg-divert', '--package', 'ubiquity', '--rename',
911
 
                       '--quiet', '--remove', '/usr/sbin/update-initramfs')
912
 
            install_misc.chrex(self.target,'update-initramfs', '-c', '-k', self.kernel_version)
 
929
            install_misc.chrex(
 
930
                self.target, 'dpkg-divert', '--package', 'ubiquity',
 
931
                '--rename', '--quiet', '--remove',
 
932
                '/usr/sbin/update-initramfs')
 
933
            install_misc.chrex(
 
934
                self.target, 'update-initramfs', '-c',
 
935
                '-k', self.kernel_version)
913
936
            install_misc.chroot_cleanup(self.target, x11=True)
914
937
 
915
938
        # Fix up kernel symlinks now that the initrd exists. Depending on
957
980
                os.symlink(linksrc, linkdst)
958
981
 
959
982
    def configure_bootloader(self):
960
 
        """configuring and installing boot loader into installed
961
 
        hardware system."""
962
 
 
 
983
        """Configure and install the boot loader."""
963
984
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
964
985
            #the language might be different than initial install.
965
986
            #recopy translations if we have them now
966
987
            full_lang = self.db.get('debian-installer/locale').split('.')[0]
967
988
            for lang in [full_lang.split('.')[0], full_lang.split('_')[0]]:
968
 
                source = '/usr/share/locale-langpack/%s/LC_MESSAGES/grub.mo' % lang
969
 
                if os.path.exists(source) and os.path.isdir('/boot/grub/locale'):
 
989
                source = (
 
990
                    '/usr/share/locale-langpack/%s/LC_MESSAGES/grub.mo' % lang)
 
991
                if (os.path.exists(source) and
 
992
                    os.path.isdir('/boot/grub/locale')):
970
993
                    shutil.copy(source, '/boot/grub/locale/%s.mo' % lang)
971
994
                    break
972
995
            return
1028
1051
                        raise install_misc.InstallStepError(
1029
1052
                            "YabootInstaller failed with code %d" % ret)
1030
1053
                else:
1031
 
                    raise install_misc.InstallStepError("No bootloader installer found")
 
1054
                    raise install_misc.InstallStepError(
 
1055
                        "No bootloader installer found")
1032
1056
            except ImportError:
1033
 
                raise install_misc.InstallStepError("No bootloader installer found")
 
1057
                raise install_misc.InstallStepError(
 
1058
                    "No bootloader installer found")
1034
1059
 
1035
1060
            misc.execute('umount', '-f', self.target + '/proc')
1036
1061
            misc.execute('umount', '-f', self.target + '/sys')
1103
1128
        self.nested_progress_end()
1104
1129
 
1105
1130
    def install_oem_extras(self):
1106
 
        """Try to install additional packages requested by the distributor"""
1107
 
 
 
1131
        """Try to install additional packages requested by the distributor."""
1108
1132
        try:
1109
1133
            inst_langpacks = \
1110
1134
                self.db.get('oem-config/install-language-support') == 'true'
1197
1221
            self.do_install(packages)
1198
1222
 
1199
1223
    def install_extras(self):
1200
 
        """Try to install additional packages requested by installer
1201
 
        components."""
1202
 
 
 
1224
        """Try to install packages requested by installer components."""
1203
1225
        # We only ever install these packages from the CD.
1204
1226
        sources_list = self.target_file('etc/apt/sources.list')
1205
1227
        os.rename(sources_list, "%s.apt-setup" % sources_list)
1228
1250
                    with open(self.target_file('home/oem/.hwdb'), 'w'):
1229
1251
                        pass
1230
1252
 
 
1253
                    apps_dir = 'usr/share/applications'
1231
1254
                    for desktop_file in (
1232
 
                        'usr/share/applications/oem-config-prepare-gtk.desktop',
1233
 
                        'usr/share/applications/kde4/oem-config-prepare-kde.desktop'):
 
1255
                        apps_dir + '/oem-config-prepare-gtk.desktop',
 
1256
                        apps_dir + '/kde4/oem-config-prepare-kde.desktop'):
1234
1257
                        if os.path.exists(self.target_file(desktop_file)):
1235
1258
                            desktop_base = os.path.basename(desktop_file)
1236
 
                            install_misc.chrex(self.target,'install', '-d',
1237
 
                                       '-o', 'oem', '-g', 'oem',
1238
 
                                       '/home/oem/Desktop')
1239
 
                            install_misc.chrex(self.target,'install', '-o', 'oem', '-g', 'oem',
1240
 
                                       '/%s' % desktop_file,
1241
 
                                       '/home/oem/Desktop/%s' % desktop_base)
 
1259
                            install_misc.chrex(
 
1260
                                self.target, 'install', '-d',
 
1261
                                '-o', 'oem', '-g', 'oem',
 
1262
                                '/home/oem/Desktop')
 
1263
                            install_misc.chrex(
 
1264
                                self.target, 'install',
 
1265
                                '-o', 'oem', '-g', 'oem',
 
1266
                                '/%s' % desktop_file,
 
1267
                                '/home/oem/Desktop/%s' % desktop_base)
1242
1268
                            break
1243
1269
 
1244
1270
                # Carry the locale setting over to the installed system.
1245
1271
                # This mimics the behavior in 01oem-config-udeb.
1246
1272
                di_locale = self.db.get('debian-installer/locale')
1247
1273
                if di_locale:
1248
 
                    install_misc.set_debconf(self.target, 'debian-installer/locale', di_locale, self.db)
1249
 
                #in an automated install, this key needs to carry over
1250
 
                installable_lang = self.db.get('ubiquity/only-show-installable-languages')
 
1274
                    install_misc.set_debconf(
 
1275
                        self.target, 'debian-installer/locale', di_locale,
 
1276
                        self.db)
 
1277
                # in an automated install, this key needs to carry over
 
1278
                installable_lang = self.db.get(
 
1279
                    'ubiquity/only-show-installable-languages')
1251
1280
                if installable_lang:
1252
1281
                    install_misc.set_debconf(self.target,
1253
1282
                        'ubiquity/only-show-installable-languages',
1256
1285
            pass
1257
1286
 
1258
1287
    def remove_oem_extras(self):
1259
 
        '''Try to remove packages that were not part of the base install and
 
1288
        """Remove unnecessary packages in OEM mode.
 
1289
 
 
1290
        Try to remove packages that were not part of the base install and
1260
1291
        are not needed by the final system.
1261
 
        
1262
 
        This is roughly the set of packages installed by ubiquity + packages we
1263
 
        explicitly installed in oem-config (langpacks, for example) -
1264
 
        everything else.'''
1265
1292
 
 
1293
        This is roughly the set of packages installed by ubiquity + packages
 
1294
        we explicitly installed in oem-config (langpacks, for example) -
 
1295
        everything else.
 
1296
        """
1266
1297
        manifest = '/var/lib/ubiquity/installed-packages'
1267
1298
        if not os.path.exists(manifest):
1268
1299
            return
1269
 
        
 
1300
 
1270
1301
        keep = set()
1271
1302
        with open(manifest) as manifest_file:
1272
1303
            for line in manifest_file:
1279
1310
        cache = Cache()
1280
1311
        # TODO cjwatson 2012-05-04: It would be nice to use a set
1281
1312
        # comprehension here, but that causes:
1282
 
        #   SyntaxError: can not delete variable 'cache' referenced in nested scope
 
1313
        #   SyntaxError: can not delete variable 'cache' referenced in nested
 
1314
        #   scope
1283
1315
        remove = set([pkg for pkg in cache.keys() if cache[pkg].is_installed])
1284
1316
        # Keep packages we explicitly installed.
1285
1317
        keep |= install_misc.query_recorded_installed()
1286
1318
        remove -= install_misc.expand_dependencies_simple(cache, keep, remove)
1287
1319
        del cache
1288
 
        
 
1320
 
1289
1321
        install_misc.record_removed(remove)
1290
1322
        (regular, recursive) = install_misc.query_recorded_removed()
1291
1323
        self.do_remove(regular)
1328
1360
                elif stat.S_ISSOCK(st.st_mode):
1329
1361
                    os.mknod(targetpath, stat.S_IFSOCK | mode)
1330
1362
                elif stat.S_ISREG(st.st_mode):
1331
 
                    install_misc.copy_file(self.db, sourcepath, targetpath, True)
 
1363
                    install_misc.copy_file(
 
1364
                        self.db, sourcepath, targetpath, True)
1332
1365
 
1333
1366
                os.lchown(targetpath, uid, gid)
1334
1367
                if not stat.S_ISLNK(st.st_mode):
1335
1368
                    os.chmod(targetpath, mode)
1336
1369
                if stat.S_ISDIR(st.st_mode):
1337
 
                    directory_times.append((targetpath, st.st_atime, st.st_mtime))
 
1370
                    directory_times.append(
 
1371
                        (targetpath, st.st_atime, st.st_mtime))
1338
1372
                # os.utime() sets timestamp of target, not link
1339
1373
                elif not stat.S_ISLNK(st.st_mode):
1340
1374
                    try:
1355
1389
                pass
1356
1390
 
1357
1391
    def remove_extras(self):
1358
 
        """Try to remove packages that are needed on the live CD but not on
1359
 
        the installed system."""
 
1392
        """Remove unnecessary packages.
1360
1393
 
 
1394
        Try to remove packages that are needed on the live CD but not on the
 
1395
        installed system.
 
1396
        """
1361
1397
        # Looking through files for packages to remove is pretty quick, so
1362
1398
        # don't bother with a progress bar for that.
1363
1399
 
1409
1445
                    difference.add(pkg)
1410
1446
 
1411
1447
        cache = Cache()
1412
 
        difference -= install_misc.expand_dependencies_simple(cache, keep, difference)
 
1448
        difference -= install_misc.expand_dependencies_simple(
 
1449
            cache, keep, difference)
1413
1450
        del cache
1414
1451
 
1415
1452
        if len(difference) == 0:
1441
1478
 
1442
1479
        oem_remove_extras = False
1443
1480
        try:
1444
 
            oem_remove_extras = misc.create_bool(self.db.get('oem-config/remove_extras'))
 
1481
            oem_remove_extras = misc.create_bool(
 
1482
                self.db.get('oem-config/remove_extras'))
1445
1483
        except debconf.DebconfError:
1446
1484
            pass
1447
1485
 
1527
1565
            shutil.copytree(source_bluetooth, target_bluetooth)
1528
1566
 
1529
1567
    def recache_apparmor(self):
1530
 
        """Generate an apparmor cache in /etc/apparmor.d/cache to speed up boot
1531
 
        time."""
1532
 
 
 
1568
        """Generate an apparmor cache to speed up boot time."""
1533
1569
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
1534
1570
            return
1535
1571
        if not os.path.exists(self.target_file('etc/init.d/apparmor')):
1536
 
            syslog.syslog('Apparmor is not installed, so not generating cache.')
 
1572
            syslog.syslog(
 
1573
                'Apparmor is not installed, so not generating cache.')
1537
1574
            return
1538
 
        install_misc.chrex(self.target,'mount', '-t', 'proc', 'proc', '/proc')
1539
 
        install_misc.chrex(self.target,'mount', '-t', 'sysfs', 'sysfs', '/sys')
1540
 
        install_misc.chrex(self.target,'mount', '-t', 'securityfs',
1541
 
                   'securityfs', '/sys/kernel/security')
1542
 
        install_misc.chrex(self.target,'/etc/init.d/apparmor', 'recache')
1543
 
        install_misc.chrex(self.target,'umount', '/proc')
1544
 
        install_misc.chrex(self.target,'umount', '/sys/kernel/security')
1545
 
        install_misc.chrex(self.target,'umount', '/sys')
 
1575
        install_misc.chrex(self.target, 'mount', '-t', 'proc', 'proc', '/proc')
 
1576
        install_misc.chrex(
 
1577
            self.target, 'mount', '-t', 'sysfs', 'sysfs', '/sys')
 
1578
        install_misc.chrex(
 
1579
            self.target, 'mount', '-t', 'securityfs',
 
1580
            'securityfs', '/sys/kernel/security')
 
1581
        install_misc.chrex(self.target, '/etc/init.d/apparmor', 'recache')
 
1582
        install_misc.chrex(self.target, 'umount', '/proc')
 
1583
        install_misc.chrex(self.target, 'umount', '/sys/kernel/security')
 
1584
        install_misc.chrex(self.target, 'umount', '/sys')
1546
1585
 
1547
1586
    def copy_wallpaper_cache(self):
1548
 
        """Copy wallpaper cache for libgnome desktop so that it's taken into
1549
 
        account by ureadahead. Only install on system having g-s-d."""
 
1587
        """Copy GNOME wallpaper cache for the benefit of ureadahead.
1550
1588
 
 
1589
        Only do this on systems with gnome-settings-daemon.
 
1590
        """
1551
1591
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
1552
1592
            return
1553
1593
 
1554
 
        # we don't use copy_network_config casper user trick as it's not and not
1555
 
        # ubuntu in install mode
 
1594
        # We don't use the copy_network_config casper user trick as it's not
 
1595
        # ubuntu in install mode.
1556
1596
        try:
1557
1597
            casper_user = pwd.getpwuid(999).pw_name
1558
1598
        except KeyError:
1594
1634
            os.chmod(target_user_wallpaper_cache_dir, 0o700)
1595
1635
 
1596
1636
    def copy_dcd(self):
1597
 
        """Copy the Distribution Channel Descriptor (DCD) file into the
1598
 
        installed system."""
1599
 
 
 
1637
        """Install the Distribution Channel Descriptor (DCD) file."""
1600
1638
        dcd = '/cdrom/.disk/ubuntu_dist_channel'
1601
1639
        if os.path.exists(dcd):
1602
1640
            shutil.copy(dcd, self.target_file('var/lib/ubuntu_dist_channel'))
1603
1641
 
1604
1642
    def copy_logs(self):
1605
 
        """copy log files into installed system."""
1606
 
 
 
1643
        """Copy log files to the installed system."""
1607
1644
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
1608
1645
            return
1609
1646
 
1664
1701
 
1665
1702
    def cleanup(self):
1666
1703
        """Miscellaneous cleanup tasks."""
1667
 
 
1668
1704
        misc.execute('umount', self.target_file('cdrom'))
1669
1705
 
1670
1706
        env = dict(os.environ)
1677
1713
            osextras.unlink_force(
1678
1714
                self.target_file('etc/apt/apt.conf.d', apt_conf))
1679
1715
 
 
1716
 
1680
1717
if __name__ == '__main__':
1681
1718
    os.environ['DPKG_UNTRANSLATED_MESSAGES'] = '1'
1682
1719
    if not os.path.exists('/var/lib/ubiquity'):