View Single Post
Old 09-23-2013, 07:51 AM   #7
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Code:
#!/bin/sh
unset LD_PRELOAD
rm /dev/loop/debian
mknod -m0660 /dev/loop/debian b 7 250
echo "[*] Mounting Rootfs..."
/bin/mount -o loop=/dev/loop/debian,noatime -t ext3 /mnt/base-us/debian.ext3 /mnt/us/debian
echo "[*] Preparing Filesystem..."
/bin/mount -o bind /dev /mnt/us/debian/dev
/bin/mount -o bind /proc /mnt/us/debian/proc
/bin/mount -o bind /sys /mnt/us/debian/sys
/bin/mount -o bind /dev/pts /mnt/us/debian/dev/pts

#optionally make the kindle available inside debian...
#mount -o bind /mnt/base-us /mnt/us/debian/kindle/mnt/us
#mount -o bind /mnt/base-us /mnt/us/debian/kindle/mnt/base-us

echo "[*] Preparing Network Connections..."
cp /etc/hosts /mnt/us/debian/etc/hosts
cp /etc/resolv.conf /mnt/us/debian/etc/resolv.conf
echo "[*] Starting Debian shell..."
chroot /mnt/us/debian /bin/bash $@
#chroot /mnt/debian 
echo
echo "[*] Unmounting Rootfs..."

#optionally remove that kindle inside the debian stuff
#umount /mnt/us/debian/kindle/mnt/us
#umount /mnt/us/debian/kindle/mnt/base-us

/bin/umount /mnt/us/debian/dev/pts
/bin/umount /mnt/us/debian/dev
/bin/umount /mnt/us/debian/proc
/bin/umount /mnt/us/debian/sys
/bin/umount -d /mnt/us/debian
echo "[*] Debian unmounted."

Please note that this script EXPECTS the debian image to be called debian.ext3 and to be on the FAT ROOT like /mnt/us/debian.ext3

so rename your image to that and put it there...

put this script wherever you would like and run it directly via SSH.

Last edited by twobob; 09-23-2013 at 02:10 PM.
twobob is offline   Reply With Quote