You are not logged in.

#1 2011-11-18 18:59:02

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,596
Website

cannot call pacman through schroot

I have a 32-bit chroot setup which I use for building i686 packages.  Ever since upgrading to pacman4, I am unable to call pacman through the shcroot command:

Example:

$ schroot -p -- sudo pacman -S libnetfilter_queue
resolving dependencies...
looking for inter-conflicts...

Targets (2): libnfnetlink-1.0.0-2  libnetfilter_queue-1.0.0-1

Total Installed Size:   0.14 MiB

Proceed with installation? [Y/n] 
(2/2) checking package integrity                                    [#####################################] 100%
error: GPGME error: Inappropriate ioctl for device
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

I can use pacman as expected if do not try through the schroot command, but if I manually chroot into the chroot.

Example:

$ sudo chroot /opt/arch32 /bin/bash
# pacman -S libnetfilter_queue
resolving dependencies...
looking for inter-conflicts...

Targets (2): libnfnetlink-1.0.0-2  libnetfilter_queue-1.0.0-1

Total Installed Size:   0.14 MiB

Proceed with installation? [Y/n] 
(2/2) checking package integrity                                    [#####################################] 100%
(2/2) loading package files                                         [#####################################] 100%
(2/2) checking for file conflicts                                   [#####################################] 100%
(1/2) installing libnfnetlink                                       [#####################################] 100%
(2/2) installing libnetfilter_queue                                 [#####################################] 100%

Thoughts?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-11-18 19:01:29

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,095
Website

Re: cannot call pacman through schroot

ttyname_r calls are failing because of the way you've mounted /dev/pts. Do not mount it with the "newinstance" option. Better yet, just bind mount it over from the real root. We already solved this in devtools.

Offline

#3 2011-11-18 19:09:34

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,596
Website

Re: cannot call pacman through schroot

falconindy wrote:

ttyname_r calls are failing because of the way you've mounted /dev/pts. Do not mount it with the "newinstance" option. Better yet, just bind mount it over from the real root. We already solved this in devtools.

Here is the relevant bit of /etc/rc.d/arch32 initscript which setups-up my chroot for me.  I'm confused what you mean by the "newinstance" option.  Can you take a peek and educate me?

dirs=(/dev /dev/pts /tmp /home)
case $1 in
  start)
    stat_busy "Starting Arch32 chroot"
    [[ ! -f /opt/arch32/.arch32 ]] && mount LABEL="arch32" /opt/arch32
    for d in "${dirs[@]}"; do
      mount -o bind $d /opt/arch32$d
    done
    mount -t proc none /opt/arch32/proc
    mount -t sysfs none /opt/arch32/sys
    linux32 chroot /opt/arch32 sh -c "/etc/rc.d/distccd start" || return 1
    add_daemon arch32
    stat_done
    ;;

Thanks!

Last edited by graysky (2011-11-18 19:11:45)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2011-11-18 19:43:56

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,095
Website

Re: cannot call pacman through schroot

Actually, it looks like schroot doesn't even mount /dev/pts. I'm not really familiar with schroot, but your problem revolves around gpg's inability to determine the tty its operating on.

Last edited by falconindy (2011-11-18 19:44:04)

Offline

#5 2011-11-18 19:49:44

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,596
Website

Re: cannot call pacman through schroot

falconindy wrote:

Actually, it looks like schroot doesn't even mount /dev/pts. I'm not really familiar with schroot, but your problem revolves around gpg's inability to determine the tty its operating on.

Right, schroot doesn't but the config file that starts my chroot does... it's in the "dirs" array in that code I posted.  Do you think it's not mounting properly?  See line 6-8.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2011-12-17 22:16:45

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819

Re: cannot call pacman through schroot

Graysky, I know it's a bit late, but I don't know if you've seen this:

http://mailman.archlinux.org/pipermail/ … 01953.html

I bumped into this problem again after setting up a chroot on my new desktop.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2012-01-10 13:08:40

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 292

Re: cannot call pacman through schroot

This seems to be still valid. Today I tried to build a custom Arch Linux live media using archiso. I strictly followed the wiki here: https://wiki.archlinux.org/index.php/Archiso
I get to the point where I should do

pacman -Sy devtools libisoburn squashfs-tools

and pacman throws still this error

error: GPGME error: Inappropriate ioctl for device

for several times. No joy with alans suggestion here: http://mailman.archlinux.org/pipermail/ … 01994.html to do

mount --bind /dev/pts "${working_dir}/dev/pts"

  - Same error - sad

Harvey


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#8 2012-01-10 20:06:28

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,596
Website

Re: cannot call pacman through schroot

Hmm... dunno what to say - mine is working now.

$ cat /etc/rc.d/arch32 
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

dirs=(/dev /dev/pts /tmp /home /media/data /scratch)
case $1 in
	start)
		stat_busy "Starting Arch32 chroot"
		[[ ! -f /opt/arch32/.arch32 ]] && mount LABEL="arch32" /opt/arch32
		for d in "${dirs[@]}"; do
			mount -o bind $d /opt/arch32$d
		done
		mount -t proc none /opt/arch32/proc
		mount -t sysfs none /opt/arch32/sys
		add_daemon arch32
		stat_done
		;;
	stop)
		stat_busy "Stopping Arch32 chroot"
		for (( i = ${#dirs[@]} - 1; i >= 0; i-- )); do
			umount "/opt/arch32${dirs[i]}"
		done
		umount /opt/arch32/{proc,sys}
		[[ -f /opt/arch32/.arch32 ]] && umount /opt/arch32
		rm_daemon arch32
		stat_done
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	*)
		echo "usage: $0 {start|stop|restart}"
esac
exit 0

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2012-01-11 07:35:02

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 292

Re: cannot call pacman through schroot

graysky wrote:

Hmm... dunno what to say - mine is working now.

Ah, I see! So this is another usecase. I use the archiso scripts.They seem to be at fault here. Will investigate further and report back, I guess this is a bug in archiso.

Harvey

EDIT: Opened a new thread on this:
https://bbs.archlinux.org/viewtopic.php … 7#p1039677

Last edited by Harey (2012-01-12 07:22:20)


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#10 2013-05-30 06:09:00

py_crash
Member
From: Resistencia
Registered: 2013-05-28
Posts: 10

Re: cannot call pacman through schroot

The problem for calling pacman within schroot is that by default schroot doesn't mount /dev/pts.
Proper way to fix it is to uncomment the following line:

/dev/pts    /dev/pts    none    rw,bind     0   0 

in the "/etc/schroot/arch32/mount" file

Offline

Board footer

Powered by FluxBB