Skip to content

Commit 6cf02ac

Browse files
committed
Merge branch 'dev' into dev-stable
2 parents 6f7bf4f + 4e17c06 commit 6cf02ac

File tree

29 files changed

+296
-231
lines changed

29 files changed

+296
-231
lines changed

allarch.sh

Lines changed: 98 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,53 @@ umask 0022
4141
# Show an INFO message
4242
# $1: message string
4343
msg_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
5256
msg_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
6169
msg_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)
7385
msg_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() {
285301
prepare_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
471487
prepare_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
}
@@ -995,6 +1024,7 @@ make_isolinux() {
9951024
}
9961025

9971026
# Prepare /EFI
1027+
# Todo 2020/10/13 Hayao0819: x86_64に依存しているのをなくす
9981028
make_efi() {
9991029
mkdir -p "${work_dir}/iso/EFI/boot"
10001030
for arch in ${all_arch[@]}; do
@@ -1013,14 +1043,23 @@ make_efi() {
10131043
s|%KERNEL_FILENAME%|${kernel_filename}|g;
10141044
s|%ARCH%|${arch}|g;
10151045
s|%INSTALL_DIR%|${install_dir}|g" \
1016-
"${script_path}/efiboot/loader/entries/archiso-usb.conf" > "${work_dir}/iso/loader/entries/archiso-${arch}-usb.conf"
1046+
"${script_path}/efiboot/loader/entries/archiso-usb.conf" > "${work_dir}/iso/loader/entries/archiso-${arch}.conf"
10171047
done
10181048

10191049
# edk2-shell based UEFI shell
10201050
# shellx64.efi is picked up automatically when on /
1021-
if [[ -f "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then
1022-
cp "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" "${work_dir}/iso/shellx64.efi"
1023-
fi
1051+
#if [[ -f "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then
1052+
# cp "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" "${work_dir}/iso/shellx64.efi"
1053+
#fi
1054+
1055+
#if [[ "${arch}" = "x86_64" ]]; then
1056+
# cp "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" "${work_dir}/iso/shellx64.efi"
1057+
#fi
1058+
1059+
local _efi_shell_arch
1060+
for _efi_shell_arch in "${work_dir}"/${arch}/airootfs/usr/share/edk2-shell/*; do
1061+
cp "${_efi_shell_arch}/Shell_Full.efi" "${work_dir}/iso/shell_$(basename ${_efi_shell_arch}).efi"
1062+
done
10241063
}
10251064

10261065
# Prepare efiboot.img::/EFI for "El Torito" EFI boot mode
@@ -1045,7 +1084,7 @@ make_efiboot() {
10451084
for arch in ${all_arch[@]}; do
10461085
(
10471086
local __bootfile="$(basename "$(ls "${work_dir}/${arch}/airootfs/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
1048-
cp "${work_dir}/${arch}/airootfs/usr/lib/systemd/boot/efi/${__bootfile}" "${work_dir}/iso/EFI/boot/${__bootfile#systemd-}"
1087+
cp "${work_dir}/${arch}/airootfs/usr/lib/systemd/boot/efi/${__bootfile}" "${work_dir}/efiboot/boot/${__bootfile#systemd-}"
10491088
)
10501089
done
10511090

@@ -1062,9 +1101,11 @@ make_efiboot() {
10621101
done
10631102

10641103
# shellx64.efi is picked up automatically when on /
1065-
if [[ -f "${work_dir}/iso/shellx64.efi" ]]; then
1066-
cp "${work_dir}/iso/shellx64.efi" "${work_dir}/efiboot/"
1067-
fi
1104+
#if [[ -f "${work_dir}/iso/shellx64.efi" ]]; then
1105+
# cp "${work_dir}/iso/shellx64.efi" "${work_dir}/efiboot/"
1106+
#fi
1107+
1108+
cp "${work_dir}/iso/shell"*".efi" "${work_dir}/efiboot/"
10681109

10691110
umount -d "${work_dir}/efiboot"
10701111
}
@@ -1117,16 +1158,23 @@ make_prepare() {
11171158
}
11181159
rm -rf "${_info_file}"; touch "${_info_file}"
11191160

1120-
_write_info_file "Created by ${iso_publisher}"
1121-
_write_info_file "${iso_application} ${arch}"
1161+
_write_info_file "Developer : ${iso_publisher}"
1162+
_write_info_file "OS Name : ${iso_application}"
1163+
_write_info_file "Architecture : ${all_arch}"
11221164
if [[ -d "${script_path}/.git" ]] && [[ "${gitversion}" = false ]]; then
1123-
_write_info_file "Version : ${iso_version}-$(git rev-parse --short HEAD)"
1165+
_write_info_file "Version : ${iso_version}-$(git rev-parse --short HEAD)"
1166+
else
1167+
_write_info_file "Version : ${iso_version}"
1168+
fi
1169+
_write_info_file "Channel name : ${channel_name}"
1170+
_write_info_file "Live user name : ${username}"
1171+
_write_info_file "Live user pass : ${password}"
1172+
_write_info_file "Kernel name : ${kernel}"
1173+
if [[ "${boot_splash}" = true ]]; then
1174+
_write_info_file "Plymouth : Yes"
11241175
else
1125-
_write_info_file "Version : ${iso_version}"
1176+
_write_info_file "Plymouth : No"
11261177
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}"
11301178
fi
11311179
}
11321180

@@ -1395,8 +1443,8 @@ else
13951443
fi
13961444

13971445
# 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
1446+
msg_debug "channel path is ${channel_dir}"
1447+
if [[ ! "$(cat "${channel_dir}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then
14001448
msg_error "This channel does not support Alter ISO 3."
14011449
if [[ -d "${script_path}/.git" ]]; then
14021450
msg_error "Please run \"git checkout alteriso-2\"" "1"

0 commit comments

Comments
 (0)