@@ -41,37 +41,53 @@ umask 0022
4141# Show an INFO message
4242# $1: message string
4343msg_info () {
44- local _msg_opts=" -a allarch.sh"
44+ local _msg_opts=" -a build.sh"
45+ if [[ " ${1} " = " -n" ]]; then
46+ _msg_opts=" ${_msg_opts} -o -n"
47+ shift 1
48+ fi
4549 [[ " ${msgdebug} " = true ]] && _msg_opts=" ${_msg_opts} -x"
4650 [[ " ${nocolor} " = true ]] && _msg_opts=" ${_msg_opts} -n"
47- " ${script_path} /tools/msg.sh" ${_msg_opts} info " ${@ } "
51+ " ${script_path} /tools/msg.sh" ${_msg_opts} info " ${1 } "
4852}
4953
5054# Show an Warning message
5155# $1: message string
5256msg_warn () {
53- local _msg_opts=" -a allarch.sh"
57+ local _msg_opts=" -a build.sh"
58+ if [[ " ${1} " = " -n" ]]; then
59+ _msg_opts=" ${_msg_opts} -o -n"
60+ shift 1
61+ fi
5462 [[ " ${msgdebug} " = true ]] && _msg_opts=" ${_msg_opts} -x"
5563 [[ " ${nocolor} " = true ]] && _msg_opts=" ${_msg_opts} -n"
56- " ${script_path} /tools/msg.sh" ${_msg_opts} warn " ${@ } "
64+ " ${script_path} /tools/msg.sh" ${_msg_opts} warn " ${1 } "
5765}
5866
5967# Show an debug message
6068# $1: message string
6169msg_debug () {
6270 if [[ " ${debug} " = true ]]; then
63- local _msg_opts=" -a allarch.sh"
71+ local _msg_opts=" -a build.sh"
72+ if [[ " ${1} " = " -n" ]]; then
73+ _msg_opts=" ${_msg_opts} -o -n"
74+ shift 1
75+ fi
6476 [[ " ${msgdebug} " = true ]] && _msg_opts=" ${_msg_opts} -x"
6577 [[ " ${nocolor} " = true ]] && _msg_opts=" ${_msg_opts} -n"
66- " ${script_path} /tools/msg.sh" ${_msg_opts} debug " ${@ } "
78+ " ${script_path} /tools/msg.sh" ${_msg_opts} debug " ${1 } "
6779 fi
6880}
6981
7082# Show an ERROR message then exit with status
7183# $1: message string
7284# $2: exit code number (with 0 does not exit)
7385msg_error () {
74- local _msg_opts=" -a allarch.sh"
86+ local _msg_opts=" -a build.sh"
87+ if [[ " ${1} " = " -n" ]]; then
88+ _msg_opts=" ${_msg_opts} -o -n"
89+ shift 1
90+ fi
7591 [[ " ${msgdebug} " = true ]] && _msg_opts=" ${_msg_opts} -x"
7692 [[ " ${nocolor} " = true ]] && _msg_opts=" ${_msg_opts} -n"
7793 " ${script_path} /tools/msg.sh" ${_msg_opts} error " ${1} "
@@ -228,10 +244,10 @@ remove() {
228244 local _list=($( echo " $@ " ) ) _file
229245 for _file in " ${_list[@]} " ; do
230246 if [[ -f ${_file} ]]; then
231- msg_debug " Removeing ${_file} "
247+ msg_debug " Removing ${_file} "
232248 rm -f " ${_file} "
233249 elif [[ -d ${_file} ]]; then
234- msg_debug " Removeing ${_file} "
250+ msg_debug " Removing ${_file} "
235251 rm -rf " ${_file} "
236252 fi
237253 done
@@ -285,12 +301,12 @@ check_bool() {
285301prepare_env () {
286302 for arch in ${all_arch[@]} ; do
287303 # Check architecture for each channel
288- if [[ -z $( cat " ${channel_path } /architecture" | grep -h -v ^' #' | grep -x " ${arch} " ) ]]; then
304+ if [[ -z $( cat " ${channel_dir } /architecture" | grep -h -v ^' #' | grep -x " ${arch} " ) ]]; then
289305 msg_error " ${channel_name} channel does not support current architecture (${arch} )." " 1"
290306 fi
291307
292308 # Check kernel for each channel
293- if [[ -f " ${channel_path } /kernel_list-${arch} " ]] && [[ -z $( cat " ${channel_path } /kernel_list-${arch} " | grep -h -v ^' #' | grep -x " ${kernel} " 2> /dev/null) ]]; then
309+ if [[ -f " ${channel_dir } /kernel_list-${arch} " ]] && [[ -z $( cat " ${channel_dir } /kernel_list-${arch} " | grep -h -v ^' #' | grep -x " ${kernel} " 2> /dev/null) ]]; then
294310 msg_error " This kernel is currently not supported on this channel." " 1"
295311 fi
296312 done
@@ -408,7 +424,7 @@ configure_var() {
408424 fi
409425
410426 # Set architecture
411- all_arch=($( cat " ${channel_path } /architecture" | grep -h -v ^' #' ) )
427+ all_arch=($( cat " ${channel_dir } /architecture" | grep -h -v ^' #' ) )
412428
413429 # gitversion
414430 if [[ " ${gitversion} " = true ]]; then
@@ -470,17 +486,17 @@ show_settings() {
470486# Preparation for build
471487prepare_build () {
472488 # If there is pacman.conf for each channel, use that for building
473- if [[ -f " ${channel_path } /pacman-${arch} .conf" ]]; then
474- build_pacman_conf=" ${channel_path } /pacman-${arch} .conf"
489+ if [[ -f " ${channel_dir } /pacman-${arch} .conf" ]]; then
490+ build_pacman_conf=" ${channel_dir } /pacman-${arch} .conf"
475491 fi
476492
477493 # If there is config for share channel. load that.
478494 load_config " ${script_path} /channels/share/config.any"
479495 load_config " ${script_path} /channels/share/config.${arch} "
480496
481497 # If there is config for each channel. load that.
482- load_config " ${channel_path } /config.any"
483- load_config " ${channel_path } /config.${arch} "
498+ load_config " ${channel_dir } /config.any"
499+ load_config " ${channel_dir } /config.${arch} "
484500
485501 # check bool
486502 check_bool boot_splash
@@ -496,6 +512,7 @@ prepare_build() {
496512 check_bool noiso
497513 check_bool noaur
498514 check_bool customized_syslinux
515+ check_bool norescue_entry
499516
500517 # Unmount
501518 umount_chroot
@@ -537,19 +554,19 @@ make_packages() {
537554 " ${script_path} /channels/share/packages.${arch} /lang/${locale_name} .${arch} "
538555
539556 # channel packages
540- $( ls ${channel_path } /packages.${arch} /* .${arch} 2> /dev/null)
541- " ${channel_path } /packages.${arch} /lang/${locale_name} .${arch} "
557+ $( ls ${channel_dir } /packages.${arch} /* .${arch} 2> /dev/null)
558+ " ${channel_dir } /packages.${arch} /lang/${locale_name} .${arch} "
542559
543560 # kernel packages
544561 " ${script_path} /channels/share/packages.${arch} /kernel/${kernel} .${arch} "
545- " ${channel_path } /packages.${arch} /kernel/${kernel} .${arch} "
562+ " ${channel_dir } /packages.${arch} /kernel/${kernel} .${arch} "
546563 )
547564
548565 # Plymouth package list
549566 if [[ " ${boot_splash} " = true ]]; then
550567 _loadfilelist+=(
551568 $( ls " ${script_path} " /channels/share/packages.${arch} /plymouth/* .${arch} 2> /dev/null)
552- $( ls ${channel_path } /packages.${arch} /plymouth/* .${arch} 2> /dev/null)
569+ $( ls ${channel_dir } /packages.${arch} /plymouth/* .${arch} 2> /dev/null)
553570 )
554571 fi
555572
@@ -567,7 +584,7 @@ make_packages() {
567584 # Exclude packages from the share exclusion list
568585 _excludefile=(
569586 " ${script_path} /channels/share/packages.${arch} /exclude"
570- " ${channel_path } /packages.${arch} /exclude"
587+ " ${channel_dir } /packages.${arch} /exclude"
571588 )
572589
573590 for _file in ${_excludefile[@]} ; do
@@ -617,18 +634,18 @@ make_packages_file() {
617634 # -- Detect package list to load --#
618635 # Add the files for each channel to the list of files to read.
619636 # _loadfilelist=(
620- # $(ls ${channel_path }/packages.${arch}/*.${arch} 2> /dev/null)
621- # ${channel_path }/packages.${arch}/lang/${locale_name}.${arch}
637+ # $(ls ${channel_dir }/packages.${arch}/*.${arch} 2> /dev/null)
638+ # ${channel_dir }/packages.${arch}/lang/${locale_name}.${arch}
622639 # $(ls "${script_path}"/channels/share/packages.${arch}/*.${arch} 2> /dev/null)
623640 # "${script_path}"/channels/share/packages.${arch}/lang/${locale_name}.${arch}
624641 # )
625642
626- # ls "${channel_path }/package_files.${arch}/*.pkg.*" > /dev/null 2>&1
643+ # ls "${channel_dir }/package_files.${arch}/*.pkg.*" > /dev/null 2>&1
627644 # Install packages on airootfs
628645 # if [ $? -ne 0 ]; then
629646 # :
630647 # else
631- ${mkalteriso} ${mkalteriso_option} -w " ${work_dir} /${arch} " -C " ${work_dir} /pacman-${arch} .conf" -D " ${install_dir} " -p " ${channel_path } /package_files.${arch} /*.pkg.*" install_file
648+ ${mkalteriso} ${mkalteriso_option} -w " ${work_dir} /${arch} " -C " ${work_dir} /pacman-${arch} .conf" -D " ${install_dir} " -p " ${channel_dir } /package_files.${arch} /*.pkg.*" install_file
632649 # fi
633650 # ls "${script_path}/channels/share/package_files.${arch}/*.pkg.*" > /dev/null 2>&1
634651 # if [ $? -ne 0 ]; then
@@ -789,8 +806,8 @@ make_customize_airootfs() {
789806
790807 _copy_airootfs " ${script_path} /channels/share/airootfs.any"
791808 _copy_airootfs " ${script_path} /channels/share/airootfs.${arch} "
792- _copy_airootfs " ${channel_path } /airootfs.any"
793- _copy_airootfs " ${channel_path } /airootfs.${arch} "
809+ _copy_airootfs " ${channel_dir } /airootfs.any"
810+ _copy_airootfs " ${channel_dir } /airootfs.${arch} "
794811
795812 # Replace /etc/mkinitcpio.conf if Plymouth is enabled.
796813 if [[ " ${boot_splash} " = true ]]; then
@@ -928,12 +945,12 @@ make_syslinux() {
928945 # 一時ディレクトリに設定ファイルをコピー
929946 mkdir -p " ${work_dir} /${arch} /syslinux/"
930947 cp -a " ${script_path} /syslinux/" * " $work_dir /${arch} /syslinux/"
931- if [[ -d " ${channel_path } /syslinux" ]] && [[ " ${customized_syslinux} " = true ]]; then
932- cp -af " ${channel_path } /syslinux/" * " $work_dir /${arch} /syslinux/"
948+ if [[ -d " ${channel_dir } /syslinux" ]] && [[ " ${customized_syslinux} " = true ]]; then
949+ cp -af " ${channel_dir } /syslinux/" * " $work_dir /${arch} /syslinux/"
933950 fi
934951
935952 # copy all syslinux config to work dir
936- for _cfg in $work_dir /${arch} /syslinux/* .cfg; do
953+ for _cfg in ${ work_dir} /${arch} /syslinux/* .cfg; do
937954 sed " s|%ARCHISO_LABEL%|${iso_label} |g;
938955 s|%OS_NAME%|${os_name} |g;
939956 s|%KERNEL_FILENAME%|${kernel_filename} |g;
@@ -956,12 +973,19 @@ make_syslinux() {
956973 done
957974
958975 # Set syslinux wallpaper
959- if [[ -f " ${channel_path } /splash.png" ]]; then
960- cp " ${channel_path } /splash.png" " ${work_dir} /iso/${install_dir} /boot/syslinux"
976+ if [[ -f " ${channel_dir } /splash.png" ]]; then
977+ cp " ${channel_dir } /splash.png" " ${work_dir} /iso/${install_dir} /boot/syslinux"
961978 else
962979 cp " ${script_path} /syslinux/splash.png" " ${work_dir} /iso/${install_dir} /boot/syslinux"
963980 fi
964981
982+ # Rename rescue config
983+ if [[ " ${norescue_entry} " = false ]]; then
984+ mv " ${work_dir} /iso/${install_dir} /boot/syslinux/archiso_sys_rescue.cfg" " ${work_dir} /iso/${install_dir} /boot/syslinux/archiso_sys_rescue_${arch} .cfg"
985+ else
986+ remove " ${work_dir} /iso/${install_dir} /boot/syslinux/archiso_sys_rescue.cfg"
987+ fi
988+
965989 # copy files
966990 cp " ${work_dir} " /${arch} /airootfs/usr/lib/syslinux/bios/* .c32 " ${work_dir} /iso/${install_dir} /boot/syslinux"
967991 cp " ${work_dir} /${arch} /airootfs/usr/lib/syslinux/bios/lpxelinux.0" " ${work_dir} /iso/${install_dir} /boot/syslinux"
@@ -977,7 +1001,12 @@ make_syslinux_loadfiles() {
9771001 for _pxe_or_sys in " sys" " pxe" ; do
9781002 _write_load () { echo -e " ${@ } " >> " ${work_dir} /iso/${install_dir} /boot/syslinux/archiso_${_pxe_or_sys} _load.cfg" ; }
9791003 _write_load " INCLUDE boot/syslinux/archiso_head.cfg"
980- for _arch in ${all_arch[@]} ; do _write_load " INCLUDE boot/syslinux/archiso_${_pxe_or_sys} _${_arch} .cfg" ; done
1004+ for _arch in ${all_arch[@]} ; do
1005+ _write_load " INCLUDE boot/syslinux/archiso_${_pxe_or_sys} _${_arch} .cfg"
1006+ if [[ " ${_pxe_or_sys} " = " sys" ]] && [[ " ${norescue_entry} " = false ]]; then
1007+ _write_load " INCLUDE boot/syslinux/archiso_sys_rescue_${arch} .cfg"
1008+ fi
1009+ done
9811010 _write_load " INCLUDE boot/syslinux/archiso_tail.cfg"
9821011 done
9831012}
@@ -1117,16 +1146,23 @@ make_prepare() {
11171146 }
11181147 rm -rf " ${_info_file} " ; touch " ${_info_file} "
11191148
1120- _write_info_file " Created by ${iso_publisher} "
1121- _write_info_file " ${iso_application} ${arch} "
1149+ _write_info_file " Developer : ${iso_publisher} "
1150+ _write_info_file " OS Name : ${iso_application} "
1151+ _write_info_file " Architecture : ${all_arch} "
11221152 if [[ -d " ${script_path} /.git" ]] && [[ " ${gitversion} " = false ]]; then
1123- _write_info_file " Version : ${iso_version} -$( git rev-parse --short HEAD) "
1153+ _write_info_file " Version : ${iso_version} -$( git rev-parse --short HEAD) "
1154+ else
1155+ _write_info_file " Version : ${iso_version} "
1156+ fi
1157+ _write_info_file " Channel name : ${channel_name} "
1158+ _write_info_file " Live user name : ${username} "
1159+ _write_info_file " Live user pass : ${password} "
1160+ _write_info_file " Kernel name : ${kernel} "
1161+ if [[ " ${boot_splash} " = true ]]; then
1162+ _write_info_file " Plymouth : Yes"
11241163 else
1125- _write_info_file " Version : ${iso_version} "
1164+ _write_info_file " Plymouth : No "
11261165 fi
1127- _write_info_file " Channel name: ${channel_name} "
1128- _write_info_file " Live user name: ${username} "
1129- _write_info_file " Live user pass: ${password} "
11301166 fi
11311167}
11321168
@@ -1395,8 +1431,8 @@ else
13951431fi
13961432
13971433# Check channel version
1398- msg_debug " channel path is ${channel_path } "
1399- if [[ ! " $( cat " ${channel_path } /alteriso" 2> /dev/null) " = " alteriso=${alteriso_version} " ]] && [[ " ${nochkver} " = false ]]; then
1434+ msg_debug " channel path is ${channel_dir } "
1435+ if [[ ! " $( cat " ${channel_dir } /alteriso" 2> /dev/null) " = " alteriso=${alteriso_version} " ]] && [[ " ${nochkver} " = false ]]; then
14001436 msg_error " This channel does not support Alter ISO 3."
14011437 if [[ -d " ${script_path} /.git" ]]; then
14021438 msg_error " Please run \" git checkout alteriso-2\" " " 1"
0 commit comments