Ritesh Raj Sarraf | 11 Dec 2010 16:41
Favicon
Gravatar

[uml-user] dpkg fails to install packages


Hello,

I'm trying to use hostfs for my root file system.

I think providing hostfs access for root file system is great. It will
help especially for the near future because the current linux file
systems are still catching up on block discard.

I have almost been able to finish my uml setup. But I have one major glitch.

Warning: unable to open an initial console.
Not activating Mandatory Access Control now since /sbin/tomoyo-init
doesn't exist.
Failed to open console 0, err = -19
Failed to open console 0, err = -19
Failed to open console 0, err = -19
Failed to open console 0, err = -19
Failed to open console 0, err = -19
IRQ 13/xterm: IRQF_DISABLED is not guaranteed on shared IRQs
IRQ 2/console: IRQF_DISABLED is not guaranteed on shared IRQs
IRQ 3/console-write: IRQF_DISABLED is not guaranteed on shared IRQs
IRQ 10/winch: IRQF_DISABLED is not guaranteed on shared IRQs
root <at> champaran:~# dpkg --configure -a
dpkg: unable to sync directory '/var/lib/dpkg': Invalid argument
root <at> champaran:~# cat /proc/cmdline
root=/dev/root rootflags=/var/tmp/chroot/uml-debian rootfstype=hostfs
mem=512m eth0=daemon eth1=daemon con0=fd0,fd1,fd2 con=xterm

In the snippet above, you can notice that the dpkg command fails. I am
not sure what is the real cause.

root <at> champaran:~# ls -l /var/lib/dpkg/
total 476
drwxr-xr-x 2 1000 1000   4096 Dec 11 12:12 alternatives
-rw-r--r-- 1 1000 1000 114163 Dec 11 12:12 available
-rw-r--r-- 1 1000 1000 114163 Dec 11 12:12 available-old
-rw-r--r-- 1 1000 1000      8 Dec 11 12:10 cmethopt
-rw-r--r-- 1 1000 1000     98 Dec 11 12:07 diversions
-rw-r--r-- 1 1000 1000     29 Dec 11 12:07 diversions-old
drwxr-xr-x 2 1000 1000  20480 Dec 11 12:12 info
-rw-r----- 1 1000 1000      0 Dec 11 12:12 lock
drwxr-xr-x 2 1000 1000   4096 Nov 25 06:32 parts
-rw-r--r-- 1 1000 1000     35 Dec 11 12:12 statoverride
-rw-r--r-- 1 1000 1000      0 Dec 11 12:06 statoverride-old
-rw-r--r-- 1 1000 1000  98944 Dec 11 15:30 status
-rw-r--r-- 1 1000 1000  98944 Dec 11 15:04 status-old
drwxr-xr-x 2 1000 1000   4096 Dec 11 12:12 triggers
drwxr-xr-x 2 1000 1000   4096 Dec 11 14:19 updates

id 1000 maps to the user id on the host, that executed the uml application.

I did this file ownership change because the guides mentioned it. I do
have read/write access to these files/directories, but dpkg fails to
proceed. It cannot install a package. `apt-get update` does work though.

Here's the listing of:
root <at> champaran:~# ls /var/lib/apt/lists/ -l
total 32660
-rw-r--r-- 1 1000 1000   103733 Dec 11 08:10
ftp.us.debian.org_debian_dists_sid_Release
-rw-r--r-- 1 1000 1000 33330762 Dec 11 08:02
ftp.us.debian.org_debian_dists_sid_main_binary-amd64_Packages
drwxr-xr-x 2 1000 1000     4096 Dec 11 11:56 partial

These files are written during the "apt-get update" operation.

Since the `apt-get update` operation succeeds, is this more of a dpkg
bug than UML's ?

PS: Even running UML as root does not help. I can log in, do apt-get
update, but as soon as I try to install, it fails.
Here's an apt-get install failure example:

root <at> champaran:~# apt-get install psmisc
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  psmisc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/124 kB of archives.
After this operation, 733 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  psmisc
Install these packages without verification [y/N]? y
tar: ./control: Cannot change ownership to uid 0, gid 0: Operation not
permitted
tar: ./md5sums: Cannot change ownership to uid 0, gid 0: Operation not
permitted
tar: ./postrm: Cannot change ownership to uid 0, gid 0: Operation not
permitted
tar: ./postinst: Cannot change ownership to uid 0, gid 0: Operation not
permitted
tar: .: Cannot change ownership to uid 0, gid 0: Operation not permitted
tar: Exiting with failure status due to previous errors
dpkg-deb: subprocess tar returned error exit status 2
dpkg: error processing /var/cache/apt/archives/psmisc_22.13-1_amd64.deb
(--unpack):
 subprocess dpkg-deb --control returned error exit status 2
configured to not write apport reports
                                      dpkg: unable to sync directory
'/var/lib/dpkg': Invalid argument
E: Sub-process /usr/bin/dpkg returned an error code (2)

BTW, this is pretty interesting. I do have read/write access to these
files, but I can't change their ownership.

root <at> champaran:/var/lib/dpkg# ls -l
total 476
drwxr-xr-x 2 1000 1000   4096 Dec 11 12:12 alternatives
-rw-r--r-- 1 1000 1000 114163 Dec 11 12:12 available
-rw-r--r-- 1 1000 1000 114163 Dec 11 12:12 available-old
-rw-r--r-- 1 1000 1000      8 Dec 11 12:10 cmethopt
-rw-r--r-- 1 1000 1000     98 Dec 11 12:07 diversions
-rw-r--r-- 1 1000 1000     29 Dec 11 12:07 diversions-old
drwxr-xr-x 2 1000 1000  20480 Dec 11 12:12 info
-rw-r----- 1 1000 1000      0 Dec 11 12:12 lock
drwxr-xr-x 2 1000 1000   4096 Nov 25 06:32 parts
-rw-r--r-- 1 1000 1000     35 Dec 11 12:12 statoverride
-rw-r--r-- 1 1000 1000      0 Dec 11 12:06 statoverride-old
-rw-r--r-- 1 1000 1000  98944 Dec 11 15:38 status
-rw-r--r-- 1 1000 1000  98944 Dec 11 15:38 status-old
drwxr-xr-x 2 1000 1000   4096 Dec 11 12:12 triggers
drwxr-xr-x 2 1000 1000   4096 Dec 11 14:19 updates
root <at> champaran:/var/lib/dpkg# mv updates/ foo
root <at> champaran:/var/lib/dpkg# mv foo updates
root <at> champaran:/var/lib/dpkg# id
uid=0(root) gid=0(root) groups=0(root)
root <at> champaran:/var/lib/dpkg# chown root *
chown: changing ownership of `alternatives': Operation not permitted
chown: changing ownership of `available': Operation not permitted
chown: changing ownership of `available-old': Operation not permitted
chown: changing ownership of `cmethopt': Operation not permitted
chown: changing ownership of `diversions': Operation not permitted
chown: changing ownership of `diversions-old': Operation not permitted
chown: changing ownership of `info': Operation not permitted
chown: changing ownership of `lock': Operation not permitted
chown: changing ownership of `parts': Operation not permitted
chown: changing ownership of `statoverride': Operation not permitted
chown: changing ownership of `statoverride-old': Operation not permitted
chown: changing ownership of `status': Operation not permitted
chown: changing ownership of `status-old': Operation not permitted
chown: changing ownership of `triggers': Operation not permitted
chown: changing ownership of `updates': Operation not permitted

--

-- 
Given the large number of mailing lists I follow, I request you to CC me
in replies for quicker response

Gmane