summaryrefslogtreecommitdiffstats
path: root/hooks/00-linux
blob: f2a092130410750fe931dd59832be3a7460d73e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# setup chroot mounts

if [ "$reason" = CHROOT ] && [ -n "$chroot" ]; then
	# Special case /dev/log
	if [ -h /dev/log ]; then
		devlogdir=$(dirname $(readlink /dev/log))
	else
		devlogdir=
	fi
	for d in /dev /proc /sys /run/udev $devlogdir; do
		[ -d "$d" ] || continue
		if ! mountpoint -q "$chroot$d"; then
			mkdir -p "$chroot$d"
			mount --bind $d "$chroot$d"
		fi
	done
fi