From b51593405b3a99d54d47f4c813963aeb800ca6b2 Mon Sep 17 00:00:00 2001 From: Daniel Erat Date: Mon, 26 Mar 2012 17:16:29 -0700 Subject: [PATCH] build: Test /etc/localtime symlink in built images. This makes us fail if /etc/localtime doesn't point at /var/lib/timezone/localtime. BUG=chromium-os:27413 TEST=manual: error from build_image after i patched chromeos-base to not create the symlink Change-Id: I11ef272c2dcd67a189a5d67c46792490ec6d27a1 Reviewed-on: https://gerrit.chromium.org/gerrit/19335 Tested-by: Daniel Erat Reviewed-by: Mike Frysinger Commit-Ready: Daniel Erat --- build_library/test_image_content.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build_library/test_image_content.sh b/build_library/test_image_content.sh index 2d007ecb7f..3c1a078eec 100644 --- a/build_library/test_image_content.sh +++ b/build_library/test_image_content.sh @@ -41,5 +41,19 @@ test_image_content() { fi done + # Check that /etc/localtime is a symbolic link pointing at + # /var/lib/timezone/localtime. + local localtime="$root/etc/localtime" + if [ ! -L "$localtime" ]; then + error "test_image_content: /etc/localtime is not a symbolic link" + returncode=1 + else + local dest=$(readlink "$localtime") + if [ "$dest" != "/var/lib/timezone/localtime" ]; then + error "test_image_content: /etc/localtime points at $dest" + returncode=1 + fi + fi + return $returncode }