Skip to content

Commit dae2d55

Browse files
committed
ci: Allow build script to run without install
Update the script to allow it to run the build without installing. Signed-off-by: Jack Thomson <[email protected]>
1 parent 3bca636 commit dae2d55

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

resources/hiding_ci/build_and_install_kernel.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ if ! grep -qi 'ubuntu' /etc/os-release; then
1515
fi
1616

1717
confirm() {
18-
if [[ "$*" == *"-y"* ]]; then
18+
if [[ "$*" == *"--no-install"* ]]; then
19+
echo "Not installing new kernel."
20+
exit 1
21+
fi
22+
23+
if [[ "$*" == *"--install"* ]]; then
1924
return 0
2025
fi
2126

2227
while true; do
23-
echo "This script will build and install a new kernel. Run this script at your own risk"
24-
read -p "Do you want to continue? (y/n) " yn
28+
read -p "Do you want to install the new kernel? (y/n) " yn
2529
case $yn in
2630
[Yy]*) return 0 ;;
2731
[Nn]*)
@@ -33,9 +37,6 @@ confirm() {
3337
done
3438
}
3539

36-
# Make sure a user really wants to run this script
37-
confirm "$@"
38-
3940
KERNEL_URL=$(cat kernel_url)
4041
KERNEL_COMMIT_HASH=$(cat kernel_commit_hash)
4142
KERNEL_VERSION=$(cat kernel_version)
@@ -85,6 +86,9 @@ echo "Building kernel modules"
8586
make modules -j $(nproc)
8687
echo "Kernel build complete!"
8788

89+
# Make sure a user really wants to install this kernel
90+
confirm "$@"
91+
8892
echo "Installing kernel modules..."
8993
make INSTALL_MOD_STRIP=1 modules_install
9094
echo "Installing kernel..."

0 commit comments

Comments
 (0)