Skip to content

Commit 77a89d0

Browse files
committed
[update] : Remove unnecessary branch processing
1 parent eb7a0a9 commit 77a89d0

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

build.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,9 @@ make_setup_mkinitcpio() {
705705
sed -i "s|/usr/lib/initcpio/|/etc/initcpio/|g" "${airootfs_dir}/etc/initcpio/install/archiso_shutdown"
706706
cp "${script_path}/system/initcpio/install/archiso_kms" "${airootfs_dir}/etc/initcpio/install"
707707
cp "${script_path}/system/initcpio/archiso_shutdown" "${airootfs_dir}/etc/initcpio"
708-
if [[ "${boot_splash}" = true ]]; then
709-
cp "${script_path}/mkinitcpio/mkinitcpio-archiso-plymouth.conf" "${airootfs_dir}/etc/mkinitcpio-archiso.conf"
710-
else
711-
cp "${script_path}/mkinitcpio/mkinitcpio-archiso.conf" "${airootfs_dir}/etc/mkinitcpio-archiso.conf"
712-
fi
708+
cp "${script_path}/mkinitcpio/mkinitcpio-archiso.conf" "${airootfs_dir}/etc/mkinitcpio-archiso.conf"
709+
[[ "${boot_splash}" = true ]] && cp "${script_path}/mkinitcpio/mkinitcpio-archiso-plymouth.conf" "${airootfs_dir}/etc/mkinitcpio-archiso.conf"
710+
713711
if [[ "${gpg_key}" ]]; then
714712
gpg --export "${gpg_key}" >"${build_dir}/gpgkey"
715713
exec 17<>"${build_dir}/gpgkey"
@@ -764,9 +762,7 @@ make_syslinux() {
764762
# 一時ディレクトリに設定ファイルをコピー
765763
mkdir -p "${build_dir}/syslinux/"
766764
cp -a "${script_path}/syslinux/"* "${build_dir}/syslinux/"
767-
if [[ -d "${channel_dir}/syslinux" ]] && [[ "${customized_syslinux}" = true ]]; then
768-
cp -af "${channel_dir}/syslinux"* "${build_dir}/syslinux/"
769-
fi
765+
[[ -d "${channel_dir}/syslinux" ]] && [[ "${customized_syslinux}" = true ]] && cp -af "${channel_dir}/syslinux"* "${build_dir}/syslinux/"
770766

771767
# copy all syslinux config to work dir
772768
for _cfg in "${build_dir}/syslinux/"*.cfg; do
@@ -778,25 +774,19 @@ make_syslinux() {
778774
done
779775

780776
# Replace the SYSLINUX configuration file with or without boot splash.
781-
local _use_config_name _no_use_config_name _pxe_or_sys
777+
local _use_config_name="nosplash" _no_use_config_name="splash" _pxe_or_sys
782778
if [[ "${boot_splash}" = true ]]; then
783779
_use_config_name=splash
784780
_no_use_config_name=nosplash
785-
else
786-
_use_config_name=nosplash
787-
_no_use_config_name=splash
788781
fi
789782
for _pxe_or_sys in "sys" "pxe"; do
790783
remove "${isofs_dir}/syslinux/archiso_${_pxe_or_sys}_${_no_use_config_name}.cfg"
791784
mv "${isofs_dir}/syslinux/archiso_${_pxe_or_sys}_${_use_config_name}.cfg" "${isofs_dir}/syslinux/archiso_${_pxe_or_sys}.cfg"
792785
done
793786

794787
# Set syslinux wallpaper
795-
if [[ -f "${channel_dir}/splash.png" ]]; then
796-
cp "${channel_dir}/splash.png" "${isofs_dir}/syslinux"
797-
else
798-
cp "${script_path}/syslinux/splash.png" "${isofs_dir}/syslinux"
799-
fi
788+
cp "${script_path}/syslinux/splash.png" "${isofs_dir}/syslinux"
789+
[[ -f "${channel_dir}/splash.png" ]] && cp -f "${channel_dir}/splash.png" "${isofs_dir}/syslinux"
800790

801791
# remove config
802792
local _remove_config

0 commit comments

Comments
 (0)