You are not logged in.

#1 2008-08-22 02:12:33

biatchi
Member
Registered: 2007-05-16
Posts: 9

Run Yaourt as user inside 32bit chroot?

I have a 64bit system and have a 32chroot setup as per the wiki instructions. Everything works brilliantly except that Yaourt runs as root and I want to build firefox-spookyet. Does anybody know how I would go about doing this?

Come to think of it, Is it safe to run Firefox from a chroot? Htop says firefox is runing as biatchi but also that root executed

/bin/su -p biatchi -c firefox

Is that safe?

Last edited by biatchi (2008-08-22 02:13:24)

Offline

#2 2008-08-22 02:19:34

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Run Yaourt as user inside 32bit chroot?

I use the dchroot command to run things from chroot, so yaourt, for example, can be run like this:

dchroot -d 'yaourt -Syu --aur'

I actually have this aliased to something more convenient.

The problem is, I just noticed that the dchroot package was removed from the repos and schroot (the package that's supposed to be its replacement) doesn't seem to be in any of the repos, so I'm not sure what's going on there...

EDIT: uhm, I don't think I've read your post carefully enough.  You should be able to do "su [username]" when within chroot, which would then allow you to use makepkg as regular user.  I'm not sure is you need to have your /home --bind mounted withing the chroot for this to work or not.

I actually log into chroot as regular user, I have this alias in my .bashrc:

alias arch32="sudo chroot /opt/arch32/ /bin/su - filip"

You'd need to replace "filip" with your username, of course.

Last edited by fwojciec (2008-08-22 02:30:28)

Offline

#3 2008-08-22 03:11:05

biatchi
Member
Registered: 2007-05-16
Posts: 9

Re: Run Yaourt as user inside 32bit chroot?

That works brilliantly thanks smile

Htop still shows root executing

/bin/su -p biatchi -c firefox

if I do dchroot -d firefox but it doesn't if I log into my chroot and just type firefox, I guess that isn't anything to worry about?

Last edited by biatchi (2008-08-22 03:11:39)

Offline

#4 2008-08-22 03:24:56

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Run Yaourt as user inside 32bit chroot?

On my system htop shows that commands "su" and "dchroot" are running with root privileges, but firefox is running with regular user privileges so it should be all good, I think, though I'm not a security expert so don't trust me on that wink

Also, if you look carefully, the command /bin/login, on which almost all other processes such as X, window manager and so on depend is also running as root -- this seems to be analogous to the relationship between su/dchroot and firefox.  If you switch htop to "tree view" in preferences it all sort of becomes more clear.

Offline

#5 2008-08-25 00:43:21

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Run Yaourt as user inside 32bit chroot?

fwojciec wrote:

I actually log into chroot as regular user, I have this alias in my .bashrc:

alias arch32="sudo chroot /opt/arch32/ /bin/su - filip"

Hmmmm....I tried this alias and also tried 'su username' within the chroot. Each time I get an error saying

/bin/su: incorrect password

Any ideas why?

[Edit -- solved]Oops -- above part solved by running /sbin/pwconv inside the chroot. Apparently something got corrupted or I missed step when I installed the chroot.

Does anyone know when or where I can download dchroot or schroot? They're still missing from the repos.


Thanks!
Scott

Last edited by firecat53 (2008-08-25 00:52:37)

Offline

#6 2008-08-25 00:57:18

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Run Yaourt as user inside 32bit chroot?

firecat53 wrote:

Does anyone know when or where I can download dchroot or schroot? They're still missing from the repos.

# $Id: PKGBUILD,v 1.6 2008/01/16 16:16:29 sergej Exp $
# Maintainer: Sergej Pupykin <sergej@aur.archlinux.org>
# Maintainer: William Rea <sillywilly@gmail.com>

pkgname=dchroot
pkgver=0.12.1
pkgrel=3
pkgdesc="Allows users to execute shell commands under different root filesystems"
arch=('x86_64' 'i686')
url="http://packages.debian.org/unstable/admin/dchroot"
license=("GPL")
depends=()
makedepends=(help2man)
backup=(etc/dchroot.conf)
source=(http://ftp.debian.org/debian/pool/main/d/dchroot/dchroot_$pkgver.tar.gz)
md5sums=('13990d6d8d1d052d5114f42d544b61d2')

build() {
  cd $startdir/src/$pkgname-$pkgver
  touch dchroot.1
  ./configure --prefix=/usr
  make dchroot.1 || return 1
  make || return 1
  make DESTDIR=$startdir/pkg  install
}

Save this as "PKGBUILD" somewhere and run makepkg -cis in the same directory.

Offline

#7 2008-08-25 02:36:36

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Run Yaourt as user inside 32bit chroot?

Thanks very much for the dchroot PKGBUILD! Hopefully the new schroot makes it in to the repos soon.

Scott

Offline

#8 2008-08-25 02:59:45

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Run Yaourt as user inside 32bit chroot?

firecat53 wrote:

Hopefully the new schroot makes it in to the repos soon.

I added a comment to schroot aur page -- hopefully this will be solved soon.

Offline

Board footer

Powered by FluxBB