Friday, February 15, 2008

Linux compatibility layer in the FreeBSD kernel

Very easy to set up: install linux_dist-gentoo-stage3, download the tarball into a directory below /usr/local/gentoo-stage3/, mkdir dev and sys in the gentoo-stage3 directory, mount devfs, linprocfs and linsysfs and then do a "chroot /usr/local/gentoo-stage3 bash". To prepare the LTP extract the tarball, cd into the directory, type "make && make install" and then you can run the first tests with "./runltp -v -p -l mylogfilename 2>&1 | tee verboselog.txt".

If you don't have at least revision 1.187 of /sys/compat/linux/linux/misc.c you need to comment out "reboot02" in runtest/syscalls or your system will reboot. "send01" (and some test immediatly after that test) will cause a kernel panic if you don't have at least revision 1.282 of uipc_socket.c (mutex so_snd held when returning to userland).

There are some tests which hang around and do not finish if you use a -current prior to ~20061222, you need to kill those tests there.

Keep an eye on /usr/local/gentoo-stage3/tmp between tests and clean it up. You should also run "ipcs" and remove some leftover (compare before and after each run).

A little funny note: we are even more compatible than a real linux distribution (don't take this literally). LTP 20061222 does not even compile on Ubuntu 6.10. The error message is ../../generate.sh: 60: arith: syntax error: "cnt--" and the line in question is while [ $((cnt--)) -gt 0 ] ; do. If you do a loop unrolling by hand it fails later when you try to run the LTP tests even before it tries the first test. We did not try to proceed further, we want to fix problems on FreeBSD, not on Linux.

No comments:

Post a Comment

Powered By Blogger