make_packages_aur() {
local _pkg pkglist_aur
-
pkglist_aur=($("${script_path}/tools/pkglist.sh" --aur -a "x86_64" -k "${kernel}" -c "${channel_dir}" -l "${locale_name}"))
# Create a list of packages to be finally installed as packages.list directly under the working directory.
echo -e "\n\n# AUR packages.\n#\n\n" >> "${work_dir}/packages.list"
for _pkg in ${pkglist_aur[@]}; do echo ${_pkg} >> "${work_dir}/packages.list"; done
- # Build aur packages on airootfs
- for _file in "aur_prepare" "aur_remove"; do
- cp -r "${script_path}/system/aur_scripts/${_file}.sh" "${airootfs_dir}/root/${_file}.sh"
- chmod 755 "${airootfs_dir}/root/${_file}.sh"
- done
-
- local _aur_packages_ls_str=""
- for _pkg in ${_pkglist[@]}; do
- _aur_packages_ls_str="${_aur_packages_ls_str} ${_pkg}"
- done
+ # prepare for yay
+ cp -r "${script_path}/system//aur_prepare.sh" "${airootfs_dir}/root/aur_prepare.sh"
+ chmod 755 "${airootfs_dir}/root/aur_prepare.sh"
cp -rf "/etc/pacman.d/gnupg/" "${airootfs_dir}/etc/pacman.d/gnupg/"
- #cp -f "/etc/resolv.conf" "${airootfs_dir}/etc/resolv.conf"
- cp -f "${work_dir}/pacman-${arch}.conf" "${airootfs_dir}/etc/pacman.conf"
- # Create user to build AUR
+ cp -f "${work_dir}/pacman-${arch}.conf" "${airootfs_dir}/etc/alteriso-pacman.conf"
+
+ # Run aur script
${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -D "${install_dir}" -r "/root/aur_prepare.sh ${pkglist_aur[*]}" run
- rm -rf "${airootfs_dir}/etc/pacman.d/gnupg/"
- #rm -rf "${airootfs_dir}/etc/resolv.conf"
- rm -rf "${airootfs_dir}/etc/pacman.conf"
- # Remove the user created for the build.
- ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -D "${install_dir}" -r "/root/aur_remove.sh" run
-
- # Remove scripts
- remove "${airootfs_dir}/root/"{"aur_prepare","aur_remove"}".sh"
+
+ # Remove script
+ remove "${airootfs_dir}/root/aur_prepare.sh"
}
# Customize installation (airootfs)
# Build and install
chmod +s /usr/bin/sudo
-sudo -u aurbuild yay -Sy --nocleanmenu --nodiffmenu --noeditmenu --noupgrademenu --noprovides ${*}
\ No newline at end of file
+sudo -u aurbuild yay -Sy --nocleanmenu --nodiffmenu --noeditmenu --noupgrademenu --noprovides --config "/etc/alteriso-pacman.conf" ${*}
+
+
+# remove user and file
+userdel aurbuild
+remove /aurbuild_temp
+remove /etc/sudoers.d/aurbuild
+remove "/etc/pacman.d/gnupg/"
+remove "/etc/alteriso-pacman.conf"
+++ /dev/null
-#!/usr/bin/env bash
-#
-# Yamada Hayao
-# Twitter: @Hayao0819
-# Email : hayao@fascode.net
-#
-# (c) 2019-2020 Fascode Network.
-#
-set -e -u
-
-# Delete file only if file exists
-# remove <file1> <file2> ...
-function remove () {
- local _list
- local _file
- _list=($(echo "$@"))
- for _file in "${_list[@]}"; do
- if [[ -f ${_file} ]]; then
- rm -f "${_file}"
- elif [[ -d ${_file} ]]; then
- rm -rf "${_file}"
- fi
- echo "${_file} was deleted."
- done
-}
-
-
-
-# remove user and file
-userdel aurbuild
-remove /aurbuild_temp
-remove /etc/sudoers.d/aurbuild