From bcf90a68ff09f13fcecad61874f0b90121bc169a Mon Sep 17 00:00:00 2001 From: bin456789 Date: Tue, 3 Sep 2024 19:01:32 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=B7=BB=E5=8A=A0=20--installer=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 23 ++++++++++++++++++++--- trans.sh | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index 84548e5..4b06a0d 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -131,6 +131,10 @@ is_use_cloud_image() { [ -n "$cloud_image" ] && [ "$cloud_image" = 1 ] } +is_force_use_installer() { + [ -n "$installer" ] && [ "$installer" = 1 ] +} + is_use_dd() { [ "$distro" = dd ] } @@ -2924,7 +2928,7 @@ else fi # 整理参数 -if ! opts=$(getopt -n $0 -o "" --long ci,debug,minimal,hold:,sleep:,iso:,image-name:,img:,lang:,commit:,force: -- "$@"); then +if ! opts=$(getopt -n $0 -o "" --long ci,installer,debug,minimal,hold:,sleep:,iso:,image-name:,img:,lang:,commit:,force: -- "$@"); then usage_and_exit fi @@ -2942,6 +2946,12 @@ while true; do ;; --ci) cloud_image=1 + unset installer + shift + ;; + --installer) + installer=1 + unset cloud_image shift ;; --minimal) @@ -3016,12 +3026,19 @@ case "$distro" in dd | windows | netboot.xyz | kali | alpine | arch | gentoo | nixos) if is_use_cloud_image; then echo "ignored --ci" - cloud_image=0 + unset cloud_image fi ;; -redhat | centos | alma | rocky | oracle | ubuntu | fedora | opensuse | anolis | opencloudos | openeuler) +oracle | opensuse | anolis | opencloudos | openeuler) cloud_image=1 ;; +redhat | centos | alma | rocky | fedora | ubuntu) + if is_force_use_installer; then + unset cloud_image + else + cloud_image=1 + fi + ;; esac # 检查内存 diff --git a/trans.sh b/trans.sh index dcddc38..1efcbe2 100644 --- a/trans.sh +++ b/trans.sh @@ -1866,8 +1866,8 @@ create_part() { parted /dev/$xda -s -- \ mklabel gpt \ mkpart '" "' fat32 1MiB 1025MiB \ - mkpart '" "' ext4 1025MiB -2GiB \ - mkpart '" "' ext4 -2GiB 100% \ + mkpart '" "' ext4 1025MiB -3GiB \ + mkpart '" "' ext4 -3GiB 100% \ set 1 boot on update_part