User Tools

Site Tools


управление_ядром_и_модулями_в_freebsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
управление_ядром_и_модулями_в_freebsd [2014/09/16 09:49]
val [Обновление исходных текстов ядра]
управление_ядром_и_модулями_в_freebsd [2017/10/13 12:58] (current)
val [Установка исходных текстов ядра]
Line 19: Line 19:
 # cat /​boot/​loader.conf # cat /​boot/​loader.conf
 </​code><​code>​ </​code><​code>​
 +...
 hint.acpi.0.disabled="​1"​ hint.acpi.0.disabled="​1"​
 </​code>​ </​code>​
  
 ===== Модули ядра ===== ===== Модули ядра =====
 +
 +  * [[Подключение звуковой карты]] (в старых версиях)
 +
 <​code>​ <​code>​
 # kldstat # kldstat
Line 29: Line 33:
  
 # sysctl net.inet.ip.fw.enable=0 # sysctl net.inet.ip.fw.enable=0
 +
 +# cat /​boot/​loader.conf
 +</​code><​code>​
 +...
 +if_em_load="​YES"​
 +snd_ich_load="​YES"​
 </​code>​ </​code>​
  
Line 54: Line 64:
 ==== Установка исходных текстов ядра ==== ==== Установка исходных текстов ядра ====
  
-=== FreeBSD 9.X === 
 <​code>​ <​code>​
-[server:~] # mkdir /cdrom/ +[server:~] # mount -t cd9660 /dev/cd0 /mnt/
- +
-[server:~] # mount -t cd9660 /dev/cd0 /cdrom/+
  
 [server:~] # cd / [server:~] # cd /
  
-[server:/] # tar -tf /cdrom/​usr/​freebsd-dist/​src.txz+[server:/] # tar -xvf /mnt/​usr/​freebsd-dist/​src.txz
  
-[server:/] # cd+[server:~] # umount /mnt/
 </​code>​ </​code>​
  
-=== FreeBSD 8.X === 
-<​code>​ 
-[server:~] # mkdir /usr/src 
- 
-[server:~] # mount /cdrom 
- 
-[server:~] # cd /​cdrom/​X-RELEASE/​src/​ 
- 
-[server:/​cdrom/​X-RELEASE/​src] # ./​install.sh base sys 
-Extracting sources into /usr/src... 
-  Extracting source component: base 
-  Extracting source component: sys 
-Done extracting sources. 
- 
-[server:/​cdrom/​X-RELEASE/​src] # cd 
- 
-[server:~] # umount /cdrom/ 
-</​code>​ 
  
 ==== Обновление исходных текстов ядра ==== ==== Обновление исходных текстов ядра ====
Line 93: Line 82:
 </​code>​ </​code>​
 ==== Создание файла конфигурации ядра ==== ==== Создание файла конфигурации ядра ====
-Задача - уменьшенить размер ядра+ 
 +Задачи: 
 + 
 +  * уменьшенить размер ядра 
 +  * отключить IPv6 
 +  * добавить в ядро поддержку pf и altq 
 +  * вынести драйвера сетевой и звуковой карты в модули 
 +  * остальные модули не компилировать 
 <​code>​ <​code>​
 +[server:~] # less /​usr/​src/​sys/​conf/​NOTES
 +
 [server:~] # cd /​usr/​src/​sys/​i386/​conf/​ [server:~] # cd /​usr/​src/​sys/​i386/​conf/​
    
Line 104: Line 103:
 # cpu           ​I486_CPU # cpu           ​I486_CPU
 # cpu           ​I586_CPU # cpu           ​I586_CPU
-cpu             ​I686_CPU +cpu I686_CPU 
-ident           KERN+ident GENERIC
  
-makeoptions ​    ​DEBUG=-g                ​# Build kernel with gdb(1) debug symbols+makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols 
 +makeoptions WITH_CTF=1 #​ Run ctfconvert(1) for DTrace support
  
