File tree 5 files changed +11
-9
lines changed
5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
28
28
- info: -B instead of -b for private bridge information
29
29
- copy-in: copy is executed in the jail environment, to avoid soft-link related issues in the destination path
30
30
- copy-in: with running pots, a -F flag is needed to force the copy, an operation that is discouraged for security reasons
31
+ - fetch base.txz: the base FreeBSD tarball used to be temporarily stored in /tmp. While a POT_CACHE folder is available, use that instead.
31
32
32
33
### Removed
33
34
- create-dns: remove this already deprecated command, leaving the user to create a dns for the public bridge
Original file line number Diff line number Diff line change @@ -855,7 +855,7 @@ _fetch_freebsd()
855
855
if ! _fetch_freebsd_internal " $1 " " $_archpath " ; then
856
856
# remove artifact and retry only once
857
857
_rel=" $( _get_freebsd_release_name " $1 " ) "
858
- rm -f /tmp/ " ${_rel} " _base.txz
858
+ rm -f " ${POT_CACHE} / ${_rel} " _base.txz
859
859
if ! _fetch_freebsd_internal " $1 " " $_archpath " ; then
860
860
return 1 # false
861
861
fi
@@ -872,15 +872,15 @@ _fetch_freebsd_internal()
872
872
_rel=" $( _get_freebsd_release_name " $1 " ) "
873
873
_archpath=" $( echo " $2 " | sed -e ' s:-:/:' ) "
874
874
875
- if [ ! -r /tmp/ " ${_rel} " _base.txz ]; then
876
- fetch -m https://ftp.freebsd.org/pub/FreeBSD/releases/" $_archpath " /" ${_rel} " /base.txz -o /tmp/ " ${_rel} " _base.txz
875
+ if [ ! -r " ${POT_CACHE} / ${_rel} " _base.txz ]; then
876
+ fetch -m https://ftp.freebsd.org/pub/FreeBSD/releases/" $_archpath " /" ${_rel} " /base.txz -o " ${POT_CACHE} / ${_rel} " _base.txz
877
877
fi
878
878
879
- if [ ! -r /tmp/ " ${_rel} " _base.txz ]; then
879
+ if [ ! -r " ${POT_CACHE} / ${_rel} " _base.txz ]; then
880
880
return 1 # false
881
881
fi
882
882
if [ -r /usr/local/share/freebsd/MANIFESTS/" $2 " -" ${_rel} " ]; then
883
- _sha=$( sha256 -q /tmp/ " ${_rel} " _base.txz )
883
+ _sha=$( sha256 -q " ${POT_CACHE} / ${_rel} " _base.txz )
884
884
# shellcheck disable=SC2002
885
885
_sha_m=$( cat /usr/local/share/freebsd/MANIFESTS/" $2 " -" ${_rel} " | awk ' /^base.txz/ { print $2 }' )
886
886
# This version would remove the useless cat, but the testability of this function is compromised
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ _cb_tar_dir()
58
58
(
59
59
set -e
60
60
cd " $_mnt "
61
- tar xkf /tmp/ " ${_rel} " _base.txz
61
+ tar xkf " ${POT_CACHE} / ${_rel} " _base.txz
62
62
# add release information
63
63
echo " $_rel " > .osrelease
64
64
cp -a root opt/custom/
Original file line number Diff line number Diff line change @@ -435,16 +435,16 @@ _cj_single_install()
435
435
else
436
436
_rel=" $_base " -RELEASE
437
437
fi
438
- if [ ! -r " /tmp /${_rel} _base.txz" ]; then
439
- _error " FreeBSD base tarball /tmp /${_rel} _base.txz is missing"
438
+ if [ ! -r " ${POT_CACHE} /${_rel} _base.txz" ]; then
439
+ _error " FreeBSD base tarball ${POT_CACHE} /${_rel} _base.txz is missing"
440
440
_cj_undo_create
441
441
return 1 # falase
442
442
fi
443
443
(
444
444
set -e
445
445
cd " $_proot "
446
446
_info " Extract the tarball"
447
- tar xkf " /tmp /${_rel} _base.txz"
447
+ tar xkf " ${POT_CACHE} /${_rel} _base.txz"
448
448
if [ ! -d usr/home ]; then
449
449
mkdir -p usr/home
450
450
fi
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ setUp()
207
207
__arch=" amd64"
208
208
__didfetch=" 1"
209
209
common_setUp
210
+ POT_CACHE=" /tmp"
210
211
FETCH_CALLS=0
211
212
RM_CALLS=0
212
213
}
You can’t perform that action at this time.
0 commit comments