From e7d7a03d969cc973fdff31ee79658f68e744b95d Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 29 Jul 2023 11:51:47 +0800 Subject: [PATCH] =?UTF-8?q?redhat:=20=E4=BF=AE=E5=A4=8D=E4=B8=A4=E6=AD=A5?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E4=B8=8Bel8=E5=8D=A1=E5=9C=A8=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E7=95=8C=E9=9D=A2=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- redhat.cfg | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/redhat.cfg b/redhat.cfg index 2ed8592..a53b0ea 100644 --- a/redhat.cfg +++ b/redhat.cfg @@ -49,19 +49,21 @@ done include=/tmp/include-packages-for-resize touch $include if [ -e /dev/disk/by-label/installer ]; then - # 1g内存下,安装器默认开启了zram ,但安装f38还是不够内存,所以还要开启swap - mkdir /installer - mount /dev/disk/by-label/installer /installer - mount /dev/disk/by-label/installer /installer -o remount,rw - swapfile=/installer/swapfile - if command -v fallocate; then - fallocate -l 1GiB $swapfile - else - dd if=/dev/zero of=$swapfile bs=1MiB count=1024 + # 1g内存下,安装器默认开启了zram ,但安装f38还是不够内存 + # 具体表现为不断重启安装界面,所以还要开启swap + ram_size=$(lsmem -b 2>/dev/null | grep 'Total online memory:' | awk '{ print $NF/1024/1024 }') + if [ -z $ram_size ] || [ $ram_size -le 1024 ]; then + mount /dev/disk/by-label/installer /run/install/repo -o remount,rw + swapfile=/run/install/repo/swapfile + if command -v fallocate; then + fallocate -l 1G $swapfile + else + dd if=/dev/zero of=$swapfile bs=1M count=1024 + fi + chmod 0600 $swapfile + mkswap $swapfile + swapon $swapfile fi - chmod 0600 $swapfile - mkswap $swapfile - swapon $swapfile # feroda 默认不包含 cronie echo cronie >>$include