@@ -190,11 +190,15 @@ _usage () {
190190 echo " --nocolor No output colored output"
191191 echo " --noconfirm No check the settings before building"
192192 echo " --nochkver No check the version of the channel"
193+ echo " --nodebug No debug message"
193194 echo " --noefi No efi boot"
194195 echo " --noloopmod No check and load kernel module automatically"
195196 echo " --nodepend No check package dependencies before building"
196197 echo " --noiso No build iso image (Use with --tarball)"
197198 echo " --shmkalteriso Use the shell script version of mkalteriso"
199+ echo
200+ echo " Many packages are installed from AUR, so specifying --noaur can cause problems."
201+ echo
198202 if [[ -n " ${1:- } " ]]; then exit " ${1} " ; fi
199203}
200204
@@ -240,6 +244,7 @@ umount_chroot_advance() {
240244
241245# Helper function to run make_*() only one time.
242246run_once () {
247+ set -eu
243248 if [[ ! -e " ${work_dir} /build.${1} _${arch} " ]]; then
244249 msg_debug " Running $1 ..."
245250 " $1 "
@@ -315,26 +320,30 @@ check_bool() {
315320prepare_env () {
316321 # Check packages
317322 if [[ " ${nodepend} " = false ]]; then
318- local _check_failed=false _pkg _ver
323+ local _check_failed=false _pkg _result
319324 msg_info " Checking dependencies ..."
320325 for _pkg in ${dependence[@]} ; do
321326 msg_debug -n " Checking ${_pkg} ..."
322- _ver= " $( pacman -Sp --print-format ' %v ' ${_pkg} 2> /dev/null ; : ) "
323- case " $( " ${script_path} /tools/package.sh " -s " ${_pkg} " ) " in
327+ _result=( $( " ${script_path} /tools/package.py " -s " ${_pkg} " ) )
328+ case " ${_result[0]} " in
324329 " latest" )
325- [[ ${debug} = true ]] && echo -ne " $( pacman -Q ${_pkg} | getclm 2 ) \n"
330+ [[ ${debug} = true ]] && echo -ne " ${_result[1]} \n"
326331 ;;
327332 " noversion" )
328333 echo ; msg_warn " Failed to get the latest version of ${_pkg} ."
329334 ;;
330- " old " )
331- [[ " ${debug} " = true ]] && echo -ne " $( pacman -Q ${_pkg} | getclm 2 ) \n"
332- msg_warn " ${_pkg} is not the latest package .\nLocal: $( pacman -Q ${_pkg} 2> /dev/null | getclm 2 ) Latest: ${_ver } "
335+ " nomatch " )
336+ [[ " ${debug} " = true ]] && echo -ne " ${_result[1]} \n"
337+ msg_warn " The version of ${_pkg} installed in local does not match one of the latest.\nLocal: ${_result[1]} Latest: ${_result[2] } "
333338 ;;
334339 " failed" )
335340 [[ " ${debug} " = true ]] && echo
336341 msg_error " ${_pkg} is not installed." ; _check_failed=true
337342 ;;
343+ " error" )
344+ [[ " ${debug} " = true ]] && echo
345+ msg_error " pyalpm is not installed." ; exit 1
346+ ;;
338347 esac
339348 done
340349 if [[ " ${_check_failed} " = true ]]; then exit 1; fi
@@ -699,7 +708,8 @@ make_packages_aur() {
699708
700709 # prepare for yay
701710 cp -rf --preserve=mode " ${script_path} /system/aur.sh" " ${airootfs_dir} /root/aur.sh"
702- cp -f " ${work_dir} /pacman-${arch} .conf" " ${airootfs_dir} /etc/alteriso-pacman.conf"
711+ # cp -f "${work_dir}/pacman-${arch}.conf" "${airootfs_dir}/etc/alteriso-pacman.conf"
712+ sed " s|https|http|g" " ${work_dir} /pacman-${arch} .conf" > " ${airootfs_dir} /etc/alteriso-pacman.conf"
703713
704714 # Run aur script
705715 ${mkalteriso} ${mkalteriso_option} -w " ${work_dir} /${arch} " -D " ${install_dir} " -r " /root/aur.sh ${pkglist_aur[*]} " run
@@ -720,9 +730,11 @@ make_customize_airootfs() {
720730
721731 # Replace /etc/mkinitcpio.conf if Plymouth is enabled.
722732 if [[ " ${boot_splash} " = true ]]; then
723- cp " ${script_path} /mkinitcpio/mkinitcpio-plymouth.conf" " ${airootfs_dir} /etc/mkinitcpio.conf"
733+ cp -f " ${script_path} /mkinitcpio/mkinitcpio-plymouth.conf" " ${airootfs_dir} /etc/mkinitcpio.conf"
734+ else
735+ cp -f " ${script_path} /mkinitcpio/mkinitcpio.conf" " ${airootfs_dir} /etc/mkinitcpio.conf"
724736 fi
725-
737+
726738 # customize_airootfs options
727739 # -b : Enable boot splash.
728740 # -d : Enable debug mode.
@@ -938,7 +950,11 @@ make_efi() {
938950 local _efi_shell _efi_shell_arch
939951 for _efi_shell in " ${work_dir} " /${arch} /airootfs/usr/share/edk2-shell/* ; do
940952 _efi_shell_arch=" $( basename ${_efi_shell} ) "
941- cp " ${_efi_shell} /Shell_Full.efi" " ${isofs_dir} /EFI/shell_${_efi_shell_arch} .efi"
953+ if [[ " ${_efi_shell_arch} " == ' aarch64' ]]; then
954+ cp " ${_efi_shell} /Shell.efi" " ${isofs_dir} /EFI/shell_${_efi_shell_arch} .efi"
955+ else
956+ cp " ${_efi_shell} /Shell_Full.efi" " ${isofs_dir} /EFI/shell_${_efi_shell_arch} .efi"
957+ fi
942958 cat - > " ${isofs_dir} /loader/entries/uefi-shell-${_efi_shell_arch} .conf" << EOF
943959title UEFI Shell ${_efi_shell_arch}
944960efi /EFI/shell_${_efi_shell_arch} .efi
@@ -969,9 +985,9 @@ make_efiboot() {
969985
970986 # PreLoader.efiがefitoolsのi686版に存在しません。この行を有効化するとi686ビルドに失敗します
971987 # PreLoader.efiの役割がわかりません誰かたすけてください(archiso v43で使用されていた)
972- # cp "${work_dir}/${arch}/airootfs /usr/share/efitools/efi/PreLoader.efi" "${work_dir}/efiboot/EFI/boot/bootx64.efi"
988+ # cp "${airootfs_dir} /usr/share/efitools/efi/PreLoader.efi" "${work_dir}/efiboot/EFI/boot/bootx64.efi"
973989
974- cp " ${work_dir} / ${arch} /airootfs /usr/share/efitools/efi/HashTool.efi" " ${work_dir} /efiboot/EFI/boot/"
990+ cp " ${airootfs_dir} /usr/share/efitools/efi/HashTool.efi" " ${work_dir} /efiboot/EFI/boot/"
975991
976992 local _bootfile=" $( basename " $( ls " ${airootfs_dir} /usr/lib/systemd/boot/efi/systemd-boot" * " .efi" ) " ) "
977993 cp " ${airootfs_dir} /usr/lib/systemd/boot/efi/${_bootfile} " " ${work_dir} /efiboot/EFI/boot/${_bootfile# systemd-} "
@@ -1064,9 +1080,7 @@ make_prepare() {
10641080 if [[ " ${cleaning} " = true ]]; then
10651081 remove " ${airootfs_dir} "
10661082 fi
1067- if [[ " ${noaur} " != true ]]; then
1068- mount " ${work_dir} /${arch} /airootfs.img" " ${work_dir} /${arch} /airootfs"
1069- fi
1083+
10701084 # iso version info
10711085 if [[ " ${include_info} " = true ]]; then
10721086 local _write_info_file _info_file=" ${isofs_dir} /alteriso-info"
@@ -1112,10 +1126,6 @@ make_overisofs() {
11121126
11131127# Build ISO
11141128make_iso () {
1115-
1116- if [[ " ${noaur} " == false ]]; then
1117- umount -fl " ${work_dir} /${arch} /airootfs"
1118- fi
11191129 remove " ${work_dir} /airootfs"
11201130 ${mkalteriso} ${mkalteriso_option} -w " ${work_dir} " -D " ${install_dir} " -L " ${iso_label} " -P " ${iso_publisher} " -A " ${iso_application} " -o " ${out_dir} " iso " ${iso_filename} "
11211131 msg_info " The password for the live user and root is ${password} ."
@@ -1125,7 +1135,7 @@ make_iso() {
11251135# Parse options
11261136ARGUMENT=" ${@ } "
11271137_opt_short=" a:bc:deg:hjk:l:o:p:rt:u:w:x"
1128- _opt_long=" arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi"
1138+ _opt_long=" arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi,nodebug "
11291139OPT=$( getopt -o ${_opt_short} -l ${_opt_long} -- ${DEFAULT_ARGUMENT} ${ARGUMENT} )
11301140[[ ${?} != 0 ]] && exit 1
11311141
@@ -1257,6 +1267,12 @@ while :; do
12571267 nochkver=true
12581268 shift 1
12591269 ;;
1270+ --nodebug)
1271+ debug=false
1272+ msgdebug=false
1273+ bash_debug=false
1274+ shift 1
1275+ ;;
12601276 --noefi)
12611277 noefi=true
12621278 shift 1
0 commit comments