5 # Email : hayao@fascode.net
7 # (c) 2019-2020 Fascode Network.
11 # The main script that runs the build
18 # Do not change these values.
19 script_path="$(readlink -f ${0%/*})"
20 defaultconfig="${script_path}/default.conf"
22 customized_username=false
26 if [[ -f "${defaultconfig}" ]]; then
27 source "${defaultconfig}"
29 echo "${defaultconfig} was not found."
38 # usage: echo_color -b <backcolor> -t <textcolor> -d <decoration> [Text]
61 # You can specify multiple decorations with ;.
62 # 0 => All attributs off (ノーマル)
64 # 4 => Underscore (下線)
66 # 7 => Reverse video on (色反転)
80 while getopts 'b:t:d:n' arg; do
82 b) backcolor="${OPTARG}" ;;
83 t) textcolor="${OPTARG}" ;;
84 d) decotypes="${OPTARG}" ;;
85 n) echo_opts="-n -e" ;;
91 if [[ "${nocolor}" = false ]]; then
92 echo ${echo_opts} "\e[$([[ -v backcolor ]] && echo -n "${backcolor}"; [[ -v textcolor ]] && echo -n ";${textcolor}"; [[ -v decotypes ]] && echo -n ";${decotypes}")m${@}\e[m"
94 echo ${echo_opts} "${@}"
99 # Show an INFO message
102 if [[ "${msgdebug}" = false ]]; then
111 while getopts 'n' arg; do
113 n) echo_opts="${echo_opts} -n" ;;
116 shift $((OPTIND - 1))
117 echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '32' 'Info') ${@}"
118 if [[ "${bash_debug}" = true ]]; then
126 # Show an Warning message
129 if [[ "${msgdebug}" = false ]]; then
138 while getopts 'n' arg; do
140 n) echo_opts="${echo_opts} -n" ;;
143 shift $((OPTIND - 1))
144 echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '33' 'Warning') ${@}" >&2
145 if [[ "${bash_debug}" = true ]]; then
153 # Show an debug message
156 if [[ "${msgdebug}" = false ]]; then
165 while getopts 'n' arg; do
167 n) echo_opts="${echo_opts} -n" ;;
170 shift $((OPTIND - 1))
171 if [[ ${debug} = true ]]; then
172 echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '35' 'Debug') ${@}"
174 if [[ "${bash_debug}" = true ]]; then
182 # Show an ERROR message then exit with status
184 # $2: exit code number (with 0 does not exit)
186 if [[ "${msgdebug}" = false ]]; then
196 while getopts 'n' arg; do
198 n) echo_opts="${echo_opts} -n" ;;
201 shift $((OPTIND - 1))
202 echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '31' 'Error') ${1}" >&2
203 if [[ -n "${2:-}" ]]; then
206 if [[ "${bash_debug}" = true ]]; then
215 echo "usage ${0} [options] [channel]"
217 echo " General options:"
219 echo " -b | --boot-splash Enable boot splash"
220 echo " Default: disable"
221 echo " -j | --japanese Enable Japanese mode."
222 echo " Default: disable"
223 echo " -l | --cleanup Enable post-build cleaning."
224 echo " Default: disable"
225 echo " -d | --debug Enable debug messages."
226 echo " Default: disable"
227 echo " -x | --bash-debug Enable bash debug mode.(set -xv)"
228 echo " Default: disable"
229 echo " -h | --help This help message and exit."
231 echo " -a | --arch <arch> Set iso architecture."
232 echo " Default: ${arch}"
233 echo " -c | <comp_type> Set SquashFS compression type (gzip, lzma, lzo, xz, zstd)"
234 echo " Default: ${sfs_comp}"
235 echo " -g | --gpgkey <key> Set gpg key"
236 echo " Default: ${gpg_key}"
237 echo " -k | --kernel <kernel> Set special kernel type.See below for available kernels."
238 echo " Default: ${kernel}"
239 echo " -o | --out <out_dir> Set the output directory"
240 echo " Default: ${out_dir}"
241 echo " -p | --password <password> Set a live user password"
242 echo " Default: ${password}"
243 echo " -t | --comp-opts <options> Set compressor-specific options."
244 echo " Default: empty"
245 echo " -u | --user <username> Set user name."
246 echo " Default: ${username}"
247 echo " -w | --work <work_dir> Set the working directory"
248 echo " Default: ${work_dir}"
250 echo " --gitversion Add Git commit hash to image file version"
251 echo " --msgdebug Enables output debugging."
252 echo " --nocolor No output colored output."
253 echo " --noconfirm No check the settings before building."
254 echo " --noloopmod No check and load kernel module automatically."
255 echo " --nodepend No check package dependencies before building."
256 echo " --shmkalteriso Use the shell script version of mkalteriso."
258 echo "A list of kernels available for each architecture."
262 for list in $(ls ${script_path}/system/kernel_list-*); do
263 echo " ${list#${script_path}/system/kernel_list-}:"
265 for kernel in $(grep -h -v ^'#' ${list}); do
271 echo "You can switch between installed packages, files included in images, etc. by channel."
274 for i in $(ls -l "${script_path}"/channels/ | awk '$1 ~ /d/ {print $9 }'); do
275 if [[ -n $(ls "${script_path}"/channels/${i}) ]]; then
276 if [[ ! ${i} = "share" ]]; then
277 if [[ ! $(echo "${i}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
278 if [[ ! -d "${script_path}/channels/${i}.add" ]]; then
279 channel_list="${channel_list[@]} ${i}"
282 channel_list="${channel_list[@]} ${i}"
287 channel_list="${channel_list[@]} rebuild"
290 for _channel in ${channel_list[@]}; do
291 if [[ -f "${script_path}/channels/${_channel}/description.txt" ]]; then
292 description=$(cat "${script_path}/channels/${_channel}/description.txt")
293 elif [[ "${_channel}" = "rebuild" ]]; then
294 description="Rebuild using the settings of the previous build."
296 description="This channel does not have a description.txt."
298 if [[ $(echo "${_channel}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
299 echo -ne " $(echo ${_channel} | sed 's/\.[^\.]*$//')"
300 for i in $( seq 1 $(( ${blank} - ${#_channel} )) ); do
304 echo -ne " ${_channel}"
305 for i in $( seq 1 $(( ${blank} - 4 - ${#_channel} )) ); do
309 echo -ne "${description}\n"
312 if [[ -n "${1:-}" ]]; then
321 for mount in $(mount | awk '{print $3}' | grep $(realpath ${work_dir}) | tac); do
322 _msg_info "Unmounting ${mount}"
323 umount -lf "${mount}"
327 # Helper function to run make_*() only one time.
329 if [[ ! -e "${work_dir}/build.${1}_${arch}" ]]; then
330 _msg_debug "Running $1 ..."
332 touch "${work_dir}/build.${1}_${arch}"
335 _msg_debug "Skipped because ${1} has already been executed."
341 # Delete the file if it exists.
342 # For directories, rm -rf is used.
343 # If the file does not exist, skip it.
344 # remove <file> <file> ...
349 for _file in "${_list[@]}"; do
350 if [[ -f ${_file} ]]; then
351 _msg_debug "Removeing ${_file}"
353 elif [[ -d ${_file} ]]; then
354 _msg_debug "Removeing ${_file}"
365 _msg_error "It was killed by the user."
366 _msg_error "The process may not have completed successfully."
371 # load_config [file1] [file2] ...
375 if [[ -f "${file}" ]]; then
377 _msg_debug "The settings have been overwritten by the ${file}"
385 remove "$(ls ${work_dir}/* | grep "build.make")"
386 remove "${work_dir}"/pacman-*.conf
387 remove "${work_dir}/efiboot"
388 remove "${work_dir}/iso"
389 remove "${work_dir}/${arch}"
390 remove "${work_dir}/packages.list"
391 remove "${work_dir}/packages-full.list"
392 #remove "${rebuildfile}"
393 if [[ -z $(ls $(realpath "${work_dir}")/* 2>/dev/null) ]]; then
399 # Preparation for build
402 if [[ "${shmkalteriso}" = false ]]; then
403 mkalteriso="${script_path}/system/mkalteriso"
405 _msg_info "Building mkalteriso..."
406 if [[ "${debug}" = true ]]; then
410 make mkalteriso > /dev/null 2>&1
412 cd - > /dev/null 2>&1
414 mkalteriso="${script_path}/system/mkalteriso.sh"
417 # Create a working directory.
418 [[ ! -d "${work_dir}" ]] && mkdir -p "${work_dir}"
422 if [[ -n $(ls -a "${work_dir}" 2> /dev/null | grep -xv ".." | grep -xv ".") ]] && [[ ! "${rebuild}" = true ]]; then
424 _msg_info "Deleting the contents of ${work_dir}..."
425 remove "${work_dir%/}"/*
429 # 強制終了時に作業ディレクトリを削除する
430 local trap_remove_work
437 trap 'trap_remove_work' 1 2 3 15
442 local out_file="${rebuildfile}"
444 echo "#!/usr/bin/env bash" > "${out_file}"
445 echo "# Build options are stored here." >> "${out_file}"
447 echo -n "${i}=" >> "${out_file}"
448 echo -n '"' >> "${out_file}"
449 eval echo -n '$'{${i}} >> "${out_file}"
450 echo '"' >> "${out_file}"
453 if [[ ${rebuild} = false ]]; then
454 # If there is pacman.conf for each channel, use that for building
455 if [[ -f "${script_path}/channels/${channel_name}/pacman-${arch}.conf" ]]; then
456 build_pacman_conf="${script_path}/channels/${channel_name}/pacman-${arch}.conf"
459 # If there is config for share channel. load that.
460 load_config "${script_path}/channels/share/config.any"
461 load_config ${script_path}/channels/share/config.${arch}
464 # If there is config for each channel. load that.
465 load_config "${script_path}/channels/${channel_name}/config.any"
466 load_config "${script_path}/channels/${channel_name}/config.${arch}"
470 if [[ "${customized_username}" = false ]]; then
471 username="${defaultusername}"
475 if [[ "${gitversion}" = true ]]; then
477 iso_version=${iso_version}-$(git rev-parse --short HEAD)
478 cd - > /dev/null 2>&1
481 # Generate iso file name.
483 if [[ $(echo "${channel_name}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
484 _channel_name="$(echo ${channel_name} | sed 's/\.[^\.]*$//')"
486 _channel_name="${channel_name}"
488 if [[ "${japanese}" = true ]]; then
489 _channel_name="${_channel_name}-jp"
491 if [[ "${nochname}" = true ]]; then
492 iso_filename="${iso_name}-${iso_version}-${arch}.iso"
494 iso_filename="${iso_name}-${_channel_name}-${iso_version}-${arch}.iso"
496 _msg_debug "Iso filename is ${iso_filename}"
498 # Save the value of the variable for use in rebuild.
533 customized_username \
538 load_config "${rebuildfile}"
539 _msg_debug "Iso filename is ${iso_filename}"
541 # Delete the lock file.
542 # remove "$(ls ${work_dir}/* | grep "build.make")"
548 for mount in $(mount | awk '{print $3}' | grep $(realpath ${work_dir})); do
549 _msg_info "Unmounting ${mount}"
555 if [[ "${nodepend}" = false ]] && [[ "${arch}" = $(uname -m) ]] ; then
559 local check_failed=false
562 installed_pkg=($(pacman -Q | awk '{print $1}'))
563 installed_ver=($(pacman -Q | awk '{print $2}'))
568 for i in $(seq 0 $(( ${#installed_pkg[@]} - 1 ))); do
569 if [[ "${installed_pkg[${i}]}" = ${1} ]]; then
570 ver=$(pacman -Sp --print-format '%v' --config ${build_pacman_conf} ${1} 2> /dev/null)
571 if [[ "${installed_ver[${i}]}" = "${ver}" ]]; then
574 elif [[ -z ${ver} ]]; then
586 if [[ ${debug} = false ]]; then
587 _msg_info "Checking dependencies ..."
591 for pkg in ${dependence[@]}; do
592 _msg_debug -n "Checking ${pkg} ..."
593 case $(check_pkg ${pkg}) in
595 [[ "${debug}" = true ]] && echo -ne " $(pacman -Q ${pkg} | awk '{print $2}')\n"
596 _msg_warn "${pkg} is not the latest package."
597 _msg_warn "Local: $(pacman -Q ${pkg} 2> /dev/null | awk '{print $2}') Latest: $(pacman -Sp --print-format '%v' --config ${build_pacman_conf} ${pkg} 2> /dev/null)"
600 [[ "${debug}" = true ]] && echo
601 _msg_error "${pkg} is not installed." ; check_failed=true
604 [[ "${debug}" = true ]] && echo
605 _msg_warn "${pkg} is not a repository package."
607 "installed") [[ ${debug} = true ]] && echo -ne " $(pacman -Q ${pkg} | awk '{print $2}')\n" ;;
611 if [[ "${check_failed}" = true ]]; then
616 # Load loop kernel module
617 if [[ "${noloopmod}" = false ]]; then
618 if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then
619 _msg_error "The currently running kernel module could not be found."
620 _msg_error "Probably the system kernel has been updated."
621 _msg_error "Reboot your system to run the latest kernel." "1"
623 if [[ -z $(lsmod | awk '{print $1}' | grep -x "loop") ]]; then
632 _msg_info "mkalteriso path is ${mkalteriso}"
634 if [[ "${boot_splash}" = true ]]; then
635 _msg_info "Boot splash is enabled."
636 _msg_info "Theme is used ${theme_name}."
638 _msg_info "Use the ${kernel} kernel."
639 _msg_info "Live username is ${username}."
640 _msg_info "Live user password is ${password}."
641 _msg_info "The compression method of squashfs is ${sfs_comp}."
642 if [[ $(echo "${channel_name}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
643 _msg_info "Use the $(echo ${channel_name} | sed 's/\.[^\.]*$//') channel."
645 _msg_info "Use the ${channel_name} channel."
647 [[ "${japanese}" = true ]] && _msg_info "Japanese mode has been activated."
648 _msg_info "Build with architecture ${arch}."
650 if [[ ${noconfirm} = false ]]; then
651 echo "Press Enter to continue or Ctrl + C to cancel."
658 trap 'umount_trap' 1 2 3 15
662 # Setup custom pacman.conf with current cache directories.
664 _msg_debug "Use ${build_pacman_conf}"
666 _cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
667 sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${_cache_dirs[@]})|g" ${build_pacman_conf} > "${work_dir}/pacman-${arch}.conf"
670 # Base installation, plus needed packages (airootfs)
672 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" init
673 # ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "haveged intel-ucode amd-ucode memtest86+ mkinitcpio-nfs-utils nbd zsh efitools" install
674 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "bash haveged intel-ucode amd-ucode mkinitcpio-nfs-utils nbd efitools" install
677 if [[ "${boot_splash}" = true ]]; then
678 if [[ -n "${theme_pkg}" ]]; then
679 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "plymouth ${theme_pkg}" install
681 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "plymouth" install
686 if [[ ! "${kernel}" = "core" ]]; then
687 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "linux-${kernel} linux-${kernel}-headers broadcom-wl-dkms" install
689 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "linux linux-headers broadcom-wl" install
693 # Additional packages (airootfs)
695 # インストールするパッケージのリストを読み込み、配列pkglistに代入します。
706 #-- Detect package list to load --#
707 # Append the file in the share directory to the file to be read.
709 # Package list for Japanese
710 jplist="${script_path}/channels/share/packages.${arch}/jp.${arch}"
712 # Package list for non-Japanese
713 nojplist="${script_path}/channels/share/packages.${arch}/non-jp.${arch}"
715 if [[ "${japanese}" = true ]]; then
716 _loadfilelist=($(ls "${script_path}"/channels/share/packages.${arch}/*.${arch} | grep -xv "${nojplist}"))
718 _loadfilelist=($(ls "${script_path}"/channels/share/packages.${arch}/*.${arch} | grep -xv "${jplist}"))
722 # Add the files for each channel to the list of files to read.
724 # Package list for Japanese
725 jplist="${script_path}/channels/${channel_name}/packages.${arch}/jp.${arch}"
727 # Package list for non-Japanese
728 nojplist="${script_path}/channels/${channel_name}/packages.${arch}/non-jp.${arch}"
730 if [[ "${japanese}" = true ]]; then
731 # If Japanese is enabled, add it to the list of files to read other than non-jp.
732 _loadfilelist=(${_loadfilelist[@]} $(ls "${script_path}"/channels/${channel_name}/packages.${arch}/*.${arch} | grep -xv "${nojplist}"))
734 # If Japanese is disabled, add it to the list of files to read other than jp.
735 _loadfilelist=(${_loadfilelist[@]} $(ls "${script_path}"/channels/${channel_name}/packages.${arch}/*.${arch} | grep -xv ${jplist}))
739 #-- Read package list --#
740 # Read the file and remove comments starting with # and add it to the list of packages to install.
741 for _file in ${_loadfilelist[@]}; do
742 _msg_debug "Loaded package file ${_file}."
743 pkglist=( ${pkglist[@]} "$(grep -h -v ^'#' ${_file})" )
745 if [[ ${debug} = true ]]; then
749 # Exclude packages from the share exclusion list
750 excludefile="${script_path}/channels/share/packages.${arch}/exclude"
751 if [[ -f "${excludefile}" ]]; then
752 excludelist=( $(grep -h -v ^'#' "${excludefile}") )
755 _pkglist=(${pkglist[@]})
757 for _pkg in ${_pkglist[@]}; do
758 # もし変数_pkgの値が配列excludelistに含まれていなかったらpkglistに追加する
759 if [[ ! $(printf '%s\n' "${excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then
760 pkglist=(${pkglist[@]} "${_pkg}")
765 if [[ -n "${excludelist[@]}" ]]; then
766 _msg_debug "The following packages have been removed from the installation list."
767 _msg_debug "Excluded packages: ${excludelist[@]}"
770 # Exclude packages from the exclusion list for each channel
771 excludefile="${script_path}/channels/${channel_name}/packages.${arch}/exclude"
772 if [[ -f "${excludefile}" ]]; then
773 excludelist=( $(grep -h -v ^'#' "${excludefile}") )
776 _pkglist=(${pkglist[@]})
778 for _pkg in ${_pkglist[@]}; do
779 # もし変数_pkgの値が配列excludelistに含まれていなかったらpkglistに追加する
780 if [[ ! $(printf '%s\n' "${excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then
781 pkglist=(${pkglist[@]} "${_pkg}")
787 # Sort the list of packages in abc order.
790 for _pkg in ${pkglist[@]}; do
799 #for _pkg in ${pkglist[@]}; do
802 # echo "${pkglist[@]}"
810 # _msg_debug "${pkglist[@]}"
812 # Create a list of packages to be finally installed as packages.list directly under the working directory.
813 echo "# The list of packages that is installed in live cd." > ${work_dir}/packages.list
814 echo "#" >> ${work_dir}/packages.list
815 echo >> ${work_dir}/packages.list
816 for _pkg in ${pkglist[@]}; do
817 echo ${_pkg} >> ${work_dir}/packages.list
820 # Install packages on airootfs
821 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "${pkglist[@]}" install
824 # Customize installation (airootfs)
825 make_customize_airootfs() {
826 # Overwrite airootfs with customize_airootfs.
833 if [[ -d "${_dir}" ]]; then
834 cp -af "${_dir}"/* "${work_dir}/${arch}/airootfs"
839 copy_airootfs "${script_path}/channels/share/airootfs.any"
840 copy_airootfs "${script_path}/channels/share/airootfs.${arch}"
841 copy_airootfs "${script_path}/channels/${channel_name}/airootfs.any"
842 copy_airootfs "${script_path}/channels/${channel_name}/airootfs.${arch}"
844 # Replace /etc/mkinitcpio.conf if Plymouth is enabled.
845 if [[ "${boot_splash}" = true ]]; then
846 cp "${script_path}/mkinitcpio/mkinitcpio-plymouth.conf" "${work_dir}/${arch}/airootfs/etc/mkinitcpio.conf"
849 # Code to use common pacman.conf in archiso.
850 # cp "${script_path}/pacman.conf" "${work_dir}/${arch}/airootfs/etc"
851 # cp "${build_pacman_conf}" "${work_dir}/${arch}/airootfs/etc"
853 # Get the optimal mirror list.
855 local mirrorlisturl_all
856 local mirrorlisturl_jp
861 mirrorlisturl_jp='https://www.archlinux.org/mirrorlist/?country=JP'
862 mirrorlisturl_all='https://www.archlinux.org/mirrorlist/?country=all'
865 mirrorlisturl_jp='https://archlinux32.org/mirrorlist/?country=jp'
866 mirrorlisturl_all='https://archlinux32.org/mirrorlist/?country=all'
870 if [[ "${japanese}" = true ]]; then
871 mirrorlisturl="${mirrorlisturl_jp}"
873 mirrorlisturl="${mirrorlisturl_all}"
875 curl -o "${work_dir}/${arch}/airootfs/etc/pacman.d/mirrorlist" "${mirrorlisturl}"
877 # Add install guide to /root (disabled)
878 # lynx -dump -nolist 'https://wiki.archlinux.org/index.php/Installation_Guide?action=render' >> ${work_dir}/${arch}/airootfs/root/install.txt
881 # customize_airootfs.sh options
882 # -b : Enable boot splash.
883 # -d : Enable debug mode.
884 # -i <inst_dir> : Set install dir
885 # -j : Enable Japanese.
886 # -k <kernel> : Set kernel name.
887 # -o <os name> : Set os name.
888 # -p <password> : Set password.
889 # -s <shell> : Set user shell.
890 # -t : Set plymouth theme.
891 # -u <username> : Set live user name.
892 # -x : Enable bash debug mode.
893 # -r : Enable rebuild.
896 # Generate options of customize_airootfs.sh.
897 local addition_options
900 if [[ ${boot_splash} = true ]]; then
901 if [[ -z ${theme_name} ]]; then
902 addition_options="${addition_options} -b"
904 addition_options="${addition_options} -b -t ${theme_name}"
907 if [[ ${debug} = true ]]; then
908 addition_options="${addition_options} -d"
910 if [[ ${bash_debug} = true ]]; then
911 addition_options="${addition_options} -x"
913 if [[ ${japanese} = true ]]; then
914 addition_options="${addition_options} -j"
916 if [[ ${rebuild} = true ]]; then
917 addition_options="${addition_options} -r"
920 share_options="-p '${password}' -k '${kernel}' -u '${username}' -o '${os_name}' -i '${install_dir}' -s '${usershell}' -a '${arch}'"
924 if [[ -f ${work_dir}/${arch}/airootfs/root/customize_airootfs.sh ]]; then
925 chmod 755 "${work_dir}/${arch}/airootfs/root/customize_airootfs.sh"
927 if [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs.sh" ]]; then
928 chmod 755 "${work_dir}/${arch}/airootfs/root/customize_airootfs.sh"
930 if [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh" ]]; then
931 chmod 755 "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh"
932 elif [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh" ]]; then
933 chmod 755 "${work_dir}/${arch}/airootfs/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh"
936 # Execute customize_airootfs.sh.
937 if [[ -z ${addition_options} ]]; then
938 ${mkalteriso} ${mkalteriso_option} \
939 -w "${work_dir}/${arch}" \
940 -C "${work_dir}/pacman-${arch}.conf" \
941 -D "${install_dir}" \
942 -r "/root/customize_airootfs.sh ${share_options}" \
944 if [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh" ]]; then
945 ${mkalteriso} ${mkalteriso_option} \
946 -w "${work_dir}/${arch}" \
947 -C "${work_dir}/pacman-${arch}.conf" \
948 -D "${install_dir}" \
949 -r "/root/customize_airootfs_${channel_name}.sh ${share_options}" \
951 elif [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh" ]]; then
952 ${mkalteriso} ${mkalteriso_option} \
953 -w "${work_dir}/${arch}" \
954 -C "${work_dir}/pacman-${arch}.conf" \
955 -D "${install_dir}" \
956 -r "/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh ${share_options}" \
960 ${mkalteriso} ${mkalteriso_option} \
961 -w "${work_dir}/${arch}" \
962 -C "${work_dir}/pacman-${arch}.conf" \
963 -D "${install_dir}" \
964 -r "/root/customize_airootfs.sh ${share_options} ${addition_options}" \
967 if [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh" ]]; then
968 ${mkalteriso} ${mkalteriso_option} \
969 -w "${work_dir}/${arch}" \
970 -C "${work_dir}/pacman-${arch}.conf" \
971 -D "${install_dir}" \
972 -r "/root/customize_airootfs_${channel_name}.sh ${share_options} ${addition_options}" \
974 elif [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh" ]]; then
975 ${mkalteriso} ${mkalteriso_option} \
976 -w "${work_dir}/${arch}" \
977 -C "${work_dir}/pacman-${arch}.conf" \
978 -D "${install_dir}" \
979 -r "/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh ${share_options} ${addition_options}" \
985 # Delete customize_airootfs.sh.
986 remove "${work_dir}/${arch}/airootfs/root/customize_airootfs.sh"
987 remove "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh"
990 # Copy mkinitcpio archiso hooks and build initramfs (airootfs)
991 make_setup_mkinitcpio() {
993 mkdir -p "${work_dir}/${arch}/airootfs/etc/initcpio/hooks"
994 mkdir -p "${work_dir}/${arch}/airootfs/etc/initcpio/install"
995 for _hook in "archiso" "archiso_shutdown" "archiso_pxe_common" "archiso_pxe_nbd" "archiso_pxe_http" "archiso_pxe_nfs" "archiso_loop_mnt"; do
996 cp "${script_path}/system/initcpio/hooks/${_hook}" "${work_dir}/${arch}/airootfs/etc/initcpio/hooks"
997 cp "${script_path}/system/initcpio/install/${_hook}" "${work_dir}/${arch}/airootfs/etc/initcpio/install"
999 sed -i "s|/usr/lib/initcpio/|/etc/initcpio/|g" "${work_dir}/${arch}/airootfs/etc/initcpio/install/archiso_shutdown"
1000 cp "${script_path}/system/initcpio/install/archiso_kms" "${work_dir}/${arch}/airootfs/etc/initcpio/install"
1001 cp "${script_path}/system/initcpio/archiso_shutdown" "${work_dir}/${arch}/airootfs/etc/initcpio"
1002 if [[ "${boot_splash}" = true ]]; then
1003 cp "${script_path}/mkinitcpio/mkinitcpio-archiso-plymouth.conf" "${work_dir}/${arch}/airootfs/etc/mkinitcpio-archiso.conf"
1005 cp "${script_path}/mkinitcpio/mkinitcpio-archiso.conf" "${work_dir}/${arch}/airootfs/etc/mkinitcpio-archiso.conf"
1008 if [[ "${gpg_key}" ]]; then
1009 gpg --export "${gpg_key}" >"${work_dir}/gpgkey"
1010 exec 17<>$"{work_dir}/gpgkey"
1013 if [[ ! ${kernel} = "core" ]]; then
1014 ARCHISO_GNUPG_FD=${gpg_key:+17} ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -r "mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux-${kernel} -g /boot/archiso.img" run
1016 ARCHISO_GNUPG_FD=${gpg_key:+17} ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img' run
1019 if [[ "${gpg_key}" ]]; then
1024 # Prepare kernel/initramfs ${install_dir}/boot/
1026 mkdir -p "${work_dir}/iso/${install_dir}/boot/${arch}"
1027 cp "${work_dir}/${arch}/airootfs/boot/archiso.img" "${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img"
1029 if [[ ! "${kernel}" = "core" ]]; then
1030 cp "${work_dir}/${arch}/airootfs/boot/vmlinuz-linux-${kernel}" "${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz-linux-${kernel}"
1032 cp "${work_dir}/${arch}/airootfs/boot/vmlinuz-linux" "${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz"
1036 # Add other aditional/extra files to ${install_dir}/boot/
1038 # In AlterLinux, memtest has been removed.
1039 # cp "${work_dir}/${arch}/airootfs/boot/memtest86+/memtest.bin" "${work_dir}/iso/${install_dir}/boot/memtest"
1040 # cp "${work_dir}/${arch}/airootfs/usr/share/licenses/common/GPL2/license.txt" "${work_dir}/iso/${install_dir}/boot/memtest.COPYING"
1041 cp "${work_dir}/${arch}/airootfs/boot/intel-ucode.img" "${work_dir}/iso/${install_dir}/boot/intel_ucode.img"
1042 cp "${work_dir}/${arch}/airootfs/usr/share/licenses/intel-ucode/LICENSE" "${work_dir}/iso/${install_dir}/boot/intel_ucode.LICENSE"
1043 cp "${work_dir}/${arch}/airootfs/boot/amd-ucode.img" "${work_dir}/iso/${install_dir}/boot/amd_ucode.img"
1044 cp "${work_dir}/${arch}/airootfs/usr/share/licenses/amd-ucode/LICENSE" "${work_dir}/iso/${install_dir}/boot/amd_ucode.LICENSE"
1047 # Prepare /${install_dir}/boot/syslinux
1049 if [[ ! ${kernel} = "core" ]]; then
1050 _uname_r="$(file -b ${work_dir}/${arch}/airootfs/boot/vmlinuz-linux-${kernel} | awk 'f{print;f=0} /version/{f=1}' RS=' ')"
1052 _uname_r="$(file -b ${work_dir}/${arch}/airootfs/boot/vmlinuz-linux | awk 'f{print;f=0} /version/{f=1}' RS=' ')"
1054 mkdir -p "${work_dir}/iso/${install_dir}/boot/syslinux"
1056 for _cfg in ${script_path}/syslinux/${arch}/*.cfg; do
1057 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1058 s|%OS_NAME%|${os_name}|g;
1059 s|%INSTALL_DIR%|${install_dir}|g" "${_cfg}" > "${work_dir}/iso/${install_dir}/boot/syslinux/${_cfg##*/}"
1062 if [[ ${boot_splash} = true ]]; then
1063 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1064 s|%OS_NAME%|${os_name}|g;
1065 s|%INSTALL_DIR%|${install_dir}|g" \
1066 "${script_path}/syslinux/${arch}/pxe-plymouth/archiso_pxe-${kernel}.cfg" > "${work_dir}/iso/${install_dir}/boot/syslinux/archiso_pxe.cfg"
1068 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1069 s|%OS_NAME%|${os_name}|g;
1070 s|%INSTALL_DIR%|${install_dir}|g" \
1071 "${script_path}/syslinux/${arch}/sys-plymouth/archiso_sys-${kernel}.cfg" > "${work_dir}/iso/${install_dir}/boot/syslinux/archiso_sys.cfg"
1073 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1074 s|%OS_NAME%|${os_name}|g;
1075 s|%INSTALL_DIR%|${install_dir}|g" \
1076 "${script_path}/syslinux/${arch}/pxe/archiso_pxe-${kernel}.cfg" > "${work_dir}/iso/${install_dir}/boot/syslinux/archiso_pxe.cfg"
1078 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1079 s|%OS_NAME%|${os_name}|g;
1080 s|%INSTALL_DIR%|${install_dir}|g" \
1081 "${script_path}/syslinux/${arch}/sys/archiso_sys-${kernel}.cfg" > "${work_dir}/iso/${install_dir}/boot/syslinux/archiso_sys.cfg"
1084 if [[ -f "${script_path}/channels/${channel_name}/splash.png" ]]; then
1085 cp "${script_path}/channels/${channel_name}/splash.png" "${work_dir}/iso/${install_dir}/boot/syslinux"
1087 cp "${script_path}/syslinux/${arch}/splash.png" "${work_dir}/iso/${install_dir}/boot/syslinux"
1089 cp "${work_dir}"/${arch}/airootfs/usr/lib/syslinux/bios/*.c32 "${work_dir}/iso/${install_dir}/boot/syslinux"
1090 cp "${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/lpxelinux.0" "${work_dir}/iso/${install_dir}/boot/syslinux"
1091 cp "${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/memdisk" "${work_dir}/iso/${install_dir}/boot/syslinux"
1092 mkdir -p "${work_dir}/iso/${install_dir}/boot/syslinux/hdt"
1093 gzip -c -9 "${work_dir}/${arch}/airootfs/usr/share/hwdata/pci.ids" > "${work_dir}/iso/${install_dir}/boot/syslinux/hdt/pciids.gz"
1094 gzip -c -9 "${work_dir}/${arch}/airootfs/usr/lib/modules/${_uname_r}/modules.alias" > "${work_dir}/iso/${install_dir}/boot/syslinux/hdt/modalias.gz"
1099 mkdir -p "${work_dir}/iso/isolinux"
1101 sed "s|%INSTALL_DIR%|${install_dir}|g" \
1102 "${script_path}/system/isolinux.cfg" > "${work_dir}/iso/isolinux/isolinux.cfg"
1103 cp "${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isolinux.bin" "${work_dir}/iso/isolinux/"
1104 cp "${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isohdpfx.bin" "${work_dir}/iso/isolinux/"
1105 cp "${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/ldlinux.c32" "${work_dir}/iso/isolinux/"
1110 mkdir -p "${work_dir}/iso/EFI/boot"
1111 cp "${work_dir}/${arch}/airootfs/usr/share/efitools/efi/HashTool.efi" "${work_dir}/iso/EFI/boot/"
1112 if [[ "${arch}" = "x86_64" ]]; then
1113 cp "${work_dir}/${arch}/airootfs/usr/share/efitools/efi/PreLoader.efi" "${work_dir}/iso/EFI/boot/bootx64.efi"
1114 cp "${work_dir}/${arch}/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi" "${work_dir}/iso/EFI/boot/loader.efi"
1117 mkdir -p "${work_dir}/iso/loader/entries"
1118 cp "${script_path}/efiboot/loader/loader.conf" "${work_dir}/iso/loader/"
1119 cp "${script_path}/efiboot/loader/entries/uefi-shell-x86_64.conf" "${work_dir}/iso/loader/entries/"
1120 cp "${script_path}/efiboot/loader/entries/uefi-shell-full-x86_64.conf" "${work_dir}/iso/loader/entries/"
1122 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1123 s|%OS_NAME%|${os_name}|g;
1124 s|%INSTALL_DIR%|${install_dir}|g" \
1125 "${script_path}/efiboot/loader/entries/usb/archiso-x86_64-usb-${kernel}.conf" > "${work_dir}/iso/loader/entries/archiso-x86_64.conf"
1127 # edk2-shell based UEFI shell
1128 cp /usr/share/edk2-shell/x64/Shell.efi ${work_dir}/iso/EFI/Shell_x64.efi
1129 cp /usr/share/edk2-shell/x64/Shell_Full.efi ${work_dir}/iso/EFI/Shell_Full_x64.efi
1132 # Prepare efiboot.img::/EFI for "El Torito" EFI boot mode
1134 mkdir -p "${work_dir}/iso/EFI/archiso"
1135 truncate -s 64M "${work_dir}/iso/EFI/archiso/efiboot.img"
1136 mkfs.fat -n ARCHISO_EFI "${work_dir}/iso/EFI/archiso/efiboot.img"
1138 mkdir -p "${work_dir}/efiboot"
1139 mount "${work_dir}/iso/EFI/archiso/efiboot.img" "${work_dir}/efiboot"
1141 mkdir -p "${work_dir}/efiboot/EFI/archiso"
1143 if [[ ! ${kernel} = "core" ]]; then
1144 cp "${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz-linux-${kernel}" "${work_dir}/efiboot/EFI/archiso/vmlinuz-linux-${kernel}.efi"
1146 cp "${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz" "${work_dir}/efiboot/EFI/archiso/vmlinuz.efi"
1149 cp "${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img" "${work_dir}/efiboot/EFI/archiso/archiso.img"
1151 cp "${work_dir}/iso/${install_dir}/boot/intel_ucode.img" "${work_dir}/efiboot/EFI/archiso/intel_ucode.img"
1152 cp "${work_dir}/iso/${install_dir}/boot/amd_ucode.img" "${work_dir}/efiboot/EFI/archiso/amd_ucode.img"
1154 mkdir -p "${work_dir}/efiboot/EFI/boot"
1155 cp "${work_dir}/${arch}/airootfs/usr/share/efitools/efi/HashTool.efi" "${work_dir}/efiboot/EFI/boot/"
1157 if [[ "${arch}" = "x86_64" ]]; then
1158 cp "${work_dir}/${arch}/airootfs/usr/share/efitools/efi/PreLoader.efi" "${work_dir}/efiboot/EFI/boot/bootx64.efi"
1159 cp "${work_dir}/${arch}/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi" "${work_dir}/efiboot/EFI/boot/loader.efi"
1162 mkdir -p "${work_dir}/efiboot/loader/entries"
1163 cp "${script_path}/efiboot/loader/loader.conf" "${work_dir}/efiboot/loader/"
1164 cp "${script_path}/efiboot/loader/entries/uefi-shell-x86_64.conf" "${work_dir}/efiboot/loader/entries/"
1165 cp "${script_path}/efiboot/loader/entries/uefi-shell-full-x86_64.conf" "${work_dir}/efiboot/loader/entries/"
1168 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
1169 s|%OS_NAME%|${os_name}|g;
1170 s|%INSTALL_DIR%|${install_dir}|g" \
1171 "${script_path}/efiboot/loader/entries/cd/archiso-x86_64-cd-${kernel}.conf" > "${work_dir}/efiboot/loader/entries/archiso-x86_64.conf"
1173 cp "${work_dir}/iso/EFI/Shell_x64.efi" "${work_dir}/efiboot/EFI/"
1174 cp "${work_dir}/iso/EFI/Shell_Full_x64.efi" "${work_dir}/efiboot/EFI/"
1176 umount -d "${work_dir}/efiboot"
1179 # Build airootfs filesystem image
1181 cp -a -l -f "${work_dir}/${arch}/airootfs" "${work_dir}"
1182 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}" -D "${install_dir}" pkglist
1183 pacman -Q --sysroot "${work_dir}/airootfs" > "${work_dir}/packages-full.list"
1184 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} -c "${sfs_comp}" -t "${sfs_comp_opt}" prepare
1185 remove "${work_dir}/airootfs"
1187 if [[ "${cleaning}" = true ]]; then
1188 remove "${work_dir}/${arch}/airootfs"
1194 ${mkalteriso} ${mkalteriso_option} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" -A "${iso_application}" -o "${out_dir}" iso "${iso_filename}"
1195 _msg_info "The password for the live user and root is ${password}."
1201 _opt_short="a:bc:dg:hjk:lo:p:t:u:w:x"
1202 _opt_long="arch:,boot-splash,comp-type:,debug,gpgkey:,help,japanese,kernel:,cleaning,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod"
1203 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
1204 if [[ ${?} != 0 ]]; then
1208 eval set -- "${OPT}"
1226 "gzip" | "lzma" | "lzo" | "lz4" | "xz" | "zstd") sfs_comp="${2}" ;;
1227 *) _msg_error "Invaild compressors '${2}'" '1' ;;
1248 if [[ -n $(cat ${script_path}/system/kernel_list-${arch} | grep -h -v ^'#' | grep -x "${2}") ]]; then
1251 _msg_error "Invalid kernel ${2}" "1"
1272 customized_username=true
1273 username="$(echo -n "${2}" | sed 's/ //g' |tr '[A-Z]' '[a-z]')"
1298 if [[ -d "${script_path}/.git" ]]; then
1301 _msg_error "There is no git directory. You need to use git clone to use this feature." "1"
1322 _msg_error "Invalid argument '${1}'"
1330 if [[ ${EUID} -ne 0 ]]; then
1331 _msg_warn "This script must be run as root." >&2
1332 # echo "Use -h to display script details." >&2
1334 _msg_warn "Re-run 'sudo ${0} ${options}'"
1335 sudo ${0} ${options}
1340 # Show alteriso version
1341 if [[ -d "${script_path}/.git" ]]; then
1343 _msg_debug "The version of alteriso is $(git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')."
1344 cd - > /dev/null 2>&1
1348 # Show config message
1349 [[ -f "${defaultconfig}" ]] && _msg_debug "The settings have been overwritten by the ${defaultconfig}"
1353 mkalteriso_option="-a ${arch} -v"
1354 if [[ "${bash_debug}" = true ]]; then
1357 mkalteriso_option="${mkalteriso_option} -x"
1361 # Pacman configuration file used only when building
1362 build_pacman_conf=${script_path}/system/pacman-${arch}.conf
1364 # Set rebuild config file
1365 rebuildfile="${work_dir}/build_options"
1370 if [[ -n "${1}" ]]; then
1374 # check_channel <channel name>
1379 for i in $(ls -l "${script_path}"/channels/ | awk '$1 ~ /d/ {print $9 }'); do
1380 if [[ -n $(ls "${script_path}"/channels/${i}) ]]; then
1381 if [[ ! ${i} = "share" ]]; then
1382 if [[ ! $(echo "${i}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
1383 if [[ ! -d "${script_path}/channels/${i}.add" ]]; then
1384 channel_list="${channel_list[@]} ${i}"
1387 channel_list="${channel_list[@]} ${i}"
1392 for i in ${channel_list[@]}; do
1393 if [[ $(echo "${i}" | sed 's/^.*\.\([^\.]*\)$/\1/') = "add" ]]; then
1394 if [[ $(echo ${i} | sed 's/\.[^\.]*$//') = ${1} ]]; then
1399 if [[ ${i} = ${1} ]]; then
1405 if [[ "${channel_name}" = "rebuild" ]] || [[ "${channel_name}" = "clean" ]]; then
1414 if [[ $(check_channel "${channel_name}") = false ]]; then
1415 _msg_error "Invalid channel ${channel_name}" "1"
1418 if [[ -d "${script_path}"/channels/${channel_name}.add ]]; then
1419 channel_name="${channel_name}.add"
1420 elif [[ "${channel_name}" = "rebuild" ]]; then
1421 if [[ -f "${rebuildfile}" ]]; then
1424 _msg_error "The previous build information is not in the working directory." "1"
1426 elif [[ "${channel_name}" = "clean" ]]; then
1428 rm -rf "${work_dir}"
1432 _msg_debug "channel path is ${script_path}/channels/${channel_name}"
1435 # Check architecture and kernel for each channel
1436 if [[ ! "${channel_name}" = "rebuild" ]]; then
1438 if [[ -z $(cat "${script_path}/channels/${channel_name}/architecture" | grep -h -v ^'#' | grep -x "${arch}") ]]; then
1439 _msg_error "${channel_name} channel does not support current architecture (${arch})." "1"
1443 if [[ -f "${script_path}/channels/${channel_name}/kernel_list-${arch}" ]]; then
1444 if [[ -z $(cat "${script_path}/channels/${channel_name}/kernel_list-${arch}" | grep -h -v ^'#' | grep -x "${kernel}") ]]; then
1445 _msg_error "This kernel is currently not supported on this channel." "1"
1451 # Check the value of a variable that can only be set to true or false.
1454 _value="$(eval echo '$'${1})"
1455 _msg_debug -n "Checking ${1}..."
1456 if [[ "${debug}" = true ]]; then
1457 echo -e " ${_value}"
1459 if [[ ! -v "${1}" ]]; then
1460 echo; _msg_error "The variable name ${1} is empty." "1"
1461 elif [[ ! "${_value}" = "true" ]] && [[ ! "${_value}" = "false" ]]; then
1462 echo; _msg_error "The variable name ${1} is not of bool type." "1"
1466 if [[ "${debug}" = true ]]; then
1469 check_bool boot_splash
1471 check_bool bash_debug
1475 check_bool noconfirm
1478 check_bool shmkalteriso
1480 check_bool customized_username
1481 check_bool noloopmod
1484 if [[ "${debug}" = true ]]; then
1492 run_once make_pacman_conf
1493 run_once make_basefs
1494 run_once make_packages
1495 run_once make_customize_airootfs
1496 run_once make_setup_mkinitcpio
1498 run_once make_boot_extra
1499 run_once make_syslinux
1500 run_once make_isolinux
1502 run_once make_efiboot
1503 run_once make_prepare
1506 if [[ ${cleaning} = true ]]; then