Created
April 4, 2013 17:55
-
-
Save tcheneau/5312546 to your computer and use it in GitHub Desktop.
Chroot into a Cloonix virtual machine disk image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
losetup /dev/loop1 $1 | |
losetup -o 1048576 /dev/loop2 /dev/loop1 | |
mount /dev/loop2 /media/vm | |
mount -t proc foo /media/vm/proc | |
mount -t sysfs foo /media/vm/sys | |
mount -o bind /dev /media/vm/dev | |
mount -o bind /selinux /media/vm/selinux | |
chroot /media/vm | |
umount /media/vm/dev | |
umount /media/vm/sys | |
umount /media/vm/proc | |
umount /media/vm/selinux | |
umount /media/vm | |
losetup -d /dev/loop2 | |
losetup -d /dev/loop1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment