From 7cc881a82c29edd3dfaa4277a45ac99c60b39b02 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Mon, 12 Aug 2024 22:51:32 +0800 Subject: [PATCH] =?UTF-8?q?openeuler:=20=E4=BF=AE=E5=A4=8D=20installer=20?= =?UTF-8?q?=E5=88=86=E5=8C=BA=E8=BF=87=E5=B0=8F=E5=AF=BC=E8=87=B4=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=B8=8B=E8=BD=BD=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/trans.sh b/trans.sh index e4e3af2..d20578e 100644 --- a/trans.sh +++ b/trans.sh @@ -2232,19 +2232,22 @@ get_ci_installer_part_size() { # https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img 500m # https://gentoo.osuosl.org/experimental/amd64/openstack/gentoo-openstack-amd64-systemd-latest.qcow2 800m - if get_http_file_size_to size_bytes $img >&2 && [ -n "$size_bytes" ]; then + # openeuler 是 .qcow2.xz,要解压后才知道 qcow2 大小 + if [ "$distro" = openeuler ]; then + # openeuler 20.03 3g + if [ "$releasever" = 20.03 ]; then + echo 3GiB + else + echo 2GiB + fi + elif get_http_file_size_to size_bytes $img >&2 && [ -n "$size_bytes" ]; then # 额外 +100M 文件系统保留大小 和 qcow2 写入空间 size_bytes_mb=$((size_bytes / 1024 / 1024 + 100)) # 最少 1g ,因为可能要用作临时 swap echo "$((size_bytes_mb / 1024 + 1))GiB" else - # openeuler 20.03 3g - if [ "$distro" = openeuler ] && [ "$releasever" = 20.03 ]; then - echo 3GiB - else - # 如果没获取到文件大小 - echo 2GiB - fi + # 如果没获取到文件大小 + echo 2GiB fi }