-options ​        ​SCHED_ULE ​              ​# ULE scheduler +options ​ SCHED_ULE # ULE scheduler 
-options ​        ​PREEMPTION ​             # Enable kernel thread preemption +options ​ PREEMPTION # Enable kernel thread preemption 
-options ​        ​INET                    # InterNETworking +options ​ INET # InterNETworking 
-# options ​      ​INET6                   ​# IPv6 communications protocols +# options ​ INET6 # IPv6 communications protocols 
-options ​        ​SCTP                    # Stream Control Transmission Protocol +options ​ TCP_OFFLOAD #​ TCP offload 
-options ​        ​FFS                     ​# Berkeley Fast Filesystem +options SCTP # Stream Control Transmission Protocol 
-options ​        ​SOFTUPDATES ​            ​# Enable FFS soft updates support +options ​ FFS # Berkeley Fast Filesystem 
-options ​        ​UFS_ACL ​                ​# Support for access control lists +options ​ SOFTUPDATES # Enable FFS soft updates support 
-options ​        ​UFS_DIRHASH ​            ​# Improve performance on big directories +options ​ UFS_ACL # Support for access control lists 
-options ​        ​UFS_GJOURNAL ​           # Enable gjournal-based UFS journaling +options ​ UFS_DIRHASH # Improve performance on big directories 
-options ​        NFSCLIENT ​              # Network Filesystem Client +options ​ UFS_GJOURNAL # Enable gjournal-based UFS journaling 
-options ​        NFSSERVER ​              # Network Filesystem Server +options ​ QUOTA Enable disk quotas for UFS 
-options ​        ​NFSLOCKD ​               # Network Lock Manager +options NFSCL # New Network Filesystem Client 
-options ​        ​NFS_ROOT ​               # NFS usable as /, requires ​NFSCLIENT +options ​ NFSD New Network Filesystem Server 
-options ​        ​MSDOSFS ​                ​# MSDOS Filesystem +options ​ NFSLOCKD # Network Lock Manager 
-options ​        ​CD9660 ​                 # ISO 9660 Filesystem +options ​ NFS_ROOT # NFS usable as /, requires ​NFSCL 
-options ​        ​PROCFS ​                 # Process filesystem (requires PSEUDOFS) +options ​ MSDOSFS # MSDOS Filesystem 
-options ​        ​PSEUDOFS ​               # Pseudo-filesystem framework +options ​ CD9660 # ISO 9660 Filesystem 
-options ​        ​GEOM_PART_GPT ​          ​# GUID Partition Tables. +options ​ PROCFS # Process filesystem (requires PSEUDOFS) 
-options ​        ​GEOM_LABEL ​             # Provides labelization +options ​ PSEUDOFS # Pseudo-filesystem framework 
-options ​        COMPAT_43TTY ​           # BSD 4.3 TTY compat [KEEP THIS!] +options ​ GEOM_PART_GPT # GUID Partition Tables. 
-options ​        COMPAT_FREEBSD4 ​        ​# Compatible with FreeBSD4 +options ​ GEOM_RAID #​ Soft RAID functionality. 
-options ​        ​COMPAT_FREEBSD5 ​        ​# Compatible with FreeBSD5 +options GEOM_LABEL # Provides labelization 
-options ​        ​COMPAT_FREEBSD6 ​        ​# Compatible with FreeBSD6 +options ​ COMPAT_FREEBSD4 # Compatible with FreeBSD4 
-options ​        ​SCSI_DELAY=5000 ​        ​# Delay (in ms) before probing SCSI +options ​ COMPAT_FREEBSD5 # Compatible with FreeBSD5 
-options ​        ​KTRACE ​                 # ktrace(1) support +options ​ COMPAT_FREEBSD6 # Compatible with FreeBSD6 
-options ​        ​STACK                   ​# stack(9) support +options ​ COMPAT_FREEBSD7 #​ Compatible with FreeBSD7 
-options ​        ​SYSVSHM ​                ​# SYSV-style shared memory +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI 
-options ​        ​SYSVMSG ​                ​# SYSV-style message queues +options ​ KTRACE # ktrace(1) support 
-options ​        ​SYSVSEM ​                ​# SYSV-style semaphores +options ​ STACK # stack(9) support 
-options ​        ​_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options ​ SYSVSHM # SYSV-style shared memory 
-options ​        ​KBD_INSTALL_CDEV ​       # install a CDEV entry in /dev +options ​ SYSVMSG # SYSV-style message queues 
-options ​        ADAPTIVE_GIANT ​         ​Giant mutex is adaptive. +options ​ SYSVSEM # SYSV-style semaphores 
-options ​        STOP_NMI ​               # Stop CPUS using NMI instead of IPI +options ​ _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions 
-options ​        AUDIT                   ​# Security event auditing +options ​ PRINTF_BUFR_SIZE=128 #​ Prevent printf output being interspersed. 
-#​options ​       KDTRACE_HOOKS ​          ​# Kernel DTrace hooks+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 DDB_CTF #​ kernel ELF linker loads CTF data 
 + 
 +options ALTQ 
 +options ALTQ_CBQ # Class Based Queueing 
 +options ALTQ_RED # Random Early Detection 
 +options ALTQ_RIO # RED In/Out 
 +options ALTQ_HFSC #​ Hierarchical Packet Scheduler 
 +options ALTQ_CDNR #​ Traffic conditioner 
 +options ALTQ_PRIQ #​ Priority Queueing 
 +options ALTQ_NOPCC #​ Required if the TSC is unusable 
 +options ALTQ_DEBUG
  
 # To make an SMP kernel, the next two lines are needed # To make an SMP kernel, the next two lines are needed
