Skip to content

Commit

Permalink
fix issue to apply existing updates to jail; "/var/db/freebsd-update"…
Browse files Browse the repository at this point in the history
… should be verified for symlink. idented 'if' conditions and new comments to better explain it. based on commit 47ff5fc from #385
  • Loading branch information
Vinicius Zavam committed Jul 5, 2017
1 parent ebd70ef commit b1469c4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/share/poudriere/jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,14 @@ update_jail() {
chmod +x ${JAILMNT}/usr/sbin/freebsd-update.fixed
if [ -z "${TORELEASE}" ]; then
# We're running inside the jail so basedir is /.
# If we start using -b this needs to match it.
# If we start using '-b' this needs to match it.
basedir=/
bdhash="$(echo "${basedir}" | sha256 -q)"
if injail env PAGER=/bin/cat \
/usr/sbin/freebsd-update.fixed fetch && \
[ -L "${JAILMNT}/${bdhash}-install" ]; then
injail env PAGER=/bin/cat \
/usr/sbin/freebsd-update.fixed install
fi
bdhash=$(echo ${basedir} | sha256 -q)
injail env PAGER=/bin/cat /usr/sbin/freebsd-update.fixed fetch && \
# New updates are identified by a symlink containing the basedir hash and -install as suffix.
# If we really have new updates to install, then install them.
[ -L "${JAILMNT}/var/db/freebsd-update/${bdhash}-install" ] && \
injail env PAGER=/bin/cat /usr/sbin/freebsd-update.fixed install
else
# Install new kernel
injail env PAGER=/bin/cat \
Expand Down

0 comments on commit b1469c4

Please sign in to comment.