Verified Commit 3d6651ab authored by nl6720's avatar nl6720
Browse files

archiso/mkarchiso: clear environment variables when chrooting

Environment variables can interfere with the commands in chroot.
This causes issues when the environment variables specify a path that does not exist inside the chroot, e.g. if TMPDIR is set to a custom value.

Fixes .
parent 0bc62940
......@@ -324,13 +324,12 @@ _make_packages() {
if [[ -n "${gpg_key}" ]]; then
exec {ARCHISO_GNUPG_FD}<>"${work_dir}/pubkey.gpg"
if [[ "${quiet}" = "y" ]]; then
pacstrap -C "${work_dir}/${buildmode}.pacman.conf" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}" &> /dev/null
env -i "ARCHISO_GNUPG_FD=${ARCHISO_GNUPG_FD}" pacstrap -C "${work_dir}/${buildmode}.pacman.conf" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}" &> /dev/null
pacstrap -C "${work_dir}/${buildmode}.pacman.conf" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}"
env -i "ARCHISO_GNUPG_FD=${ARCHISO_GNUPG_FD}" pacstrap -C "${work_dir}/${buildmode}.pacman.conf" -c -G -M -- "${pacstrap_dir}" "${buildmode_pkg_list[@]}"
if [[ -n "${gpg_key}" ]]; then
......@@ -372,7 +371,7 @@ _make_customize_airootfs() {
_msg_info "Running in '${pacstrap_dir}' chroot..."
_msg_warning " is deprecated! Support for it will be removed in a future archiso version."
chmod -f -- +x "${pacstrap_dir}/root/"
eval -- arch-chroot "${pacstrap_dir}" "/root/"
eval -- env -i arch-chroot "${pacstrap_dir}" "/root/"
rm -- "${pacstrap_dir}/root/"
_msg_info "Done! run successfully."
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment