add graphical environments only on systems with more than 4199MB RAM

This commit is contained in:
Tobias Powalowski 2022-10-23 10:06:25 +02:00
parent d2cb67fa33
commit 04a91cddf1
3 changed files with 4 additions and 3 deletions

View file

@ -165,7 +165,8 @@ _install_archboot() {
[[ "${_CLEANUP_CACHE}" == "1" ]] && _GRAPHICAL_PACKAGES=""
#shellcheck disable=SC2086
if grep -qw archboot /etc/hostname; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]]; then
# 4200MB RAM are needed for graphic packages
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4111000 ]]; then
_PACKAGES="${_ARCHBOOT} ${_GRAPHICAL_PACKAGES}"
else
_PACKAGES="${_ARCHBOOT}"

View file

@ -49,7 +49,7 @@ _run_update_installer() {
sleep 10
echo -e "\033[1mStarting\033[0m assembling of archboot environment with package cache ..."
echo ""
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4111000 ]]; then
_run_latest_install
else
# local image

View file

@ -39,7 +39,7 @@ usage () {
if [[ -e /usr/bin/setup ]]; then
# local image
if [[ -e "/var/cache/pacman/pkg/archboot.db" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]] ; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4111000 ]] ; then
# you can only install one environment with less RAM
if ! [[ -e "/.graphic_installed" && "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 4413000 ]]; then
_graphic_options