summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Evenson <bevenson@melinkcorp.com>2015-04-14 17:08:15 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-20 15:03:06 +0100
commit6f03a8d7ae383d63bfed8b85c06a697b86719004 (patch)
treec4cdf94d854caf5e9311967b7eded5250ea03f2a
parent72d88f29da1ece634028420317233a45ff8e015b (diff)
downloadpoky-6f03a8d7ae383d63bfed8b85c06a697b86719004.tar.gz
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. (From OE-Core rev: 272805f064848f14306b1ed2648a7760017ee318) Signed-off-by: Bryan Evenson <bevenson@melinkcorp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb24
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 f2d254e6bd..e16fe722b8 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
@@ -69,6 +69,29 @@ hostname = "${MACHINE}"
69 69
70BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" 70BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
71 71
72# In previous versions of base-files, /run was a softlink to /var/run and the
73# directory was located in /var/volatlie/run. Also, /var/lock was a softlink
74# to /var/volatile/lock which is where the real directory was located. Now,
75# /run and /run/lock are the real directories. If we are upgrading, we may
76# need to remove the symbolic links first before we create the directories.
77# Otherwise the directory creation will fail and we will have circular symbolic
78# links.
79#
80pkg_preinst_${PN} () {
81 #!/bin/sh -e
82 if [ x"$D" = "x" ]; then
83 if [ -h "/var/lock" ]; then
84 # Remove the symbolic link
85 rm -f /var/lock
86 fi
87
88 if [ -h "/run" ]; then
89 # Remove the symbolic link
90 rm -f /run
91 fi
92 fi
93}
94
72do_install () { 95do_install () {
73 for d in ${dirs755}; do 96 for d in ${dirs755}; do
74 install -m 0755 -d ${D}$d 97 install -m 0755 -d ${D}$d
@@ -82,6 +105,7 @@ do_install () {
82 for d in ${volatiles}; do 105 for d in ${volatiles}; do
83 ln -sf volatile/$d ${D}${localstatedir}/$d 106 ln -sf volatile/$d ${D}${localstatedir}/$d
84 done 107 done
108
85 ln -snf ../run ${D}${localstatedir}/run 109 ln -snf ../run ${D}${localstatedir}/run
86 ln -snf ../run/lock ${D}${localstatedir}/lock 110 ln -snf ../run/lock ${D}${localstatedir}/lock
87 111