Commit b60f5a3d authored by Franco Fichtner's avatar Franco Fichtner

rc: fix recover stage on /var MFS

Keep a symlink on the true file system underneath MFS to keep
pkg(8) operating correctly all the time.
parent 397863b5
...@@ -157,6 +157,9 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then ...@@ -157,6 +157,9 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then
if [ ! -d /root/var/db/pkg ]; then if [ ! -d /root/var/db/pkg ]; then
mkdir -p /root/var/db mkdir -p /root/var/db
mv /var/db/pkg /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 fi
mdmfs -S -M -s ${tmpsize} md /tmp mdmfs -S -M -s ${tmpsize} md /tmp
...@@ -170,6 +173,9 @@ elif [ -d /root/var/db/pkg ]; then ...@@ -170,6 +173,9 @@ elif [ -d /root/var/db/pkg ]; then
# User must have just disabled RAM disks, # User must have just disabled RAM disks,
# let's move these back into place. # let's move these back into place.
mkdir -p /var/db 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/ mv /root/var/db/pkg /var/db/
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment