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 include=/tmp/include-packages-for-resize
touch $include touch $include
if [ -e /dev/disk/by-label/installer ]; then if [ -e /dev/disk/by-label/installer ]; then
# 1g内存下安装器默认开启了zram 但安装f38还是不够内存所以还要开启swap # 1g内存下安装器默认开启了zram 但安装f38还是不够内存
mkdir /installer # 具体表现为不断重启安装界面所以还要开启swap
mount /dev/disk/by-label/installer /installer ram_size=$(lsmem -b 2>/dev/null | grep 'Total online memory:' | awk '{ print $NF/1024/1024 }')
mount /dev/disk/by-label/installer /installer -o remount,rw if [ -z $ram_size ] || [ $ram_size -le 1024 ]; then
swapfile=/installer/swapfile mount /dev/disk/by-label/installer /run/install/repo -o remount,rw
if command -v fallocate; then swapfile=/run/install/repo/swapfile
fallocate -l 1GiB $swapfile if command -v fallocate; then
else fallocate -l 1G $swapfile
dd if=/dev/zero of=$swapfile bs=1MiB count=1024 else
dd if=/dev/zero of=$swapfile bs=1M count=1024
fi
chmod 0600 $swapfile
mkswap $swapfile
swapon $swapfile
fi fi
chmod 0600 $swapfile
mkswap $swapfile
swapon $swapfile
# feroda 默认不包含 cronie # feroda 默认不包含 cronie
echo cronie >>$include echo cronie >>$include