@@ -76,6 +76,8 @@ custom_name="-ophub"
76
76
package_list=" all"
77
77
# Set the compression format, options: [ gzip / lzma / xz / zstd ]
78
78
compress_format=" xz"
79
+ # Set whether to automatically delete the source code after the kernel is compiled
80
+ delete_source=" false"
79
81
80
82
# Compile toolchain download mirror, run on Armbian
81
83
dev_repo=" https://github.com/ophub/kernel/releases/download/dev"
@@ -104,7 +106,7 @@ init_var() {
104
106
echo -e " ${STEPS} Start Initializing Variables..."
105
107
106
108
# If it is followed by [ : ], it means that the option requires a parameter value
107
- get_all_ver=" $( getopt " k:a:n:m:p:r:t:c:" " ${@ } " ) "
109
+ get_all_ver=" $( getopt " k:a:n:m:p:r:t:c:d: " " ${@ } " ) "
108
110
109
111
while [[ -n " ${1} " ]]; do
110
112
case " ${1} " in
@@ -176,6 +178,14 @@ init_var() {
176
178
error_msg " Invalid -c parameter [ ${2} ]!"
177
179
fi
178
180
;;
181
+ -d | --DeleteSource)
182
+ if [[ -n " ${2} " ]]; then
183
+ delete_source=" ${2} "
184
+ shift
185
+ else
186
+ error_msg " Invalid -d parameter [ ${2} ]!"
187
+ fi
188
+ ;;
179
189
* )
180
190
error_msg " Invalid option [ ${1} ]!"
181
191
;;
@@ -502,13 +512,13 @@ compile_kernel() {
502
512
503
513
# Make kernel
504
514
echo -e " ${STEPS} Start compilation kernel [ ${local_kernel_path} ]..."
505
- make ${MAKE_SET_STRING} Image modules dtbs -j${PROCESS}
515
+ make -s ${MAKE_SET_STRING} Image modules dtbs -j${PROCESS}
506
516
# make ${MAKE_SET_STRING} bindeb-pkg KDEB_COMPRESS=xz KBUILD_DEBARCH=arm64 -j${PROCESS}
507
517
[[ " ${?} " -eq " 0" ]] && echo -e " ${SUCCESS} The kernel is compiled successfully."
508
518
509
519
# Install modules
510
520
echo -e " ${STEPS} Install modules ..."
511
- make ${MAKE_SET_STRING} INSTALL_MOD_PATH=${output_path} /modules modules_install
521
+ make -s ${MAKE_SET_STRING} INSTALL_MOD_PATH=${output_path} /modules modules_install
512
522
[[ " ${?} " -eq " 0" ]] && echo -e " ${SUCCESS} The modules is installed successfully."
513
523
514
524
# Strip debug information
@@ -687,6 +697,7 @@ clean_tmp() {
687
697
688
698
sync && sleep 3
689
699
rm -rf ${output_path} /{boot/,dtb/,modules/,header/,${kernel_version} /}
700
+ [[ " ${delete_source} " == " true" ]] && rm -rf ${kernel_path} /* 2> /dev/null
690
701
rm -rf ${tmp_backup_path}
691
702
692
703
echo -e " ${SUCCESS} All processes have been completed."
0 commit comments