跳转到内容


Debian GNU/kFreeBSD Setup Guide, 2015 edition

Debian kFreeBSD

  • 您无法回复此主题
No replies to this topic

#1 冰力

    Administrator

  • 总版主
  • 1269 帖子数:

发表于 2016/12/22 15:17:29

Norimitsu Sugimoto <dictoss@live.jp>
Agenda
  • Self-introduction.

  • Debian Ports & Debian GNU/kFreeBSD.
  • Installation of Debian GNU/kFreeBSD.
  • Debian GNU/kFreeBSD specific Debian packages.
  • Dual-boot configuration of Windows and Debian GNU/kFreeBSD.
  • Setting up the hardware and software.
  • Conclusion.
  • References.
Self-introduction
  • Norimitsu Sugimoto (杉本 典充).

  • dictoss@live.jp
  • Twitter: @dictoss
  • Have used Debian for more than 10 years, FreeBSD for more than 5 years.
  • [Have become interested in?] Debian GNU/kFreeBSD? [が気になっておりウォッチ中]
  • Working as a software developer.

Debian Ports & Debian GNU/kFreeBSD
  • Debian Ports:

    • https://www.debian.org/ports/.
    • Projects porting Debian to a variety of CPU architectures and kernels.
    • There are some official release architectures; some are unofficial.
  • Debian GNU/kFreeBSD:

    • https://wiki.debian....an_GNU/kFreeBSD
    • Is a flavour of Debian based on the FreeBSD kernel, rather than the Linux kernel.
    • Architecture names in Debian are kfreebsd-i386, kfreebsd-amd64.
    • 2011, released as a "technology preview" with Debian 6 (squeeze).
    • 2015, it became separated from official Debian 8 release (jessie).

Installation: Creating and booting install media
  • Download a mini.iso of daily-images.
  • Choose kfreebsd-amd64 if you want to use the ZFS.

  • Copy to a USB memory stick with dd
  • Boot from USB memory stick into the installer.
  • Installer limitations:
    • [Native] UEFI boot is not supported.
    • Disc format is only compatible with MBR (GPT is not allowed). [Actually - GPT should work, please file a bug if it does not :)]
  • I ran the installer with LANG=C because it cannot be displayed in Japanese. [Actually - should be supported, only for kfreebsd-amd64, using the GTK version of mini.iso in graphical mode]

Installation: Partition configuration and file system
  • Notes for partition configuration:
  • Root partition must be a primary partition. [That is, ada0p1-ada0p4, not an MSDOS 'logical' partition like ada0p5+]
  • Especially when dual-booting with Windows, be aware of the number of remaining primary partitions. [4 maximum]
  • ZFS - a good choice on kfreebsd-amd64, if enough RAM available [4GiB+ recommended].
  • UFS - preferred for kfreebsd-i386, or if available RAM is less.
  • When you select UFS, the default is synchronous write mode, which may seem very slow. [If you have more than one partition, then only the root (/) will be synchronous - other partitions will have softdeps enabled and be much faster].

Debian GNU/kFreeBSD specific packages
  • kfreebsd-image-* [the FreeBSD kernel]
  • zfsutils
  • [ufsutils]
  • freebsd-utils
  • freebsd-smbfs
  • freebsd-ppp
  • pf
  • [devd]
  • [fuse4bsd]
  • [cuse4bsd]

Dual-booting Windows & Debian GNU/kFreeBSD
  • kfreebsd uses grub2 as bootloader
  • Manually adding a boot menu entry for Windows: [with my corrections, I think]

# vi /etc/grub.d/40_custom.kfreebsd
menuentry "Windows (loader)" {
    insmod part_msdos
    set root='(hd0,msdos2)'
    chainloader +1
}
# update-grub2

Configuration: Wired LAN
  • Interface names depend on the NIC model:
    • em0 [= Intel chipset]
    • re0 [= Realtek chipset
    • [instead of a generic eth0...eth1 name for everything]

  • Configuration is in the usual Debian /etc/network/interfaces file:

    • allow-hotplug is not available, for Linux udev functionality [Actually - kfreebsd should support this using devd instead - or file a bug :)]

    • auto em0 and such are inconvenient because [??? - などとしておくと外出先でも DHCP でアドレスを取得しにいくので不便]

  • ifup em0=network-name is available [what is that?]

