libexec/rc/rc.initdiskless: make tar's path flexible

Summary:
PR:		274977
Reviewed by: rgrimes,imp
Approved by: rgrimes
MFC after:      1 month
This commit is contained in:
Cheng Cui 2023-11-24 10:47:18 -05:00
parent 5fb307d29b
commit 93b7818226
No known key found for this signature in database
GPG key ID: F9BE886D1486EF98

View file

@ -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