summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-06-19 17:31:16 -0400
committerAndrew Cady <d@jerkface.net>2023-06-19 17:31:16 -0400
commit041fde012385cd83876573edd97e30d25f4fb893 (patch)
tree0fea9ee2f0e92ae2d8c83a66e245ed9f05eb6a25
parent9c1bd9b72a3167dd988bba9a51d381394ef3cd05 (diff)
selfstrap: bind mount /etc/resolv.conf in chroot
-rwxr-xr-xselfstrap3
1 files changed, 3 insertions, 0 deletions
diff --git a/selfstrap b/selfstrap
index 3521bb2..4aa6ef9 100755
--- a/selfstrap
+++ b/selfstrap
@@ -181,6 +181,8 @@ prepare_chroot()
181 mountpoint -q "$TARGET"/proc || mount -t proc proc "$TARGET"/proc 181 mountpoint -q "$TARGET"/proc || mount -t proc proc "$TARGET"/proc
182 mountpoint -q "$TARGET"/sys || mount -t sysfs sysfs "$TARGET"/sys 182 mountpoint -q "$TARGET"/sys || mount -t sysfs sysfs "$TARGET"/sys
183 mountpoint -q "$TARGET"/dev || mount --bind /dev "$TARGET"/dev 183 mountpoint -q "$TARGET"/dev || mount --bind /dev "$TARGET"/dev
184 [ -e "$TARGET"/etc/resolv.conf ] || touch "$TARGET"/etc/resolv.conf
185 mountpoint -q "$TARGET"/etc/resolv.conf || mount --bind /etc/resolv.conf "$TARGET"/etc/resolv.conf
184} 186}
185 187
186cleanup_chroot() 188cleanup_chroot()
@@ -189,6 +191,7 @@ cleanup_chroot()
189 umount "$TARGET"/proc || fail=y 191 umount "$TARGET"/proc || fail=y
190 umount "$TARGET"/sys || fail=y 192 umount "$TARGET"/sys || fail=y
191 umount "$TARGET"/dev || fail=y 193 umount "$TARGET"/dev || fail=y
194 umount "$TARGET"/etc/resolv.conf || fail=y
192 [ ! "$fail" ] 195 [ ! "$fail" ]
193} 196}
194 197