lddtree resolves base path incorrectly for symlinks with absolute paths (e.g. sommelier) |
||||||
Issue descriptionAs 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.
,
Sep 7
,
Sep 10
,
Sep 10
,
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
,
Sep 18
,
Sep 20
,
Oct 3
Verified by running /usr/bin/sommelier --help on M70-11021.34.0 |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by dverkamp@chromium.org
, Sep 7