@@ -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} "
@@ -590,7 +601,7 @@ prepare_build() {
590601
591602 # Check kernel for each channel
592603 # 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- if [[ ! " $( bash " ${script_path} /tools/kernel.sh" -c " ${channel_name} " -a " ${arch} " -s check " ${channel_name } " ) " = " correct" ]]; then
604+ if [[ ! " $( bash " ${script_path} /tools/kernel.sh" -c " ${channel_name} " -a " ${arch} " -s check " ${kernel } " ) " = " correct" ]]; then
594605 msg_error " This kernel is currently not supported on this channel or architecture" " 1"
595606 fi
596607
@@ -1243,12 +1254,6 @@ make_iso() {
12431254 msg_info " The password for the live user and root is ${password} ."
12441255}
12451256
1246- # Parse files
1247- parse_files () {
1248- eval $( bash " ${script_path} /tools/locale.sh" -s -a " ${arch} " get " ${locale_name} " )
1249- eval $( bash " ${script_path} /tools/kernel.sh" -s -c " ${channel_name} " -a " ${arch} " get " ${kernel} " )
1250- }
1251-
12521257
12531258# Parse options
12541259ARGUMENT=" ${@ } "
@@ -1298,6 +1303,7 @@ while :; do
12981303 msg_error " This option is obsolete in AlterISO 3. To use Japanese, use \" -l ja\" ." " 1"
12991304 ;;
13001305 -k | --kernel)
1306+ customized_kernel=true
13011307 kernel=" ${2} "
13021308 shift 2
13031309 ;;
@@ -1477,8 +1483,6 @@ if [[ ! "${channel_name}" = "rebuild" ]]; then
14771483 fi
14781484fi
14791485
1480- parse_files
1481-
14821486set -eu
14831487
14841488prepare_env
0 commit comments