@@ -447,12 +447,8 @@ prepare_build() {
447447 [[ " ${gitversion} " = true ]] && iso_version=" ${iso_version} -${gitrev} "
448448
449449 # Generate iso file name.
450- local _channel_name=" ${channel_name% .add} -${locale_version} "
451- if [[ " ${nochname} " = true ]]; then
452- iso_filename=" ${iso_name} -${iso_version} -${arch} .iso"
453- else
454- iso_filename=" ${iso_name} -${_channel_name} -${iso_version} -${arch} .iso"
455- fi
450+ local _channel_name=" ${channel_name% .add} -${locale_version} " iso_filename=" ${iso_name} -${_channel_name} -${iso_version} -${arch} .iso"
451+ [[ " ${nochname} " = true ]] && iso_filename=" ${iso_name} -${iso_version} -${arch} .iso"
456452 msg_debug " Iso filename is ${iso_filename} "
457453
458454 # check bool
@@ -468,7 +464,7 @@ prepare_build() {
468464 # Run with tee
469465 if [[ ! " ${logging} " = false ]]; then
470466 [[ " ${customized_logpath} " = false ]] && logging=" ${out_dir} /${iso_filename% .iso} .log"
471- mkdir -p " $( dirname " ${logging} " ) " ; touch " ${logging} "
467+ mkdir -p " $( dirname " ${logging} " ) " && touch " ${logging} "
472468 msg_warn " Re-run sudo ${0} ${ARGUMENT[*]} --nodepend --nolog --nocolor 2>&1 | tee ${logging} "
473469 sudo " ${0} " " ${ARGUMENT[@]} " --nolog --nocolor --nodepend 2>&1 | tee " ${logging} "
474470 exit " ${?} "
@@ -507,13 +503,9 @@ make_pacman_conf() {
507503 msg_debug " Use ${build_pacman_conf} "
508504 sed -r " s|^#?\\ s*CacheDir.+|CacheDir = ${cache_dir} |g" " ${build_pacman_conf} " > " ${build_dir} /pacman.conf"
509505
510- if [[ " ${nosigcheck} " = true ]]; then
511- sed -ir " s|^s*SigLevel.+|SigLevel = Never|g" " ${build_pacman_conf} "
512- fi
506+ [[ " ${nosigcheck} " = true ]] && sed -ir " s|^s*SigLevel.+|SigLevel = Never|g" " ${build_pacman_conf} "
513507
514- if [[ -n " $( find " ${cache_dir} " -maxdepth 1 -name ' *.pkg.tar.*' 2> /dev/null) " ]]; then
515- msg_info " Use cached package files in ${cache_dir} "
516- fi
508+ [[ -n " $( find " ${cache_dir} " -maxdepth 1 -name ' *.pkg.tar.*' 2> /dev/null) " ]] && msg_info " Use cached package files in ${cache_dir} "
517509
518510 # Share any architecture packages
519511 # while read -r _pkg; do
@@ -699,9 +691,7 @@ make_setup_mkinitcpio() {
699691
700692 _chroot_run " mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/${kernel_filename} -g /boot/archiso.img"
701693
702- if [[ " ${gpg_key} " ]]; then
703- exec 17< & -
704- fi
694+ [[ " ${gpg_key} " ]] && exec 17< & -
705695
706696 return 0
707697}
@@ -743,18 +733,17 @@ make_boot_extra() {
743733
744734# Prepare /${install_dir}/boot/syslinux
745735make_syslinux () {
746- _uname_r=" $( file -b ${airootfs_dir} /boot/${kernel_filename} | awk ' f{print;f=0} /version/{f=1}' RS=' ' ) "
747736 mkdir -p " ${isofs_dir} /syslinux"
748737
749738 # 一時ディレクトリに設定ファイルをコピー
750- mkdir -p " ${build_dir} /${arch} / syslinux/"
751- cp -a " ${script_path} /syslinux/" * " ${build_dir} /${arch} / syslinux/"
739+ mkdir -p " ${build_dir} /syslinux/"
740+ cp -a " ${script_path} /syslinux/" * " ${build_dir} /syslinux/"
752741 if [[ -d " ${channel_dir} /syslinux" ]] && [[ " ${customized_syslinux} " = true ]]; then
753- cp -af " ${channel_dir} /syslinux" * " ${build_dir} /${arch} / syslinux/"
742+ cp -af " ${channel_dir} /syslinux" * " ${build_dir} /syslinux/"
754743 fi
755744
756745 # copy all syslinux config to work dir
757- for _cfg in ${build_dir} /${arch} / syslinux/* .cfg; do
746+ for _cfg in " ${build_dir} /syslinux/" * .cfg; do
758747 sed " s|%ARCHISO_LABEL%|${iso_label} |g;
759748 s|%OS_NAME%|${os_name} |g;
760749 s|%KERNEL_FILENAME%|${kernel_filename} |g;
@@ -893,12 +882,8 @@ make_efiboot() {
893882 local _bootfile=" $( basename " $( ls " ${airootfs_dir} /usr/lib/systemd/boot/efi/systemd-boot" * " .efi" ) " ) "
894883 cp " ${airootfs_dir} /usr/lib/systemd/boot/efi/${_bootfile} " " ${build_dir} /efiboot/EFI/boot/${_bootfile# systemd-} "
895884
896- local _use_config_name
897- if [[ " ${boot_splash} " = true ]]; then
898- _use_config_name=" splash"
899- else
900- _use_config_name=" nosplash"
901- fi
885+ local _use_config_name=" nosplash"
886+ [[ " ${boot_splash} " = true ]] && _use_config_name=" splash"
902887
903888 mkdir -p " ${build_dir} /efiboot/loader/entries"
904889 sed " s|%ARCH%|${arch} |g;" " ${script_path} /efiboot/${_use_config_name} /loader.conf" > " ${build_dir} /efiboot/loader/loader.conf"
@@ -980,7 +965,7 @@ make_prepare() {
980965 # Create squashfs
981966 mkdir -p -- " ${isofs_dir} /${install_dir} /${arch} "
982967 msg_info " Creating SquashFS image, this may take some time..."
983- mksquashfs " ${airootfs_dir} " " ${build_dir} /iso/${install_dir} /${arch} /airootfs.sfs" -noappend -comp " ${sfs_comp} " ${sfs_comp_opt}
968+ mksquashfs " ${airootfs_dir} " " ${build_dir} /iso/${install_dir} /${arch} /airootfs.sfs" -noappend -comp " ${sfs_comp} " " ${sfs_comp_opt[@]} "
984969
985970 # Create checksum
986971 msg_info " Creating checksum file for self-test..."
@@ -1008,9 +993,7 @@ make_alteriso_info(){
1008993 if [[ " ${include_info} " = true ]]; then
1009994 local _info_file=" ${isofs_dir} /alteriso-info" _version=" ${iso_version} "
1010995 remove " ${_info_file} " ; touch " ${_info_file} "
1011- if [[ -d " ${script_path} /.git" ]] && [[ " ${gitversion} " = false ]]; then
1012- _version=" ${iso_version} -${gitrev} "
1013- fi
996+ [[ -d " ${script_path} /.git" ]] && [[ " ${gitversion} " = false ]] && _version=" ${iso_version} -${gitrev} "
1014997 " ${tools_dir} /alteriso-info.sh" -a " ${arch} " -b " ${boot_splash} " -c " ${channel_name% .add} " -d " ${iso_publisher} " -k " ${kernel} " -o " ${os_name} " -p " ${password} " -u " ${username} " -v " ${_version} " > " ${_info_file} "
1015998 fi
1016999
@@ -1034,7 +1017,7 @@ make_iso() {
10341017 local _iso_efi_boot_args=()
10351018 # If exists, add an EFI "El Torito" boot image (FAT filesystem) to ISO-9660 image.
10361019 if [[ -f " ${build_dir} /efiboot.img" ]]; then
1037- _iso_efi_boot_args=(-append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${build_dir} /efiboot.img -appended_part_as_gpt -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat)
1020+ _iso_efi_boot_args=(-append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B " ${build_dir} /efiboot.img" -appended_part_as_gpt -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat)
10381021 fi
10391022
10401023 mkdir -p -- " ${out_dir} "
@@ -1137,9 +1120,9 @@ while true; do
11371120 ;;
11381121 -t | --comp-opts)
11391122 if [[ " ${2} " = " reset" ]]; then
1140- sfs_comp_opt=" "
1123+ sfs_comp_opt=()
11411124 else
1142- sfs_comp_opt=" ${2} "
1125+ sfs_comp_opt=( ${2} )
11431126 fi
11441127 shift 2
11451128 ;;
0 commit comments