Skip to content

Commit b651e1b

Browse files
committed
kernel_build: Add --no-reboot
Adding this flag means the script will not reboot the machine after installing the kernel.
1 parent ce4dc35 commit b651e1b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

kernel_build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -e
33

4+
NO_REBOOT=0
45
SKIP_MRPROPER=0
56
SKIP_KABI=0
67

@@ -9,6 +10,7 @@ cat <<EOF
910
Usage: $0 [OPTIONS]
1011
1112
Options:
13+
-n, --no-reboot Don't reboot after kernel install
1214
-m, --skip-mrproper Skip 'make mrproper'
1315
-k, --skip-kabi Skip kABI check
1416
-h, --help Show this help message
@@ -18,6 +20,7 @@ EOF
1820
# Parse arguments
1921
while [ "$#" -gt 0 ]; do
2022
case "$1" in
23+
-n|--no-reboot) NO_REBOOT=1 ;;
2124
-m|--skip-mrproper) SKIP_MRPROPER=1 ;;
2225
-k|--skip-kabi) SKIP_KABI=1 ;;
2326
-h|--help) print_help; exit 0 ;;
@@ -176,7 +179,9 @@ echo "[TIMER]{MODULES}: $(( $END_MODULES - $START_MODULES ))s"
176179
echo "[TIMER]{INSTALL}: $(( $END_INSTALL - $START_INSTALL ))s"
177180
echo "[TIMER]{TOTAL} ${DIFF}s"
178181

179-
echo "Rebooting in 10 seconds"
180-
sleep 10
181-
sudo reboot
182+
if [ "$NO_REBOOT" -ne 1 ]; then
183+
echo "Rebooting in 10 seconds"
184+
sleep 10
185+
sudo reboot
186+
fi
182187

0 commit comments

Comments
 (0)