Re: /etc/localtime symlink in poudriere jails

From: Tatsuki Makino <tatsuki_makino_at_hotmail.com>
Date: Wed, 11 Dec 2024 09:45:51 UTC
Hello.

On 2024/12/11 17:28, Nuno Teixeira wrote:
> I'm trying to find why there is no /etc/localtime in poudriere jails and I
> need to create manually a symlink for some R-cran tests inside interactive
> jail.
> 
> Any hints on how to automatize this task?

Hook is considered to be the most suitable for this.
jail.sh will be the most suitable hook point for it.

However, I think it's quite difficult to make jail.sh hook without knowing what's inside poudriere.
Below is the part we will need for it.

case ${1} in
mount)
	case ${2} in
	${POUDRIERE_DATA}/.m/*/ref)
		# reference jail
		# I think /etc/localtime should be copied here.
		;;
	${POUDRIERE_DATA}/.m/*)
		# builder jail
		# A reference jail where /etc/localtime already exists should have been copied.
		;;
	*/jails/*)
		# master jail
		# The hook is fired, but it is better not to touch the contents of this path.
		;;
	*)
		# unknown condition
	esac
	;;
start)
	#
	;;
stop)
	# It can only be reached once.
	# The path cannot be determined.
esac

However, this is what I looked into around the time of poudriere-3.3.x, and it may be different now.
I'm not done cleaning up 12.4-STABLE yet, so that's it :)

Regards.