Shared memory in chroot environment

I'm playing with Ubuntu 11.10 launched in a chroot environment under Android 3.2.1. Most of the software works fine except PostgreSQL. When installed or initdb launched it's saying:

FATAL: could not create shared memory segment: Function not implemented.
DETAIL: Failed Failed system call was shmget(key=1, size=1908736, 03600).

Is there any specific tuning of shared memory/PostgreSQL in a chroot? Perhaps some kind of mount the android ashmem to chrooted shm? I'm a novice in Linux.


Solution 1:

ashmem uses the /dev/ashmem device node. You need to create it in the chroot's /dev, either by using mknod with the apropriate numbers, or by doing a bind mount:

touch chroot/dev/ashmem
mount --bind /dev/ashmem chroot/dev/ashmem

(You might need Busybox or Ubuntu's mount for this.)