Improve stability
This commit is contained in:
parent
fae1cd0c81
commit
67c6846feb
@ -296,13 +296,13 @@ trap 'signal_abort' INT TERM TSTP
|
||||
|
||||
ask() {
|
||||
echo -e "${c_magenta}\r"
|
||||
read -p " ${2}" ${1} 2>&1
|
||||
read -p " ${2}: " ${1} 2>&1
|
||||
echo -e "${c_default}"
|
||||
}
|
||||
|
||||
confirm() {
|
||||
while [[ "${!1}" != "y" && "${!1}" != "n" ]]; do
|
||||
ask ${1} "${2}"
|
||||
ask ${1} "${2} (y/n)"
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ prepare_swupd() {
|
||||
|
||||
if has_command dnf; then
|
||||
prompt -w "CLEAR LINUX: You have 'dnf' installed in your system. It may break your system especially when you remove a package\n"
|
||||
confirm remove "CLEAR LINUX: You wanna remove it? (y/n): "; echo
|
||||
confirm remove "CLEAR LINUX: You wanna remove it?"; echo
|
||||
fi
|
||||
|
||||
if ! sudo swupd update -y; then
|
||||
@ -94,12 +94,13 @@ install_swupd_packages() {
|
||||
prepare_xbps() {
|
||||
[[ "${xbps_prepared}" == "true" ]] && return 0
|
||||
|
||||
# System upgrading can't remove the old kernel files by it self. It eats the
|
||||
# boot partition and may cause kernel panic when there is no enough space
|
||||
sudo vkpurge rm all
|
||||
# 'xbps-install' requires 'xbps' to be always up-to-date
|
||||
sudo xbps-install -Syu xbps
|
||||
|
||||
# System upgrading can't remove the old kernel files by it self. It eats the
|
||||
# boot partition and may cause kernel panic when there is no enough space
|
||||
sudo vkpurge rm all; sudo xbps-install -Syu
|
||||
|
||||
xbps_prepared="true"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user