-options ​        ​SMP                     ​# Symmetric MultiProcessor Kernel +options ​ SMP # Symmetric MultiProcessor Kernel 
-device ​         apic                    # I/O APIC+device apic # I/O APIC
  
 # CPU frequency control # CPU frequency control
-device ​         cpufreq+device cpufreq
  
 # Bus support. # Bus support.
-device ​         pci+device acpi 
 +device pci
  
 # Floppy drives # Floppy drives
-device ​         fdc+device fdc
  
-device ​         ata +# ATA controllers 
-device ​         atadisk ​        # ATA disk drives +device ata Legacy ATA/SATA controllers 
-device ​         ​atapicd ​        ATAPI CDROM drives +options ATA_CAM Handle legacy controllers with CAM
-device ​         atapist ​        ATAPI tape drives+
  
 # SCSI Controllers # SCSI Controllers
-# options ​      ​AHC_REG_PRETTY_PRINT ​   # Print register bitfields in debug +# options ​ AHC_REG_PRETTY_PRINT #​ Print register bitfields in debug 
-                                        # output. ​ Adds ~128k to driver. + # output. ​ Adds ~128k to driver. 
-# options ​      ​AHD_REG_PRETTY_PRINT ​   # Print register bitfields in debug +# options ​ AHD_REG_PRETTY_PRINT #​ Print register bitfields in debug 
-                                        # output. ​ Adds ~215k to driver.+ # output. ​ Adds ~215k to driver.
  
-# SCSI peripherals +ATA/SCSI peripherals 
-device ​         scbus           ​# SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) 
-device ​         da              # Direct Access (disks)+device da # Direct Access (disks)
  
 # RAID controllers interfaced to the SCSI subsystem # RAID controllers interfaced to the SCSI subsystem
Line 179: Line 197:
  
 # atkbdc0 controls both the keyboard and the PS/2 mouse # atkbdc0 controls both the keyboard and the PS/2 mouse
-device ​         atkbdc ​         # AT keyboard controller +device atkbdc # AT keyboard controller 
-device ​         atkbd           ​# AT keyboard +device atkbd # AT keyboard 
-device ​         psm             ​# PS/2 mouse+device psm # PS/2 mouse
  
-device ​         kbdmux ​         # keyboard multiplexer+device kbdmux # keyboard multiplexer
  
-device ​         vga             ​# VGA video card driver+device vga # VGA video card driver 
 +options VESA # Add support for VESA BIOS Extensions (VBE)
  
-device ​         splash ​         # Splash screen and screen saver support+device splash # Splash screen and screen saver support
  
 # syscons is the default console driver, resembling an SCO console # syscons is the default console driver, resembling an SCO console
-device ​         sc+device sc 
 +options SC_PIXEL_MODE #​ add support for the raster text mode
  
-device ​         agp             ​# support several AGP chipsets+device agp # support several AGP chipsets
  
 # Power management support (see NOTES for more options) # Power management support (see NOTES for more options)
 # Add suspend/​resume support for the i8254. # Add suspend/​resume support for the i8254.
-device ​         pmtimer+device pmtimer
  
 # PCCARD (PCMCIA) support # PCCARD (PCMCIA) support
Line 202: Line 222:
  
 # Serial (COM) ports # Serial (COM) ports
-device ​         ​sio ​            # 8250, 16[45]50 based serial ports +device uart # Generic UART driver
-device ​         ​uart            # Generic UART driver+
  
 # Parallel port # Parallel port
-device ​         ppc 
-device ​         ppbus           # Parallel port bus (required) 
-device ​         lpt             # Printer 
- 
-# If you've got a "​dumb"​ serial or parallel PCI card that is 
-# supported by the puc(4) glue driver, uncomment the following 
-# line to enable it (connects to sio, uart and/or ppc drivers): 
  
 # PCI Ethernet NICs. # PCI Ethernet NICs.
  
 # PCI Ethernet NICs that use the common MII bus controller code. # PCI Ethernet NICs that use the common MII bus controller code.
