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.

link|improve this question
feedback

1 Answer

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.)

link|improve this answer
Thanks. Mount failed with error "Not a directory". Have tried ln /dev/ashmem $chroot/dev/ashmem - failed cross-device link. Tried mknod, but still same error. Have also experimented with creating $chroot/dev/shm device with no success. – Stan Oct 25 '11 at 16:55
@Stan: 1) apparently the Linux version used by Android does not yet support file bindmounts; 2) obvious; 3) impossible, as mknod does not create links -- but a different error message might occur; 4) ashmem, not shm. – grawity Oct 25 '11 at 19:42
feedback

Your Answer

 
or
required, but never shown

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