Skip to content

Commit

Permalink
update: allow to override the ABI for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Nov 30, 2016
1 parent c64cae9 commit 854ece5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion update/opnsense-update.8
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd November 20, 2016
.Dd November 30, 2016
.Dt OPNSENSE-UPDATE 8
.Os
.Sh NAME
Expand All @@ -33,6 +33,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl BbdefhikPpsu
.Op Fl a Ar abi
.Op Fl l Ar directory
.Op Fl m Ar mirror
.Op Fl n Ar flavour
Expand Down Expand Up @@ -64,6 +65,12 @@ instead.
.Pp
The options are as follows:
.Bl -tag -width ".Fl l Ar directory" -offset indent
.It Fl a Ar abi
Change the
.Ar abi
from the detected default to a specific value.
This does not affect
.Sq Fl p .
.It Fl B
Execute single-step base system upgrade after use of
.Sq Fl u .
Expand Down
12 changes: 10 additions & 2 deletions update/opnsense-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ DO_BASE=
DO_PKGS=
DO_SKIP=
DO_TYPE=
DO_ABI=

while getopts Bbcdefhikl:m:n:Ppr:st:uv OPT; do
while getopts a:Bbcdefhikl:m:n:Ppr:st:uv OPT; do
case ${OPT} in
a)
DO_ABI="-a ${OPTARG}"
;;
B)
DO_FORCE="-f"
DO_BASE="-B"
Expand Down Expand Up @@ -294,7 +298,8 @@ if [ "${DO_PKGS}" = "-p" -a -z "${DO_UPGRADE}" ]; then
if [ -n "${DO_BASE}${DO_KERNEL}" ]; then
# script may have changed, relaunch...
opnsense-update ${DO_BASE} ${DO_KERNEL} ${DO_LOCAL} \
${DO_FORCE} ${DO_RELEASE} ${DO_MIRROR} ${DO_HIDE}
${DO_FORCE} ${DO_RELEASE} ${DO_MIRROR} ${DO_HIDE} \
${DO_ABI}
fi

# stop here to prevent the second pass
Expand Down Expand Up @@ -334,6 +339,9 @@ BASESET=base-${RELEASE}-${ARCH}.txz
# we need all of it to find the correct sets
MIRROR=$(sed -n 's/'"${URL_KEY}"'\"pkg\+\(.*\/${ABI}\/[^\/]*\)\/.*/\1/p' ${ORIGIN})
ABI=$(opnsense-verify -a 2> /dev/null)
if [ -n "${DO_ABI}" ]; then
ABI=${DO_ABI#"-a "}
fi
eval MIRROR=${MIRROR}

fetch_set()
Expand Down

0 comments on commit 854ece5

Please sign in to comment.