git: 504ac101ba28 - stable/13 - bsdinstall: allow an install script to access packages on the DVD
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 24 Jul 2022 15:40:43 UTC
The branch stable/13 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=504ac101ba2848d79bce3cd3011fea0438b881e2
commit 504ac101ba2848d79bce3cd3011fea0438b881e2
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2022-05-26 21:39:20 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2022-07-24 15:39:58 +0000
bsdinstall: allow an install script to access packages on the DVD
If installing from the DVD, mount its packages in the chroot at
/dist/packages. That way they'll be accessible to an install script.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D35330
(cherry picked from commit 6a02539959cb36c4777f962d3d7ef4a76fbe0c24)
---
usr.sbin/bsdinstall/scripts/mount | 6 ++++++
usr.sbin/bsdinstall/scripts/umount | 7 +++++++
2 files changed, 13 insertions(+)
diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount
index c7bc1aa5387d..244f11fa215d 100755
--- a/usr.sbin/bsdinstall/scripts/mount
+++ b/usr.sbin/bsdinstall/scripts/mount
@@ -53,3 +53,9 @@ done
# User might want a shell and require devfs, so mount it
mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null
mount -t devfs devfs $BSDINSTALL_CHROOT/dev
+
+# If installing from the DVD, mount packages where they'll be accessible
+if [ -d /packages ]; then
+ mkdir -p $BSDINSTALL_CHROOT/dist/packages
+ mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages
+fi
diff --git a/usr.sbin/bsdinstall/scripts/umount b/usr.sbin/bsdinstall/scripts/umount
index 3c33eff7e105..a5d96ffffd32 100755
--- a/usr.sbin/bsdinstall/scripts/umount
+++ b/usr.sbin/bsdinstall/scripts/umount
@@ -26,6 +26,13 @@
#
# $FreeBSD$
+# If we mounted the DVD packages, unmount them
+if [ -d $BSDINSTALL_CHROOT/dist/packages ]; then
+ umount $BSDINSTALL_CHROOT/dist/packages
+ rmdir $BSDINSTALL_CHROOT/dist/packages
+ rmdir $BSDINSTALL_CHROOT/dist
+fi
+
TMP_FSTAB=${TMPDIR:-"/tmp"}/bsdinstall-tmp-fstab
cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{