@@ -156,18 +156,17 @@ src_prepare() {
156156
157157 # Fail if any firmware is missing.
158158 einfo " Scanning for files required by ${KV_FULL} "
159- echo -n > " ${T} /firmware-scan "
159+ echo " # Remove files that shall not be installed from this list. " > ${PN} .conf
160160 local kofile fwfile failed
161161 for kofile in $( find " ${kernel_mods} " -name ' *.ko' -o -name ' *.ko.xz' ) ; do
162162 for fwfile in $( modinfo --field firmware " ${kofile} " ) ; do
163163 if [[ ! -e " ${fwfile} " ]]; then
164164 eerror " Missing firmware: ${fwfile} (${kofile##*/ } )"
165165 failed=1
166166 elif [[ -L " ${fwfile} " ]]; then
167- echo " ${fwfile} " >> " ${T} /firmware-scan"
168- realpath --relative-to=. " ${fwfile} " >> " ${T} /firmware-scan"
167+ printf " %s\n" " ${fwfile} " " $( realpath --relative-to=. " ${fwfile} " ) " >> ${PN} .conf
169168 else
170- echo " ${fwfile} " >> " ${T} /firmware-scan "
169+ printf " %s\n " " ${fwfile} " >> ${PN} .conf
171170 fi
172171 done
173172 done
@@ -177,20 +176,13 @@ src_prepare() {
177176
178177 # AMD's microcode is shipped as part of coreos-firmware, but not a dependency to
179178 # any module, so add it manually
180- use amd64 && find amd-ucode/ -type f -not -name " *.asc" >> " ${T} /firmware-scan "
179+ use amd64 && find amd-ucode/ -type f -not -name " *.asc" >> ${PN} .conf
181180
182181 einfo " Pruning all unneeded firmware files..."
183- sort -u " ${T} /firmware-scan" > " ${T} /firmware"
184- find * -not -type d \
185- | sort " ${T} /firmware" " ${T} /firmware" - \
186- | uniq -u | xargs -r rm
187- find * -type f -name " * *" -exec rm -f {} \;
182+ find * -not -type d -not -name ${PN} .conf -print0 | grep -Fzxvf ${PN} .conf | xargs -r0 rm -v
188183
189184 default
190185
191- echo " # Remove files that shall not be installed from this list." > ${PN} .conf
192- find * \( \! -type d -and \! -name ${PN} .conf \) >> ${PN} .conf
193-
194186 # whitelist of misc files
195187 local misc_files=(
196188 build_packages.py
@@ -318,7 +310,7 @@ src_prepare() {
318310 if use ! unknown-license; then
319311 einfo " Removing files with unknown license ..."
320312 # Flatcar: do not die even if no such license file is there.
321- rm -v " ${unknown_license[@]} "
313+ rm -vf " ${unknown_license[@]} "
322314 fi
323315
324316 if use ! redistributable; then
0 commit comments