kfreebsd is now in a stable release
|Deletions are marked like this.||Additions are marked like this.|
|Line 18:||Line 18:|
|A. Debian GNU/kFreeBSD is available in the official Debian archive as ''unstable'' and ''testing'', i.e. the sources.list entries are identical to any other machine running Sid or Squeeze. Daily snapshots of D-I images are available at http://d-i.debian.org/daily-images/.||A. Debian GNU/kFreeBSD is available in the official Debian ''squeeze'' release. The sources.list entries are identical to what you'd use on a Debian GNU/Linux machine. Daily snapshots of D-I images are available at http://d-i.debian.org/daily-images/.|
- Q. What does the 'k' in "kFreeBSD" stand for?
- Q. What is the point of Debian GNU/kFreeBSD?
- Q. What version of kFreeBSD is supported?
- Q. Which Debian releases are available?
- Q. Which mirrors offer Debian GNU/kFreeBSD?
- Q. Is there any documentation available?
- Q. Who are the main contributors?
- Q. What hardware does this support?
- Q. Does Debian plan to drop support for the Linux kernel and replace it with a FreeBSD kernel?
- Q. Can I run Debian GNU/kFreeBSD in a chroot under FreeBSD?
- Q. Can I share a swap partition between GNU/Linux and GNU/kFreeBSD?
- Q. Can I share partitions between GNU/Linux and GNU/kFreeBSD?
- Q. What's the status of amd64 support?
- Q. Can *.deb packages co-exist with classical BSD ports?
- Q. Are there any plans to support alternate CPU instruction sets, e.g. ARM, PPC or Sparc64?
- Q. What about all those packages which use ALSA?
- Q. Does dpkg's license affect packages build with it, e.g. the kFreeBSD kernels?
- Q: Which syscall kernel interface is used by binaries compiled for Debian GNU/kFreeBSD?
- Q: Is it possible to run FreeBSD binaries under Debian GNU/kFreeBSD kernel?
- Q: Is it possible to run Linux binaries under Debian GNU/kFreeBSD kernel?
- Q: How do I setup a firewall with Debian GNU/kFreeBSD?
- Q: How do I setup a diskless system?
Using Debian GNU/kFreeBSD
- Q. Where can I download kFreeBSD?
- Q. How do I configure/enable sound?
- Q. Wireless?
- Q. How can I burn CD-ROMs?
- Q. How do I trace system calls?
- Q. How do I run native freebsd userland tools easily?
- Q. How do I debug the kernel?
- Q. Is there something like LXR for browsing the freebsd codebase?
- Q. What freebsd userland tools are still missing?
- Q. How do I scroll up on the console?
- Q. I specified wrong root device in fstab, how do I remount it in single user mode?
- Q. I just installed Debian GNU/kFreeBSD. Is there anything I can do to help making it more popular?
- Q. Is there ZFS support?
- Q. How can I build a package in a chroot?
- Q. How do I use pf (Packet Filter)?
- Q. Can I run this as a Xen DomU?
- Q. How do I boot Debian GNU/kFreeBSD into single user mode?
- Development questions
- Q. Is anyone running this in production?
- Q. How stable is kFreeBSD?
- Q. What license is kFreeBSD released under?
- Q. Are there any benchmarks available?
- Q. Are there any repositories for the non-free stuff that was taken out?
- Q. How do you support GPL-licensed file systems?
- Q. Are the kernel patches needed to make Debian GNU/kFreeBSD work given back to FreeBSD?
Q. What does the 'k' in "kFreeBSD" stand for?
A. It's an abbreviation. It stands for "kernel of". Hence "kFreeBSD" means "kernel of FreeBSD", and "GNU/kFreeBSD" means "GNU with kernel of FreeBSD".
Q. What is the point of Debian GNU/kFreeBSD?
A. This answer has its own wiki page, see Debian GNU/kFreeBSD why.
Q. What version of kFreeBSD is supported?
A. The latest GNU/kFreeBSD install CD is based on the 8.1 kernel, see for details. The 7.3 kernel is also available. If you are interested, you can take a look at the patches Debian applies to the kernel.
Q. Which Debian releases are available?
A. Debian GNU/kFreeBSD is available in the official Debian squeeze release. The sources.list entries are identical to what you'd use on a Debian GNU/Linux machine. Daily snapshots of D-I images are available at http://d-i.debian.org/daily-images/.
There are still also lenny-based snapshots of the GNU/kFreeBSD archive. Just use the install CD from Jan 2009 and put the following lines into your /etc/apt/sources.list
deb http://ftp.debian-ports.org/debian-snapshot/lenny unstable main deb http://ftp.debian-ports.org/debian-snapshot/lenny unreleasedF main
Q. Which mirrors offer Debian GNU/kFreeBSD?
A. See official mirror list.
Q. Is there any documentation available?
A. Apart from the regular Debian documentation, there is this wiki page, and that's about it. You are welcome to contribute to the main wiki page of course. If you are interested in kernel features specifically then http://www.freebsd.org/doc/handbook/ FreeBSD handbook might give you hints even thought it is targeted to users of FreeBSD userland.
Q. Who are the main contributors?
A. Contributors would be mostly: Aurélien Jarno, Petr Salinger, Luca Falavigna, Robert Millan, Cyril Brulebois.
Q. What hardware does this support?
Q. Does Debian plan to drop support for the Linux kernel and replace it with a FreeBSD kernel?
A. No. Both kernels will co-exist in Debian.
Q. Can I run Debian GNU/kFreeBSD in a chroot under FreeBSD?
A. Yes, but it won't work perfectly unless you apply some kernel patches. You can get them from the Debian kfreebsd-8 source package, but it is up to you to find out and decide which ones you need. We recommend to use a Debian kernel for running Debian GNU/kFreeBSD userland. In case something fails, you're on your own.
Q. Can I share a swap partition between GNU/Linux and GNU/kFreeBSD?
A. Yes, but it's not recommended. See http://www.tldp.org/HOWTO/Linux+FreeBSD-3.html for details on how to proceed. Also note that Linux tends to save suspend-to-disk data to the swap partition, which makes sharing swap less attractive.
Q. Can I share partitions between GNU/Linux and GNU/kFreeBSD?
A. Yes, recommended options are ext2fs and zfs.
- For ext2fs, when creating the filesystem, pass "-O none" to mke2fs for best results.
- For zfs, create the filesystem from GNU/kFreeBSD, then use zfs-fuse on GNU/Linux. Filesystems created by zfs-fuse might be too new for ZFS v14 in kFreeBSD to access.
A few other file systems may be used to transfer data, but only in one direction:
- For ufs (either 1 or 2), it's only supported readonly by Linux. Write support is highly experimental and is likely to cause panics.
- For ext3fs, kFreeBSD can only access it in readonly mode.
For reiserfs, readonly support has been added to kfreebsd 6.x (see 335019).
For xfs, readonly support has been added to kfreebsd 7.x (see 335020 for details). Write support is also planned.
Q. What's the status of amd64 support?
A. It is in roughly same state as the i386 one.
A. I am unsure about this. You can prepare a filesystem on a different partition/slice and use chroot to install the basic files. Look inside the latest ISO at http://glibc-bsd.alioth.debian.org/install-cd/, there is base/base.tgz inside install.iso. Unpack it into the created chroot. But at least multi-threaded programs will not work under pristine FreeBSD kernel.
Q. Can *.deb packages co-exist with classical BSD ports?
A. It is not good idea. Please use a chroot for things like this.
A. In the same way as on any other Debian system -- the usual prefix is /usr.
A. There are (almost) no files from any *.deb in /usr/local/. It is really left for local system administrator.
Q. Are there any plans to support alternate CPU instruction sets, e.g. ARM, PPC or Sparc64?
A. Not yet. But see http://lists.debian.org/debian-bsd/2011/01/msg00011.html
Q. What about all those packages which use ALSA?
Short A. No ALSA.
Long A. We have salsa which emulates some basic alsa features, which is sufficient for some packages, but far not for all of them.
Q. Does dpkg's license affect packages build with it, e.g. the kFreeBSD kernels?
Q: Which syscall kernel interface is used by binaries compiled for Debian GNU/kFreeBSD?
A: The native FreeBSD one.
Q: Is it possible to run FreeBSD binaries under Debian GNU/kFreeBSD kernel?
A: Yes, please just use the full chroot with FreeBSD libraries.
Q: Is it possible to run Linux binaries under Debian GNU/kFreeBSD kernel?
A: Only as long as standard FreeBSD Linux Compatibility Layer is sufficient. Some symlinks might be missing. The basic linux-i386 chroot of etch and lenny under kfreebsd-amd64 and kfreebsd-i386 works. The FreeBSD Linux Compatibility Layer claims it supports up to 2.6.16 syscalls. Please note that squeeze supports only 2.6.18 and above Linux kernels.
A start to dig deeper and test the limits (like #571523) is:
debootstrap --foreign --arch=i386 etch ./linux-chroot http://ftp.de.debian.org/debian
Q: How do I setup a firewall with Debian GNU/kFreeBSD?
A: You can use PF, the OpenBSD Packet Filter, which has been ported to the kernel of FreeBSD, and is available as part of the Debian GNU/kFreeBSD distribution.
A complete guide on PF is available at http://www.openbsd.org/faq/pf/index.html
Q: How do I setup a diskless system?
A: Support for network boot is still work in progress. It's possible to set it up with some tweaking, see this HOWTO: http://robertmh.wordpress.com/2011/02/04/diskless-debian-gnukfreebsd-howto/
Using Debian GNU/kFreeBSD
Q. Where can I download kFreeBSD?
A. debian-installer images: http://d-i.debian.org/daily-images/kfreebsd-amd64/ and http://d-i.debian.org/daily-images/kfreebsd-i386/
Previous versions were on: http://glibc-bsd.alioth.debian.org/install-cd/
Q. How do I configure/enable sound?
A. You have to load the proper kernel sound driver(s) using the kldload command. This works for me (SiS AC'97 sound controller):
kldload snd_csa kldload snd_driver
A. A debian specific bug makes wireless unusable. You can workaround this by using native freebsd userland tools from a chroot to setup wlan.
Q. How can I burn CD-ROMs?
A. Nothing special here, just use wodim:
apt-get install wodim wodim foo.iso
Q. How do I trace system calls?
A. You can use ktrace/kdump. Here's a cheatsheet, read man pages for details:
start: strace -o mytrace -s4096 -f -p PID
start: ktrace -f mytrace -d -p PID
Q. How do I run native freebsd userland tools easily?
A. First extract the binaries from the freebsd ISO image to a tarball on a gnu/linux system:
wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/FreeBSD-8.1-RELEASE-i386-disc1.iso mount -o loop FreeBSD-8.1-RELEASE-i386-disc1.iso /mnt mkdir freebsd-8.1-release-i386-base-manpages && cd freebsd-8.1-release-i386-base-manpages cat /mnt/8.1-RELEASE/base/base.??|tar vzxf - cat /mnt/8.1-RELEASE/manpages/manpages.??|tar vzxf - cd .. tar cjf freebsd-8.1-release-i386-base-manpages.tar.bz2 freebsd-8.1-release-i386-base-manpages umount /mnt
FreeBSD and Debian GNU/kFreeBSD:
if test `which wget` then wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/FreeBSD-8.1-RELEASE-i386-disc1.iso else fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/FreeBSD-8.1-RELEASE-i386-disc1.iso fi mdconfig -a -t vnode -f FreeBSD-8.1-RELEASE-i386-disc1.iso -u 0 mount -t cd9660 -o ro /dev/md0 /mnt mkdir freebsd-8.1-release-i386-base-manpages && cd freebsd-8.1-release-i386-base-manpages cat /mnt/8.1-RELEASE/base/base.??|tar vzxf - cat /mnt/8.1-RELEASE/manpages/manpages.??|tar vzxf - cd .. tar cjf freebsd-8.1-release-i386-base-manpages.tar.bz2 freebsd-8.1-release-i386-base-manpages umount /mnt mdconfig -d -u 0
and then unpack this freebsd-8.1-release-i386-base-manpages.tar.bz2 to e.g. /root and create a new file named /usr/local/bin/freebsd with the contents
exec chroot /root/freebsd-8.1-release-i386-base-manpages "$@"
and make it executable. You can now run freebsd useland tools easily by prefixing the commands with freebsd:
# uname GNU/kFreeBSD # freebsd uname FreeBSD
(For yor convenience a completely unofficial copy of this tarball is also available at http://lindi.iki.fi/lindi/kfreebsd/freebsd-8.1-release-i386-base-manpages.tar.bz2 so that you do not need to download the whole ISO image.)
Since many tools depend on /dev you might want to mount devfs under the chroot with e.g.
mount -t devfs devfs /root/freebsd-8.1-release-i386-base-manpages/dev
Q. How do I debug the kernel?
A. Recompile the kernel with debugging symbols and support for built-in debugger:
# Make sure you have at least 4 gigabytes of disk space. apt-get source kfreebsd-8 cd kfreebsd-8-8.1 export QUILT_PATCHES=debian/patches quilt push -a quilt new debugger.diff quilt add sys/i386/conf/GENERIC editor sys/i386/conf/GENERIC # Add the following options: # makeoptions DEBUG="-g" # options DDB # options KDB dch -i # Add a new changelog entry. # You probably want to use something like "+debugger" in the version number and # UNRELEASED in place of "unstable". quilt refresh debuild sudo debi sudo reboot
Here's an example debugging story:
"ifconfig wlan0 create wlandev ath0" fails with "ifconfig: SIOCIFCREATE2: Bad address". By reading the source code I guess that this might be caused by copyin() failing in wlan_clone_create() function. I hit ctrl-alt-esc to enter the debugger prompt and add a breakpoint to that function:
KDB: enter: manual escape to debugger [thread pid 12 tid 100013 ] Stopped at kdb_enter+0x3d: movl $0,kdb_why db> break wlan_clone_create db> c
and then proceed with the failing command using
root@debian:~# ifconfig wlan0 create wlandev ath0 [thread pid 1309 tid 100088 ] Breakpoint at wlan_clone_create: pushl %ebp db>
If you are using qemu you can start it with the "-s" option and then use
gdb flavor-8.1-1-686/sys/i386/compile/DEBCUSTOM/kernel.debug target remote host:port
to debug the kernel with line number information.
TODO: on i386 x/x $ebp,10 shows the stack ($ebp+4) contains the return address ($ebp+8) contains the first argument ($ebp+12) contains the second argument ($ebp+16) contains the third argument
Beware: 1+4*4 == 11 but 1+(4*4) == 17 in the debugger
Q. Is there something like LXR for browsing the freebsd codebase?
Q. What freebsd userland tools are still missing?
A. As of 2010 I can't find at least the following binaries:
Q. How do I scroll up on the console?
A. Hit scroll lock. Then use page up, page down and arrow keys to scroll.
Q. I specified wrong root device in fstab, how do I remount it in single user mode?
A. You can enter single user mode by adding -s option to kernel in grub. You can then mount the root file system read-write with
mount -u -o ro /dev/ad0s1 / mount -u -o rw /dev/ad0s1 /
and fix your /etc/fstab. (Two mount commands are needed due to a bug).
Q. I just installed Debian GNU/kFreeBSD. Is there anything I can do to help making it more popular?
A. Yes! You can install/enable popularity-contest (see http://popcon.debian.org/) to increase our user count. Also you can register yourself as Debian GNU/kFreeBSD user in http://buildd.net/cgi/archvote.phtml. You might also want to tell us how did you hear about Debian GNU/kFreeBSD in this poll. And of course, you can tell all your friends about it. =)
Finally, you can install the "bsdstats" script to record your Debian GNU/kFreeBSD installation at bsdstats.org (Debian GNU/kFreeBSD not listed as possible BSD OS). You need to install the following packages for the script to work:
apt-get install netcat mksh sharutils openssl bind9-host
Then, you can simply run the script manually via "mksh bsdstats", and/or via a cron-job (weekly, for example).
Q. Is there ZFS support?
A: Yes! You have to install the zfsutils package.
apt-get install zfsutils
Q. How can I build a package in a chroot?
A. For now, sbuild isn't working properly since schroot seems to be using some Linuxisms. It is possible to set up pbuilder in the meanwhile, using the patch and the configuration mentioned in #560332. Andi noted some limitations in #542837, it would be nice to investigate.
Q. How do I use pf (Packet Filter)?
A. (Warning: this answer is a stub only, please double-check and expand as needed.) It seems one has to load the pf module, and then enable pf. Something like that should do:
sudo kldload pf sudo pfctl -e
Q. Can I run this as a Xen DomU?
A: Seems someone has gotten it to boot: http://article.gmane.org/gmane.linux.debian.ports.bsd/4238, http://smp.if.uj.edu.pl/~baryluk/kfreebsd-xen/. The support in FreeBSD kernel have been significantly improved in 8.2 release. You might consider to use precompiled 8.2 rc1 kernel from http://io.debian.net/~salinger/
Q. How do I boot Debian GNU/kFreeBSD into single user mode?
A. In GRUB, edit the entry's line starting with "kfreebsd" and add a " -s" (blank dash "s") at the end. Then boot.
Q. Where can I check buildd logs for a particular package on kfreebsd-*?
A. At the usual place for almost all build logs: https://buildd.debian.org/status/
Q. I'm a Debian maintainer. Is there any machine running GNU/kFreeBSD I can have access to?
Q. Do I have the option of which libc to use?
Q. Why was the choice made to use glibc?
A. Because otherwise far more packages would need patches to build on Debian GNU/kFreeBSD. All packages in Debian GNU/Linux are known to work fine with (e)glibc. So most of the work is in only one package, the libc. The no more active Debian GNU/NetBSD port tried to use the BSD libc, but not using the glibc was probably one of the reasons why it stalled.
Q. Is anyone running this in production?
Q. How stable is kFreeBSD?
Q. What license is kFreeBSD released under?
Q. Are there any benchmarks available?
Q. Are there any repositories for the non-free stuff that was taken out?
Q. How do you support GPL-licensed file systems?
Q. Are the kernel patches needed to make Debian GNU/kFreeBSD work given back to FreeBSD?
A. Yes, but not all are accepted. Q2: Why?