dev_install: dereference symlinks
If the files in /etc/make.profile are symlinks, dereference them.
Otherwise, when we try to update/modify those files, we get an
error because they're pointing to files in /.
This is needed now that dev-install installs into /usr/share and
then symlinks its files into /etc.
BUG=chromium-os:38789
TEST=`dev_install` on board now works (no longer errors out on read-only rootfs)
Change-Id: Ic52e635c08cd5d33ada7c75377ed5bb2fada8c44
Previous-Reviewed-on: https://gerrit.chromium.org/gerrit/43189
(cherry picked from commit 6e4c9e904fde23b45c5382adb0aeabb11c656e02)
Reviewed-on: https://gerrit.chromium.org/gerrit/43688
Reviewed-by: Chris Sosa <[email protected]>
Commit-Queue: Mike Frysinger <[email protected]>
Tested-by: Mike Frysinger <[email protected]>
diff --git a/dev-install/dev_install b/dev-install/dev_install
index d99fc5e..6f4980e 100644
--- a/dev-install/dev_install
+++ b/dev-install/dev_install
@@ -126,7 +126,9 @@
# Copy emerge configuration to /usr/local.
mkdir -p -m 0755 "${P_CONFIG_DEVELOPER}"
cp "${P_CONFIG_CROS}/make.profile/make.conf" "${P_CONFIG_DEVELOPER}"
- cp -rf "${P_CONFIG_CROS}/make.profile" "${P_CONFIG_DEVELOPER}/make.profile"
+ # The source files might be symlinks, and we'll probably clobber/update things
+ # ourselves locally, so dereference all the symlinks for our local copy.
+ cp -rfL "${P_CONFIG_CROS}/make.profile" "${P_CONFIG_DEVELOPER}/make.profile"
# Create the directories defined in the portage config files. Permissions are
# consistent with the other directories in /usr/local, which is a bind mount
@@ -258,4 +260,4 @@
echo "dev_install done. Enjoy!"
}
-main
\ No newline at end of file
+main