git: 93b7818226cf - main - libexec/rc/rc.initdiskless: make tar's path flexible

From: Cheng Cui <cc_at_FreeBSD.org>
Date: Fri, 15 Dec 2023 13:47:34 UTC
The branch main has been updated by cc:

URL: https://cgit.FreeBSD.org/src/commit/?id=93b7818226cf5270646725805b4a8c17a1ad3761

commit 93b7818226cf5270646725805b4a8c17a1ad3761
Author:     Cheng Cui <cc@FreeBSD.org>
AuthorDate: 2023-11-24 15:47:18 +0000
Commit:     Cheng Cui <cc@FreeBSD.org>
CommitDate: 2023-12-15 08:46:44 +0000

    libexec/rc/rc.initdiskless: make tar's path flexible
    
    Summary:
    PR:             274977
    Reviewed by: rgrimes,imp
    Approved by: rgrimes
    MFC after:      1 month
---
 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..ee891c3f782e 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