mirror of
https://abf.rosa.ru/djam/kernel-6.6.git
synced 2025-02-25 20:02:47 +00:00
Avoid tricky shell construction
It sometimes failed: environment: line 4: 1 7+1: syntax error in expression (error token is "7+1")
This commit is contained in:
parent
3eca49b16a
commit
236b8ce3a6
1 changed files with 5 additions and 4 deletions
|
@ -1084,13 +1084,15 @@ cp -a %{temp_root} %{buildroot}
|
||||||
# Multithreaded verification that every kernel module
|
# Multithreaded verification that every kernel module
|
||||||
# has a signature attached to it
|
# has a signature attached to it
|
||||||
mkdir -p "%{certs_dir_rnd}"
|
mkdir -p "%{certs_dir_rnd}"
|
||||||
echo 0 > %{certs_verify_tmp}
|
touch %{certs_verify_tmp}
|
||||||
_verify_signature(){
|
_verify_signature(){
|
||||||
if [ -z "$1" ] || [ ! -f "$1" ]; then return; fi
|
if [ -z "$1" ] || [ ! -f "$1" ]; then return; fi
|
||||||
if hexdump -C "$1" | rev | cut -f 2 -d '|' | rev | tr -d '\n' | \
|
if hexdump -C "$1" | rev | cut -f 2 -d '|' | rev | tr -d '\n' | \
|
||||||
grep -q '~Module signature appended~'
|
grep -q '~Module signature appended~'
|
||||||
then
|
then
|
||||||
echo $(($(cat %{certs_verify_tmp})+1)) > %{certs_verify_tmp}
|
if [ -f %{certs_verify_tmp} ]; then
|
||||||
|
rm -f %{certs_verify_tmp}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Module $1 has no signature attached to it!"
|
echo "ERROR: Module $1 has no signature attached to it!"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1099,11 +1101,10 @@ _verify_signature(){
|
||||||
export -f _verify_signature
|
export -f _verify_signature
|
||||||
find %{target_modules} -name '*.ko' -print0 | sort -u | \
|
find %{target_modules} -name '*.ko' -print0 | sort -u | \
|
||||||
xargs --null -P "$(nproc)" -I {} "$SHELL" -c '_verify_signature "{}"'
|
xargs --null -P "$(nproc)" -I {} "$SHELL" -c '_verify_signature "{}"'
|
||||||
if [ "$(cat %{certs_verify_tmp})" -lt 1 ]; then
|
if [ -f %{certs_verify_tmp} ]; then
|
||||||
echo "ERROR: seems that signatures of none modules were verified!"
|
echo "ERROR: seems that signatures of none modules were verified!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cat %{certs_verify_tmp}
|
|
||||||
rm -f %{certs_verify_tmp}
|
rm -f %{certs_verify_tmp}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue