OSDN Git Service

[add] : Added kernel list.
authorhayao <shun819.mail@gmail.com>
Sun, 1 Mar 2020 06:30:43 +0000 (15:30 +0900)
committerhayao <shun819.mail@gmail.com>
Sun, 1 Mar 2020 06:30:43 +0000 (15:30 +0900)
You no longer need to write the kernel list directly in build.sh.

build.sh
kernel_list [new file with mode: 0644]

index 7426161..43a7098 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -401,18 +401,12 @@ while getopts 'w:o:g:p:c:t:hbk:x' arg; do
         t) sfs_comp_opt=${OPTARG} ;;
         b) boot_splash=true ;;
         k) 
-            case ${OPTARG} in
-                "lts") kernel="lts"    ;;
-                "lqx") kernel="lqx"    ;;
-                "zen") kernel="zen"    ;;
-                 "ck") kernel="ck"     ;;
-                 "rt") kernel="rt"     ;;
-             "rt-lts") kernel="rt-lts" ;;
-                    *)
-                        echo "Invalid kernel ${OPTARG}" >&2
-                        _usage 1
-                        ;;
-            esac
+            if [[ -n $(cat ./kernel_list | grep -x "${OPTARG}") ]]; then
+                kernel="${OPTARG}"
+            else
+                echo "Invalid kernel ${OPTARG}" >&2
+                _usage 1
+            fi
             ;;
         x) debug=true;;
         h) _usage 0 ;;
@@ -440,7 +434,7 @@ echo "Live user password is ${password}."
 echo "The compression method of squashfs is ${sfs_comp}."
 sleep 2
 
-
+exit
 run_once make_pacman_conf
 run_once make_basefs
 run_once make_packages
diff --git a/kernel_list b/kernel_list
new file mode 100644 (file)
index 0000000..08a702c
--- /dev/null
@@ -0,0 +1,6 @@
+lts
+lqx
+zen
+ck
+rt
+rt-lts
\ No newline at end of file