SliTaz SliTaz Forum

You are not logged in.

#1 2013-07-09 21:38:44

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Cooking chroot: how to set up mobile internet here?

Hello guys!

I have no my "normal" Wi-Fi internet connection for a long long time (two weeks, or more).

I'm starting to miss the package development!

The fact is that the Wi-Fi connection is raised automatically when booting. And I have internet inside chroot when I command "tazdev chroot".

But, when I up my ppp0 (mobile phone as modem) connection using wvdial, there is no internet inside chroot.

But here are strange points. When ppp0 is raised (of course, outside chroot) then [c]cook[/c] hangs for a some time — it want to check web site, and then to download packages missed in cache. But when I broke any internet connection, then [c]cook[/c] not hangs, it flies and wget prints errors immediately.

I'm as root superuser in the chroot, does it mean that I should have control over ppp0? But I don't know how chroot works, really what is /dev folder inside chroot?

So, please, help me to establish mobile connection inside chroot.

TIA

Offline

#2 2013-07-10 04:27:05

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Cooking chroot: how to set up mobile internet here?

Only two things come to mind. Either /etc/resolv.conf has the wrong permission (this was a bug in SliTaz 4 caused by pppd) or you need to mirror the external /etc/resolv.conf within the chroot.

Offline

#3 2013-07-10 09:35:18

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Cooking chroot: how to set up mobile internet here?

Trixar_za,

Thank you! Really, googling for "chroot resolv.conf" and found some tips.

Hardlinking:

[c]ln /etc/resolv.conf <CHROOT>/etc/resolv.conf[/c]

not worked with this error:

[c]ln: /home/slitaz/cooking/chroot/etc/resolv.conf: Invalid cross-device link[/c]

My root filesystem in RAM, and chroot in the hard disk, in the /home partition.

Use symbolic link ([c]ln -s ...[/c])? No, it will not work.

Open /usr/bin/tazdev and thinking...

We have these commands in the gen_new_chroot():

[c]echo -n "Creating resolv.conf..."
    cat /etc/resolv.conf > $rootfs/etc/resolv.conf
    status[/c]
Our resolv.conf is copied only once — at generating new chroot.

But every time I have different nameservers. So, I just copied this piece of code to mount_chroot():

[c]mount_chroot()
{
    if [ ! -d $rootfs/proc/1 ]; then
        echo -ne "\nMounting virtual filesystems..."
        mount -t proc proc $rootfs/proc
        mount -t sysfs sysfs $rootfs/sys
        mount -t devpts devpts $rootfs/dev/pts
        mount -t tmpfs shm $rootfs/dev/shm
        status
→        echo -n "Creating resolv.conf..."
→        cat /etc/resolv.conf > $rootfs/etc/resolv.conf
→        status
    fi
. . . . . . . .[/c]
Now I need to raise ppp0 connection, then su, tazdev chroot, and cooking works! big_smile

I just prepared small package 915resolution, and cook downloaded source tarball from internet.

Resolved.

Offline

#4 2014-03-29 12:52:06

Guest
Guest

Re: Cooking chroot: how to set up mobile internet here?

hey i did some research for you have  a look at this thread

www . superuser.com/questions/111152/whats-the-proper-way-to-prepare-chroot-to-recover-a-broken-linux-installation

#5 2014-03-29 13:33:11

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Cooking chroot: how to set up mobile internet here?

teginder81,

Thank You for your research!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]