Add logic for detecting non-persistent filesystems being utilized by
workdir which would break the upgrade process upon reboot. Currently we check for tmpfs and mdmfs. PR: 195006 Differential Revision: https://reviews.freebsd.org/D1163 Approved by: cperciva
This commit is contained in:
parent
2bdae054ab
commit
1706600a13
@ -580,6 +580,7 @@ fetchupgrade_check_params () {
|
||||
_KEYPRINT_z="Key must be given via -k option or configuration file."
|
||||
_KEYPRINT_bad="Invalid key fingerprint: "
|
||||
_WORKDIR_bad="Directory does not exist or is not writable: "
|
||||
_WORKDIR_bad2="Directory is not on a persistent filesystem: "
|
||||
|
||||
if [ -z "${SERVERNAME}" ]; then
|
||||
echo -n "`basename $0`: "
|
||||
@ -603,6 +604,14 @@ fetchupgrade_check_params () {
|
||||
echo ${WORKDIR}
|
||||
exit 1
|
||||
fi
|
||||
for i in tmpfs mdmfs; do
|
||||
if df -t ${i} ${WORKDIR} >/dev/null 2>1; then
|
||||
echo -n "`basename $0`: "
|
||||
echo -n "${_WORKDIR_bad2}"
|
||||
echo ${WORKDIR}
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
chmod 700 ${WORKDIR}
|
||||
cd ${WORKDIR} || exit 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user