[Pkg-privacy-commits] [tails-installer] 02/05: Drop unused code invoking extlinux. We use the syslinux binary from the ISO and installing on extN is not supported for Tails anyway. will-fix: #11196

anonym anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:14:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

anonym-tails-guest pushed a commit to branch master
in repository tails-installer.

commit 078d93761cc442e5f0b4bee0174424beff83911b
Author: Ulrike Uhlig <u at 451f.org>
Date:   Tue Nov 15 17:27:08 2016 +0100

    Drop unused code invoking extlinux. We use the syslinux binary from the ISO and installing on extN is not supported for Tails anyway. will-fix: #11196
---
 tails_installer/creator.py | 81 ++++++++++++++--------------------------------
 1 file changed, 24 insertions(+), 57 deletions(-)

diff --git a/tails_installer/creator.py b/tails_installer/creator.py
index 286fec4..71bbea4 100755
--- a/tails_installer/creator.py
+++ b/tails_installer/creator.py
@@ -569,14 +569,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
     def __init__(self, *args, **kw):
         super(LinuxTailsInstallerCreator, self).__init__(*args, **kw)
 
-        extlinux = self.get_extlinux_version()
-        if extlinux is None:
-            self.valid_fstypes -= self.ext_fstypes
-        elif extlinux < 4:
-            self.log.debug(_('You are using an old version of syslinux-extlinux '
-                    'that does not support the ext4 filesystem'))
-            self.valid_fstypes -= set(['ext4'])
-
+        self.valid_fstypes -= self.ext_fstypes
         self.drives = {}
         self._udisksclient = UDisks.Client.new_sync()
 
@@ -1026,38 +1019,30 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
                 self.log.debug(_("Removing %(file)s") % {'file': ldlinux})
                 os.unlink(ldlinux)
 
-        # XXX: broken now that we use the syslinux binary from the
-        # ISO, but installing on extN is not supported for Tails
-        # anyway, and likely we've broken it in various other ways
-        # already anyway.
-        if self.drive['fstype'] in self.ext_fstypes:
-            shutil.move(os.path.join(syslinux_path, "syslinux.cfg"),
-                        os.path.join(syslinux_path, "extlinux.conf"))
-            self.popen("extlinux -i '%s'" % syslinux_path)
-        else: # FAT
-            if is_running_from_tails():
-                syslinux_executable = 'syslinux';
-                self.log.debug('Will use %s as the syslinux binary'
-                               % syslinux_executable)
-                iso_syslinux = self.get_liveos_file_path('utils', 'linux', syslinux_executable)
-                tmpdir = tempfile.mkdtemp()
-                tmp_syslinux = os.path.join(tmpdir, syslinux_executable)
-                shutil.copy(iso_syslinux, tmp_syslinux)
-                os.chmod(tmp_syslinux,
-                         os.stat(tmp_syslinux).st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
-                self.flush_buffers()
-                self.unmount_device()
-                self.popen('%s %s -d %s %s' %  (
-                        tmp_syslinux,
-                        ' '.join(self.syslinux_options()),
-                        'syslinux', self.drive['device']))
-                shutil.rmtree(tmpdir)
-            else:
-                self.flush_buffers()
-                self.unmount_device()
-                self.popen('/usr/bin/pkexec /usr/bin/syslinux %s -d syslinux %s' % (
+        # FAT
+        if is_running_from_tails():
+            syslinux_executable = 'syslinux';
+            self.log.debug('Will use %s as the syslinux binary'
+                           % syslinux_executable)
+            iso_syslinux = self.get_liveos_file_path('utils', 'linux', syslinux_executable)
+            tmpdir = tempfile.mkdtemp()
+            tmp_syslinux = os.path.join(tmpdir, syslinux_executable)
+            shutil.copy(iso_syslinux, tmp_syslinux)
+            os.chmod(tmp_syslinux,
+                     os.stat(tmp_syslinux).st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
+            self.flush_buffers()
+            self.unmount_device()
+            self.popen('%s %s -d %s %s' %  (
+                    tmp_syslinux,
                     ' '.join(self.syslinux_options()),
-                    self.drive['device']))
+                    'syslinux', self.drive['device']))
+            shutil.rmtree(tmpdir)
+        else:
+            self.flush_buffers()
+            self.unmount_device()
+            self.popen('/usr/bin/pkexec /usr/bin/syslinux %s -d syslinux %s' % (
+                ' '.join(self.syslinux_options()),
+                self.drive['device']))
 
     def get_free_bytes(self, device=None):
         """ Return the number of available bytes on our device """
@@ -1323,24 +1308,6 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
     def is_admin(self):
         return os.getuid() == 0
 
-    def get_extlinux_version(self):
-        """ Return the version of extlinux. None if it isn't installed """
-        import subprocess
-        version = None
-        p = subprocess.Popen('extlinux -v', shell=True,
-                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        out, err = p.communicate()
-        out = unicode_to_utf8(out)
-        err = unicode_to_utf8(err)
-        if p.returncode == 0:
-            version = int(err.split()[1].split('.')[0])
-        elif p.returncode == 127:
-            self.log.warning('extlinux not found! Only FAT filesystems will be supported')
-        else:
-            self.log.debug('Unknown return code from extlinux: %s' % p.returncode)
-            self.log.debug('stdout: %s\nstderr: %s' % (out, err))
-        return version
-
     def connect_drive_monitor(self, callback, data=None):
         self._udisksclient.connect('changed', callback, data)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list