From b688cbe4f4a03a6697c8a4a781746195277f0243 Mon Sep 17 00:00:00 2001 From: Paul Drews Date: Mon, 8 Oct 2012 15:33:43 -0700 Subject: [PATCH] Fix chroot bootstrap "no such file or directory" breakage CL:33868 (7b6f377c581ec6d7170b550bd17f0c1a746a0906) introduced a breakage in the "cros_sdk --replace --bootstrap" scenario. The make_chroot.sh script invokes early_enter_chroot before invoking init_setup. The chroot/etc/profiles.d directory is created in init_setup, but the referenced change was expecting to create a file in that directory in the context of early_enter_chroot before the directory was created. This led to a "no such file or directory" error when trying to create the file. This change does a "mkdir -p" of the referenced directory before putting things in it in the context of early_enter_chroot. The filename is also fixed to the name expected elsewhere in the scripts. BUG=none TEST=cros_sdk --replace --bootstrap Change-Id: I6ac0467117d7b0dd413695153469b367d56c256c Reviewed-on: https://gerrit.chromium.org/gerrit/34958 Commit-Ready: Brian Harring Reviewed-by: Brian Harring Tested-by: Brian Harring --- sdk_lib/enter_chroot.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index c81f89fc15..ee57fff007 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -371,9 +371,10 @@ setup_env() { if [ ! -L "${distfiles_path}" ]; then # While we're at it, ensure the var is exported w/in the chroot; it # won't exist if distfiles isn't a symlink. - p="${FLAGS_chroot}/etc/profile.d/chromeos-cache.sh" + p="${FLAGS_chroot}/etc/profile.d/chromeos-cachedir.sh" sudo_multi "rm -rf '${distfiles_path}'" \ "ln -s chromeos-cache/distfiles '${distfiles_path}'" \ + "mkdir -p -m 775 '${p%/*}'" \ "echo 'export CHROMEOS_CACHEDIR=${chroot_cache}' > '${p}'" \ "chmod 0644 '${p}'" fi