-device ​         miibus ​         # MII bus support 
-device ​         fxp             # Intel EtherExpress PRO/100B (82557, 82558) 
  
 # ISA Ethernet NICs.  pccard NICs included. # ISA Ethernet NICs.  pccard NICs included.
Line 224: Line 234:
 # Wireless NIC cards # Wireless NIC cards
  
-device ​         loop            # Network loopback + 
-device ​         ether           ​# Ethernet support +device loop # Network loopback 
-device ​         ​ppp ​            Kernel PPP +options PADLOCK_RNG #​ VIA Padlock RNG 
-device ​         tun             ​# Packet tunnel. +options RDRAND_RNG #​ Intel Bull Mountain RNG 
-device ​         pty             ​Pseudo-ttys (telnet etc) +device ether # Ethernet support 
-device ​         md              # Memory "​disks"​ +device vlan 802.1Q VLAN support 
-device ​         gif             ​# IPv6 and IPv4 tunneling +device tun # Packet tunnel. 
-device ​         firmware ​       # firmware assist module+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
  
 # Be aware of the administrative consequences of enabling this! # Be aware of the administrative consequences of enabling this!
 # Note that '​bpf'​ is required for DHCP. # Note that '​bpf'​ is required for DHCP.
-device ​         bpf             ​# Berkeley packet filter+device bpf # Berkeley packet filter
  
 # USB support # USB support
-device ​         uhci            # UHCI PCI->USB interface +options USB_DEBUG #​ enable debug msgs 
-device ​         ohci            # OHCI PCI->USB interface +device uhci # UHCI PCI->USB interface 
-device ​         ehci            # EHCI PCI->USB interface (USB 2.0) +device ohci # OHCI PCI->USB interface 
-device ​         usb             ​# USB Bus (required) +device ehci # EHCI PCI->USB interface (USB 2.0) 
-device ​         ​ugen ​           ​Generic +device xhci # XHCI PCI->USB interface (USB 3.0) 
-device ​         ukbd            # Keyboard +device usb # USB Bus (required) 
-device ​         umass           ​# Disks/Mass storage - Requires scbus and da +device uhid "Human Interface Devices"​ 
-device ​         ums             ​# Mouse+device ukbd # Keyboard 
 +device ulpt # Printer 
 +device umass # Disks/Mass storage - Requires scbus and da 
 +device ums # Mouse 
 +device urio #​ Diamond Rio 500 MP3 player 
 +device u3g #​ USB-based 3G modems (Option, Huawei, Sierra) 
 +device uark #​ Technologies ARK3116 based serial adapters 
 +device ubsa #​ Belkin F5U103 and compatible serial adapters 
 +device uftdi #​ For FTDI usb serial adapters 
 +device uplcom #​ Prolific PL-2303 serial adapters 
 +device uslcom #​ SI Labs CP2101/​CP2102 serial adapters 
 +device uvscom #​ USB serial support for DDI pocket'​s PHS
 # USB Ethernet, requires miibus # USB Ethernet, requires miibus
 +# # USB Wireless
  
-FireWire ​support+Sound support 
 + 
 +# VirtIO support 
 + 
 +device ​         pf 
 +device ​         pflog 
 +device ​         pfsync 
 +</​code>​ 
 + 
 +==== Выбор модулей ядра ==== 
 +<​code>​ 
 +# cat /​etc/​make.conf 
 +</​code><​code>​ 
 +... 
 +MODULES_OVERRIDE = sound em
 </​code>​ </​code>​
  
Line 254: Line 294:
 <​code>​ <​code>​
 [server:​sys/​i386/​conf] # cd /usr/src [server:​sys/​i386/​conf] # cd /usr/src
 +
 [server:/​usr/​src] # make buildkernel KERNCONF=KERN [server:/​usr/​src] # make buildkernel KERNCONF=KERN
 +
 [server:/​usr/​src] # make installkernel KERNCONF=KERN [server:/​usr/​src] # make installkernel KERNCONF=KERN
  
Line 261: Line 303:
 [server:~] # uname –a [server:~] # uname –a
 </​code>​ </​code>​
 +
 ==== Загрузка старого ядра ==== ==== Загрузка старого ядра ====
  
управление_ядром_и_модулями_в_freebsd.1410846559.txt.gz · Last modified: 2014/09/16 09:49 by val