Contents

  1. Pytania podstawowe
    1. Q. Co oznacza 'k' w "kFreeBSD"?
    2. Q. Jaki jest cel Debiana GNU/kFreeBSD?
    3. Q. Która wersja kFreeBSD jest wspierana?
    4. Q. Które edycje Debiana są dostępne?
    5. Q. Które serwery lustrzane oferują Debiana GNU/kFreeBSD?
    6. Q. Czy są dostępne instrukcje dotyczące ściągnięcia i instalacji kFreeBSD, które nie wymagają wcześniejszych doświadczeń z Debianem?
    7. Q. Is there any documentation available?
    8. Q. Who are the main contributors?
    9. Q. What hardware does this support?
    10. Q. Does Debian plan to drop support for the Linux kernel and replace it with a FreeBSD kernel?
  2. Pytania techniczne
    1. Q. Can I run Debian GNU/kFreeBSD in a chroot under FreeBSD?
    2. Q. Can I share a swap partition between GNU/Linux and GNU/kFreeBSD?
    3. Q. Can I share partitions between GNU/Linux and GNU/kFreeBSD?
    4. Q. What's the status of amd64 support?
    5. Q. Is there any way to upgrade to Debian-*bsd an existing, running FreeBSD installation (whether it makes sense or not)
    6. Q. Can *.deb packages co-exist with classical BSD ports?
    7. Q. Are the *.deb packages for *bsd handled the same old way they did on Linux, or do they simply use the /usr/local filesystem?
    8. Q. What about some specs I once read about leaving the use of /usr/local to the system administrator? (Maybe these are concerning only to Linux...)
    9. Q. Are there any plans to support alternate CPU instruction sets, e.g. ARM, PPC or Sparc64?
    10. Q. What about all those packages which use ALSA?
    11. Q. Does dpkg's license affect packages build with it, e.g. the kFreeBSD kernels?
    12. Q: Which syscall kernel interface is used by binaries compiled for Debian GNU/kFreeBSD?
    13. Q: Is it possible to run FreeBSD binaries under Debian GNU/kFreeBSD kernel?
    14. Q: Is it possible to run Linux binaries under Debian GNU/kFreeBSD kernel?
    15. Q: How do I setup a firewall with Debian GNU/kFreeBSD?
    16. Q. Can I run Java programs?
    17. Q: How do I setup a diskless system?
    18. Q: How do I mount root filesystem by UUID?
    19. Q. How does kfreebsd's config differ from upstream and why?
  3. Using Debian GNU/kFreeBSD
    1. Q. Where can I download kFreeBSD?
    2. Q. How do I configure/enable sound?
    3. Q. Wireless?
    4. Q. How can I burn CD-ROMs?
    5. Q. How do I trace system calls?
    6. Q. How do I run native freebsd userland tools easily?
    7. Q. How do I debug the kernel?
    8. Q. Is there something like LXR for browsing the freebsd codebase?
    9. Q. What freebsd userland tools are still missing?
    10. Q. How do I configure keyboard layout on the console?
    11. Q. How do I scroll up on the console?
    12. Q. I specified wrong root device in fstab, how do I remount it in single user mode?
    13. Q. I just installed Debian GNU/kFreeBSD. Is there anything I can do to help making it more popular?
    14. Q. Is there ZFS support?
    15. Q. Can I use ZFS as root file system?
    16. Q. How can I build a package in a chroot?
    17. Q. How do I use pf (Packet Filter)?
    18. Q. Can I run this as a Xen DomU?
    19. Q. How do I boot Debian GNU/kFreeBSD into single user mode?
    20. Q. What is this idle process and why is it using all available CPU time?
  4. Development questions
    1. Q. Where can I check buildd logs for a particular package on kfreebsd-*?
    2. Q. I'm a Debian maintainer. Is there any machine running GNU/kFreeBSD I can have access to?
    3. Q. Do I have the option of which libc to use?
    4. Q. Why was the choice made to use glibc?
  5. Pytania bez odpowiedzi
    1. Q. Is anyone running this in production?
    2. Q. How stable is kFreeBSD?
    3. Q. What license is kFreeBSD released under?
    4. Q. Are there any benchmarks available?
    5. Q. Are there any repositories for the non-free stuff that was taken out?
    6. Q. How do you support GPL-licensed file systems?
    7. Q. Are the kernel patches needed to make Debian GNU/kFreeBSD work given back to FreeBSD?

Pytania podstawowe

Q. Co oznacza 'k' w "kFreeBSD"?

A. To skrót oznaczający "kernel of" (jądro). Stąd "kFreeBSD" oznacza "jądro FreeBSD" i "GNU/kFreeBSD" oznacza "GNU z jądrem FreeBSD".

Q. Jaki jest cel Debiana GNU/kFreeBSD?

A. Ta odpowiedź ma swoją własną stronę wiki, zobacz pl/Debian_GNU/kFreeBSD_why.

Q. Która wersja kFreeBSD jest wspierana?

A. Squeeze jest oparty na wersji jądra 8.1, zobacz tutaj po szczegóły. Jeśli chcesz, możesz sprawdzić jakie łatki zostały nałożone na jądro w Debianie.

Q. Które edycje Debiana są dostępne?

A. Debian GNU/kFreeBSD jest dostępny w oficjalnym wydaniu Debiana Squeeze. Po szczegóły zobacz główną stronę wiki.

Q. Które serwery lustrzane oferują Debiana GNU/kFreeBSD?

A. Zobacz oficjalną listę serwerów lustrzanych.

Q. Czy są dostępne instrukcje dotyczące ściągnięcia i instalacji kFreeBSD, które nie wymagają wcześniejszych doświadczeń z Debianem?

