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

Re: Instalando Debian desde el HD con un linux ya existente (problemas con chroot)



"TeLeNiEkO (Marc Fargas)" <TeLeNiEkO@telenieko.com> writes:

> Hace algunos dias que tengo metida en la cabeza la idea de instalar la
> debian desde un linux ya existente sin usar disquetes ni nada por el estilo.
> 
[...]
> 
> A alguien se le ocurre alguna solucion?
> 
No se de esta forma que has hecho tú. Pero lo que puedes hacer es como
un dia explicaron en debian-devel para potato. Para woody no hay
base.tgz pero te lo puedes construir tu mismo con debootstrap (atento
con la e extra). No lo he probado así que no respondo, tambien estaria
bien que si lo pruebas no comentes como va. Yo tengo en mente utilizar
algun dia el uml (user-mode-linux) para probar los boot-floppies (o el
debian-installer). A ver si algun dia lo hago.


Howto make a debian chroot system.
----------------------------------

1) download base2_2.tgz
2) as root?, untar in safe place (homedir, /usr/local/woody, whatever)
3) as root?, chroot /usr/local/woody /bin/sh
4) mount proc -t proc /proc
5) put name servers in /etc/resolv.conf
6) put the REAL machine name in /etc/hostname. run hostname -F
   /etc/hostname. Copy /etc/hosts from real machine. 
7) edit /etc/apt/sources.list to suit your needs. apt-cdrom add?
8) apt-get install build-essential dpkg-dev
9) [optional] Install sshd in the chrootable tree, and run it on a high port.
    Copy the /etc/ssh directory from the true root of the machine (so the host
    keys match), and change the Port in sshd_config to something high. Run
    /etc/init.d/ssh start in the chrooted tree.
10) exit 
11) [optional] tar this tree up for multiple uses.

The following script (in $chroot_base/etc/init.d/) is helpful to automate the
above (allows for easy start/stop, and keeps the chroot in a semi-updated
state with the host).

---
#!/bin/sh -e
if [ -e /etc/init.d/$(basename $0) ]; then
	# starting inside chroot
	hostname -F /etc/hostname
	exec /bin/sh --login
else
	# starting outside the chroot
	dir=$(dirname $0)/../..
	files="/etc/resolv.conf /etc/hosts /etc/hostname"
	for f in $files; do
		cp $f $dir/$f
	done
	mount proc -t proc $dir/proc
	chroot $dir /etc/init.d/$(basename $0)
	umount $dir/proc
fi
---

Santi
-- 
Buscando firma...
Buscando firma...hecho



Reply to: