This commit is contained in:
Valeria Fadeeva 2023-10-18 14:00:40 +05:00
parent 3511d8a5aa
commit 99b25aea37
1 changed files with 8 additions and 8 deletions

View File

@ -76,11 +76,11 @@ EOF
if [ -f "${i}" ] if [ -f "${i}" ]
then then
echo "${i} exist" echo "${i} exist"
keys_count=$(expr $keys_count + 1) keys_count=$(($keys_count + 1))
fi fi
done done
if [[ $keys_count -lt 6 ]] if [ $keys_count -lt 6 ]
then then
for i in "${keys[@]}" for i in "${keys[@]}"
do do
@ -88,13 +88,13 @@ EOF
then then
echo "${i} remove" echo "${i} remove"
rm "${i}" rm "${i}"
keys_count=$(expr $keys_count - 1) keys_count=$(($keys_count - 1))
fi fi
done done
fi fi
echo "Keys = $keys_count" echo "Keys = $keys_count"
if [ -f "${ukify_conf}" ] && [[ $keys_count == 0 ]] if [ -f "${ukify_conf}" ] && [ $keys_count == 0 ]
then then
echo "Generate keys" echo "Generate keys"
/usr/lib/systemd/ukify genkey --config "${ukify_conf}" /usr/lib/systemd/ukify genkey --config "${ukify_conf}"
@ -181,7 +181,7 @@ if (( update_all )); then
for kernel_path in /usr/lib/modules/*; do for kernel_path in /usr/lib/modules/*; do
[ -f "$kernel_path/pkgbase" ] || continue [ -f "$kernel_path/pkgbase" ] || continue
kernel_version=$(basename $kernel_path) kernel_version=$(basename "$kernel_path")
kernel_dir="/usr/lib/modules/$kernel_version" kernel_dir="/usr/lib/modules/$kernel_version"
pkgbase="$kernel_dir/pkgbase" pkgbase="$kernel_dir/pkgbase"
kernel_name=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "$pkgbase") kernel_name=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "$pkgbase")
@ -207,13 +207,13 @@ function gen_image() {
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline") cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline")
elif [ -f "/boot/refind_linux.conf" ]; then elif [ -f "/boot/refind_linux.conf" ]; then
cmdline=$(cat "/boot/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') cmdline=$(head -n 1 < "/boot/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g')
elif [ -f "/efi/refind_linux.conf" ]; then elif [ -f "/efi/refind_linux.conf" ]; then
cmdline=$(cat "/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') cmdline=$(head -n 1 < "/efi/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g')
elif [ -f "/boot/efi/refind_linux.conf" ]; then elif [ -f "/boot/efi/refind_linux.conf" ]; then
cmdline=$(cat "/boot/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') cmdline=$(head -n 1 < "/boot/efi/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g')
else else
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline") cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline")