aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/contrib/chimera/cleanDebianChroot.sh16
-rwxr-xr-xscripts/contrib/chimera/goDebianChroot.sh23
-rwxr-xr-xscripts/contrib/chimera/makeDebianChroot.sh31
3 files changed, 70 insertions, 0 deletions
diff --git a/scripts/contrib/chimera/cleanDebianChroot.sh b/scripts/contrib/chimera/cleanDebianChroot.sh
new file mode 100755
index 00000000000..1391eea1b43
--- /dev/null
+++ b/scripts/contrib/chimera/cleanDebianChroot.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+CHROOT=debian-8
+
+function umountIt {
+ mDir=$1
+ if mount|grep ${CHROOT} |grep -q ${mDir} ;then
+ echo " unmounting ${CHROOT}/${mDir} "
+ umount /${CHROOT}/${mDir}
+ fi
+}
+
+umountIt proc
+umountIt dev
+umountIt sys
+umountIt tmp
diff --git a/scripts/contrib/chimera/goDebianChroot.sh b/scripts/contrib/chimera/goDebianChroot.sh
new file mode 100755
index 00000000000..039404f4ba2
--- /dev/null
+++ b/scripts/contrib/chimera/goDebianChroot.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+CHROOT=debian-8
+
+function mountOrDie {
+ mDir=$1
+ if mount|grep ${CHROOT} |grep -q ${mDir} ;then
+ echo " ${mDir} mounted already, exiting..."
+ exit
+ else
+ echo "not mounted so mounting ${mDir}"
+ mount -o bind /${mDir} /${CHROOT}/${mDir}
+ fi
+}
+
+mountOrDie tmp
+mountOrDie proc
+mountOrDie dev
+mountOrDie sys
+
+
+echo "jumping into chroot"
+chroot /${CHROOT} /bin/bash
diff --git a/scripts/contrib/chimera/makeDebianChroot.sh b/scripts/contrib/chimera/makeDebianChroot.sh
new file mode 100755
index 00000000000..c95ad03bbad
--- /dev/null
+++ b/scripts/contrib/chimera/makeDebianChroot.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# this is largely pulled from
+# http://www.linuxquestions.org/questions/debian-26/how-to-install-debian-using-debootstrap-4175465295/
+
+CHROOT=debian-8
+
+mkdir /${CHROOT}
+wget --no-remove-listing -O /${CHROOT}/deboot.html -q http://ftp.us.debian.org/debian/pool/main/d/debootstrap
+DEB=$(grep 'all.deb' /${CHROOT}/deboot.html | awk -F 'href' '{print $2}' | cut -d '"' -f2 | tail -1)
+echo "using debootstrap deb $DEB"
+wget -P /${CHROOT}/debootstrap http://ftp.us.debian.org/debian/pool/main/d/debootstrap/${DEB}
+cd /${CHROOT}/debootstrap
+
+echo "unpacking $DEB"
+ar vx debootstrap_1.0.90_all.deb
+tar xf data.tar.gz
+ln -s /debian-8/debootstrap/usr/sbin/debootstrap /usr/sbin/debootstrap
+ln -s /debian-8/debootstrap/usr/share/debootstrap/ /usr/share/debootstrap
+
+echo "running debootstrap"
+debootstrap --include linux-image-amd64,locales --arch amd64 unstable /${CHROOT} http://ftp.us.debian.org/debian
+
+# ubuntu version
+# debootstrap --arch amd64 xenial /${CHROOT} http://archive.ubuntu.com/ubuntu
+#cleanup
+rm /usr/sbin/debootstrap /usr/share/debootstrap
+cd ~
+echo "To use do $chroot /debian-8 /bin/bash"
+echo "or better ./goDebianChroot.sh "
+echo "Then you are in debianland"