diff options
author | Bryan Evenson <bevenson@melinkcorp.com> | 2015-04-14 17:08:15 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-20 15:03:11 +0100 |
commit | 075f0b2c889410844352d8ac6e9d12b704d8565e (patch) | |
tree | 39693e7113d9b833d6691adeb8e96149286337ca /meta | |
parent | 70832d863fb88e852a8f86fe8018160d94e1fa9d (diff) | |
download | poky-075f0b2c889410844352d8ac6e9d12b704d8565e.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: c1ee31acf509b054453f19cab162dadc295e10a4)
Signed-off-by: Bryan Evenson <bevenson@melinkcorp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 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 | ||
70 | BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" | 70 | BASEFILESISSUEINSTALL ?= "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 | # | ||
80 | pkg_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 | |||
72 | do_install () { | 95 | do_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 | ||