Generate or copy a pacman.conf into the newroot's /tmp directory
This makes pacstrap more compatible with migrating from --root to --sysroot, since the pacman.conf will be required to come from the newroot itself.
This commit is contained in:
parent
e418a17468
commit
8f7fc3f5d7
12
pacstrap.in
12
pacstrap.in
@ -81,10 +81,6 @@ if (( ! interactive )); then
|
|||||||
pacman_args+=(--noconfirm)
|
pacman_args+=(--noconfirm)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $pacman_config ]]; then
|
|
||||||
pacman_args+=(--config="$pacman_config")
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
|
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
|
||||||
|
|
||||||
# create obligatory directories
|
# create obligatory directories
|
||||||
@ -96,8 +92,14 @@ mkdir -m 0555 -p "$newroot"/{sys,proc}
|
|||||||
# mount API filesystems
|
# mount API filesystems
|
||||||
chroot_setup "$newroot" || die "failed to setup chroot %s" "$newroot"
|
chroot_setup "$newroot" || die "failed to setup chroot %s" "$newroot"
|
||||||
|
|
||||||
|
if [[ $pacman_config ]]; then
|
||||||
|
pacman-conf --config "$pacman_config" "$newroot/tmp/pacman.conf"
|
||||||
|
else
|
||||||
|
pacman-conf > "$newroot/tmp/pacman.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
msg 'Installing packages to %s' "$newroot"
|
msg 'Installing packages to %s' "$newroot"
|
||||||
if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then
|
if ! pacman -r "$newroot" --config "$newroot"/tmp/pacman.conf -Sy "${pacman_args[@]}"; then
|
||||||
die 'Failed to install packages to new root'
|
die 'Failed to install packages to new root'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user