Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Name Resolution Failures [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 56
Location: Oklahoma City

PostPosted: Fri May 03, 2019 3:13 am    Post subject: Name Resolution Failures [Solved] Reply with quote

I'm trying to install the x86 version of gentoo in a directory on my archlinux system, using the handbook and this article:

https://wiki.gentoo.org/wiki/Project:AMD64/32-bit_Chroot_Guide

I've unpacked the x86 stage 3 in a gentoo directory; copied resolv.conf; mounted dev, sys, and proc; and chrooted in with:

Code:
linux32 chroot . /bin/bash


I see from uname -m that I'm running in i686 mode, so I ran /etc/profile, env-update, and "emerge --sync". Everything seemed to work normally, but when I run "emerge -avuDN @world", I get:

Code:
>>> Emerging (1 of 31) dev-util/re2c-1.1.1::gentoo                             
 * Fetching files in the background.                                           
 * To view fetch progress, run in another terminal:                             
 * tail -f /var/log/emerge-fetch.log                                           
>>> Downloading 'http://gentoo.mirrors.easynews.com/linux/gentoo/distfiles/re2c-1.1.1.tar.gz'                                                                   
--2019-05-03 02:39:30--  http://gentoo.mirrors.easynews.com/linux/gentoo/distfiles/re2c-1.1.1.tar.gz                                                           
Resolving gentoo.mirrors.easynews.com... failed: Temporary failure in name resolution.                                                                         
wget: unable to resolve host address ‘gentoo.mirrors.easynews.com’             
>>> Downloading 'https://gentoo.osuosl.org/distfiles/re2c-1.1.1.tar.gz'         
--2019-05-03 02:39:30--  https://gentoo.osuosl.org/distfiles/re2c-1.1.1.tar.gz 
Resolving gentoo.osuosl.org... failed: Temporary failure in name resolution.   
wget: unable to resolve host address ‘gentoo.osuosl.org’                       
>>> Downloading 'ftp://ftp.gtlib.gatech.edu/pub/gentoo/distfiles/re2c-1.1.1.tar.gz'                                                                             
--2019-05-03 02:39:30--  ftp://ftp.gtlib.gatech.edu/pub/gentoo/distfiles/re2c-1.1.1.tar.gz                                                                     
           => ‘/usr/portage/distfiles/re2c-1.1.1.tar.gz’                       
Resolving ftp.gtlib.gatech.edu... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘ftp.gtlib.gatech.edu’     
>>> Downloading 'https://github.com/skvadrik/re2c/releases/download/1.1.1/re2c-1.1.1.tar.gz'
--2019-05-03 02:39:30--  https://github.com/skvadrik/re2c/releases/download/1.1.1/re2c-1.1.1.tar.gz
Resolving github.com... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘github.com’
!!! Couldn't download 're2c-1.1.1.tar.gz'. Aborting.
 * Fetch failed for 'dev-util/re2c-1.1.1', Log file:
 *  '/var/tmp/portage/dev-util/re2c-1.1.1/temp/build.log'

>>> Failed to emerge dev-util/re2c-1.1.1, Log file:

>>>  '/var/tmp/portage/dev-util/re2c-1.1.1/temp/build.log'

 * Messages for package dev-util/re2c-1.1.1:

 * Fetch failed for 'dev-util/re2c-1.1.1', Log file:
 *  '/var/tmp/portage/dev-util/re2c-1.1.1/temp/build.log'


The odd thing is, I CAN use wget (in the chroot) to download the files directly without any problem. I'm guessing that emerge doesn't use the same (lack of) wget parameters that I am:

Code:
(chroot) duane-laptop / # wget http://gentoo.mirrors.easynews.com/linux/gentoo/distfiles/re2c-1.1.1.tar.gz


Just to be clear, the above works and gets me the file.

I'd blame the fact that I'm running the thing on 64-bit arch, if I wasn't able to download the files myself in the same chroot. Can anyone point out something I'm doing wrong?


Last edited by duane on Sat May 04, 2019 3:39 am; edited 1 time in total
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3081
Location: Illinois, USA

PostPosted: Fri May 03, 2019 12:10 pm    Post subject: Reply with quote

Do I understand correctly that you are trying to build 64 bit Gentoo by chroot from a 32 bit Arch Linux installation?
Once you chroot, you immediately start running 64 bit code while your CPU is in 32 bit mode. You have enter 64 bit mode via an assembly program (And I no longer remember how to do that) or, download and extract your stage 3, then reboot using a 64 bit medium to chroot.
I can't find whether wget is 32-bit or 64. 32-bit programs will run on a 64 bit OS, but not the converse.

EDIT:
I seem to recall a program called chroot32, that accomplishes the transition. I kept screwing up and running chroot instead of chroot32, so now I have a separate partition, booted by grub (legacy) that obviates the necessity to remember.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Fri May 03, 2019 12:52 pm    Post subject: Re: Name Resolution Failures Reply with quote

duane wrote:
Can anyone point out something I'm doing wrong?

You assume your arch also use /etc/resolv.conf to do name resolution and copy that file assuming its content is good. But if i remember well systemd has a dns resolution, which as usual must use a different file, because they like re-invent the wheel and create new locations and files to let anyone think it's brand new.
You can either check its content to see what is inside
Or create your own one with some google or generic dns in it, to build a valid one
Make sure you do that inside the chroot (make sure to use >> instead of > in case you mess up)
Code:
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Back to top
View user's profile Send private message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 56
Location: Oklahoma City

PostPosted: Fri May 03, 2019 3:07 pm    Post subject: Reply with quote

Tony0945 wrote:
Do I understand correctly that you are trying to build 64 bit Gentoo by chroot from a 32 bit Arch Linux installation?


No, I'm building a 32 bit gentoo inside 64 bit (standard) archlinux. I'm using linux32 to try to force the chroot into 32 bit mode. (I'm not sure how necessary that is.) It seems to work well enough to compile everything. The wget in the chroot shows:

gentoo/usr/bin/wget: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, stripped

I'll have to look for chroot32.

Krinn wrote:
You assume your arch also use /etc/resolv.conf to do name resolution and copy that file assuming its content is good.


The resolv.conf in the chroot shows about what I expected -- my router as the nameserver:

# Generated by resolvconf
domain robertson
nameserver 192.168.1.1

I added 8.8.8.8, but it didn't seem to make any difference.

For the moment, I'm just grepping the file names out of the emerge -pf output and using wget to download them directly into distfiles. It's kind of a pain, but it works, and the cd image I made from the installation runs in qemu i386 (so far).

However, unmounting the dev filesystem (umount -l gentoo/dev{/shm,/pts,}) plays havoc with my arch system for some reason, which is forcing me to reboot before making a squashfs out of the gentoo directory.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13848

PostPosted: Sat May 04, 2019 12:03 am    Post subject: Re: Name Resolution Failures Reply with quote

krinn wrote:
duane wrote:
Can anyone point out something I'm doing wrong?

You assume your arch also use /etc/resolv.conf to do name resolution and copy that file assuming its content is good.
If it was not sufficient, then shouldn't his manually executed wget inside the chroot also be broken?

duane: Portage runs wget as the Linux user portage, not as root the way you did. My guess is that you made /etc/resolv.conf unreadable to unprivileged users, but root can still read it. Check the output of ls -l /etc/resolv.conf in the chroot and the host system.
Back to top
View user's profile Send private message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 56
Location: Oklahoma City

PostPosted: Sat May 04, 2019 3:38 am    Post subject: Re: Name Resolution Failures Reply with quote

Hu wrote:
My guess is that you made /etc/resolv.conf unreadable to unprivileged users, but root can still read it.


That was it! Thank you.

I need to remember to use "sudo -i". This isn't the first time that's happened.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum