1

I have installed the latest raspbian on /dev/sda1, root filesystem is btrfs. So I had to recompile the kernel and compile the btrfs module into the kernel. For that, I used the latest raspberrypi/linux git (4.4.8), following exactly what was said here.

Now, everything seems to work, except for two things:

  • it fails to run "Update UTMP about System Boot/Shutdown" during boot
  • I cannot run any package manager, be it apt-get, dpkg, or aptitude. apt-get update just fails with

    E: Could not get lock /var/lib/apt/lists/lock - open (13: Permission denied)
    E: Unable to lock directory /var/lib/apt/lists/
    E: Could not get lock /var/lib/dpkg/lock - open (13: Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
    

    which is the only output.

I did search the internet and read just about everything I could find. But almost all the answers talk about running as root. So, no:

  • I did not forget sudo, I also tried logging in as root or doing sudo bash, but it all makes no difference.
  • I deleted all the lock files under /var, no success.
  • There are no other processes running. The lock files stay deleted until I execute apt-get update again, which recreates them and then it fails again :(

And I installed both, Ubuntu as well as Raspbian - same problem.

This has got to do with my kernel since everything else is unmodified. But I am lost now. How can I debug this problem? Which kernel config option did I forget or break?

I looked at the process with strace and got

open("/var/lib/dpkg/lock", O_RDWR|O_CREAT|O_LARGEFILE|O_NOFOLLOW, 0640) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC)
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 0x...) = -1 EACCESS (Permission denied)

The only thing I am wondering about is the fcntl64? Why 64?

2
  • 64 bit cpu. I guess you don't have that on the pi-2.
    – ott--
    Commented Apr 27, 2016 at 21:23
  • @ott strace reports system calls. They are glue between userland and the kernel, and that one obviously ran. Anyway, if the kernel or native library had been compiled 64-bit, the whole system would not work at all (i.e., this is just a coincidence in the name of the call).
    – goldilocks
    Commented Apr 28, 2016 at 3:09

1 Answer 1

2

Oh no! Days of debugging wasted, but I finally found it: I disabled CONFIG_FILE_LOCKING (Enable POSIX file locking API), an option you will only see if CONFIG_EXPERT is set (which I usually don't set, but the raspberry config has it). It is needed for any locking, not just NFS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.