mirror of https://github.com/archzfs/archzfs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
9 years ago
|
# Requires the pacman cache and pacman package repos be mounted via NFS
|
||
|
test_pacman_config() {
|
||
|
# $1 arch-chroot target directory
|
||
|
arch_target_dir=""
|
||
|
arch_packages="${test_archiso_packages}"
|
||
|
if [[ -n $1 ]]; then
|
||
|
arch_target_dir="${1}"
|
||
|
arch_chroot="/usr/bin/arch-chroot ${1}"
|
||
|
fi
|
||
|
|
||
|
msg "Installing archzfs repo into chroot"
|
||
|
printf "\n%s\n%s\n" "[${test_archzfs_repo_name}]" "Server = file:///repo/\$repo/\$arch" >> ${arch_target_dir}/etc/pacman.conf
|
||
|
|
||
|
msg2 "Setting up gnupg"
|
||
|
run_cmd "${arch_chroot} dirmngr < /dev/null"
|
||
|
|
||
|
msg2 "Installing the signer key"
|
||
|
run_cmd "${arch_chroot} pacman-key -r 0EE7A126"
|
||
9 years ago
|
if [[ ${run_cmd_return} -ne 0 ]]; then
|
||
9 years ago
|
exit 1
|
||
|
fi
|
||
|
run_cmd "${arch_chroot} pacman-key --lsign-key 0EE7A126"
|
||
9 years ago
|
if [[ ${run_cmd_return} -ne 0 ]]; then
|
||
|
exit 1
|
||
|
fi
|
||
9 years ago
|
|
||
|
|
||
|
if [[ ! -n $1 ]]; then
|
||
|
# Install the required packages in the image
|
||
9 years ago
|
msg2 "Installing test packages"
|
||
9 years ago
|
run_cmd "${arch_chroot} pacman -Sy --noconfirm ${arch_packages}"
|
||
9 years ago
|
if [[ ${run_cmd_return} -ne 0 ]]; then
|
||
9 years ago
|
exit 1
|
||
|
fi
|
||
|
msg2 "Loading zfs modules"
|
||
|
run_cmd "modprobe zfs"
|
||
9 years ago
|
if [[ ${run_cmd_return} -ne 0 ]]; then
|
||
|
exit 1
|
||
|
fi
|
||
9 years ago
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
test_pacman_pacstrap() {
|
||
|
msg "bootstrapping the base installation"
|
||
9 years ago
|
run_cmd "/usr/bin/pacstrap -c '${test_target_dir}/ROOT' base base-devel ${test_chroot_packages}"
|
||
|
if [[ ${run_cmd_return} -ne 0 ]]; then
|
||
|
exit 1
|
||
|
fi
|
||
9 years ago
|
}
|