Skip to content

Commit

Permalink
rc: fix recover stage on /var MFS
Browse files Browse the repository at this point in the history
Keep a symlink on the true file system underneath MFS to keep
pkg(8) operating correctly all the time.
  • Loading branch information
fichtner committed Jul 6, 2015
1 parent 397863b commit b60f5a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/etc/rc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then
if [ ! -d /root/var/db/pkg ]; then
mkdir -p /root/var/db
mv /var/db/pkg /root/var/db
# create a symlink underneath as well
# to fix early boot pkg(8) issues:
ln -s /root/var/db/pkg /var/db/pkg
fi

mdmfs -S -M -s ${tmpsize} md /tmp
Expand All @@ -170,6 +173,9 @@ elif [ -d /root/var/db/pkg ]; then
# User must have just disabled RAM disks,
# let's move these back into place.
mkdir -p /var/db
# reverse the recovery symlink before moving
# back the original database:
rm -f /var/db/pkg
mv /root/var/db/pkg /var/db/
fi

Expand Down

0 comments on commit b60f5a3

Please sign in to comment.