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
Next revision Both sides next revision
управление_ядром_и_модулями_в_freebsd [2014/09/16 09:42]
val [Бекап старого ядра]
управление_ядром_и_модулями_в_freebsd [2014/09/16 13:01]
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>​
Line 29: Line 30:
  
 # 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 53: Line 60:
  
 ==== Установка исходных текстов ядра ==== ==== Установка исходных текстов ядра ====
 +
 +=== FreeBSD 9.X ===
 +<​code>​
 +[server:~] # mkdir /cdrom/
 +
 +[server:~] # mount -t cd9660 /dev/cd0 /cdrom/
 +
 +[server:~] # cd /
 +
 +[server:/] # tar -tf /​cdrom/​usr/​freebsd-dist/​src.txz
 +
 +[server:/] # cd
 +
 +[server:~] # umount /cdrom/
 +</​code>​
 +
 +=== FreeBSD 8.X ===
 <​code>​ <​code>​
 [server:~] # mkdir /usr/src [server:~] # mkdir /usr/src
 +
 [server:~] # mount /cdrom [server:~] # mount /cdrom
 +
 [server:~] # cd /​cdrom/​X-RELEASE/​src/​ [server:~] # cd /​cdrom/​X-RELEASE/​src/​
 +
 [server:/​cdrom/​X-RELEASE/​src] # ./​install.sh base sys [server:/​cdrom/​X-RELEASE/​src] # ./​install.sh base sys
 Extracting sources into /usr/src... Extracting sources into /usr/src...
Line 64: Line 91:
  
 [server:/​cdrom/​X-RELEASE/​src] # cd [server:/​cdrom/​X-RELEASE/​src] # cd
 +
 [server:~] # umount /cdrom/ [server:~] # umount /cdrom/
 </​code>​ </​code>​
Line 70: Line 98:
 <​code>​ <​code>​
 [server:~] # freebsd-update fetch [server:~] # freebsd-update fetch
 +
 [server:~] # freebsd-update install [server:~] # freebsd-update install
 </​code>​ </​code>​
 ==== Создание файла конфигурации ядра ==== ==== Создание файла конфигурации ядра ====
-Задача - уменьшенить размер ядра+ 
 +Задачи: 
 + 
 +  * уменьшенить размер ядра 
 +  * добавить в ядро поддержку 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 84: Line 122:
 # cpu           ​I486_CPU # cpu           ​I486_CPU
 # cpu           ​I586_CPU # cpu           ​I586_CPU
-cpu             ​I686_CPU +cpu I686_CPU 
-ident           KERN+ident GENERIC 
 + 
 +makeoptions DEBUG=-gdwarf-2 #​ Build kernel with gdb(1) debug symbols 
 +makeoptions WITH_CTF=1 #​ Run ctfconvert(1) for DTrace support
  
-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 TCP_OFFLOAD #​ TCP offload 
 +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 QUOTA # Enable disk quotas for UFS 
 +options NFSCL # New Network Filesystem Client 
 +options NFSD # New Network Filesystem Server 
 +options NFSLOCKD #​ Network Lock Manager 
 +options NFS_ROOT #​ NFS usable as /, requires NFSCL 
 +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_RAID #​ Soft RAID functionality. 
 +options GEOM_LABEL #​ Provides labelization 
 +options COMPAT_FREEBSD4 #​ Compatible ​with FreeBSD4 
 +options COMPAT_FREEBSD5 #​ Compatible with FreeBSD5 
 +options COMPAT_FREEBSD6 #​ Compatible with FreeBSD6 
 +options COMPAT_FREEBSD7 #​ Compatible with FreeBSD7 
 +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 DDB_CTF #​ kernel ELF linker loads CTF data
  
-options ​        SCHED_ULE ​              # ULE scheduler +options ​ ALTQ 
-options ​        PREEMPTION ​             ​Enable kernel thread preemption +options ​ ALTQ_CBQ Class Based Queueing 
-options ​        INET                    ​InterNETworking +options ​ ALTQ_RED Random Early Detection 
-# options ​      ​INET6 ​                  # IPv6 communications protocols +options ​ ALTQ_RIO RED In/Out 
-options ​        ​SCTP ​                   # Stream Control Transmission Protocol +options ​ ALTQ_HFSC Hierarchical Packet Scheduler 
-options ​        ​FFS ​                    # Berkeley Fast Filesystem +options ​ ALTQ_CDNR Traffic conditioner 
-options ​        ​SOFTUPDATES ​            # Enable FFS soft updates support +options ​ ALTQ_PRIQ Priority Queueing 
-options ​        ​UFS_ACL ​                # Support for access control lists +options ​ ALTQ_NOPCC Required if the TSC is unusable 
-options ​        ​UFS_DIRHASH ​            # Improve performance on big directories +options ​ ALTQ_DEBUG
-options ​        ​UFS_GJOURNAL ​           # Enable gjournal-based UFS journaling +
-options ​        ​NFSCLIENT ​              # Network Filesystem Client +
-options ​        ​NFSSERVER ​              # Network Filesystem Server +
-options ​        ​NFSLOCKD ​               # Network Lock Manager +
-options ​        NFS_ROOT ​               ​NFS usable as /, requires NFSCLIENT +
-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 ​        ​COMPAT_43TTY ​           # BSD 4.3 TTY compat [KEEP THIS!] +
-options ​        ​COMPAT_FREEBSD4 ​        # Compatible with FreeBSD4 +
-options ​        ​COMPAT_FREEBSD5 ​        # Compatible with FreeBSD5 +
-options ​        ​COMPAT_FREEBSD6 ​        # Compatible with FreeBSD6 +
-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 ​        ​KBD_INSTALL_CDEV ​       # install a CDEV entry in /dev +
-options ​        ​ADAPTIVE_GIANT ​         # Giant mutex is adaptive. +
-options ​        STOP_NMI ​               # Stop CPUS using NMI instead of IPI +
-options ​        ​AUDIT ​                  # Security event auditing +
-#​options ​       KDTRACE_HOOKS ​          # Kernel DTrace hooks+
  
 # 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 159: Line 216:
  
 # 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 182: Line 241:
  
 # 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 204: Line 253:
 # 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 234: Line 313:
 <​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 241: Line 322:
 [server:~] # uname –a [server:~] # uname –a
 </​code>​ </​code>​
 +
 ==== Загрузка старого ядра ==== ==== Загрузка старого ядра ====
  
управление_ядром_и_модулями_в_freebsd.txt · Last modified: 2017/10/13 12:58 by val