lorax-templates-rhel/scripts/generate-patch-for-v2.sh
eabdullin 0d9aa63a3b Update patch generator
Remove "Correct grammar in Grub" patch -- use sed instead
2026-01-30 12:46:15 +03:00

25 lines
1.1 KiB
Bash

set -e
TEMPLATE_DIR=70-almalinux
mkdir -p a b
cp -r 80-rhel a/${TEMPLATE_DIR}
cp -r 80-rhel b/${TEMPLATE_DIR}
# Добавляем x86_v2 конфиги и шаблоны
mkdir -p b/${TEMPLATE_DIR}/live/config_files/x86_v2
cp b/${TEMPLATE_DIR}/live/config_files/x86/* b/${TEMPLATE_DIR}/live/config_files/x86_v2/
cp b/${TEMPLATE_DIR}/x86.tmpl b/${TEMPLATE_DIR}/x86_v2.tmpl
cp b/${TEMPLATE_DIR}/live/x86.tmpl b/${TEMPLATE_DIR}/live/x86_v2.tmpl
sed -i 's/%if basearch == "x86_64":/%if basearch in ("x86_64", "x86_64_v2"):/g' b/${TEMPLATE_DIR}/live/live-install.tmpl b/${TEMPLATE_DIR}/runtime-install.tmpl
sed -i 's/%if basearch in ("x86_64", "aarch64"):/%if basearch in ("x86_64", "x86_64_v2", "aarch64"):/g' b/${TEMPLATE_DIR}/runtime-install.tmpl
find b/${TEMPLATE_DIR}/live/config_files/x86_v2/ -type f -exec sed -i 's/%if basearch == \(['"'"'"]\)x86_64\1:/%if basearch == \1x86_64_v2\1:/g' {} \;
find b/${TEMPLATE_DIR}/ -type f -name '*x86_v2*' -exec sed -i 's/%if basearch == \(['"'"'"]\)x86_64\1:/%if basearch == \1x86_64_v2\1:/g' {} \;
diff -aruN a/${TEMPLATE_DIR} b/${TEMPLATE_DIR} > Add-x86_64_v2-support.patch || [ $? -eq 1 ]
rm -rf a b