Can't login to desktop autometically after oem-config is finished on OEM mode

Bug #1552621 reported by Franz Hsieh
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
ubiquity (Ubuntu)
Fix Released
Mathieu Trudel-Lapierre

Bug Description

Normally system should be able to switch to login screen after oem-config is finished. However on OEM mode the system stops with black screen after oem-config is finished.

This bug can be reproduced on Xenial daily image.


1) Boot into OEM mode (EFI) and install the system
2) Restart system, click "Prepare for shipping to end user" and reboot system.
3) oem-config starts, enter user information
4) Black screen.

I found there has race condition between oem-config-* scripts.

First, please watch the code pieces I found in the oem-config-firstboot

for try in $(seq 1 $TRY); do
 if [ "$FRONTEND" = debconf_ui ]; then
  plymouth quit || true
  /usr/sbin/oem-config-wrapper $DEBUG $AUTOMATIC --only \
   2>>/var/log/oem-config.log \
   || CODE=$?
  /usr/bin/ubiquity-dm vt7 :0 oem \
   /usr/sbin/oem-config-wrapper $DEBUG $AUTOMATIC --only || CODE=$?
 if [ "$CODE" -eq 0 ]; then
  # Remove the temporary OEM configuration user, if possible
  # and desired.
  RET="$(echo GET oem-config/remove | debconf-communicate)"
  if [ "${RET#* }" = true ] && getent passwd oem >/dev/null; then
   pkill -u oem || true
   userdel --force --remove oem || true
  /bin/systemctl set-default || true
  /bin/systemctl --no-block isolate || true
  exit 0

and oem-config-wrapper:
#! /bin/sh
# Run oem-config, plus other things that need to run after it in X.
set -e

LANG=en_US.UTF-8 oem-config "$@"

# 'set -e' will cause us to exit if oem-config fails. Otherwise:

# Don't run again.
rm -f /var/lib/oem-config/run

# Cleanup from anything the early command prepared
RET="$(echo GET oem-config/late_command | debconf-communicate)" || true
if [ "${RET%% *}" = 0 ]; then
 command="${RET#* }"
 log-output sh -c "$command" || true
RET="$(echo GET oem-config/remove | debconf-communicate)"
if [ "${RET#* }" = true ]; then
 #debconf crashes with this set (LP: #641478)
 #mandb postinst doesn't like not knowing the locale
 if [ -r /etc/default/locale ]; then
  . /etc/default/locale
 # We're about to pull the rug out from under our own feet, so this
 # has to run very late.
 case $FRONTEND in
   export DEBIAN_FRONTEND=dialog
   oem-config-remove || true
   oem-config-remove-gtk || true
   export DEBIAN_FRONTEND=kde
   oem-config-remove || true

The /usr/sbin/oem-config-wrapper calls oem-config for bring up UI for user and runs oem-config-remove-gtk to remove all ubiquity packages at the end.

Because of oem-config-remove-gtk removes all ubiquity packages, the oem-config-firstboot can't run remaining commands. Therefore session can't switch to graphical and results in black screen.

Tags: iso-testing

Related branches

description: updated
description: updated
affects: ubiquity (Ubuntu) → oem-priority
affects: ubiquity → ubiquity (Ubuntu)
Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

If we skip 'oem-config-remove-gtk', then process could be finished and desktop can be started.

Jamie Chang (jamie315)
Changed in oem-priority:
importance: Undecided → Critical
Jamie Chang (jamie315)
Changed in oem-priority:
importance: Critical → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Wimpress  (flexiondotorg) wrote :

The oem user account is also left behind.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:

tags: added: iso-testing
Changed in ubiquity (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 2.21.53

ubiquity (2.21.53) xenial; urgency=medium

  * debian/oem-config.install: install systemd units to /usr/lib/oem-config
    instead of the systemd paths. (LP: #1552621)
  * bin/oem-config-prepare: install systemd job from our copy in
  * bin/oem-config-wrapper: remove our special systemd units after oem config
    is completed.
  * debian/ Wants= network-manager.service too; so we can
    get online and possibly do NTP, downloads, etc. (LP: #1508865)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 28 Mar 2016 22:53:30 -0400

Changed in ubiquity (Ubuntu):
status: In Progress → Fix Released
Ara Pulido (ara)
Changed in oem-priority:
status: New → Fix Released
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

There's a gotcha here; the package landed late enough that it wasn't included in the images except for xubuntu; for 20160329. It will be included in the next daily.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.