# cd/usr/src/sys/i386/conf
# CP GENERIC generic.20060812
# EE GENERIC
If you want to join the IPF firewall, join
Options Ipfirewall
Options Ipfirewall_default_to_accept
Options Ipfirewall_forward
Options Ipdivert
# cd/usr/src/sys/i386/conf
Run the config command to generate the kernel source code.
#/usr/sbin/config GENERIC
Switch to the directory where the kernel is built.
# CD: /compile/generic
Compiling the kernel
# Make Cleandepend (best to clear first)
# make Depend
# make
Install the new kernel.
# make Install
OK, here, if there is no error in the middle, then our core heart has been installed successfully,
Reboot will be able to use our newly compiled kernel. If there is a
Error, then please check if your steps are consistent with the above steps, and check that your kernel configuration file is configured correctly.
General compilation is not successful is the kernel file configuration problems
, please check carefully.
Four, the new kernel cannot start:
If your compiled kernel does not start, you can use the previous kernel to boot. Once the kernel is compiled once,
will take the old kernel back up, General/boot/kernel.old is the old inside
Backup of the kernel, the problem can be started with a long core.
The implementation method is as follows:
You can press any key other than enter when the system starts to make a 10 count, and then type the Unload command,
Type boot kernel.old, or any kernel name that can start normally
, then can start the system normally, enter the system and then re-perform the kernel configuration work.
Note: You can't just rely on kernel.old, because when you install a new kernel,
Kernel.old will be overwritten by the kernel that was last installed, so you can either manually back up a
The kernel that starts normally, or whether your kernel.old can boot properly.
End
Well, here we have the job of compiling the kernel, and let's see if our kernel has been reduced:
# ls-l/boot/kernel/kernel
-r-xr-xr-x 1 root wheel 3090929 Sep 1 21:30/boot/kernel/kernel
Hehe, obviously turned the original 5940286 into the present 3090929, although not smaller one times,
But it's getting much smaller, and the system is faster.
Please refer to http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/kernelconfig-config.html when modifying
#######################################################################
Machine i386
CPU I486_CPU
CPU I586_CPU
CPU I686_CPU
Ident GENERIC
# to statically compile in device wiring instead of/boot/device.hints
#hints "generic.hints" # Default places to look for devices.
Makeoptions debug=-g # Build kernel with GDB (1) DEBUG symbols
#options Sched_ule # ULE Scheduler
Options Sched_4bsd # 4BSD Scheduler
Options preemption # Enable kernel thread preemption
Options INET # Internetworking
Options INET6 # IPV6 Communications Protocols
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 Md_root # MD is a potential ROOT device
#options nfsclient # Network Filesystem Client
#options NFSServer # Network Filesystem Server
#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_gpt # GUID Partition Tables.
Options compat_43 # Compatible with BSD 4.3 [KEEP this!]
Options Compat_freebsd4 # Compatible with FreeBSD4
Options Compat_freebsd5 # Compatible with FreeBSD5
#options scsi_delay=5000 # DELAY (in ms) before probing SCSI
Options Ktrace # Ktrace (1) 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 Ahc_reg_pretty_print # PRINT Register Bitfields in debug
# output. Adds ~128k to driver.
Options Ahd_reg_pretty_print # PRINT Register Bitfields in debug
# output. Adds ~215k to driver.
Options Adaptive_giant # GIANT Mutex is ADAPTIVE.
Options Ipfirewall
Options Ipfirewall_default_to_accept
Options Ipfirewall_forward
Device APIC # I/O APIC
# Bus Support.
Device EISA
Device PCI
# Floppy Drives
Device FDC
# ATA and ATAPI devices
Device ATA
Device Atadisk # ATA disk drives
Device Ataraid # ATA RAID drives
Device ATAPICD # ATAPI CDROM drives
Device ATAPIFD # ATAPI floppy Drives
Device Atapist # ATAPI tape Drives
Options ata_static_id # STATIC device numbering
# SCSI Controllers
#device ahb # EISA AHA1742 family
#device ahc # AHA2940 and onboard aic7xxx devices
#device ahd # aha39320/29320 and onboard aic79xx Devices
#device amd # amd 53c974 (Tekram DC-390 (T))
#device isp # Qlogic Family
#device ispfw # Firmware for Qlogic hbas-normally a module
#device mpt # lsi-logic mpt-fusion
#device ncr # ncr/symbios Logic
#device sym # Ncr/symbios Logic (newer chipsets + those of ' NCR ')
#device trm # Tekram dc395u/uw/f dc315u Adapters
#device adv # AdvanSys SCSI adapters
#device ADW # AdvanSys wide SCSI adapters
#device AHA # Adaptec 154x SCSI Adapters
#device AIC # Adaptec 15[012]x SCSI adapters, aic-6[23]60.
#device BT # Buslogic/mylex multimaster SCSI Adapters
#device NCV # NCR 53c500
#device NSP # workbit Ninja SCSI-3
#device STG # TMC 18C30/18C50
# SCSI Peripherals
#device scbus # SCSI bus (required for SCSI)
#device ch& nbsp; # SCSI Media changers
#device da # Direct Access (disks)
#device sa # sequential Access (tape etc)
#device cd # CD
#device pass # Passthrough Device (direct SCSI access)
#device ses # SCSI Environmental Services (and Saf-te)
# RAID Controllers interfaced to the SCSI subsystem
#device amr # AMI megaraid
#device & nbsp; arcmsr # areca SATA II RAID
#device asr # DPT smartraid V, VI and Adaptec SCSI raid
#device ciss # Compaq Smart RAID 5*
#device dpt # DPT Smartcache III, Iv–see NOTES for options
#device hptmv # highpoint rocketraid 182x
#device iir # Intel Integrated RAID
#device ips # IBM (Adaptec) ServeRAID
#device mly # Mylex acceleraid/extremeraid
#device twa # 3ware 9000 Series Pata/sata RAID
# RAID Controllers
#device AAC # Adaptec FSA RAID
#device AACP # SCSI passthrough for AAC (requires CAM)
#device Ida # Compaq Smart RAID
#device MLX # Mylex DAC960 Family
#device PST # Promise Supertrak SX6000
#device TWE # 3ware ATA RAID
# ATKBDC0 controls both the keyboard and the PS/2 mouse
Device ATKBDC # at keyboard controller
Device ATKBD # at keyboard
Device PSM # PS/2 Mouse
Device VGA # VGA video card driver
Device Splash # splash screen and Screens saver support
# syscons is the default console driver, resembling an SCO console
Device SC
# Enable this for the PCVT (VT220 compatible) console driver
#device VT
#options Xserver # Support for X server on a VT console
#options Fat_cursor # start with block CURSOR
Device AGP # support several AGP chipsets
# Power Management support (see NOTES for more options)
#device APM
# ADD Suspend/resume support for the i8254.
Device Pmtimer
# PCCARD (PCMCIA) support
# PCMCIA and CardBus Bridge support
#device CBB # CardBus (Yenta) bridge
#device PCCard # PC Card (16-bit) bus
#device CardBus # CardBus (32-bit) bus
# Serial (COM) ports
#device Sio # 8250, 16[45]50 based serial ports
# Parallel Port
Device PPC
Device Ppbus # Parallel Port bus (required)
Device LPT # Printer
Device Plip # TCP/IP over parallel
Device PPI # Parallel Port Interface Device
#device VPO # Requires SCBUs and Da
# If You ' ve got a "dumb" serial or parallel PCI card
# Supported by the PUC (4) Glue driver, uncomment the following
# line-to-enable it (connects to the SIO and/or PPC drivers):
#device PUC
# PCI Ethernet NICs.
#device de # Dec/intel dc21x4x ("Tulip")
#device EM # Intel pro/1000 adapter Gigabit Ethernet Card
#device IXGB # Intel Pro/10gbe Ethernet Card
#device Txp # 3Com 3cr990 ("Typhoon")
#device VX # 3Com 3c590, 3c595 ("Vortex")
# PCI Ethernet NICs that use the common MII Bus controller code.
# note:be sure to keep the ' device Miibus ' line in order to use these nics!
Device Miibus # MII Bus Support
#device BFE # Broadcom bcm440x 10/100 Ethernet
#device BGE # Broadcom bcm570xx Gigabit Ethernet
#device DC # Dec/intel 21143 and various workalikes
#device FXP # Intel EtherExpress pro/100b (82557, 82558)
#device Lge # level 1 LXT1001 Gigabit Ethernet
#device Nge # Natsemi DP83820 Gigabit Ethernet
#device Nve # NVidia NForce MCP on-board Ethernet Networking
#device PCN # AMD am79c97x PCI 10/100 (precedence over ' LNC ')
#device Re # RealTek 8139c+/8169/8169s/8110s
Device RL # RealTek 8129/8139
#device SF # Adaptec AIC-6915 ("Starfire")
#device sis # Silicon Integrated Systems sis 900/sis 7016
#device SK # SysKonnect sk-984x & sk-982x Gigabit Ethernet
#device Ste # Sundance ST201 (D-Link dfe-550tx)
#device ti # alteon Networks Tigon i/ii Gigabit Ethernet
#device TL # Texas Instruments Thunderlan
#device TX # SMC Etherpower II (83c170 "EPIC")
#device Vge # VIA vt612x Gigabit Ethernet
#device VR # VIA Rhine, Rhine II
#device WB # Winbond w89c840f
#device XL # 3Com 3c90x ("Boomerang", "Cyclone")
# ISA Ethernet NICs. PCCard NICs included.
#device CS # Crystal Semiconductor cs89x0 NIC
# ' device Ed ' requires ' device Miibus '
#device Ed # ne[12]000, SMC Ultra, 3c503, DS8390 cards
#device ex # Intel EtherExpress PRO/10 and pro/10+
#device EP # EtherLink III based cards
#device FE # Fujitsu mb8696x based cards
#device IE # etherexpress 8/16, 3c507, StarLAN etc.
#device LNC # NE2100, NE32-VL Lance Ethernet cards
#device SN # SMC ' s 9000 series of Ethernet chips
#device XE # Xircom PCCard Ethernet
# ISA devices that use the old ISA shims
#device Le
# Wireless NIC cards
#device wlan # 802.11 support
#device an # Aironet 4500/4800 802.11 wireless NICs.
#device awi # Baystack 660 and others
#device ral # Ralink Technology RT2500 Wireless NICs.
#device wi # wavelan/intersil/symbol 802.11 wireless NICs.
#device wl # Older non 802.11 wavelan wireless NIC.
# Pseudo devices.
Device Loop # Network Loopback
Device Random # Entropy device
Device Ether # Ethernet support
Device SL # Kernel SLIP
Device PPP # Kernel PPP
Device Tun # Packet tunnel.
Device Pty # Pseudo-ttys (telnet etc)
Device MD # Memory "Disks"
Device GIF # IPV6 and IPv4 tunneling
Device Faith # Ipv6-to-ipv4 relaying (translation)
# the ' BPF ' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that ' BPF ' was required for DHCP.
Device BPF # Berkeley packet filter
# USB Support
Device UHCI # UHCI PCI->USB interface
Device OHCI # OHCI PCI->USB interface
Device EHCI # EHCI PCI->USB Interface (USB 2.0)
Device USB # USB Bus (required)
#device UDBP # USB Double Bulk Pipe devices
Device Ugen # Generic
Device Uhid # "Human Interface Devices"
Device UKBD # Keyboard
#device Ulpt # Printer
#device UMass # Disks/mass storage–requires SCBUs and Da
Device UMS # Mouse
#device Ural # Ralink Technology Rt2500usb Wireless NICs
#device Urio # Diamond Rio MP3 player
#device Uscanner # Scanners
# # USB Ethernet, requires Miibus
#device Aue # ADMtek USB Ethernet
#device Axe # ASIX Electronics USB Ethernet
#device Cdce # Generic USB over Ethernet
#device Cue # CATC USB Ethernet
#device Kue # Kawasaki LSI USB Ethernet
#device Rue # RealTek RTL8150 USB Ethernet
# FireWire Support
#device FireWire # FireWire bus code
#device SBP # SCSI over FireWire (Requires SCBUs and DA)
#device Fwe # Ethernet over FireWire (non-standard!)
#######################################################################
Freebsd compiler kernel