Compare commits

..

No commits in common. "fe678523a45aad2778f78429dc0ead80becc6246" and "2c036283324fdb21911ce79d82f4a177e647a932" have entirely different histories.

7 changed files with 36 additions and 61 deletions

15
.github/FUNDING.yml vendored Executable file
View File

@ -0,0 +1,15 @@
# These are supported funding model platforms
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
#ko_fi: # Replace with a single Ko-fi username
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#otechie: # Replace with a single Otechie username
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
#github: [Valeria-Fadeeva]
custom: ["https://www.tinkoff.ru/rm/fadeeva.valeriya96/9bLRi79066", "https://yoomoney.ru/to/4100115921160758", "https://qiwi.com/n/VALERIAFADEEVA", "valeria.fadeeva.me"]

View File

@ -16,4 +16,6 @@ linux-xanmod-anbox-fallback.efi
[YooMoney](https://yoomoney.ru/to/4100115921160758)
[Qiwi](https://qiwi.com/n/VALERIAFADEEVA)
Etherium 0x981FBf878fe451BDB83BEaF68078394d4B13213f

View File

@ -1,6 +1,3 @@
#!/bin/bash
git add . && git commit -m "Update"
git push
echo "Ready"
git add . && git commit -m "Update" && git push

View File

@ -39,8 +39,6 @@ else
fi
BOOT_PATH="/boot"
ukify_conf="/etc/kernel/uki.conf"
keys_count=0
@ -73,30 +71,30 @@ EOF
echo "Check Secure Boot keys"
declare -a keys=("/etc/kernel/secure-boot.key.pem" "/etc/kernel/secure-boot.cert.pem" "/etc/kernel/pcr-initrd.key.pem" "/etc/kernel/pcr-initrd.pub.pem" "/etc/kernel/pcr-system.key.pem" "/etc/kernel/pcr-system.pub.pem")
for i in "${keys[@]}"
for i in ${keys[@]}
do
if [ -f "${i}" ]
then
echo "${i} exist"
keys_count=$(($keys_count + 1))
keys_count=$(expr $keys_count + 1)
fi
done
if [ $keys_count -lt 6 ]
if [[ $keys_count < 6 ]]
then
for i in "${keys[@]}"
for i in ${keys[@]}
do
if [ -f "${i}" ]
then
echo "${i} remove"
rm "${i}"
keys_count=$(($keys_count - 1))
keys_count=$(expr $keys_count - 1)
fi
done
fi
echo "Keys = $keys_count"
if [ -f "${ukify_conf}" ] && [ $keys_count == 0 ]
if [ -f "${ukify_conf}" ] && [[ $keys_count == 0 ]]
then
echo "Generate keys"
/usr/lib/systemd/ukify genkey --config "${ukify_conf}"
@ -142,18 +140,16 @@ while getopts ":hag:xyz" arg; do
efi_image="$BOOT_PATH/$kernel_name.efi"
efi_image_fallback="$BOOT_PATH/$kernel_name-fallback.efi"
efi_image_fallback_terminal="$BOOT_PATH/$kernel_name-fallback-terminal.efi"
declare -a images=()
images+=("$efi_image")
images+=("$efi_image_fallback")
images+=("$efi_image_fallback_terminal")
images+=($efi_image)
images+=($efi_image_fallback)
for image in "${images[@]}";
do
if [ -f "$image" ]; then
if [ -f ]; then
echo "==> Removing $image..."
rm -f "$image"
rm -f $image
fi
done
fi
@ -185,7 +181,7 @@ if (( update_all )); then
for kernel_path in /usr/lib/modules/*; do
[ -f "$kernel_path/pkgbase" ] || continue
kernel_version=$(basename "$kernel_path")
kernel_version=$(basename $kernel_path)
kernel_dir="/usr/lib/modules/$kernel_version"
pkgbase="$kernel_dir/pkgbase"
kernel_name=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "$pkgbase")
@ -208,23 +204,17 @@ function gen_image() {
kernel_dir="/usr/lib/modules/$kernel_version"
if [ -f "/etc/kernel/cmdline" ]; then
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline" | tr '[:space:]' ' ' | tr -s ' ')
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline")
elif [ -f "/boot/refind_linux.conf" ]; then
cmdline=$(head -n 1 < "/boot/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g')
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')
elif [ -f "/efi/refind_linux.conf" ]; then
cmdline=$(head -n 1 < "/efi/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g')
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')
elif [ -f "/boot/efi/refind_linux.conf" ]; then
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')
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')
else
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline")
fi
cmdline_terminal="$cmdline systemd.unit=multi-user.target"
vmlinuz="$kernel_dir/vmlinuz"
initrd_image="$(mktemp)"
@ -232,7 +222,6 @@ function gen_image() {
efi_image="$BOOT_PATH/$kernel_name.efi"
efi_image_fallback="$BOOT_PATH/$kernel_name-fallback.efi"
efi_image_fallback_terminal="$BOOT_PATH/$kernel_name-fallback-terminal.efi"
echo "==> Building initrd image $kernel_name $initrd_image"
# dracut --force --hostonly --no-hostonly-cmdline --kver "$kernel_version" "$initrd_image"
@ -290,34 +279,6 @@ function gen_image() {
/usr/lib/systemd/ukify build "${ukify_args[@]}"
fi
echo "==> Building initrd image $kernel_name $initrd_image_fallback TERMINAL"
# dracut --force --kver "$kernel_version" "$initrd_image_fallback"
dracut --force --no-hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline_terminal" --kver "$kernel_version" "$initrd_image_fallback"
declare -a ukify_args=("${ukify_global_args[@]}")
ukify_args+=(--linux "$vmlinuz")
if [ -f "/boot/amd-ucode.img" ];then
ukify_args+=(--initrd "/boot/amd-ucode.img")
fi
if [ -f "/boot/intel-ucode.img" ];then
ukify_args+=(--initrd "/boot/intel-ucode.img")
fi
ukify_args+=(--initrd "$initrd_image_fallback")
ukify_args+=(--cmdline "$cmdline_terminal")
ukify_args+=(--os-release "/etc/os-release")
ukify_args+=(--uname "$kernel_version")
ukify_args+=(--output "$efi_image_fallback_terminal")
ukify_args+=(--measure)
echo "==> Ukify image $kernel_name $efi_image_fallback_terminal TERMINAL"
if [ -f "${ukify_conf}" ]; then
# ukify_args+=(--sbat='sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
# uki.author.myimage,1,UKI for System,uki.author.myimage,1,https://www.freedesktop.org/software/systemd/man/systemd-stub.html')
/usr/lib/systemd/ukify --config "${ukify_conf}" build "${ukify_args[@]}"
else
/usr/lib/systemd/ukify build "${ukify_args[@]}"
fi
rm -f "$initrd_image"
rm -f "$initrd_image_fallback"
}

View File

@ -13,4 +13,4 @@ Target = usr/src/*/dkms.conf
[Action]
Description = Ensure ESP is mounted...
When = PreTransaction
Exec = /bin/sh -c "/usr/bin/dracut-ukify -x"
Exec = /usr/bin/dracut-ukify -x

View File

@ -7,5 +7,5 @@ Target = usr/src/*/dkms.conf
[Action]
Description = Removing linux images...
When = PreTransaction
Exec = /bin/sh -c "/usr/bin/dracut-ukify -y"
Exec = /usr/bin/dracut-ukify -y
NeedsTargets

View File

@ -13,5 +13,5 @@ Target = usr/src/*/dkms.conf
[Action]
Description = Updating linux images...
When = PostTransaction
Exec = /bin/sh -c "/usr/bin/dracut-ukify -z"
Exec = /usr/bin/dracut-ukify -z
NeedsTargets