Wireless LAN

  • Add non-free to /etc/apt/sources.list if needed for firmware, then:

# apt-get install wpa_supplicant firmware-iwlwifi
  • There will be two interfaces:
    • iwn0 (in case of Intel wireless chipset) is the physical interface.
    • wlan0 is a logical interface created by:

# ifconfig wlan0 create wlandev iwn0

$ wpa_passphrase ssid passphrase > wpa_example.conf
# wpa_supplicant -i wlan0 -c ./wpa_example.conf
# dhclient -v -1 wlan0
  • Some hints if it fails to connect:

    • [Sometimes ifconfig wlan0 down up does help].
    • Force using access point in 2.4GHz mode: [Actually, disables 802.11n modulation in the 2.4GHz band.]

ifconfig wlan0 -ht40

  • [To use 5GHz mode, try ifconfig wlan0 create wlandev iwn0 mode 11na]

USB modems [GSM/UMTS]
  • To switch a USB device into modem mode:

# apt-get install freebsd-ppp usb-modeswitch
# usb_modeswitch -c /etc/usbmodeswitch.d/config.conf

# vi /etc/ppp/ppp.conf
# ppp -foreground peername

Video drivers
  • [Most?] Intel integrated graphics chipsets are supported.
  • The Radeon series is good to use as-is. [May want to install firmware-linux-nonfree for microcode].
  • For Nvidia there is only an old driver [non-free].

# apt-get install xserver-xorg-video-intel
# apt-get install xserver-xorg-video-nv
# apt-get install xserver-xorg-video-radeon
  • If you enable KMS, resolution increases in the console, and it is possible to deliver maximum performance in the X Window System:

# kldunload i915
# kldload i915kms
# vi /etc/modules
i915kms
[This should happen automatically now in jessie-kfreebsd]

Changing the default locale

# dpkg-reconfigure locales
  • Select ja_JP.UTF-8 for Japanese, for example.

Keyboard settings of the X Window System
  • It is recognized as English [QWERTY] keyboard unless set in /etc/X11/xorg.conf

  • Keyboard detection in xorg uses hal on FreeBSD.
  • [??? - 現状はウィンドウマネージャの起動後にウィンドウマネージャのキーボード設定やコマンドラインで対応している]

Web browser
  • iceweasel package has not[!?] been provided. [Actually it is.]
  • chromium browser is not available on kfreebsd.
  • Flash is provided by upstream as a Linux-only binary, you may only use gnash [free-software alternative].

USB 3.0
  • kfreebsd-image-10.1 provides xhci.ko
  • Untested yet.

Sound driver
  • FreeBSD uses OSS [rather than ALSA]
  • Generally for sound you must load snd_hda.ko driver, used in many modern PCs.
  • pulseaudio should work.

Power management

  • CPU clock is automatically controlled by powerd

$ sysctl dev.cpu.0.freq
dev.cpu.0.freq: 800
  • Battery status:

# /usr/sbin/acpiconf -i 0
  • suspend mode [generally works OK]
  • hibernate is untested [probably not implemented]

Mounting USB drives

  • Use the mount_msdosfs command
  • Specifying the character encoding may be necessary:

# mount_msdosfs -L ja JP.UTF-8 -D CP932 /dev/da0s1 /mnt/usb
  • exFAT, NTFS cannot be mounted currently. [Actually, NTFS mount is possible. Don't remember how to do this, but may need the fuse4bsd package installed.]

Linux emulation
  • FreeBSD has a Linux binary compatibility layer.
  • linux-i386 binaries can be executed.

  • Because of the Linux kernel API version being emulated, binaries from squeeze are suggested.

  • Use debootstrap to make a linux-i386 chroot

Virtualization
  • What seems to work:
    • FreeBSD Jails
    • qemu
  • Those that do not work yet:

    • VirtualBox [kfreebsd can run as a guest inside VirtualBox, but VirtualBox can't run on kfreebsd yet]
    • bhyve [coming someday - a Debian ITP bug open for this]

Conclusion
  • I tried to summarize how to set up Debian GNU/kFreeBSD.
  • I think this is a good opportunity to study the OS.
  • [??? - まずは使ってみるところから初めてみるといいと思います]
  • [Ask for help if you get stuck? - 使ってみて疑問や動かないところがありましたら、相談に乗ります]
  • Aiming to make a stable release [jessie-kfreebsd] - Good luck! [Thanks!]