From e2df6b4e20e7653d50ae8d48b839ef2ce24afdc5 Mon Sep 17 00:00:00 2001 From: hayao Date: Tue, 16 Jun 2020 17:57:16 +0900 Subject: [PATCH] [update] : Added noloopmod --- build.sh | 33 +++++++++++++++++++++------------ default.conf | 3 +++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 280f4018..673060ff 100755 --- a/build.sh +++ b/build.sh @@ -249,9 +249,10 @@ _usage () { echo echo " --gitversion Add Git commit hash to image file version" echo " --msgdebug Enables output debugging." - echo " --nocolor Does not output colored output." - echo " --noconfirm Does not check the settings before building." - echo " --nodepend Do not check package dependencies before building." + echo " --nocolor No output colored output." + echo " --noconfirm No check the settings before building." + echo " --noloopmod No check and load kernel module automatically." + echo " --nodepend No check package dependencies before building." echo " --shmkalteriso Use the shell script version of mkalteriso." echo echo "A list of kernels available for each architecture." @@ -511,7 +512,8 @@ prepare_build() { msgdebug \ defaultusername \ customized_username \ - gitversion + gitversion \ + noloopmod else # Load rebuild file load_config "${work_dir}/" @@ -606,13 +608,15 @@ prepare_build() { fi # Load loop kernel module - if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then - _msg_error "The currently running kernel module could not be found." - _msg_error "Probably the system kernel has been updated." - _msg_error "Reboot your system to run the latest kernel." "1" - fi - if [[ -z $(lsmod | awk '{print $1}' | grep -x "loop") ]]; then - sudo modprobe loop + if [[ "${noloopmod}" = false ]]; then + if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then + _msg_error "The currently running kernel module could not be found." + _msg_error "Probably the system kernel has been updated." + _msg_error "Reboot your system to run the latest kernel." "1" + fi + if [[ -z $(lsmod | awk '{print $1}' | grep -x "loop") ]]; then + sudo modprobe loop + fi fi } @@ -1189,7 +1193,7 @@ make_iso() { # Parse options options="${@}" _opt_short="a:bc:dg:hjk:lo:p:t:u:w:x" -_opt_long="arch:,boot-splash,comp-type:,debug,gpgkey:,help,japanese,kernel:,cleaning,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug" +_opt_long="arch:,boot-splash,comp-type:,debug,gpgkey:,help,japanese,kernel:,cleaning,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod" OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}") if [[ ${?} != 0 ]]; then exit 1 @@ -1300,6 +1304,10 @@ while :; do msgdebug=true; shift 1 ;; + --noloopmod) + noloopmod=true + shift 1 + ;; --) shift break @@ -1453,6 +1461,7 @@ check_bool nocolor check_bool shmkalteriso check_bool msgdebug check_bool customized_username +check_bool noloopmod if [[ "${debug}" = true ]]; then echo diff --git a/default.conf b/default.conf index 4a0f7eb9..627e5b87 100644 --- a/default.conf +++ b/default.conf @@ -138,6 +138,9 @@ nocolor=false # Change the default behavior of "--nodepend". nodepend=false +# Do not check the current kernel or load kernel modules. +# # Change the default behavior of "--noloopmod". +noloopmod=false #-- Debug options --# -- 2.11.0