Commit 651ac81c authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Fix some bugs in sysroot-creator.sh in preparation for adding stretch sysroot

This CL fixes:
* Parsing the release file to obtain the desired SHA256 sum when there
  are multiple hash algorithms listed in different orders.
* Removes a list of directories to relativize symlinks and replaces it
  with a direct check on the directory nesting.

BUG=751812
R=thestig@chromium.org

Change-Id: If3692f0633ba7ad059ab3c7d0945f4b7ef11786e
Reviewed-on: https://chromium-review.googlesource.com/598931Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491506}
parent c0061db1
......@@ -427,25 +427,9 @@ CleanupJailSymlinks() {
# skip links with non-absolute paths
echo "${target}" | grep -qs ^/ || continue
echo "${link}: ${target}"
case "${link}" in
usr/lib/gcc/*-linux-gnu/4.*/* | usr/lib/gcc/arm-linux-gnueabihf/4.*/* | \
usr/lib/gcc/aarch64-linux-gnu/4.*/*)
# Relativize the symlink.
ln -snfv "../../../../..${target}" "${link}"
;;
usr/lib/*-linux-gnu/* | usr/lib/arm-linux-gnueabihf/*)
# Relativize the symlink.
ln -snfv "../../..${target}" "${link}"
;;
usr/lib/*)
# Relativize the symlink.
ln -snfv "../..${target}" "${link}"
;;
lib64/* | lib/*)
# Relativize the symlink.
ln -snfv "..${target}" "${link}"
;;
esac
# Relativize the symlink.
prefix=$(echo "${link}" | sed -e 's/[^/]//g' | sed -e 's|/|../|g')
ln -snfv "${prefix}${target}" "${link}"
done
find $libdirs -type l -printf '%p %l\n' | while read link target; do
......@@ -687,8 +671,8 @@ VerifyPackageListing() {
set +x
echo "Verifying: ${output_file}"
local checksums=$(grep ${file_path} ${release_file} | cut -d " " -f 2)
local sha256sum=$(echo ${checksums} | cut -d " " -f 3)
local sha256sum=$(grep -E "${file_path}\$|:\$" "${release_file}" | \
grep "SHA256:" -A 1 | xargs echo | awk '{print $2;}')
if [ "${#sha256sum}" -ne "64" ]; then
echo "Bad sha256sum from ${release_list}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment