~xnox/ubiquity/fix-value-errors

« back to all changes in this revision

Viewing changes to scripts/plugininstall.py

  • Committer: Dmitrijs Ledkovs
  • Date: 2012-09-24 10:24:23 UTC
  • mfrom: (5651.1.29 trunk)
  • Revision ID: dmitrijs.ledkovs@canonical.com-20120924102423-hnsl11gra0u43pxg
catch up from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# along with this program; if not, write to the Free Software
20
20
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
21
 
22
 
from __future__ import print_function
23
 
 
24
22
import sys
25
23
import os
26
24
import platform
870
868
                    configdir, 'resume'), 'w') as configfile:
871
869
                    print("RESUME=%s" % resume, file=configfile)
872
870
 
873
 
        osextras.unlink_force(self.target_file('etc/usplash.conf'))
874
871
        osextras.unlink_force(self.target_file('etc/popularity-contest.conf'))
875
872
        try:
876
873
            participate = self.db.get('popularity-contest/participate')
907
904
            pass
908
905
 
909
906
        packages = ['linux-image-' + self.kernel_version,
910
 
                    'usplash',
911
 
                    'splashy',
912
907
                    'popularity-contest',
913
908
                    'libpaper1',
914
909
                    'ssl-cert']
989
984
 
990
985
        inst_boot = self.db.get('ubiquity/install_bootloader')
991
986
        if inst_boot == 'true' and 'UBIQUITY_NO_BOOTLOADER' not in os.environ:
992
 
            misc.execute('mount', '--bind', '/proc', self.target + '/proc')
993
 
            misc.execute('mount', '--bind', '/sys', self.target + '/sys')
994
 
            misc.execute('mount', '--bind', '/dev', self.target + '/dev')
 
987
            binds = ("/proc", "/sys", "/dev", "/run")
 
988
            for bind in binds:
 
989
                misc.execute('mount', '--bind', bind, self.target + bind)
995
990
 
996
991
            arch, subarch = install_misc.archdetect()
997
992
 
1043
1038
                raise install_misc.InstallStepError(
1044
1039
                    "No bootloader installer found")
1045
1040
 
1046
 
            misc.execute('umount', '-f', self.target + '/proc')
1047
 
            misc.execute('umount', '-f', self.target + '/sys')
1048
 
            misc.execute('umount', '-f', self.target + '/dev')
 
1041
            for bind in binds:
 
1042
                misc.execute('umount', '-f', self.target + bind)
1049
1043
 
1050
1044
    def do_remove(self, to_remove, recursive=False):
1051
1045
        self.nested_progress_start()
1489
1483
        if not os.path.exists(working):
1490
1484
            return
1491
1485
        install_misc.chroot_setup(self.target)
 
1486
        binds = ("/proc", "/sys", "/dev", "/run")
1492
1487
        try:
1493
 
            misc.execute('mount', '--bind', '/proc', self.target + '/proc')
1494
 
            misc.execute('mount', '--bind', '/sys', self.target + '/sys')
1495
 
            misc.execute('mount', '--bind', '/dev', self.target + '/dev')
 
1488
            for bind in binds:
 
1489
                misc.execute('mount', '--bind', bind, self.target + bind)
1496
1490
            subprocess.check_call(['apt-clone', 'restore-new-distro',
1497
1491
                working, codename, '--destination', self.target],
1498
1492
                preexec_fn=install_misc.debconf_disconnect)
1499
1493
        finally:
1500
1494
            install_misc.chroot_cleanup(self.target)
1501
 
            misc.execute('umount', '-f', self.target + '/proc')
1502
 
            misc.execute('umount', '-f', self.target + '/sys')
1503
 
            misc.execute('umount', '-f', self.target + '/dev')
 
1495
            for bind in binds:
 
1496
                misc.execute('umount', '-f', self.target + bind)
1504
1497
 
1505
1498
    def copy_network_config(self):
1506
1499
        if 'UBIQUITY_OEM_USER_CONFIG' in os.environ: