diff --git a/core/lib/Drupal/Core/Extension/Extension.php b/core/lib/Drupal/Core/Extension/Extension.php
index 3c765fe..e1e9b3d 100644
--- a/core/lib/Drupal/Core/Extension/Extension.php
+++ b/core/lib/Drupal/Core/Extension/Extension.php
@@ -166,8 +166,9 @@ public function __call($method, array $args) {
    * Serializes the Extension object in the most optimized way.
    */
   public function serialize() {
+    // Don't serialize the app root, since this could change if the install is
+    // moved..
     $data = array(
-      'root' => $this->root,
       'type' => $this->type,
       'pathname' => $this->pathname,
       'filename' => $this->filename,
@@ -188,7 +189,8 @@ public function serialize() {
    */
   public function unserialize($data) {
     $data = unserialize($data);
-    $this->root = $data['root'];
+    // Get the app root from the container.
+    $this->root = DRUPAL_ROOT;
     $this->type = $data['type'];
     $this->pathname = $data['pathname'];
     $this->filename = $data['filename'];
diff --git a/core/lib/Drupal/Core/Update/UpdateKernel.php b/core/lib/Drupal/Core/Update/UpdateKernel.php
index 6c5de73..1c2ca61 100755
--- a/core/lib/Drupal/Core/Update/UpdateKernel.php
+++ b/core/lib/Drupal/Core/Update/UpdateKernel.php
@@ -10,10 +10,13 @@
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Session\AnonymousUserSession;
 use Drupal\Core\Site\Settings;
+use Drupal\system\Tests\Routing\MockRouteProvider;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\ParameterBag;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\Routing\Route;
+use Symfony\Component\Routing\RouteCollection;
 
 /**
  * Defines a kernel which is used primarily to run the update of Drupal.
@@ -57,6 +60,27 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch =
   }
 
   /**
+   * {@inheritdoc}
+   */
+  protected function initializeContainer() {
+    $container = parent::initializeContainer();
+
+    $routes = new RouteCollection();
+
+    $routes->add('<front>', new Route('/', ['_title' => 'Home'], ['_access' => 'TRUE']));
+    $routes->add('<none>', new Route('', [], ['_access' => 'TRUE'], ['_no_path' => TRUE]));
+    $routes->add('<current>', new Route('<current>'));
+    $routes->add('system.site_maintenance_mode', new Route('/admin/config/development/maintenance', ['_title' => 'Maintenance mode'], ['_permission' => 'administer site configuration']));
+    $routes->add('system.db_update', new Route('/update.php/{op}', ['op' => 'info'], ['_access' => 'TRUE']));
+
+    $mock_route_provider = new MockRouteProvider($routes);
+    $container->set('@router.route_provider', $mock_route_provider);
+
+    return $container;
+  }
+
+
+  /**
    * Generates the actual result of update.php.
    *
    * The actual logic of the update is done in the db update controller.
diff --git a/core/modules/block/src/Tests/Update/BlockContextMappingUpdateTest.php b/core/modules/block/src/Tests/Update/BlockContextMappingUpdateTest.php
index 4aa0ac0..0362390 100644
--- a/core/modules/block/src/Tests/Update/BlockContextMappingUpdateTest.php
+++ b/core/modules/block/src/Tests/Update/BlockContextMappingUpdateTest.php
@@ -32,6 +32,8 @@ protected function setDatabaseDumpFiles() {
     $this->databaseDumpFiles = [
       __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
       __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php',
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.language-enabled.php',
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.block-test-enabled.php',
     ];
   }
 
diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php
index 28ab72b..e66a1a5 100644
--- a/core/modules/system/src/Controller/DbUpdateController.php
+++ b/core/modules/system/src/Controller/DbUpdateController.php
@@ -228,7 +228,8 @@ protected function info(Request $request) {
       '#type' => 'link',
       '#title' => $this->t('Continue'),
       '#attributes' => array('class' => array('button', 'button--primary')),
-      '#url' => Url::fromUri($request->getUriForPath('/selection')),
+      // @todo Revisit once https://www.drupal.org/node/2548095 is in.
+      '#url' => Url::fromUri('base://selection'),
     );
     return $build;
   }
@@ -484,6 +485,9 @@ protected function results(Request $request) {
    */
   public function requirements($severity, array $requirements, Request $request) {
     $options = $severity == REQUIREMENT_WARNING ? array('continue' => 1) : array();
+    // @todo Revisit once https://www.drupal.org/node/2548095 is in. Something
+    // like Url::fromRoute('system.db_update')->setOptions ... should then be
+    // possible.
     $try_again_url = Url::fromUri($request->getUriForPath(''))->setOptions(['query' => $options])->toString(TRUE)->getGeneratedUrl();
 
     $build['status_report'] = array(
@@ -580,7 +584,8 @@ protected function triggerBatch(Request $request) {
     );
     batch_set($batch);
 
-    return batch_process(Url::fromUri($request->getUriForPath('/results')), Url::fromUri($request->getUriForPath('/start')));
+    // @todo Revisit once https://www.drupal.org/node/2548095 is in.
+    return batch_process(Url::fromUri('base://results'), Url::fromUri('base://start'));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
index c5197a2..fbd7ab0 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -179,9 +179,6 @@ protected function setUp() {
     // Add the config directories to settings.php.
     drupal_install_config_directories();
 
-    // Install any additional modules.
-    $this->installModulesFromClassProperty($container);
-
     // Restore the original Simpletest batch.
     $this->restoreBatch();
 
@@ -189,6 +186,7 @@ protected function setUp() {
     $this->rebuildAll();
 
     // Replace User 1 with the user created here.
+    // @todo: do this without saving the user account.
     /** @var \Drupal\user\UserInterface $account */
     $account = User::load(1);
     $account->setPassword($this->rootUser->pass_raw);
@@ -274,7 +272,9 @@ protected function rebuildAll() {
     // We know the rebuild causes notices, so don't exit on failure.
     $die_on_fail = $this->dieOnFail;
     $this->dieOnFail = FALSE;
-    parent::rebuildAll();
+
+    // Initialize the container. parent::rebuildall() is not safe to call here.
+    $this->container = \Drupal::getContainer();
 
     // Remove the notices we get due to the menu link rebuild prior to running
     // the system updates for the schema change.
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php b/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php
index 30ed37d..623a400 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php
@@ -18,6 +18,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
    * {@inheritdoc}
    */
   protected function setDatabaseDumpFiles() {
+    parent::setDatabaseDumpFiles();
     $this->databaseDumpFiles[0] = __DIR__ . '/../../../tests/fixtures/update/drupal-8.filled.standard.php.gz';
   }
 
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php
index 28e003a..65e0b21 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php
@@ -25,7 +25,10 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
    * {@inheritdoc}
    */
   protected function setDatabaseDumpFiles() {
-    $this->databaseDumpFiles = [__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz'];
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
+      __DIR__ . '/../../../tests/fixtures/update/drupal-8.update-test-schema-enabled.php',
+    ];
   }
 
   /**
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 865e101..e07fa56 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -249,7 +249,7 @@ function system_theme_suggestions_html(array $variables) {
     $path_args = [''];
   }
   else {
-    $path_args = explode('/', Url::fromRoute('<current>')->getInternalPath());
+    $path_args = explode('/', ltrim(\Drupal::service('path.current')->getPath(), '/'));
   }
   return theme_get_suggestions($path_args, 'html');
 }
diff --git a/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php
new file mode 100644
index 0000000..990278d
--- /dev/null
+++ b/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Partial database to mimic the installation of the update_test_schema module.
+ */
+
+use Drupal\Core\Database\Database;
+use Symfony\Component\Yaml\Yaml;
+
+$connection = Database::getConnection();
+
+// Set the schema version.
+$connection->insert('key_value')
+  ->fields([
+    'collection' => 'system.schema',
+    'name' => 'block_test',
+    'value' => 'i:8000;',
+  ])
+  ->execute();
+
+// Update core.extension.
+$extensions = $connection->select('config')
+  ->fields('config', ['data'])
+  ->condition('collection', '')
+  ->condition('name', 'core.extension')
+  ->execute()
+  ->fetchField();
+$extensions = unserialize($extensions);
+$extensions['module']['block_test'] = 8000;
+$connection->update('config')
+  ->fields([
+    'data' => serialize($extensions),
+  ])
+  ->condition('collection', '')
+  ->condition('name', 'core.extension')
+  ->execute();
+
+// Install the block configuration.
+$config = file_get_contents(__DIR__ . '/../../../../block/tests/modules/block_test/config/install/block.block.test_block.yml');
+$config = Yaml::parse($config);
+$connection->insert('config')
+  ->fields(['data', 'name', 'collection'])
+  ->values([
+    'name' => 'block.block.test_block',
+    'data' => serialize($config),
+    'collection' => '',
+  ])
+  ->execute();
diff --git a/core/modules/system/tests/fixtures/update/drupal-8.language-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.language-enabled.php
new file mode 100644
index 0000000000000000000000000000000000000000..6be5c24f5c101bc7fea607af617b4bc135a4401e
GIT binary patch
literal 6316
zcmeHLZEM?B6z=Ez3SkOzMq|fG+I8}h(IqV_lx;K}V<bh~NY}Q=wIuYC#tZrHd(Juc
z%90buD{EOd3Z;>B&-;1K%k}p^<g<Kht1h*7Qq;LJ=f_#0&rejPE>yXE7&FP~Vm`^z
z1!(4Zmg=-R|3l3U|2N*+dK_hGs-r5&Qt!}nB7$J5tK;URzYWUa&^y(YSIx9nMl(HE
z-jyy&@D18Rc8=z{nCiZNsTbjuGPU-%w>)p>Xp(3Xm;E!mc%CmO-r<qwC&BaG-QBV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-ZrrpoeBYCur`IJ@8q@43T}vUX}I=r033*7jaDQR*FU!
zrN{kmH?X|~q2pr+7+rDr_W|n%6`o*iskHDS^H5Y`e%a(5EQ7|&r&LupVbT#!9TSzQ
zl#+_)NgAS{=1J**y$59TcdD_%a}i}|><Q|Y4B@m;X>C-2cE~^g*lYn(L!(as8_;Ev
z^pdmB(I!mB?A6Z1hVmHzF=V}N?iPBAT2p4|Oc)Bw@aA5u-;y%8MG09-g)^I^62n6>
zN06~>|D0=>zd@=rL!^p)r$&QbWz2<&E_-9D3)=~$cZ8jgaoHdm;IzltM3`)Ev|nxi
zVsgNj$T6}*+&!opu@aHu+Ez$gUi*9`_BH1%){#iO!yy2ukoD5gHHTEmkg$1{riw|0
z_x7YZt%@X_zO#%-?0M_?_d?|W73LMyqF}RR28$q9d-OUIuT(Lu=Lj65O2!Li3Sr1{
zx^pz&3GQNcT_h`M5TmC>R_81lUN_((A^cJ13KOAY^U(OD{!y%@Y|&X8tsmhfCNZ}K
zm|o#3!A2vsQuZDdqGw&aMKJb6GH+;MorH`UM1Z;xqehx}l+EW^8e&<{7{(C+3-?I~
zmvmbx+{1Yc%Yu5{$%m_b^m(DF)Rgnm><;@)#DgaA?e!=m1yW3s22cSRD(NJidKMBd
zkZIwH9J;;lma=IPTXW%&I$g8(wJtlYb+daFTXQFeQ)oiK+v-L6L4_Od&F;<+mb$7?
zedWKoY|?(i0L9+s>|vxzZT{c(&SzAUsI-;66BXgwEjbU|(jSE83)mu&2sdi)Acr&c
z(VHavTHS1<DbZDhHh9<9@q-ovl+{T8`FqRc9)%eUt!)r)v<Ht>D1X+iga7TF%1*zp
z+eY&f>_6BxXveka^c+0t2iGM&KVmXdX1?wpU-JHeqQO+c&nCgz-uGE{khR)6Gy2o*
GA%6izQ~1>Y

literal 0
HcmV?d00001

diff --git a/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php
new file mode 100644
index 0000000..7250741
--- /dev/null
+++ b/core/modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * @file
+ * Partial database to mimic the installation of the update_test_schema module.
+ */
+
+use Drupal\Core\Database\Database;
+
+$connection = Database::getConnection();
+
+// Create the table.
+$connection->schema()->createTable('update_test_schema_table', array(
+  'fields' => array(
+    'a' => array(
+      'type' => 'int',
+      'not null' => TRUE,
+      'size' => 'normal',
+    ),
+    'b' => array(
+      'type' => 'blob',
+      'not null' => FALSE,
+      'size' => 'normal',
+    ),
+  ),
+));
+
+// Set the schema version.
+$connection->merge('key_value')
+  ->condition('collection', 'system.schema')
+  ->condition('name', 'update_test_schema')
+  ->fields([
+    'collection' => 'system.schema',
+    'name' => 'update_test_schema',
+    'value' => 'i:8000;',
+  ])
+  ->execute();
+
+// Update core.extension.
+$extensions = $connection->select('config')
+  ->fields('config', ['data'])
+  ->condition('collection', '')
+  ->condition('name', 'core.extension')
+  ->execute()
+  ->fetchField();
+$extensions = unserialize($extensions);
+$extensions['module']['update_test_schema'] = 8000;
+$connection->update('config')
+  ->fields([
+    'data' => serialize($extensions),
+  ])
+  ->condition('collection', '')
+  ->condition('name', 'core.extension')
+  ->execute();
