Różnice pomiędzy wersjami 1 i 2
⇤ ← Wersja 1 z 2013-10-11 07:45:07 →
Rozmiar: 1374
Edytor: wtps0n
Komentarz: INIT
← Wersja 2 z 2013-10-13 22:59:31 → ⇥
Rozmiar: 8030
Edytor: wtps0n
Komentarz: + kernconf
Usunięcia zostały oznaczone w ten sposób. Dodatki zostały oznaczone w ten sposób.
Linia 42: Linia 42:
== 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
}}}

=== COMMON9 ===
Pełna konfiguracja (na podstawie serwerka domowego):
{{{
ident GOMMON9

#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 IPFIREWALL_FORWARD #enable transparent proxy support
options IPFILTER_LOG

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

=== QQQQ ===
{{{
include COMMON9
ident HQ9x64
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
}}}

= Kompilacja źródeł =
Linia 46: Linia 178:

# dodanie uzytkownika audit, unbound
mergemaster -p

Aktualizacja systemu

/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_FLOPPY=         true
WITHOUT_GSSAPI=         true
WITHOUT_IPX=            true
WITHOUT_LPR=            true
WITHOUT_KERBEROS=       true
WITHOUT_MAILWRAPPER=    true
WITHOUT_SENDMAIL=       true
WITHOUT_NIS=            true
WITHOUT_OPENSSH=        true
WITHOUT_PPP=            true
WITHOUT_WIRELESS=       true
WITHOUT_RCMDS=          true

Można skorzystać ze wsparcia bsd iconv, czyli dopisujemy następujące linijki:

# /etc/src.conf
WITH_ICONV=yes
WITH_LIBICONV_COMPAT=yes

oraz

# /etc/make/make.local.conf
WITH_ICONV=yes

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

COMMON9

Pełna konfiguracja (na podstawie serwerka domowego):

ident           GOMMON9

#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         IPFIREWALL_FORWARD      #enable transparent proxy support
options         IPFILTER_LOG

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

QQQQ

include         COMMON9
ident           HQ9x64
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

Kompilacja źródeł

Dalej to już klasyka aktualizacji systemu:

cd /usr/src
make buildworld && make buildkernel && make installkernel KERNCONF=QQQQ

# dodanie uzytkownika audit, unbound
mergemaster -p

# Single user mode
make installworld

AktualizacjaSystemu (ostatnio edytowane 2016-05-19 09:32:25 przez wtps0n)