redhat: 修复两步安装下el8卡在安装界面的bug

This commit is contained in:
bin456789 2023-07-29 11:51:47 +08:00
parent 7ad7295844
commit e7d7a03d96
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -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