diff options
author | Bryan Evenson <bevenson@melinkcorp.com> | 2015-04-14 17:08:15 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-17 22:38:35 +0100 |
commit | edeeee8432dc749b02e5e6eca0503229e394ebd3 (patch) | |
tree | 37c7d53dc72a8162cfaf8151585137c64b8f2440 | |
parent | bcb124931af57dc2f9d8fe9cbbabd5f8ee58e414 (diff) | |
download | openembedded-core-edeeee8432dc749b02e5e6eca0503229e394ebd3.tar.gz openembedded-core-edeeee8432dc749b02e5e6eca0503229e394ebd3.tar.bz2 openembedded-core-edeeee8432dc749b02e5e6eca0503229e394ebd3.zip |
base-files: Check for /run and /var/lock softlinks on upgrade
Commit ea647cd9eebdc3e3121b84074519c4bb305adac9 moved the locations
of /run and /var/lock to match the FHS 3 draft specifications.
However, the install doesn't remove the existing directories.
As a result, upgrading a system may result in /run as a softlink
to /var/run and /var/run as a softlink to /run, creating a circular
link.
During pre-install, check for the existence of the old softlinks and
remove them so the new directories can be installed.
Signed-off-by: Bryan Evenson <bevenson@melinkcorp.com>
-rw-r--r-- | meta/recipes-core/base-files/base-files_3.0.14.bb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb index 07f5c54c97..9021103158 100644 --- a/meta/recipes-core/base-files/base-files_3.0.14.bb +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb @@ -66,6 +66,29 @@ hostname = "openembedded" BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" +# In previous versions of base-files, /run was a softlink to /var/run and the +# directory was located in /var/volatlie/run. Also, /var/lock was a softlink +# to /var/volatile/lock which is where the real directory was located. Now, +# /run and /run/lock are the real directories. If we are upgrading, we may +# need to remove the symbolic links first before we create the directories. +# Otherwise the directory creation will fail and we will have circular symbolic +# links. +# +pkg_preinst_${PN} () { + #!/bin/sh -e + if [ x"$D" = "x" ]; then + if [ -h "/var/lock" ]; then + # Remove the symbolic link + rm -f /var/lock + fi + + if [ -h "/run" ]; then + # Remove the symbolic link + rm -f /run + fi + fi +} + do_install () { for d in ${dirs755}; do install -m 0755 -d ${D}$d @@ -79,6 +102,7 @@ do_install () { for d in ${volatiles}; do ln -sf volatile/$d ${D}${localstatedir}/$d done + ln -snf ../run ${D}${localstatedir}/run ln -snf ../run/lock ${D}${localstatedir}/lock |