A. Tak, zobacz instrukcje instalacji dla kfreebsd-i386 oraz kfreebsd-amd64.

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 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 Filipozzi, Robert Millan, Cyril Brulebois.

Q. What hardware does this support?

A. see the install instructions and the upstream documentation.

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.

Pytania techniczne

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.

A few other file systems may be used to transfer data, but only in one direction:

Q. What's the status of amd64 support?

A. It is in roughly same state as the i386 one.

Q. Is there any way to upgrade to Debian-*bsd an existing, running FreeBSD installation (whether it makes sense or not)

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

Q. Are the *.deb packages for *bsd handled the same old way they did on Linux, or do they simply use the /usr/local filesystem?

A. In the same way as on any other Debian system -- the usual prefix is /usr.

Q. What about some specs I once read about leaving the use of /usr/local to the system administrator? (Maybe these are concerning only to Linux...)

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. There are plans for a MIPS port, see Debian_GNU/kFreeBSD_MIPS

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?

A. No.

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. Can I run Java programs?

A. Not very well yet. gij works but its Swing support has not received attention lately. openjdk-6-jre is not available for kfreebsd-* but since it has been ported to FreeBSD all hope is not lost.

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/

Q: How do I mount root filesystem by UUID?

A. The following applies only to UFS2. Use e.g.

# grub-probe -t fs_uuid --device /dev/ad0s1
4cc08aab6455cf88

to figure out the UUID of your current root filesystem and then use it in fstab as follows:

/dev/ufsid/4cc08aab6455cf88      /               ufs     rw              0       1

Note that your /boot/grub/device.map might still refer to the disk by its real name as there is no way to refer to the whole disk by UUID. However, this does not seem to be a problem. In fact, it seems that everything works if you create an empty device.map. By applying

--- /etc/grub.d/10_kfreebsd.orig        2011-02-09 22:52:50.000000000 +0200
+++ /etc/grub.d/10_kfreebsd     2011-02-09 22:44:09.000000000 +0200
@@ -136,6 +136,7 @@
 
   case ${GRUB_FS} in
     zfs)               kfreebsd_device=$(grub-probe -t fs_label --device ${GRUB_DEVICE})$(grub-mkrelpath / | sed -e "s,/*@$,,") ;;
+    ufs2)              kfreebsd_device=/dev/ufsid/$(grub-probe -t fs_uuid --device ${GRUB_DEVICE}) ;;
     *)                 kfreebsd_device=${GRUB_DEVICE} ;;
   esac

grub.cfg will pass root=/dev/ufsid/XXX parameter to kernel. This has possibly been fixed in upstream bzr revision 2827.

Q. How does kfreebsd's config differ from upstream and why?

A. You can take a look at the changes made to sys/amd64/conf/GENERIC.

Using Debian GNU/kFreeBSD

Q. Where can I download kFreeBSD?

A. See the main wiki page.

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

An utility to load appropiate driver(s) automatically is being worked on, see: http://lists.debian.org/debian-bsd/2011/02/msg00073.html

Q. Wireless?

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:

gnu/linux

gnu/kfreebsd

start: strace -o mytrace -s4096 -f -p PID
stop: ctrl-c
view: less mytrace

start: ktrace -f mytrace -d -p PID
stop: ktrace -c -p PID
view: kdump -f mytrace -m 4096

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

or if you prefer, on a real FreeBSD or Debian GNU/kFreeBSD system:

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>

Using the command "x/x $ebp,10" you can contents of the stack which includes there function arguments that were passed to wlan_clone_create. On kfreebsd-i386 the following should be true:

address

contents

$ebp + 4

return address (usually the caller unless a tail call optimization is done)

$ebp + 8

the first argument

$ebp+12

the second argument

$ebp+16

the third argument

...

...

Beware that the debugger silently converts between decimal and hexadecimal: 1+4*4 == 11 but 1+(4*4) == 17!

If the in-kernel debugger is too primitive for your taste you can also use gdb. The easiest solution is to run the system under qemu started with the "-s" option and the to connect to it using gdb:

gdb flavor-8.1-1-686/sys/i386/compile/DEBCUSTOM/kernel.debug
target remote localhost:1234

Q. Is there something like LXR for browsing the freebsd codebase?

A. Yes, see http://fxr.watson.org for kernel stuff and cvsweb for userland.

Q. What freebsd userland tools are still missing?

A. As of 2011 I can't find at least the following binaries:

glabel(8)

dumpon(8)

geli(8)

mount_nfs(8)

Q. How do I configure keyboard layout on the console?

A. Run "dpkg-reconfigure kbdcontrol".

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 to the end of the kfreebsd command. 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. Can I use ZFS as root file system?

A. Yes, with some caveats:

You may not use multi-device arrays nor gzip compression in this case (default compression is fine). You may want to read about the latest developments in GRUB which will make this possible: http://lists.debian.org/debian-bsd/2011/02/msg00125.html.

If you're not repartitioning this disk from scratch, it's likely that GRUB install will fail later on (see #614768.

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, the xen flavour is available in unstable (currently as kfreebsd-image-8.2-1-xen).

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. What is this idle process and why is it using all available CPU time?

A. It is a kernel thread that executes architecture specific instructions to save energy when there is nothing else to execute. If you are curious, see "man runqueue" or take a look at the source code.

Development questions

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?

A. Yes, see http://io.debian.net/ and http://asdfasdf.debian.net/. All DDs automatically have an account.

Q. Do I have the option of which libc to use?

A. No.

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.

Pytania bez odpowiedzi

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, you can see the patches http://svn.debian.org/wsvn/glibc-bsd/trunk/kfreebsd-8/debian/patches/ but not all are accepted by upstream. Q2: Why? A2: Some of the patches see the "Status:" lines in the patches themselves.


CategoryPermalink