mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
add memory switch for --latest and --latest-install on latest and local image
This commit is contained in:
parent
271b150fe2
commit
96d07b4340
2 changed files with 45 additions and 27 deletions
|
@ -141,9 +141,19 @@ _install_archboot() {
|
||||||
echo "Adding "${_GPG_KEY_ID}" to trusted keys"
|
echo "Adding "${_GPG_KEY_ID}" to trusted keys"
|
||||||
pacman-key --add "${_GPG_KEY}" >/dev/null 2>&1
|
pacman-key --add "${_GPG_KEY}" >/dev/null 2>&1
|
||||||
pacman-key --lsign-key "${_GPG_KEY_ID}" >/dev/null 2>&1
|
pacman-key --lsign-key "${_GPG_KEY_ID}" >/dev/null 2>&1
|
||||||
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
|
||||||
#shellcheck disable=SC2086
|
#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
|
||||||
|
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
||||||
pacman --root "${1}" -Syw --dbpath "${1}"/blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --cachedir "${_CACHEDIR}" --noconfirm >/dev/null 2>&1
|
pacman --root "${1}" -Syw --dbpath "${1}"/blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --cachedir "${_CACHEDIR}" --noconfirm >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
echo "Downloading ${_ARCHBOOT} to ${1} ..."
|
||||||
|
pacman --root "${1}" -Syw --dbpath "${1}"/blankdb ${_ARCHBOOT} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --cachedir "${_CACHEDIR}" --noconfirm >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
||||||
|
pacman --root "${1}" -Syw --dbpath "${1}"/blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --cachedir "${_CACHEDIR}" --noconfirm >/dev/null 2>&1
|
||||||
|
fi
|
||||||
echo "Installing ${_ARCHBOOT} to ${1} ..."
|
echo "Installing ${_ARCHBOOT} to ${1} ..."
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
pacman --root "${1}" -Sy ${_ARCHBOOT} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --noconfirm --cachedir "${_CACHEDIR}" >/dev/null 2>&1
|
pacman --root "${1}" -Sy ${_ARCHBOOT} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --noconfirm --cachedir "${_CACHEDIR}" >/dev/null 2>&1
|
||||||
|
@ -163,6 +173,7 @@ _aarch64_install_base_packages() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_aarch64_install_archboot() {
|
_aarch64_install_archboot() {
|
||||||
|
[[ -d "${1}"/blankdb ]] || mkdir "${1}"/blankdb
|
||||||
if [[ -e "${1}/$(basename "${_PACMAN_CONF}")" ]]; then
|
if [[ -e "${1}/$(basename "${_PACMAN_CONF}")" ]]; then
|
||||||
_PACMAN_CONF=$(basename "${_PACMAN_CONF}")
|
_PACMAN_CONF=$(basename "${_PACMAN_CONF}")
|
||||||
fi
|
fi
|
||||||
|
@ -172,9 +183,18 @@ _aarch64_install_archboot() {
|
||||||
systemd-nspawn -q -D "${1}" pacman-key --add "${_GPG_KEY}" >/dev/null 2>&1
|
systemd-nspawn -q -D "${1}" pacman-key --add "${_GPG_KEY}" >/dev/null 2>&1
|
||||||
systemd-nspawn -q -D "${1}" pacman-key --lsign-key "${_GPG_KEY_ID}" >/dev/null 2>&1
|
systemd-nspawn -q -D "${1}" pacman-key --lsign-key "${_GPG_KEY_ID}" >/dev/null 2>&1
|
||||||
rm "${1}"/"${_GPG_KEY}"
|
rm "${1}"/"${_GPG_KEY}"
|
||||||
|
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
|
||||||
|
echo "Downloading ${_ARCHBOOT} to ${1} ..."
|
||||||
|
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Syw --dbpath /blankdb ${_ARCHBOOT} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
||||||
|
else
|
||||||
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
||||||
[[ -d "${1}"/blankdb ]] || mkdir "${1}"/blankdb
|
|
||||||
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Syw --dbpath /blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Syw --dbpath /blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Downloading ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} to ${1} ..."
|
||||||
|
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Syw --dbpath /blankdb ${_ARCHBOOT} ${_GRAPHICAL_PACKAGES} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
echo "Installing ${_ARCHBOOT} to ${1} ..."
|
echo "Installing ${_ARCHBOOT} to ${1} ..."
|
||||||
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Sy ${_ARCHBOOT} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
systemd-nspawn -q -D "${1}" /bin/bash -c "pacman -Sy ${_ARCHBOOT} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,19 @@ _run_update_installer() {
|
||||||
sleep 10
|
sleep 10
|
||||||
echo -e "\033[1mStarting\033[0m assembling of archboot environment with package cache ..."
|
echo -e "\033[1mStarting\033[0m assembling of archboot environment with package cache ..."
|
||||||
echo ""
|
echo ""
|
||||||
|
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]]; then
|
||||||
echo -e "\033[1mRunning now: \033[92mupdate-installer.sh -latest-install\033[0m"
|
echo -e "\033[1mRunning now: \033[92mupdate-installer.sh -latest-install\033[0m"
|
||||||
update-installer.sh -latest-install | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null
|
update-installer.sh -latest-install | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null
|
||||||
|
else
|
||||||
|
echo -e "\033[1mRunning now: \033[92mupdate-installer.sh -latest\033[0m"
|
||||||
|
update-installer.sh -latest | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null
|
||||||
|
fi
|
||||||
elif [[ "${TTY}" == "ttyS0" || "${TTY}" == "ttyAMA0" || "${TTY}" == "ttyUSB0" || "${TTY}" == "pts/0" ]]; then
|
elif [[ "${TTY}" == "ttyS0" || "${TTY}" == "ttyAMA0" || "${TTY}" == "ttyUSB0" || "${TTY}" == "pts/0" ]]; then
|
||||||
|
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]]; then
|
||||||
echo -e "Running \033[1m\033[92mupdate-installer.sh -latest-install\033[0m on \033[1mtty1\033[0m, please wait ...\033[0m"
|
echo -e "Running \033[1m\033[92mupdate-installer.sh -latest-install\033[0m on \033[1mtty1\033[0m, please wait ...\033[0m"
|
||||||
|
else
|
||||||
|
echo -e "\033[1mRunning now: \033[92mupdate-installer.sh -latest\033[0m"
|
||||||
|
fi
|
||||||
echo -e "\033[1mProgress is shown here ...\033[0m"
|
echo -e "\033[1mProgress is shown here ...\033[0m"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -50,24 +59,13 @@ if [[ -e /usr/bin/setup ]]; then
|
||||||
if ! [[ -e /tmp/.setup ]]; then
|
if ! [[ -e /tmp/.setup ]]; then
|
||||||
setup
|
setup
|
||||||
fi
|
fi
|
||||||
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 3860000 ]]; then
|
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 1970000 ]]; then
|
||||||
_welcome
|
_welcome
|
||||||
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 1970000 ]]; then
|
|
||||||
echo -e "\033[1m\033[91mMemory check failed:\033[0m"
|
echo -e "\033[1m\033[91mMemory check failed:\033[0m"
|
||||||
echo -e "\033[91m- Not engough memory detected! \033[0m"
|
echo -e "\033[91m- Not engough memory detected! \033[0m"
|
||||||
echo -e "\033[93m- Please add \033[1mmore\033[0m\033[93m than \033[1m2.0GB\033[0m\033[93m RAM.\033[0m"
|
echo -e "\033[93m- Please add \033[1mmore\033[0m\033[93m than \033[1m2.0GB\033[0m\033[93m RAM.\033[0m"
|
||||||
echo -e "\033[91mAborting ...\033[0m"
|
echo -e "\033[91mAborting ...\033[0m"
|
||||||
_enter_shell
|
_enter_shell
|
||||||
elif [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
|
|
||||||
echo -e "\033[1m\033[91mMemory check failed:\033[0m"
|
|
||||||
echo -e "\033[91m- Not engough memory detected! \033[0m"
|
|
||||||
echo -e "\033[93m- Please add \033[1mmore\033[0m\033[93m than \033[1m3.9GB\033[0m\033[93m RAM\033[0m"
|
|
||||||
echo -e "\033[93m or switch to \033[1mOnline\033[0m\033[93m mode.\033[0m"
|
|
||||||
echo -e "\033[91mAborting ...\033[0m"
|
|
||||||
_enter_shell
|
|
||||||
else
|
|
||||||
_run_update_installer
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
_welcome
|
_welcome
|
||||||
_run_update_installer
|
_run_update_installer
|
||||||
|
|
Loading…
Reference in a new issue