diff options
author | Andrew Cady <d@jerkface.net> | 2023-06-19 17:31:16 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2023-06-19 17:31:16 -0400 |
commit | 041fde012385cd83876573edd97e30d25f4fb893 (patch) | |
tree | 0fea9ee2f0e92ae2d8c83a66e245ed9f05eb6a25 | |
parent | 9c1bd9b72a3167dd988bba9a51d381394ef3cd05 (diff) |
selfstrap: bind mount /etc/resolv.conf in chroot
-rwxr-xr-x | selfstrap | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 | ||
186 | cleanup_chroot() | 188 | cleanup_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 | ||