Trước hết bạn cần chọn múi giờ để hệ thống của bạn biết nó nằm ở nơi
nào. Hãy tìm múi giờ của bạn trong
# ls /usr/share/zoneinfo(Giả sử bạn muốn dùng Asia/Saigon) # cp /usr/share/zoneinfo/Asia/Saigon /etc/localtime
Lõi của mọi bản phân phối là Linux kernel. Nó là một lớp nằm giữa
các chương trình và phần cứng hệ thống. Gentoo cung cấp cho người dùng
vài bộ mã nguồn kernel. Danh sách đầy đủ kèm mô tả nằm trong
Với những hệ thống alpha, chúng ta có
Hãy chọn mã nguồn kernel bạn muốn và cài vào hệ thống bằng
Trong ví dụ này chúng tôi sẽ cài
# USE="-doc symlink" emerge vanilla-sources
Hãy xem trong
# ls -l /usr/src/linux lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -> linux-2.6.11.2
Giờ là lúc để cấu hình và biên dịch mã nguồn kernel. bạn có thể dùng
Nếu bạn muốn cấu hình kernel bằng tay, hãy xem
Cấu hình kernel bằng tay thường bị xem là một quá trình khó khăn mà người dùng Linux phải thực hiện. Điều đó không đúng -- sau khi cấu hình một vài kernel, bạn thậm chí không nhớ khó là gì ;)
Tuy nhiên, có một điều
Giờ hãy chuyển vào thư mục mã nguồn kernel và chạy
# cd /usr/src/linux # make menuconfig
Bạn sẽ được chào mừng bằng vô số các mục cấu hình. Chúng ta sẽ liệt kê một số tùy chọn bạn phải kích hoạt (nếu không có Gentoo sẽ không hoạt động, hoặc không hoạt động đúng với vài tinh chỉnh bổ sung).
Đầu tiên hãy cho phép sử dụng code/driver thử nghiệm. Bạn cần nó, nếu không vài code/driver quan trọng sẽ không xuất hiện:
Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers General setup ---> [*] Support for hot-pluggable devices
Giờ vào phần
(Với kernel 2.4.x) File systems ---> [*] Virtual memory file system support (former shm fs) [*] /proc file system support [ ] /dev file system support (EXPERIMENTAL) [ ] /dev/pts file system for Unix98 PTYs(Với kernel 2.6.x) File systems ---> Pseudo Filesystems ---> [*] /proc file system support [*] Virtual memory file system support (former shm fs)(Chọn những tùy chọn sau tùy theo hệ thống của bạn) <*> Reiserfs support <*> Ext3 journalling file system support <*> JFS filesystem support <*> Second extended fs support <*> XFS filesystem support
Nếu bạn dùng PPPoE để kết nối Internet hoặc dùng modem quay số, bạn sẽ cần những tùy chọn sau trong kernel:
(Với kernel 2.4.x) Network device support ---> <*> PPP (point-to-point protocol) support <*> PPP support for async serial ports <*> PPP support for sync tty ports(Với kernel 2.6.x) Device Drivers ---> Networking support ---> <*> PPP (point-to-point protocol) support <*> PPP support for async serial ports <*> PPP support for sync tty ports
Hai tùy chọn nén không phương hại nhưng không phải nhất thiết không
cần, cũng như thế với tùy chọn
Nếu bạn cần nó, đừng quên thêm hỗ trợ card mạng vào kernel.
Bạn cũng nên bật những tuỳ chọn sau:
General setup ---> <*> SRM environment through procfs <*> Configure uac policy via sysctl Plug and Play configuration ---> <*> Plug and Play support <M> ISA Plug and Play support SCSI support ---> SCSI low-level drivers ---> <*> SYM53C8XX Version 2 SCSI support (NEW) <*> Qlogic ISP SCSI support Network device support ---> Ethernet (10 or 100 Mbit) ---> <M> DECchip Tulip (dc21x4x) PCI support <M> Generic DECchip & DIGITAL EtherWORKS PCI/EISA <M> EtherExpressPro/100 support (eepro100) <M> EtherExpressPro/100 support (e100) Ethernet (1000 Mbit) ---> <M> Alteon AceNIC [*] Omit support for old Tigon I <M> Broadcom Tigon3 [*] FDDI driver support <M> Digital DEFEA and DEFPA <*> PPP support <*> PPP Deflate compression Character devices ---> [*] Support for console on serial port [*] Direct Rendering Manager File systems ---> <*> Kernel automounter version 4 support Network File Systems ---> <*> NFS [*] NFSv3 client <*> NFS server [*] NFSv3 server Partition Types ---> [*] Advanced partition selection [*] Alpha OSF partition support Native Language Support <*> NLS ISO 8859-1 Sound ---> <M> Sound card support <M> OSS sound modules [*] Verbose initialisation [*] Persistent DMA buffers <M> 100% Sound Blaster compatibles
Khi bạn hoàn tất cấu hình kernel, hãy tiếp tục với
Bạn đã cấu hình kernel xong, đã đến lúc biên dịch và cài đặt kernel. Hãy thoát trình cấu hình và chạy tiến hành biên dịch:
(Với kernel 2.4) # make dep && make vmlinux modules modules_install(Với kernel 2.6) # make && make modules_install(Với mọi kernel) # make boot
Khi đã biên dịch kernel xong, hãy chép nó vào
# cp arch/alpha/boot/vmlinux.gz /boot/
Giờ hãy tiếp tục với
Nếu bạn đọc phần này, bạn đã chọn cách dùng
Giờ mã nguồn kernel đã được cài đặt, đã đến lúc biên dịch kernel bằng
Hãy xem dùng
# emerge genkernel
Giờ hãy chạy
Chú ý rằng, nếu phân vùng khởi động của bạn không dùng hệ tập tin ext2
hoặc ext3, bạn có thể cần cấu hình bằng tay với
# genkernel all GenKernel v3.0.1_beta10 * ARCH: Alpha * KERNEL VER: 2.6.11.2 * kernel: configuring source * kernel: running mrproper(Loại bỏ bớt kết quả để dễ đọc) * Kernel compiled successfully! * Required Kernel Params: * : root=/dev/ram0 init=/linuxrc real_root=/dev/$ROOT * where $ROOT is the devicenode for your root partition as * you should have specified in /etc/fstab * * You MUST tell your bootloader to use the generated initrd * * Recommended Kernel Params: * : vga=0x317 splash=verbose * * Do NOT report kernel bugs (configs included) as genkernel bugs. * Make sure you have the latest genkernel before reporting bugs * * For more info see /usr/share/genkernel/README
Khi
# ls /boot/kernel* /boot/initramfs*
Hãy thực hiện một trong những bước nữa để làm cho hệ thống giống với
CD Cài đặt hơn -- hãy emerge
# emerge coldplug # rc-update add coldplug boot
Nếu cần, bạn nên emerge những phần cứng bổ sung cần cho hệ thống. Đây là danh sách những ebuild liên quan đến kernel mà bạn có thể cần emerge:
Ebuild | Mục đích | Lệnh |
---|---|---|
Tuy nhiên nhớ cẩn thận, vài ebuild có thể kéo theo một lượng lớn
ebuild phụ thuộc khác. Để kiểm tra những gói nào sẽ được cài đặt khi
emerge một ebuild, hãy dùng
# emerge --pretend x11-drm
Bạn nên liệt kê danh sách module bạn muốn nạp tự động trong
Để xem mọi module hiện có, hãy chạy lệnh
# find /lib/modules/<phiên bản kernel>/ -type f -iname '*.o' -or -iname '*.ko'
Ví dụ, để tự động nạp module
(Ví dụ với kernel 2.4) # nano -w /etc/modules.autoload.d/kernel-2.4
3c59x
Hãy tiếp tục cài đặt với