core: 修复内存不足时,未回落到云镜像模式

This commit is contained in:
bin456789 2023-09-10 22:23:01 +08:00
parent 51b07aa73e
commit 9d42a6dd73
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -586,11 +586,16 @@ check_ram() {
debian) ram_installer=384 ;;
*) ram_installer=1024 ;;
esac
ram_cloud_image=512
case "$distro" in
opensuse | arch) cloud_image=1 ;;
esac
# ram 足够就用普通方法安装否则如果内存大于512就用 cloud image
# TODO: 测试 256 384 内存
if [ $ram_size -lt $ram_cloud_image ]; then
if [ ! "$cloud_image" = 1 ] && [ $ram_size -lt $ram_installer ]; then
if [ $ram_size -ge $ram_cloud_image ]; then
info "RAM < $ram_installer MB. Switch to cloud image mode"
cloud_image=1