LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   installing gentoo from ubuntu - network access from chroot (https://www.linuxquestions.org/questions/gentoo-87/installing-gentoo-from-ubuntu-network-access-from-chroot-861515/)

nokangaroo 02-08-2011 08:46 PM

installing gentoo from ubuntu - network access from chroot
 
(Moderators please move this post into another place if appropriate. I ran into this problem while installing Gentoo from ubuntu, but it might also apply to Linux from Scratch, for instance)

I found an instruction for installing Gentoo from ubuntu but it turned out to be incomplete (http://www.wikihow.com/Install-Gentoo-Linux-from-Ubuntu). I also posted the following there.

The stage 3 tarball lacks a "portage" user and group, for some reason, which will cause emerge to fail from inside the chroot. If you use schroot you will have to create the portage user and group on your host system (ubuntu maverick in my case); the passwd and group files in /mnt/gentoo/etc will be overwritten if you modify them directly. After adding the portage user & group to the host system chrooting in the ordinary way should also work with network access. I used schroot with the following configuration:


#/etc/schroot/schroot.conf (on host system; <host> is your username on the host). The name in square brackets can be anything you like, but you have to call schroot with that name.

[gent00]
description=gentoo
type=directory
directory=/mnt/gentoo
priority=3
users=<host>
groups=<host>,portage
root-users=<host>
root-groups=root,<host>,portage
aliases=gentoo


#adding portage user and group on host system:
sudo useradd -M -g portage -s /bin/false -u 250 portage

#which adds the following lines to /mnt/gentoo/etc/passwd (probably flawed - /home/portage does not exist - but I added the group manually in Users and Groups. Anyway, it works):
portage:x:250:250::/home/portage:/bin/false

#and to /mnt/gentoo/etc/group:
portage:x:250:<host>

#the schroot command for emerge --sync:
schroot -c gent00 -- emerge --sync

#if you get an rsync error like "mkstemp failed .... permission denied", do from inside the chroot:
chown -R 250 usr/portage

#for classic chrooting:
sudo mount --bind /dev /mnt/gentoo/dev
sudo mount --bind /dev/pts /mnt/gentoo/dev/pts
sudo mount --bind /proc /mnt/gentoo/proc
sudo mount --bind /sys /mnt/gentoo/sys
sudo cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf #(not sure if this does anything; /etc/resolv.conf is blank except for a comment)
sudo chroot /mnt/gentoo

andrewthomas 02-08-2011 08:56 PM

This may work, but it is probably best to follow the official gentoo documentation.


5. Installing Gentoo from an existing Linux distribution


http://www.gentoo.org/doc/en/altinstall.xml#doc_chap5

centh0 03-22-2011 05:01 AM

Yes is possible

---------- Post added 03-22-11 at 05:01 AM ----------

http://www.flickr.com/photos/60967642@N08/5549813400/

centh0 03-22-2011 05:04 AM

http://www.flickr.com/photos/60967642@N08/5549813402/


All times are GMT -5. The time now is 02:49 PM.