New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 882055 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Sep 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 846610



Sign in to add a comment

lddtree resolves base path incorrectly for symlinks with absolute paths (e.g. sommelier)

Project Member Reported by dverkamp@chromium.org, Sep 7

Issue description

As of https://chromium-review.googlesource.com/1195164 the lddtree-generated script no longer works for the crostini guest tools included in the termina image, such as /usr/bin/sommelier.  The /usr/bin/sommelier symlink resolves to "/etc/alternatives/sommelier" (an absolute path) in this case, which causes $base as resolved by the first line of the generated script to contain a path like /usr/bin//etc/alternatives.  The /etc/alternatives file is also a symlink, so the previous version of the script also failed to resolve the final path - this was worked around in the guest tools by placing an extra copy of the .elf file in /usr/bin.
 
Owner: dverkamp@chromium.org
https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1214099 is an attempt to fix this - it works for the crostini guest tools, but I have not verified whether it works for the case that motivated the original change.
Cc: vapier@chromium.org tikuta@chromium.org smbar...@chromium.org
Blocking: 846610
Cc: tbuck...@chromium.org reve...@chromium.org
 Issue 882452  has been merged into this issue.
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/bd30923638211e4105e56ea77bb6c37ee29005d3

commit bd30923638211e4105e56ea77bb6c37ee29005d3
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Mon Sep 17 20:18:24 2018

lddtree: use readlink -f for absolute links

Commit b97eba7fb2c0a3c5ad9e3831c6f87dca1fde59c5 causes problems when
using lddtree with symlinks containing absolute paths, such as the
crosvm guest tools, which install these links:

  /usr/bin/sommelier -> /etc/alternatives/sommelier ->
  /opt/google/cros-containers/bin/sommelier

(where the final sommelier is the lddtree-generated script).

In this case, $base resolved by the lddtree script would be
'/usr/bin//etc/alternatives/sommelier', which is incorrect.

Replace the dirname/readlink combination with readlink -f when the
symlink is absolute in order to fully resolve the symlink, while keeping
the relative path when the script is invoked through a relative path.

BUG= chromium:882055 
TEST=Build termina image and verify that sommelier can start again

Change-Id: I0879a0d72f3bff673f6fc2233924e7f21d84a0e7
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1214099
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>

[modify] https://crrev.com/bd30923638211e4105e56ea77bb6c37ee29005d3/third_party/lddtree.py

Labels: Proj-Containers
Status: Fixed (was: Started)
Cc: rohi...@chromium.org avkodipelli@chromium.org
Status: Verified (was: Fixed)
Verified by running /usr/bin/sommelier --help on M70-11021.34.0

Sign in to add a comment