[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: need help with chroot



Gabriel Parrondo wrote:
El mié, 16-07-2008 a las 21:13 -0400, Thomas H. George escribió:
The man page and a google search gave minimum info except for the link to www.debian.org/doc/manuals/reference/ch-tip.en.html. Following by

I think that document is a little out of date. The 'MAKEDEV generic' for
example, is not commonly used nowadays.

rote the prompts in 8.6.35.1 I think I succeeded in installing a minimal Etch installation though the prompt never changed to chroot # when I entered chroot /bkup/etch-root /bin/bash and a subsequent command apt-setup was unknown. (I started by making the directory /bkup/etch-root as I have lots of hard drive space in /bkup while 66% of / is used.)


As I said, this document seems out of date. Apt-setup is not in lenny
and I guess it's the same for etch.
Try the debootstrap manpage instead.



Next I proceeded to 8.6.35.2 again following the instructions by rote. Now Ctl-Alt F8 allows a login as root with no password to an empty directory.

So?

Is there a good thorough exposition of the uses of chroot?


'man chroot' is a good start. For the specific use of creating a debian
chroot, you might prefer debootstrap(8).
Also, there's a lot of posts on the list about these (there were some
recently) and definitely a lot more in google.

I've been playing around with bootable qemu images, which are really just bootable chroots. You might check out the script this list helped me develop, posted here:

http://blog.quinthar.com/2008/07/building-1gb-bootable-qemu-image-using.html

In particular, I think the following lines are most relevant for setting up a chroot (where "$1.mount" is the directory into which you want to create the chroot; once done simply type "sudo chroot $1.mount" and you should be in):

echo "Installing Etch into $1.mount"
sudo debootstrap --arch i386 etch $1.mount http://ftp.us.debian.org/debian

echo "Setting up host networking in $1.mount for apt"
sudo cp /etc/resolv.conf $1.mount/etc
sudo cp /etc/hosts $1.mount/etc

echo "Installing kernel into $1.mount"
sudo chroot $1.mount apt-get update
sudo chroot $1.mount apt-get -y install gnupg
sudo chroot $1.mount apt-get update
echo "do_symlinks = yes
relative_links = yes
do_bootloader = yes
do_bootfloppy = no
do_initrd = yes
link_in_boot = no" > /tmp/kernel-img.conf
sudo mv /tmp/kernel-img.conf $1.mount/etc
sudo chroot $1.mount apt-get -y install linux-image-2.6-686

Good luck!

-david


Reply to: