Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (0b5d93471824c623d463d478601e173c5ade544b)

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 master cauldron by Justin Boffemmyer (0b5d93471824c623d463d478601e173c5ade544b)
  • Date: Thu, 7 Feb 2008 12:45:35 -0600

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

iso/usr/share/smgl.install/smgl-chroot | 67
+++++++++++++++++++++++++++++++++
1 files changed, 67 insertions(+)

New commits:
commit 0b5d93471824c623d463d478601e173c5ade544b
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

smgl-chroot: new file, eases setup of chroot env

A simple script that helps automate the setting up of a proper chroot
environment for the installation process. By default it echo's what it
is doing, but it can also run silently when passed the '-q' option.
This will help to greatly simplify the setup procedures for e.g.
bootloaders and changing the root passwd.

diff --git a/iso/usr/share/smgl.install/smgl-chroot
b/iso/usr/share/smgl.install/smgl-chroot
new file mode 100755
index 0000000..ae72ecc
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-chroot
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+QUIET=
+rc=
+
+if [[ $# -gt 0 ]]
+then
+ while getopts "q" Option
+ do
+ case $Option in
+ q ) QUIET=1
+ esac
+ done
+ shift $(($OPTIND - 1))
+fi
+
+if [[ $QUIET = 1 ]]
+then
+ mount --bind /dev /mnt/root/dev && \
+ mount --bind /dev/pts /mnt/root/dev/pts && \
+ mount --bind /proc /mnt/root/proc
+else
+ echo "mount --bind /dev /mnt/root/dev" && \
+ mount --bind /dev /mnt/root/dev && \
+ echo "mount --bind /dev /mnt/root/dev" && \
+ mount --bind /dev/pts /mnt/root/dev/pts && \
+ echo "mount --bind /dev /mnt/root/dev" && \
+ mount --bind /proc /mnt/root/proc
+fi
+
+rc=$?
+
+if [[ $rc -gt 0 ]]
+then
+ exit $rc
+fi
+
+if [[ $QUIET = 1 ]]
+then
+ chroot /mnt/root /bin/bash -l
+else
+ echo "Entering chroot..."
+ chroot /mnt/root /bin/bash -l
+fi
+
+if [[ $rc -gt 0 ]]
+then
+ exit $rc
+fi
+
+if [[ $QUIET = 1 ]]
+then
+ umount /mnt/root/proc && \
+ umount /mnt/root/dev/pts && \
+ umount /mnt/root/dev
+else
+ echo "Unmounting /mnt/root/proc" && \
+ umount /mnt/root/proc && \
+ echo "Unmounting /mnt/root/dev/pts" && \
+ umount /mnt/root/dev/pts && \
+ echo "Unmounting /mnt/root/dev" && \
+ umount /mnt/root/dev
+fi
+
+exit $rc
+
+# vim:sw=2:ts=2:softtabstop=2:expandtab:ai




Archive powered by MHonArc 2.6.24.

Top of Page