summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2020-10-20 13:36:31 -0400
committerGordon GECOS <u@adam>2020-10-20 13:36:31 -0400
commit0715d83acfea3dd97c9eb1c2bd4be59777865499 (patch)
tree670e5d2e2a19a76a9ea04c891e28eac6e4656a1f
parent340f76d904f10b55e9bc66d1397b2b0a35d88b76 (diff)
make virtual fs available in chroot
-rwxr-xr-xselfstrap8
1 files changed, 6 insertions, 2 deletions
diff --git a/selfstrap b/selfstrap
index f5574f4..0535e42 100755
--- a/selfstrap
+++ b/selfstrap
@@ -151,7 +151,7 @@ install_devices()
151 idem ln -s /proc/self/fd/2 "$TARGET"/dev/stderr 151 idem ln -s /proc/self/fd/2 "$TARGET"/dev/stderr
152} 152}
153 153
154mount_virtfs() 154prepare_chroot()
155{ 155{
156 [ "$TARGET" ] || die 'no $TARGET' 156 [ "$TARGET" ] || die 'no $TARGET'
157 [ -d "$TARGET"/proc ] || mkdir "$TARGET"/proc 157 [ -d "$TARGET"/proc ] || mkdir "$TARGET"/proc
@@ -160,7 +160,7 @@ mount_virtfs()
160 mount -t sysfs sysfs "$TARGET"/sys 160 mount -t sysfs sysfs "$TARGET"/sys
161} 161}
162 162
163umount_virtfs() 163cleanup_chroot()
164{ 164{
165 [ "$TARGET" ] || die 'no $TARGET' 165 [ "$TARGET" ] || die 'no $TARGET'
166 umount "$TARGET"/proc || fail=y 166 umount "$TARGET"/proc || fail=y
@@ -312,7 +312,9 @@ dpkg_configure_from_apt_actions()
312 preinst=/var/lib/dpkg/info/${package}${multiarch}.preinst 312 preinst=/var/lib/dpkg/info/${package}${multiarch}.preinst
313 if [ -x "$TARGET"/"$preinst" ]; then 313 if [ -x "$TARGET"/"$preinst" ]; then
314 extract_tmp_ci "$deb" 314 extract_tmp_ci "$deb"
315 prepare_chroot "$TARGET"
315 verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$preinst" install 316 verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$preinst" install
317 cleanup_chroot "$TARGET"
316 remove_tmp_ci 318 remove_tmp_ci
317 fi 319 fi
318 ;; 320 ;;
@@ -321,7 +323,9 @@ dpkg_configure_from_apt_actions()
321 postinst=/var/lib/dpkg/info/${package}${multiarch}.postinst 323 postinst=/var/lib/dpkg/info/${package}${multiarch}.postinst
322 if [ -x "$TARGET"/"$postinst" ]; then 324 if [ -x "$TARGET"/"$postinst" ]; then
323 extract_tmp_ci "$deb" 325 extract_tmp_ci "$deb"
326 prepare_chroot "$TARGET"
324 verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$postinst" configure 327 verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$postinst" configure
328 cleanup_chroot "$TARGET"
325 remove_tmp_ci 329 remove_tmp_ci
326 fi 330 fi
327 ;; 331 ;;