~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to bin/ubiquity-dm

  • Committer: Mario Limonciello
  • Date: 2012-02-16 23:44:42 UTC
  • Revision ID: mario_limonciello@dell.com-20120216234442-dpb3he1w69xl7uvm
Have two separate failsafe attempts for 'fbdev' and 'vesa'.  It's
possible that /dev/fb0 will exist but be backed by a VGA framebuffer
causing X to exit non-zero.

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
 
186
186
        servercommand.extend([self.vt, self.display])
187
187
 
188
 
        for attempt in ('main', 'failsafe'):
 
188
        for attempt in ('main', 'fbdev', 'vesa'):
189
189
            command = list(servercommand)
190
190
            if attempt == 'main' and self.force_failsafe:
191
191
                continue
192
 
            elif attempt == 'failsafe':
 
192
            elif attempt != 'main':
193
193
                # TODO cjwatson 2010-02-11: This is a bodge.  The
194
194
                # duplication is nasty, but fortunately bullet-proof X
195
195
                # actually turns out not to be very complicated nowadays.
199
199
                # is working on doing that, but is blocked on a couple of
200
200
                # Upstart bugs; once all that's resolved, we should back
201
201
                # this out.
202
 
                if os.path.exists('/dev/fb0'):
203
 
                    driver = 'fbdev'
204
 
                else:
205
 
                    driver = 'vesa'
 
202
                if attempt == 'fbdev' and not os.path.exists('/dev/fb0'):
 
203
                    continue
206
204
                xorg_conf_failsafe = '/etc/X11/xorg.conf.failsafe'
207
205
                command.extend(['-config', xorg_conf_failsafe])
208
 
                command.extend(['-logfile', '/var/log/Xorg.failsafe.log'])
 
206
                command.extend(['-logfile', '/var/log/Xorg.%s.log' % attempt])
209
207
 
210
 
                if not os.path.exists(xorg_conf_failsafe):
211
 
                    xorg_conf_failsafe_file = open(xorg_conf_failsafe, 'w')
212
 
                    print >>xorg_conf_failsafe_file, '''\
 
208
                xorg_conf_failsafe_file = open(xorg_conf_failsafe, 'w')
 
209
                print >>xorg_conf_failsafe_file, '''\
213
210
Section "Device"
214
211
        Identifier      "Configured Video Device"
215
212
        Driver          "%s"
224
221
        Monitor         "Configured Monitor"
225
222
        Device          "Configured Video Device"
226
223
EndSection
227
 
''' % driver
228
 
                    xorg_conf_failsafe_file.close()
 
224
''' % attempt
 
225
                xorg_conf_failsafe_file.close()
229
226
 
230
227
            server = subprocess.Popen(
231
228
                command, stdin=null, stdout=logfile, stderr=logfile,
252
249
                if plymouth_running:
253
250
                    subprocess.call(['plymouth', 'quit', '--retain-splash'])
254
251
            except XStartupError:
255
 
                if attempt == 'failsafe':
 
252
                if attempt == 'vesa':
256
253
                    raise
257
254
 
258
255
            if self.server_started: