Aktualizacja systemu 10.x

/etc/make.conf

Pierwsza rzecz, to wgranie aktualnego /etc/make.conf (mojego rozbudowanego) oraz odpowiednie dostrojenie /etc/make/make.local.conf.

/etc/src.conf

Następnie wykonanie pliku odpowiedzialnego za kompilację systemu operacyjnego:

WITHOUT_BIND=           true
WITHOUT_APM=            true
WITHOUT_ATM=            true
WITHOUT_BLUETOOTH=      true
WITHOUT_BSNMP=          true
WITHOUT_FLOPPY=         true
WITHOUT_GSSAPI=         true
WITHOUT_IPX=            true
WITHOUT_LPR=            true
WITHOUT_KERBEROS=       true
WITHOUT_SENDMAIL=       true
WITHOUT_NETGRAPH=       true
WITHOUT_NIS=            true
WITHOUT_OPENSSH=        true
WITHOUT_PPP=            true
WITHOUT_WIRELESS=       true
WITHOUT_RCMDS=          true
WITHOUT_NTP=            true
WITHOUT_UNBOUND=        true

WITH_BSD_GREP=          true
WITH_CLANG=             true
WITH_CLANG_FULL=        true
WITH_NAND=              true
WITH_PKGTOOLS=          true

Trzeba pamiętać, aby nie wyłączać mailwrappera (WITHOUT_MAILWRAPPER), bo jest przydatny do podmiany sendmaila na postfixa albo ssmtp albo coś innego.

Tworzenie wlasnego kernela

Od wersji 9.x zamiast dysków numerowanych zgodnie z podłączeniami SATA wykorzystywany jest "mechanizm" nazewnictwa dysków jako ada0, ada1, etc. Aby móc z tego korzystać w konfiguracji kernela muszą się znaleźć następujące opcje:

device          ata
device          ada
options         ATA_CAM         # Handle legacy controllers with CAM
options         ATA_STATIC_ID   # Static device numbering

COMMON10

Pełna konfiguracja (na podstawie serwerka domowego):

ident           GOMMON10

#makeoptions    DEBUG=-g                # Build kernel with gdb(1) debug symbols

options         SCHED_ULE               # ULE scheduler
options         PREEMPTION              # Enable kernel thread preemption
options         INET                    # InterNETworking
options         INET6                   # IPv6 communications protocols
options         SCTP                    # Stream Control Transmission Protocol
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates support
options         UFS_ACL                 # Support for access control lists
options         UFS_DIRHASH             # Improve performance on big directories
options         UFS_GJOURNAL            # Enable gjournal-based UFS journaling
options         MD_ROOT                 # MD is a potential root device
options         MSDOSFS                 # MSDOS Filesystem
options         CD9660                  # ISO 9660 Filesystem
options         PROCFS                  # Process filesystem (requires PSEUDOFS)
options         PSEUDOFS                # Pseudo-filesystem framework
options         GEOM_PART_GPT           # GUID Partition Tables.
options         GEOM_LABEL              # Provides labelization
options         SCSI_DELAY=5000         # Delay (in ms) before probing SCSI
options         KTRACE                  # ktrace(1) support
options         STACK                   # stack(9) support
options         SYSVSHM                 # SYSV-style shared memory
options         SYSVMSG                 # SYSV-style message queues
options         SYSVSEM                 # SYSV-style semaphores
options         _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options         PRINTF_BUFR_SIZE=128    # Prevent printf output being interspersed.
options         KBD_INSTALL_CDEV        # install a CDEV entry in /dev
options         HWPMC_HOOKS             # Necessary kernel hooks for hwpmc(4)
options         AUDIT                   # Security event auditing
options         MAC                     # TrustedBSD MAC Framework
#options        KDTRACE_HOOKS           # Kernel DTrace hooks
options         INCLUDE_CONFIG_FILE     # Include this file in kernel
options         KDB                     # Kernel debugger related code
options         KDB_TRACE               # Print a stack trace for a panic
options         SMP                     # Symmetric MultiProcessor Kernel
#device         apic                    # I/O APIC
device          cpufreq
device          acpi
device          eisa
device          pci
device          scbus           # SCSI bus (required for ATA/SCSI)
device          ch              # SCSI media changers
device          da              # Direct Access (disks)
device          sa              # Sequential Access (tape etc)
device          cd              # CD
device          pass            # Passthrough device (direct ATA/SCSI access)
device          ses             # Enclosure Services (SES and SAF-TE)
device          ctl             # CAM Target Layer
device          atkbdc          # AT keyboard controller
device          atkbd           # AT keyboard
device          psm             # PS/2 mouse
device          vga             # VGA video card driver
options         VESA            # Add support for VESA BIOS Extensions (VBE)
device          splash          # Splash screen and screen saver support
device          sc
options         SC_PIXEL_MODE   # add support for the raster text mode
device          agp             # support several AGP chipsets
#device         pmtimer
device          uart            # Generic UART driver
device          loop            # Network loopback
device          random          # Entropy device
device          ether           # Ethernet support
device          vlan            # 802.1Q VLAN support
device          tun             # Packet tunnel.
device          pty             # BSD-style compatibility pseudo ttys
device          md              # Memory "disks"
device          gif             # IPv6 and IPv4 tunneling
device          faith           # IPv6-to-IPv4 relaying (translation)
device          firmware        # firmware assist module
device          bpf             # Berkeley packet filter
options         USB_DEBUG       # enable debug msgs
device          uhci            # UHCI PCI->USB interface
device          ohci            # OHCI PCI->USB interface
device          ehci            # EHCI PCI->USB interface (USB 2.0)
device          xhci            # XHCI PCI->USB interface (USB 3.0)
device          usb             # USB Bus (required)
device          uhid            # "Human Interface Devices"
device          ukbd            # Keyboard
device          umass           # Disks/Mass storage - Requires scbus and da
device          ums             # Mouse

options         DUMMYNET
options         IPFIREWALL
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         QUOTA                   #enable disk quotas
options         HZ=1000
options         DEVICE_POLLING          # gryzie si/e z SMP
options         IPFIREWALL_VERBOSE      #print information about
options         IPFILTER_LOG

options         ATA_STATIC_ID   # Static device numbering

HQ10x64

include         COMMON10
ident           HQ10x64
cpu             HAMMER
machine         amd64

device          ada
device          ahci
device          ata

options         SC_NORM_ATTR="(FG_GREEN|BG_BLACK)"
options         SC_NORM_REV_ATTR="(FG_CYAN|BG_BLACK)"
options         SC_KERNEL_CONS_ATTR="(FG_YELLOW|BG_BLACK)"
options         SC_KERNEL_CONS_REV_ATTR="(FG_BLACK|BG_CYAN)"

options         COMPAT_FREEBSD32
options         COMPAT_43TTY
options         COMPAT_LINUX32

Zmiana konsoli sc na vt (UEFI)

Od pewnego czasu obsługa konsoli w systemie została zmieniona z sc(4) na vt(4). Szczególnie należy mieć na uwadze wykorzystanie vt(4) w przypadku uruchamiania systemu z UEFI. Zgodnie z opisem idei sterownika vt(4) wspiera kodowanie UTF-8, lepsze wykorzystanie trybu graficznego, etc.

Konfiguracja własnego kernela powinna wyglądać następująco:

# vt is the new video console driver
device          vt
device          vt_vga
device          vt_efifb

options         TERMINAL_NORM_ATTR="(FG_GREEN|BG_BLACK)"
options         TERMINAL_KERN_ATTR="(FG_YELLOW|BG_BLACK)"