Project

General

Profile

Bug #8274

liveusb-creator's gdisk scripts returns error in Jessie

Added by anonym almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Installation
Target version:
Start date:
12/18/2014
Due date:
03/05/2015
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:
Starter:
Affected tool:
Installer

Description

The installation halts and we get this output:

ERROR:liveusb.creator:There was a problem executing the following command: `['/sbin/gdisk', '/dev/sda']`.
A more detailed error log has been written to '/tmp/liveusb-creator.log'.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/liveusb/gui.py", line 203, in run
    self.live.create_hybrid_mbr()
  File "/usr/lib/python2.7/dist-packages/liveusb/creator.py", line 270, in create_hybrid_mbr
    'Y',   # proceed, possibly destroying data
  File "/usr/lib/python2.7/dist-packages/liveusb/creator.py", line 258, in _gdisk_script
    self.popen(cmd, shell=False, stdin=stdin)
  File "/usr/lib/python2.7/dist-packages/liveusb/creator.py", line 346, in popen
    % {'command': cmd, 'filename': filename})
LiveUSBError: There was a problem executing the following command: `['/sbin/gdisk', '/dev/sda']`.

However, the output (in /tmp/liveusb-creator.log) and resulting partitioning from that gdisk script is still identical to what we get in Wheezy, it's just the return code that has changed to 1.


Subtasks

Bug #8454: Test gdisk minimal fix for JessieResolved


Related issues

Blocks Tails - Feature #7563: Update the automated test suite for Jessie ISO images Resolved 11/26/2014 01/15/2016

History

#1 Updated by anonym almost 5 years ago

The following quick'n'dirty fix results in a bootable Jessie-based Tails USB installation:

--- /usr/lib/python2.7/dist-packages/liveusb/creator.py.orig    2014-11-18 16:27:31.056000000 +0000
+++ /usr/lib/python2.7/dist-packages/liveusb/creator.py 2014-11-18 16:36:58.204000000 +0000
@@ -250,12 +250,12 @@
                + [ self.drive['parent'] ])
         self.popen(cmd, shell=False)

-    def _gdisk_script(self, gdisk_cmds):
+    def _gdisk_script(self, gdisk_cmds, passive=False):
         cmd = [ '/sbin/gdisk', self.drive['device'] ]
         stdin = tempfile.TemporaryFile(mode='w')
         stdin.write('\n'.join(gdisk_cmds) + '\n')
         stdin.seek(0)
-        self.popen(cmd, shell=False, stdin=stdin)
+        self.popen(cmd, passive=passive, shell=False, stdin=stdin)

     def create_hybrid_mbr(self):
         # only relevant with OS that don't know how to access partitions on GPT
@@ -268,14 +268,14 @@
                              'N',   # no protective partition
                              'w',   # write table to disk and exit
                              'Y',   # proceed, possibly destroying data
-                           ])
+                           ], passive = True)

     def remove_hybrid_mbr(self):
         self._gdisk_script([ 'x',   # extra functionality
                              'n',   # create a new protective MBR
                              'w',   # write table to disk and exit
                              'Y',   # proceed, possibly destroying data
-                           ])
+                           ], passive = True)

     def is_device_big_enough(self):
         if self.system_partition_size * 1024**2 <= self.drive['size']:

#2 Updated by anonym almost 5 years ago

  • Blocks Feature #7563: Update the automated test suite for Jessie ISO images added

#3 Updated by intrigeri almost 5 years ago

Looks like a bug in gdisk, possibly the same as http://sourceforge.net/p/gptfdisk/mailman/message/32068566/. Would be good to have this fixed in Jessie. Next step is to check with upstream if it's a known issue (and possibly to try reverting the commit pointed at by the message linked above).

#4 Updated by anonym almost 5 years ago

I think you are right. Upstream commit a920398 says: 'Fixed bug that caused spurious "1" exit condition in gdisk.' Curiously, that commit is from March 29, and there has been no release since (in facts, it's master's HEAD). Hmm.

Also, the commit is non-atomic, but the following extract of it hopefully fixes this issue (haven't tested):

--- a/gdisk.cc
+++ b/gdisk.cc
@@ -15,6 +15,7 @@ int main(int argc, char* argv[]) {
    GPTDataTextUI theGPT;
    string device = "";
    UnicodeString uString;
+   int isError = 0;

 #ifndef EFI
    cout << "GPT fdisk (gdisk) version " << GPTFDISK_VERSION << "\n\n";
@@ -49,16 +50,20 @@ int main(int argc, char* argv[]) {
             device = (string) argv[1];
          } else { // 3 arguments, but none is "-l" 
             cerr << "Usage: " << argv[0] << " [-l] device_file\n";
+            isError = 1;
          } // if/elseif/else
          if (device != "") {
             theGPT.JustLooking();
             if (theGPT.LoadPartitions(device))
                theGPT.DisplayGPTData();
+            else
+               isError = 1;
          } // if
          break;
       default:
          cerr << "Usage: " << argv[0] << " [-l] device_file\n";
+         isError = 1;
          break;
    } // switch
-   return 1 ;
+   return (isError);
 } // main

#5 Updated by intrigeri over 4 years ago

  • Priority changed from Normal to High

#6 Updated by BitingBird over 4 years ago

  • Affected tool set to Installer

#7 Updated by u over 4 years ago

  • Blocks Feature #8556: Make Tails Installer work fine outside of Tails added

#8 Updated by intrigeri over 4 years ago

  • Target version changed from Tails_2.0 to Tails_1.3.2

This needs to be fixed in Jessie soon, otherwise we'll have to workaround it in nasty ways in our Installer.

#9 Updated by intrigeri over 4 years ago

  • Assignee set to intrigeri

#11 Updated by intrigeri over 4 years ago

  • Target version changed from Tails_1.3.2 to Tails_2.0

#12 Updated by intrigeri over 4 years ago

  • Status changed from Confirmed to Resolved

I've uploaded the proposed fix to our feature-jessie suite, which fixes this bug.

#13 Updated by intrigeri over 4 years ago

  • Blocks deleted (Feature #8556: Make Tails Installer work fine outside of Tails)

Also available in: Atom PDF