summaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-21 22:09:14 +0000
committerRoy Marples <roy@marples.name>2020-01-21 22:09:14 +0000
commitb2888271d79d39d972db7746f5d4ecdcf1372586 (patch)
treefbcd58ce9f268aa0ab1bde7d1cb7317a97a2aa6d /hooks
parenta6178d6a904eff4e5fcb4cef268045e9c4e9d918 (diff)
downloaddhcpcd-b2888271d79d39d972db7746f5d4ecdcf1372586.tar.xz
Linux: setup mounts in chroot
This allows dhcpcd to work. udev sadly requires /run/udev as well, so heh ho.
Diffstat (limited to 'hooks')
-rw-r--r--hooks/00-linux11
1 files changed, 11 insertions, 0 deletions
diff --git a/hooks/00-linux b/hooks/00-linux
new file mode 100644
index 00000000..b3bf1f50
--- /dev/null
+++ b/hooks/00-linux
@@ -0,0 +1,11 @@
+# setup chroot mounts
+
+if [ "$reason" = CHROOT ] && [ -n "$chroot" ]; then
+ for d in /dev /proc /sys /run/udev; do
+ [ -d "$d" ] || continue
+ if ! mountpoint -q "$chroot$d"; then
+ mkdir -p "$chroot$d"
+ mount --bind $d "$chroot$d"
+ fi
+ done
+fi