@@ -20,6 +20,7 @@ defaultconfig="${script_path}/default.conf"
2020rebuild=false
2121customized_username=false
2222customized_password=false
23+ customized_kernel=false
2324DEFAULT_ARGUMENT=" "
2425alteriso_version=" 3.0"
2526
@@ -476,6 +477,7 @@ prepare_rebuild() {
476477 _save_var defaultusername
477478 _save_var customized_username
478479 _save_var customized_password
480+ _save_var customized_kernel
479481
480482 _write_rebuild_file " \n# mkalteriso Info"
481483 _save_var mkalteriso
@@ -510,6 +512,15 @@ prepare_build() {
510512 load_config " ${script_path} /channels/share/config.any" " ${script_path} /channels/share/config.${arch} "
511513 load_config " ${channel_dir} /config.any" " ${channel_dir} /config.${arch} "
512514
515+ # Set kernel
516+ if [[ " ${customized_kernel} " = false ]]; then
517+ kernel=" ${defaultkernel} "
518+ fi
519+
520+ # Parse files
521+ eval $( bash " ${script_path} /tools/locale.sh" -s -a " ${arch} " get " ${locale_name} " )
522+ eval $( bash " ${script_path} /tools/kernel.sh" -s -c " ${channel_name} " -a " ${arch} " get " ${kernel} " )
523+
513524 # Set username
514525 if [[ " ${customized_username} " = false ]]; then
515526 username=" ${defaultusername} "
@@ -589,8 +600,9 @@ prepare_build() {
589600
590601
591602 # Check kernel for each channel
592- if [[ -f " ${channel_dir} /kernel_list-${arch} " ]] && [[ -z $( cat " ${channel_dir} /kernel_list-${arch} " | grep -h -v ^' #' | grep -x " ${kernel} " 2> /dev/null) ]]; then
593- msg_error " This kernel is currently not supported on this channel." " 1"
603+ # if [[ -f "${channel_dir}/kernel_list-${arch}" ]] && [[ -z $(cat "${channel_dir}/kernel_list-${arch}" | grep -h -v ^'#' | grep -x "${kernel}" 2> /dev/null) ]]; then
604+ if [[ ! " $( bash " ${script_path} /tools/kernel.sh" -c " ${channel_name} " -a " ${arch} " -s check " ${kernel} " ) " = " correct" ]]; then
605+ msg_error " This kernel is currently not supported on this channel or architecture" " 1"
594606 fi
595607
596608 # Unmount
@@ -1242,12 +1254,6 @@ make_iso() {
12421254 msg_info " The password for the live user and root is ${password} ."
12431255}
12441256
1245- # Parse files
1246- parse_files () {
1247- eval $( bash " ${script_path} /tools/locale.sh" -s -a " ${arch} " get " ${locale_name} " )
1248- eval $( bash " ${script_path} /tools/kernel.sh" -s -a " ${arch} " get " ${kernel} " )
1249- }
1250-
12511257
12521258# Parse options
12531259ARGUMENT=" ${@ } "
@@ -1297,6 +1303,7 @@ while :; do
12971303 msg_error " This option is obsolete in AlterISO 3. To use Japanese, use \" -l ja\" ." " 1"
12981304 ;;
12991305 -k | --kernel)
1306+ customized_kernel=true
13001307 kernel=" ${2} "
13011308 shift 2
13021309 ;;
@@ -1476,8 +1483,6 @@ if [[ ! "${channel_name}" = "rebuild" ]]; then
14761483 fi
14771484fi
14781485
1479- parse_files
1480-
14811486set -eu
14821487
14831488prepare_env
0 commit comments