git: ffb598d0953a - stable/12 - rescue: Add fetch(1) to the rescue tool.

From: Xin LI <>
Date: Sun, 12 Feb 2023 07:59:13 UTC
The branch stable/12 has been updated by delphij:


commit ffb598d0953a328b30744ac56e8f1fd0344fd733
Author:     John Grafton <>
AuthorDate: 2023-01-29 23:05:15 +0000
Commit:     Xin LI <>
CommitDate: 2023-02-12 07:58:55 +0000

    rescue: Add fetch(1) to the rescue tool.
    After a failed upgrade, having fetch(1) on a system that is
    physically unnreachable would be very useful to download files
    required to get the OS back up and functional.
    On my system this adds 589,824 bytes (3.8%) to the binary size.
    PR:             266224
    Reported by:    Dan Mahoney
    Differential Revision:
    (cherry picked from commit ea34aa4780e5a581732520ea579342af94684882)
    rescue: Fix link order of SSL libraries and fetch.
    ld.bfd requires libraries to be linked in order.  libssl requires
    libcrypto.  libfetch requires libssl.  To fix the latter, move fetch
    up above tar rather than listing the ssl libraries twice.
    Reviewed by:    delphij
    Fixes:          ea34aa4780e5 rescue: Add fetch(1) to the rescue tool.
    Differential Revision:
    (cherry picked from commit 0f031350f32b8760e0843a6476d67aa21116103b)
 rescue/rescue/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index 6a1f7d9c768e..8faf4d29877b 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -198,10 +198,13 @@ CRUNCH_PROGS_usr.bin+= zstd
 CRUNCH_ALIAS_zstd= unzstd zstdcat zstdmt
+CRUNCH_PROGS_usr.bin+=	fetch
+CRUNCH_LIBS+=	-lfetch
 CRUNCH_PROGS_usr.bin+= tar
 CRUNCH_LIBS+= -larchive
 .if ${MK_OPENSSL} != "no"
-CRUNCH_LIBS+= -lcrypto
+CRUNCH_LIBS+= -lssl -lcrypto