From 66d830a55fa6c34a8f115950a277dee65eacd1b4 Mon Sep 17 00:00:00 2001 From: Theo BERTIN Date: Fri, 11 Feb 2022 09:41:02 +0100 Subject: [PATCH 1/2] CLONE.SH::ADDED:: update fstab paths with new jail path --- usr/local/share/bastille/clone.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 12509cc..69df00d 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -139,6 +139,8 @@ update_fstab() { sed -i '' "s|${FSTAB_CURRENT}|${FSTAB_NEWCONF}|" "${FSTAB_CONFIG}" fi fi + # Update additional fstab paths with new jail path + sed -i '' "s|${bastille_jailsdir}/${TARGET}/root/|${bastille_jailsdir}/${NEWNAME}/root/|" "${FSTAB_CONFIG}" fi } From 6ca0369072b214b2f653e2bd7ca8c6d8c59a2bda Mon Sep 17 00:00:00 2001 From: Theo BERTIN Date: Fri, 11 Feb 2022 10:16:59 +0100 Subject: [PATCH 2/2] CLONE.SH::ADDED:: Complete FSTAB_RELEASE grep from fstab to get all release names some release names (such as 14.0-CURRENT) were not correctly extracted from the fstab during fstab modification --- usr/local/share/bastille/clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 69df00d..0e8fb4d 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -130,7 +130,7 @@ update_fstab() { # Update fstab to use the new name FSTAB_CONFIG="${bastille_jailsdir}/${NEWNAME}/fstab" if [ -f "${FSTAB_CONFIG}" ]; then - FSTAB_RELEASE=$(grep -owE '([1-9]{2,2})\.[0-9](-RELEASE|-RELEASE-i386|-RC[1-2])|([0-9]{1,2}-stable-build-[0-9]{1,3})|(current-build)-([0-9]{1,3})|(current-BUILD-LATEST)|([0-9]{1,2}-stable-BUILD-LATEST)' "${FSTAB_CONFIG}" | uniq) + FSTAB_RELEASE=$(grep -owE '([1-9]{2,2})\.[0-9](-RELEASE|-RELEASE-i386|-RC[1-5]|-BETA[1-5]|-CURRENT)|([0-9]{1,2}(-stable-build-[0-9]{1,3}|-stable-LAST))|(current-build)-([0-9]{1,3})|(current-BUILD-LATEST)|([0-9]{1,2}-stable-BUILD-LATEST)' "${FSTAB_CONFIG}" | uniq) FSTAB_CURRENT=$(grep -w ".*/releases/.*/jails/${TARGET}/root/.bastille" "${FSTAB_CONFIG}") FSTAB_NEWCONF="${bastille_releasesdir}/${FSTAB_RELEASE} ${bastille_jailsdir}/${NEWNAME}/root/.bastille nullfs ro 0 0" if [ -n "${FSTAB_CURRENT}" ] && [ -n "${FSTAB_NEWCONF}" ]; then