git: 404b91dac415 - stable/14 - libexec/rc/rc.initdiskless: make tar's path flexible

From: Cheng Cui <cc_at_FreeBSD.org>
Date: Fri, 19 Jan 2024 15:46:18 UTC
The branch stable/14 has been updated by cc:

URL: https://cgit.FreeBSD.org/src/commit/?id=404b91dac415c5c9126fb4201145049c4d3dfbba

commit 404b91dac415c5c9126fb4201145049c4d3dfbba
Author:     Cheng Cui <cc@FreeBSD.org>
AuthorDate: 2023-11-24 15:47:18 +0000
Commit:     Cheng Cui <cc@FreeBSD.org>
CommitDate: 2024-01-19 10:45:28 +0000

    libexec/rc/rc.initdiskless: make tar's path flexible
    
    PR:             274977
    
    (cherry picked from commit 93b7818226cf5270646725805b4a8c17a1ad3761
     and from commit a04ca1c229195c7089b878a94fbe76505ea693b5)
---
 libexec/rc/rc.initdiskless | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libexec/rc/rc.initdiskless b/libexec/rc/rc.initdiskless
index 9b37497c1e7e..8b4a01187636 100644
--- a/libexec/rc/rc.initdiskless
+++ b/libexec/rc/rc.initdiskless
@@ -362,6 +362,8 @@ done
 # so if the cpio archive is present, it prevents the files from dir/
 # from being copied.
 
+PATH=${PATH}:/rescue
+
 for i in ${templates} ; do
     for j in /conf/$i/* ; do
 	subdir=${j##*/}
@@ -376,7 +378,7 @@ for i in ${templates} ; do
 	if [ -f $j ]; then
 	    create_md $subdir
 	    echo "Loading /$subdir from cpio archive $j"
-	    (cd / ; /rescue/tar -xpf $j)
+	    (cd / ; tar -xpf $j)
 	fi
     done
     for j in /conf/$i/*/extract ; do