Skip to content

Commit 892f451

Browse files
authored
fix(arch/nvidia): add exceptions for kernel headers installation failure (#1057)
* Adds continue anyway when linux headers fails to install while downloading deps for nvidia drivers on arch. Fixes my Issue #1056 * fix formatting
1 parent aa0f6a7 commit 892f451

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/tabs/system-setup/arch/nvidia-drivers.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ installDeps() {
1313
for kernel in $installed_kernels; do
1414
header="${kernel}-headers"
1515
printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}"
16-
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header"
16+
17+
if ! "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header" ; then
18+
printf "%b\n" "${RED}Failed to install headers.${RC}"
19+
printf "%b" "${YELLOW}Do you want to continue anyway? [y/N]: ${RC}"
20+
read -r continue_anyway
21+
if ! [ "$continue_anyway" = "y" ] && ! [ "$continue_anyway" = "Y" ]; then
22+
printf "%b\n" "${RED}Aborting installation.${RC}"
23+
exit 1
24+
fi
25+
printf "%b\n" "${YELLOW}Continuing...${RC}"
26+
fi
1727
done
1828
}
1929

0 commit comments

Comments
 (0)