Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (997a37d7b680411b30b05f2f734d4199bfffa256)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (997a37d7b680411b30b05f2f734d4199bfffa256)
  • Date: Tue, 7 Oct 2008 12:09:12 -0500

GIT changes to test cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

iso/usr/share/smgl.install/smgl-chroot | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 997a37d7b680411b30b05f2f734d4199bfffa256
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

smgl-chroot: added selectable root path

You can now pass the root path (instead of forcing it to /mnt/root) as
the first argument to smgl-chroot. If there is no argument passed on
the command-line, then it defaults to /mnt/root. Thanks to Robert
Figura for this. Fixes bug #14662.

diff --git a/iso/usr/share/smgl.install/smgl-chroot
b/iso/usr/share/smgl.install/smgl-chroot
index 717fcd9..6744361 100755
--- a/iso/usr/share/smgl.install/smgl-chroot
+++ b/iso/usr/share/smgl.install/smgl-chroot
@@ -1,16 +1,25 @@
#!/bin/bash

+# Check if called with optional argument,
+# If yes then R00T=$1, else ROOT=/mnt/root
+ROOT=${"$1":-/mnt/root}
+
# Note: don't use --rbind: It creates several mounts, and we wouldn't be able
# to figure out easily what to umount.
-mount --bind /dev /mnt/root/dev &&
-mount --bind /dev/pts /mnt/root/dev/pts &&
-mount --bind /proc /mnt/root/proc &&
+mount --bind /dev "$ROOT"/dev &&
+mount --bind /dev/pts "$ROOT"/dev/pts &&
+mount --bind /proc "$ROOT"/proc &&
+
+# set the prompt for inside the chroot to reflect the fact that the user is
chrooted
export PS1="[inside chroot, type exit to return to installer]\n\u
\w\$ " &&
-chroot /mnt/root "$@"
+
+chroot "$ROOT" "$@"
rc=$?
-umount /mnt/root/proc
-umount /mnt/root/dev/pts
-umount /mnt/root/dev
+
+# clean up the chroot mounts
+umount "$ROOT"/proc
+umount "$ROOT"/dev/pts
+umount "$ROOT"/dev

exit $rc




  • [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (997a37d7b680411b30b05f2f734d4199bfffa256), Justin Boffemmyer, 10/07/2008

Archive powered by MHonArc 2.6.24.

Top of Page