78 lines
2.4 KiB
Bash
78 lines
2.4 KiB
Bash
--- src/share/poudriere/common.sh.orig 2024-04-24 15:38:18 UTC
|
|
+++ src/share/poudriere/common.sh
|
|
@@ -9468,12 +9468,16 @@ build_repo() {
|
|
}
|
|
|
|
build_repo() {
|
|
- local origin pkg_repo_list_files
|
|
+ local origin pkg_repo_list_files hashcmd
|
|
|
|
msg "Creating pkg repository"
|
|
if [ ${DRY_RUN} -eq 1 ]; then
|
|
return 0
|
|
fi
|
|
+ if [ ${PKG_HASH} != "no" ]; then
|
|
+ hashcmd="--hash --symlink"
|
|
+ PKG_REPO_FLAGS="${PKG_REPO_FLAGS:+${PKG_REPO_FLAGS} }$hashcmd"
|
|
+ fi
|
|
bset status "pkgrepo:"
|
|
ensure_pkg_installed force_extract || \
|
|
err 1 "Unable to extract pkg."
|
|
@@ -9493,12 +9497,20 @@ build_repo() {
|
|
install -m 0400 "${PKG_REPO_META_FILE}" \
|
|
"${MASTERMNT:?}/tmp/pkgmeta"
|
|
fi
|
|
+
|
|
+ # Remount rw
|
|
+ # mount_nullfs does not support mount -u
|
|
+ umount ${UMOUNT_NONBUSY} ${MASTERMNT}/packages || \
|
|
+ umount -f ${MASTERMNT}/packages
|
|
+ mount_packages
|
|
+
|
|
mkdir -p ${MASTERMNT}/tmp/packages
|
|
if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then
|
|
msg "Signing repository with key: ${PKG_REPO_SIGNING_KEY}"
|
|
install -m 0400 "${PKG_REPO_SIGNING_KEY}" \
|
|
"${MASTERMNT:?}/tmp/repo.key"
|
|
injail ${PKG_BIN:?} repo \
|
|
+ ${PKG_REPO_FLAGS} \
|
|
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \
|
|
-o /tmp/packages \
|
|
${PKG_META} \
|
|
@@ -9515,6 +9527,7 @@ build_repo() {
|
|
# using SSH with DNSSEC as older hosts don't support
|
|
# it.
|
|
${MASTERMNT:?}${PKG_BIN:?} repo \
|
|
+ ${PKG_REPO_FLAGS} \
|
|
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \
|
|
-o "${MASTERMNT:?}/tmp/packages" ${PKG_META_MASTERMNT} \
|
|
"${MASTERMNT:?}/packages" \
|
|
@@ -9527,6 +9540,7 @@ build_repo() {
|
|
;;
|
|
esac
|
|
JNETNAME="n" injail ${PKG_BIN:?} repo \
|
|
+ ${PKG_REPO_FLAGS} \
|
|
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \
|
|
-o /tmp/packages ${PKG_META} /packages \
|
|
${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} ||
|
|
@@ -9542,6 +9556,11 @@ build_repo() {
|
|
sign_pkg pubkey "${PACKAGES:?}/Latest/pkg.${PKG_EXT}"
|
|
fi
|
|
fi
|
|
+
|
|
+ # Remount ro
|
|
+ umount ${UMOUNT_NONBUSY} ${MASTERMNT}/packages || \
|
|
+ umount -f ${MASTERMNT}/packages
|
|
+ mount_packages -o ro
|
|
}
|
|
|
|
calculate_size_in_mb() {
|
|
@@ -10109,6 +10128,7 @@ esac
|
|
: ${FLAVOR_DEFAULT_ALL:=no}
|
|
: ${NULLFS_PATHS:="/rescue /usr/share /usr/tests /usr/lib32"}
|
|
: ${PACKAGE_FETCH_URL:="pkg+http://pkg.FreeBSD.org/\${ABI}"}
|
|
+: ${PKG_HASH:=no}
|
|
|
|
: ${POUDRIERE_TMPDIR:=$(command mktemp -dt poudriere)}
|
|
: ${SHASH_VAR_PATH_DEFAULT:=${POUDRIERE_TMPDIR}}
|