Мои впечатления от процесса установки Gentoo Linux на VMware, как собственно и от полноты и тщательности изложения документации по Gentoo Linux мягко говоря неудовлетворительные! Gentoo - это ещё одно пятое колесо типа Linux...
Так как разработчики Gentoo Linux не потрудились написать качественный хандпук даже на своём буржуйском, то у меня на установку этого чуда Linux-со строения ушло 2-а дня и 24-е часа процессорного времени. Установка выполнялась на VMware 7, НЕ была завершена и прервана на этапе компиляции ядра, по той простой причине, что меня задрало ждать пока компиляция Gentoo освободит процессор для моей основной работы...
Весь этот процесс "садо-мазо-установки" описан пошагово, вместе с последовательностью возникновения геморроев, описанием возможных причин их возникновения, путей/способов лечения, неточностей и неполноты хандпука:), а поэтому перед началом установки этого Gentoo чуда Linux-со строения рекомендуется полностью ознакомится, что называется прогрызть от корки до корки, с данным материалом, сделать соответствующие выводы, а уже потом решать чи оно тебе надо?!:)
Gentoo Linux для тех кто НЕ любит удобство, стабильность, производительность и покой. Gentoo Linux предназначен скорее для тех, кто фанатично и постоянно любит преодолевать всяческие геморрои, без которых непредставляет своей жизни.
К достоинствам Gentoo Linux принято относить быстрый компилятор gcc, ручную настройку ядра на этапе установки, за счёт чего якобы и достигается пресловутое быстродействие Gentoo Linux.
Ну, вопервых, ручную конфигурацию ядра Linux можно выполнить на любой Linux системе, а вовторых, настройку того же gcc можно выполнить с таким же успехом или же выполнить предварительную конфигурацию устанавливаемого пакета!
Самым основным недостатком Gentoo Linux является то, что установку нужно выполнять не из бинарных пакетов, а компилировать из исходных кодов.
Компиляция пакетов из исходного кода занимает гораздо больше времени, чем установка готовых исполняемых файлов. В некоторых случаях — в зависимости от аппаратного обеспечения и размера исходного кода — компиляция больших программ может занять несколько часов или потребовать нескольких гигабайт временного пространства на целевом диске.
Как правило, пользователи Gentoo мирятся с медленной компиляцией в обмен на возможность задавать собственные параметры установки, предоставляемую гибкой конфигурационной технологией Portage.
Разное ставил - ставил FreeBSD, NetBSD, OpenBSD, Debian, CentOS, Suse но, большего геморроя, чем Gentoo Linux я НЕ встречал, а поэтому и нашел времени описать подробнее процесс установки этого чудо Linux-а! Gentoo Linux это яркий пример того, каким НЕ должен быть Linux - это разумеется моя, возможно субъективная точка зрения. Тем же кто считает иначе предлагается читать далее инструкции по садо-мазо установке...
Запуск установки и первоначальная настройка Gentoo Linux
Файлы установки доступные на выбор:
- install-x86-minimal-20120710.iso - 149 МБ
- livedvd-x86-amd64-32ul-2012.1.iso - 3.593.216 МБ
Выбираем подходящий источник/файл установки (Документация Gentoo Linux -- Выбор подходящего источника для установки):
- install-x86-minimal-20120710.iso - Минимальный установочный диск Gentoo, маленький загрузочный компакт-диск без излишеств, единственное назначение которого — загрузить систему, подготовить подключение к сети и перейти к установке Gentoo. Не содержит ни архива stage3, ни снимков Portage, ни готовых двоичных пакетов, и поэтому не подходит для установки без сети
- livedvd-x86-amd64-32ul-2012.1.iso - Живой установочный диск Gentoo, содержащий все необходимое для установки Gentoo. На нем есть графическая среда, графическая и консольная программы автоматической установки, и, конечно, указания по установке для вашей архитектуры.
Мы выбрали install-x86-minimal-20120710.iso ибо livedvd-x86-amd64-32ul-2012.1.iso заглючил и завис с черным экраном:) Запускаем как обычно, монтируем образ и нажимаем "Enter".
Настройка сети в Gentoo
Первое что нужно сделать после завершения загрузки Live CD - это настроить сеть...
Обычно в процессе загрузки Gentoo нет возможности настроить сетевую карту автоматически, хотя и в VMware на ИП 192.168.231.0:67 (192.168.231.2:67) был рабочий DHCP и при установке дргих Linux дистрибутивов сеть настраивалась автоматически, то приходится сеть настраивать вручную с помощью ifconfig и route:
livecd ~ # ifconfig eth0 192.168.231.160 broadcast 192.168.231.255 netmask 255.255.255.0 up livecd ~ # route add default gw 192.168.231.2
192.168.231.160 - ИП адрес для машины, 192.168.231.255 - широковещательный, 255.255.255.0 - маска сети, 192.168.231.2 - шлюз по умолчанию и он же ДНС сервер. Теперь укажем ДНС сервера:
livecd ~ # nano -w /etc/resolv.conf
nameserver 192.168.231.2
nameserver 8.8.8.8
nameserver 8.8.4.4
Для удобства настроим ssh доступ, livecd ~ # nano -w /etc/ssh/sshd_config и меняем "PasswordAuthentication no" на "PasswordAuthentication yes", иначе через ssh нас не впустят по паролю, также обращаем внимание на строку "#PermitEmptyPasswords no", которая по умолчанию запрещает использование пустых паролей, а поэтому для root нужно будет установить пароль passwd. После чего запускаем сервер ssh livecd ~ # /etc/init.d/sshd start
Теперь подключаемся через ssh и продолжаем заниматься садо-мазохизмом:)
Подготовка дисков к установке Gentoo
Смотрим где и какой диск:
livecd ~ # ls /dev | grep hda livecd ~ # ls /dev | grep sda sda
По умолчанию таблица разделов должна быть пустой:
livecd ~ # fdisk /dev/sda Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el Building a new DOS disklabel with disk identifier 0xa530fd55. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content wont be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): p Disk /dev/sda: 4508 MB, 4508876800 bytes 255 heads, 63 sectors/track, 548 cylinders, total 8806400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xa530fd55 Device Boot Start End Blocks Id System Command (m for help):
Создадим загрузочный раздел Gentoo
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 1): Using default value 1 First sector (2048-8806399, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-8806399, default 8806399): +32M Command (m for help): a Partition number (1-4): 1 Command (m for help): p Disk /dev/sda: 4508 MB, 4508876800 bytes 255 heads, 63 sectors/track, 548 cylinders, total 8806400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x544b720c Device Boot Start End Blocks Id System /dev/sda1 * 2048 67583 32768 83 Linux Command (m for help):
Размечаем раздел подкачки Gentoo
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 2): Using default value 2 First sector (67584-8806399, default 67584): Using default value 67584 Last sector, +sectors or +size{K,M,G} (67584-8806399, default 8806399): +512M Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): 82 Changed system type of partition 2 to 82 (Linux swap / Solaris) Command (m for help): p Disk /dev/sda: 4508 MB, 4508876800 bytes 255 heads, 63 sectors/track, 548 cylinders, total 8806400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x544b720c Device Boot Start End Blocks Id System /dev/sda1 * 2048 67583 32768 83 Linux /dev/sda2 67584 1116159 524288 82 Linux swap / Solaris Command (m for help):
Создаём корневой раздел, сохраняем таблицу разделов и выходим из fdisk:
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 3): Using default value 3 First sector (1116160-8806399, default 1116160): Using default value 1116160 Last sector, +sectors or +size{K,M,G} (1116160-8806399, default 8806399): Using default value 8806399 Command (m for help): p Disk /dev/sda: 4508 MB, 4508876800 bytes 255 heads, 63 sectors/track, 548 cylinders, total 8806400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x544b720c Device Boot Start End Blocks Id System /dev/sda1 * 2048 67583 32768 83 Linux /dev/sda2 67584 1116159 524288 82 Linux swap / Solaris /dev/sda3 1116160 8806399 3845120 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. livecd ~ #
Форматируем разделы
livecd ~ # mkfs.ext2 /dev/sda1 mke2fs 1.41.14 (22-Dec-2010) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 8192 inodes, 32768 blocks 1638 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=33554432 4 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577 Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 29 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. livecd ~ # mkfs.ext3 /dev/sda3 mke2fs 1.41.14 (22-Dec-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 240480 inodes, 961280 blocks 48064 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=985661440 30 block groups 32768 blocks per group, 32768 fragments per group 8016 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 22 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. livecd ~ #
Если в процессе разметки таблицы разделов вы забыли к размеру добавить букву {K,M,G}, то при форматировании вы можете получить сообщение:
livecd ~ # mke2fs /dev/sda1 mke2fs 1.41.14 (22-Dec-2010) /dev/sda1: Not enough space to build proposed filesystem while setting up superb lock
Инициализируем и подключаем файл подкачки:
Только после полного отключения блокировщика скриптов и рекламы на этом месте появится полезная подсказка/ссылка/код/пример конфигурации/etc!
Монтируем разделы:
livecd ~ # mount /dev/sda3 /mnt/gentoo livecd ~ # mkdir /mnt/gentoo/boot livecd ~ # mount /dev/sda1 /mnt/gentoo/boot
Установка установочных файлов Gentoo
Интересная формулировка "Установка установочных файлов Gentoo":))
Сначала нам рекомендую проверить системное время для избежания неприятных сюрпризов в дальнейшем, а если время отличается, то установить его командой date ММДДччммГГГГГ:
livecd ~ # date Mon Dec 10 12:37:21 UTC 2012 livecd ~ #
Установка архива стадии (stage3) на вашу систему
Переходим в точку монтирования /mnt/gentoo корневого раздела /dev/sda3:
livecd ~ # cd /mnt/gentoo livecd gentoo #
Проверяем версию архитектуры, на странице http://www.gentoo.org/main/ru/mirrors.xml выбираем зеркало, часть из которых мёртвые, скачиваем подходящий stage3 (около 141 МБ) и распаковываем его:
livecd ~ # uname -m i686 livecd ~ # wget http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/releases/x86/current- stage3/stage3-i686-20121016.tar.bz2 livecd ~ # tar xjpf stage3-*.tar.bz2 livecd ~ # rm -f stage3-*.tar.bz2
Конфигурация компилятора:
nano -w /mnt/gentoo/etc/portage/make.conf # These settings were set by the catalyst build script that automatically # built this stage. # Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. CFLAGS="-O2 -march=i686 -pipe" CXXFLAGS="${CFLAGS}" # WARNING: Changing your CHOST is not something that should be done lightly. # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. CHOST="i686-pc-linux-gnu" MAKEOPTS="-j2"
Установка базовой системы Gentoo
Для ускорения загрузки исходного кода рекомендуется выбрать быстрое зеркало. Portage ищет переменную GENTOO_MIRRORS в файле make.conf и использует зеркала, перечисленные в ней. Конечно, можно просмотреть наш список зеркал и выбрать одно или несколько, географически ближайших к вам (чаще всего они и будут самыми быстрыми), но мы предлагаем вам удобную утилиту mirrorselect, которая позволяет выбрать желаемые зеркала более удобным способом:
Только после полного отключения блокировщика скриптов и рекламы на этом месте появится полезная подсказка/ссылка/код/пример конфигурации/etc!
сервер rsync (сервер удаленной синхронизации), выбранный вами для обновления дерева Portage (коллекции файлов ebuild — сборочных сценариев, содержащих все данные, нужные Portage для скачивания и установки программ). Хотя вписать адрес сервера в SYNC можно и вручную, mirrorselect позволяет упростить это действие:
Только после полного отключения блокировщика скриптов и рекламы на этом месте появится полезная подсказка/ссылка/код/пример конфигурации/etc!
Перед тем, как перейти в новую среду, осталось сделать одно дело: скопировать информацию о DNS (системе доменных имен) в файл /etc/resolv.conf. Это нужно, чтобы при переходе сохранить работоспособность сети. В файле /etc/resolv.conf содержатся адреса серверов имен, используемых в вашей сети (параметр «-L» нужен, чтобы случайно не скопировать символьную ссылку):
livecd gentoo # cp -L /etc/resolv.conf /mnt/gentoo/etc/
Смонтируйте файловую систему /proc в /mnt/gentoo/proc, чтобы после изменения корневого каталога устанавливаемая система смогла обращаться к информации, предоставляемой ядром, а затем создайте привязку монтирования файловой системы /dev и /sys.
livecd gentoo # mount -t proc none /mnt/gentoo/proc livecd gentoo # mount --rbind /sys /mnt/gentoo/sys livecd gentoo # mount --rbind /dev /mnt/gentoo/dev
Переход в новую среду
Итак, все разделы подготовлены, а базовая операционная среда установлена. Теперь пора войти в нее, изменив корневой каталог. Таким образом, мы перейдем из текущей установочной среды (с компакт-диска или другого установочного носителя) в свою устанавливаемую систему (находящуюся в недавно размеченных разделах).
Изменение выполняется в три этапа. Сначала мы с помощью chroot изменим корневой каталог с / (находящийся на установочном носителе) на /mnt/gentoo (находящийся на ваших дисковых разделах). Затем мы создадим новую среду, пользуясь утилитой env-update, которая, собственно, создает переменные среды. Наконец, мы загрузим эти переменные в память при помощи source.
livecd gentoo # chroot /mnt/gentoo /bin/bash livecd / # env-update !!! Invalid PORTDIR_OVERLAY (not a dir): '/usr/portage' !!! main-repo not set in DEFAULT and PORTDIR is empty. >>> Regenerating /etc/ld.so.cache... livecd / # source /etc/profile livecd / # export PS1="(chroot) $PS1" (chroot) livecd / #
Поздравляем! Теперь вы в своей собственной среде Gentoo Linux. Конечно, на этом она далеко еще не готова, поэтому в руководстве еще осталось несколько разделов :-)
Установка и конфигурация Portage
Дерево портов (Portage) должно быть извлечено в каталог /usr/portage. Рекомендуется использовать emerge-webrsync, которая загрузит и установит последнюю версию снапшота Portage:
(chroot) livecd / # mkdir /usr/portage (chroot) livecd / # emerge-webrsync Fetching most recent snapshot ... Trying to retrieve 20121210 snapshot from ftp://de-mirror.org/gentoo/ ... Fetching file portage-20121210.tar.xz.md5sum ... Fetching file portage-20121210.tar.bz2.md5sum ... Fetching file portage-20121210.tar.gz.md5sum ... Trying to retrieve 20121210 snapshot from http://de-mirror.org/gentoo/ ... Fetching file portage-20121210.tar.xz.md5sum ... Fetching file portage-20121210.tar.bz2.md5sum ... Fetching file portage-20121210.tar.gz.md5sum ... Trying to retrieve 20121210 snapshot from rsync://de-mirror.org/gentoo/ ... Fetching file portage-20121210.tar.xz.md5sum ... Fetching file portage-20121210.tar.bz2.md5sum ... Fetching file portage-20121210.tar.gz.md5sum ... Trying to retrieve 20121210 snapshot from ftp://ftp.wh2.tu-dresden.de/pub/mirror s/gentoo ... Fetching file portage-20121210.tar.xz.md5sum ... Fetching file portage-20121210.tar.bz2.md5sum ... Fetching file portage-20121210.tar.gz.md5sum ... Trying to retrieve 20121210 snapshot from http://gentoo.mneisen.org/ ... Fetching file portage-20121210.tar.xz.md5sum ... Fetching file portage-20121210.tar.xz.gpgsig ... Fetching file portage-20121210.tar.xz ... Checking digest ... portage-20121210.tar.xz: OK Getting snapshot timestamp ... Syncing local tree ... ................................ Number of files: 162009 Number of files transferred: 38003 Total file size: 269765559 bytes Total transferred file size: 75330188 bytes Literal data: 75330188 bytes Matched data: 0 bytes File list size: 4056251 File list generation time: 170.141 seconds File list transfer time: 0.020 seconds Total bytes sent: 81049443 Total bytes received: 750517 sent 81049443 bytes received 750517 bytes 74874.11 bytes/sec total size is 269765559 speedup is 3.30 rsync error: some files/attrs were not transferred (see previous errors) (code 2 3) at main.c(1052) [sender=3.0.9] Cleaning up ... !!! /etc/portage/make.profile is not a symlink and will probably prevent most me rges. !!! It should point into a profile within /usr/portage/profiles/ !!! (You can safely ignore this message when syncing. Its harmless.) !!! Your current profile is invalid. If you have just changed your profile !!! configuration, you should revert back to the previous configuration. !!! Allowed actions are limited to --help, --info, --search, --sync, and !!! --version. (chroot) livecd / #
Выбор нужного профиля
Профиль является строительным блоком для любой системы Gentoo. Он не только указывает значения для USE, CFLAGS и других важных переменных по умолчанию, он также привязывает систему к определенному диапазону допустимых версий пакетов.
Вы можете увидеть, какой профиль используется в данный момент с помощью следующей команды:
# eselect profile list Available profile symlink targets: [1] default/linux/x86/10.0 * [2] default/linux/x86/10.0/desktop [3] default/linux/x86/10.0/server
Для выбора нужного профиля используйте, например eselect profile set 3
Ага, разбежались, на практике не всё оказалось так гладко и даже оригинальный и самый актуальный хандбук до лампочки!;(( Команда eselect profile list выдала: "Error: Failed to get a list of valid profiles"
Вспоминаем мессагу после выполнения emerge-webrsync:
!!! /etc/portage/make.profile is not a symlink and will probably prevent most me rges. !!! It should point into a profile within /usr/portage/profiles/ !!! (You can safely ignore this message when syncing. It's harmless.)
Делаем грёбанный symlink: ln -sf /usr/portage/profiles/ /etc/portage/make.profile
Один хрен... Смотрим в ls -la /usr/portage/profiles/, а там твою мать пусто!;( Твою gentoo мать за ногу... Идём другим путём и грузим мать его снапшота мануально:
livecd ~ # wget http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ releases/snapshots/current/portage-latest.tar.bz2 livecd ~ # tar xjf portage-latest.tar.bz2 -C /usr livecd ~ # rm -f portage-latest.tar.bz2
Повторяем eselect profile list и оОоо Чудо, что я вижу:)
(chroot) livecd / # eselect profile list Available profile symlink targets: [1] default/linux/x86/10.0 [2] default/linux/x86/10.0/selinux [3] default/linux/x86/10.0/desktop [4] default/linux/x86/10.0/desktop/gnome [5] default/linux/x86/10.0/desktop/kde [6] default/linux/x86/10.0/developer [7] default/linux/x86/10.0/server [8] hardened/linux/x86 [9] hardened/linux/x86/selinux [10] hardened/linux/uclibc/x86
Выбираем профиль server, чтоб его: eselect profile set 7
(chroot) livecd / # eselect profile set 7 (chroot) livecd / # eselect profile list Available profile symlink targets: [1] default/linux/x86/10.0 [2] default/linux/x86/10.0/selinux [3] default/linux/x86/10.0/desktop [4] default/linux/x86/10.0/desktop/gnome [5] default/linux/x86/10.0/desktop/kde [6] default/linux/x86/10.0/developer [7] default/linux/x86/10.0/server * [8] hardened/linux/x86 [9] hardened/linux/x86/selinux [10] hardened/linux/uclibc/x86 (chroot) livecd / #
Наш symlink /etc/portage/make.profile сменил указатель с /usr/portage/profiles/ на /usr/portage/profiles/default/linux/x86/10.0/server:
(chroot) livecd / # ls -la /etc/portage/make.profile lrwxrwxrwx 1 root root 56 Dec 11 05:43 /etc/portage/make.profile -> ../../usr/po rtage/profiles/default/linux/x86/10.0/server
Выходит, что emerge-webrsync явно НЕ рекомендуется использовать для установки портежей!... Шкандыбаем дальше...
Настройка переменной USE
USE («использовать») — одна из самых мощных переменных, имеющихся в распоряжении пользователей Gentoo. Она позволяет при компиляции программ включать или отключать поддержку определенных необязательных функций. Например, некоторые программы можно компилировать с поддержкой gtk или qt на выбор. Другие можно собирать, включая или отключая поддержку SSL. Некоторые программы можно даже компилировать с поддержкой кадрового буфера (svgalib) вместо поддержки X11 (X-сервера).
В большинстве дистрибутивов пакеты собраны с поддержкой практически всех мыслимых вариантов. Это увеличивает размер программ и время запуска, не говоря уже о чрезмерных зависимостях. В Gentoo вы сами можете определять, с какими возможностями следует компилировать пакет. Здесь играет роль переменная USE.
В переменной USE указываются ключевые слова, которые отражаются на параметрах компиляции. Например, параметр ssl включает компиляцию с поддержкой ssl всех программ, которые способны его поддерживать. -X отключает поддержку X-сервера (обратите внимание на предшествующий знак «минус»). Параметры gnome gtk -kde -qt обеспечивают компиляцию ваших программ с поддержкой Gnome и gtk, но без поддержки KDE и qt, делая систему оптимальной для GNOME.
Настройки USE по умолчанию хранятся в файлах make.defaults вашего профиля. Файлы make.defaults находятся в каталоге, на который указывает /etc/portage/make.profile, а также во всех родительских каталогах. Значение USE по умолчанию — это сумма всех значений USE во всех файлах make.defaults. Все, что вы вносите в /etc/portage/make.conf, рассчитывается относительно этих значений. Когда вы добавляете что-либо к значению USE, оно добавляется в список по умолчанию. Когда удаляете что-либо (указывая ключевое слово с предшествующим знаком минус), оно удаляется из списка по умолчанию (если оно там вообще было). Никогда ничего не меняйте в /etc/portage/make.profile. Все, что там находится, перезаписывается при обновлении Portage!
Полное описание переменной USE находится во второй части настольной книги Gentoo в главе USE-флаги. Полное описание возможных значений признаков использования находится в вашей системе в файле /usr/portage/profiles/use.desc: less /usr/portage/profiles/use.desc
Ну да, так бы мы вот это и посмотрели бы в less /usr/portage/profiles/use.desc, если бы не установили снапшот мануАнально...
Например, приведем значение USE:
Только после полного отключения блокировщика скриптов и рекламы на этом месте появится полезная подсказка/ссылка/код/пример конфигурации/etc!
Конфигурация и компиляция ядра Gentoo
Оооо, щас начнём.... Конфигурация и компиляция ядра Gentoo - это самый тупиковый период:)...
Установка часового пояса
# ls /usr/share/zoneinfo/Europe # cp /usr/share/zoneinfo/Europe/Kiev /etc/localtime
Выбор ядра
Gentoo предоставляет своим пользователям несколько возможных источников ядра. Полный список с описанием можно найти в руководстве по выбору ядра Gentoo.
Настоятельно рекомендуется заглянуть в Gentoo Kernel Guide и выберите ядро из секции "Supported kernel packages" имхо еже может выйти так что ниже указано уже устаревшее и не поддерживаемое ядро, несмотря на то, что мы гульчитаем оригинальный и типа самый актуальный хандпук!:)
Выберите исходники ядра и установите его используя emerge, мы выбрали ядро "For servers: hardened-sources":
(chroot) livecd / # emerge hardened-sources Performing Global Updates: (Could take a couple of minutes if you have a lot of binary packages.) .='update pass' *='binary update' #='/var/db update' @='/var/db move' s='/var/db SLOT move' %='binary move' S='binary SLOT move' p='update /etc/portage/package.*' /usr/portage/profiles/updates/4Q-2012........................................... ............ * IMPORTANT: 5 news items need reading for repository 'gentoo'. * Use eselect news to read news items. Calculating dependencies... done! >>> Verifying ebuild manifests >>> Starting parallel fetch >>> Emerging (1 of 2) virtual/udev-171 * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you don't know if this * applies to you, then it doesn't and you should probably be using * Hardened, instead. >>> Unpacking source... >>> Source unpacked in /var/tmp/portage/virtual/udev-171/work >>> Preparing source in /var/tmp/portage/virtual/udev-171/work ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/virtual/udev-171/work ... >>> Source configured. >>> Compiling source in /var/tmp/portage/virtual/udev-171/work ... >>> Source compiled. >>> Test phase [not enabled]: virtual/udev-171 >>> Install udev-171 into /var/tmp/portage/virtual/udev-171/image/ category virt ual >>> Completed installing udev-171 into /var/tmp/portage/virtual/udev-171/image/ >>> Installing (1 of 2) virtual/udev-171 >>> Emerging (2 of 2) sys-kernel/hardened-sources-3.5.4-r1 * Fetching files in the background. To view fetch progress, run * `tail -f /var/log/emerge-fetch.log` in another terminal. * linux-3.5.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * hardened-patches-3.5.4-2.extras.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * genpatches-3.5-5.base.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * genpatches-3.5-5.extras.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you don't know if this * applies to you, then it doesn't and you should probably be using * Hardened, instead. >>> Preparing to unpack ... >>> Unpacking source... >>> Unpacking linux-3.5.tar.bz2 to /var/tmp/portage/sys-kernel/hardened-sources- 3.5.4-r1/work >>> Unpacking genpatches-3.5-5.base.tar.bz2 to /var/tmp/portage/sys-kernel/harde ned-sources-3.5.4-r1/work/patches >>> Unpacking genpatches-3.5-5.extras.tar.bz2 to /var/tmp/portage/sys-kernel/har dened-sources-3.5.4-r1/work/patches >>> Unpacking hardened-patches-3.5.4-2.extras.tar.bz2 to /var/tmp/portage/sys-ke rnel/hardened-sources-3.5.4-r1/work/patches * Excluding Patch #4200_fbcondecor-0.9.6.patch ... [ ok ] * Applying 1000_linux-3.5.1.patch (-p0+) ... [ ok ] * Applying 1001_linux-3.5.2.patch (-p0+) ... [ ok ] * Applying 1002_linux-3.5.3.patch (-p0+) ... [ ok ] * Applying 1003_linux-3.5.4.patch (-p0+) ... [ ok ] * Applying 2400_kcopy-patch-for-infiniband-driver.patch (-p0+) ... [ ok ] * Applying 4420_grsecurity-2.9.1-3.5.4-201209192118.patch (-p0+) ... [ ok ] * Applying 4430_grsec-remove-localversion-grsec.patch (-p0+) ... [ ok ] * Applying 4435_grsec-mute-warnings.patch (-p0+) ... [ ok ] * Applying 4440_grsec-remove-protected-paths.patch (-p0+) ... [ ok ] * Applying 4450_grsec-kconfig-default-gids.patch (-p0+) ... [ ok ] * Applying 4465_selinux-avc_audit-log-curr_ip.patch (-p0+) ... [ ok ] * Applying 4470_disable-compat_vdso.patch (-p0+) ... [ ok ] >>> Source unpacked in /var/tmp/portage/sys-kernel/hardened-sources-3.5.4-r1/wor k >>> Preparing source in /var/tmp/portage/sys-kernel/hardened-sources-3.5.4-r1/wo rk/linux-3.5.4-hardened-r1 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/sys-kernel/hardened-sources-3.5.4-r1/ work/linux-3.5.4-hardened-r1 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/sys-kernel/hardened-sources-3.5.4-r1/wo rk/linux-3.5.4-hardened-r1 ... >>> Source compiled. >>> Test phase [not enabled]: sys-kernel/hardened-sources-3.5.4-r1 >>> Install hardened-sources-3.5.4-r1 into /var/tmp/portage/sys-kernel/hardened- sources-3.5.4-r1/image/ category sys-kernel >>> Copying sources ... >>> Completed installing hardened-sources-3.5.4-r1 into /var/tmp/portage/sys-ker nel/hardened-sources-3.5.4-r1/image/ >>> Installing (2 of 2) sys-kernel/hardened-sources-3.5.4-r1 * If you are upgrading from a previous kernel, you may be interested * in the following document: * - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml * * Hardened Gentoo provides three different predefined grsecurity level: * [server], [workstation], and [virtualization]. Those who intend to * use one of these predefined grsecurity levels should read the help * associated with the level. Because some options require >=gcc-4.5, * users with more, than one version of gcc installed should use gcc-config * to select a compatible version. * * Users of grsecuritys RBAC system must ensure they are using * sys-apps/gradm-2.9.1*, which is compatible with hardened-sources-3.5.4-r1. * It is strongly recommended that the following command is issued * prior to booting a hardened-sources-3.5.4-r1 kernel for the first time: * * emerge -na =sys-apps/gradm-2.9.1* * >>> Recording sys-kernel/hardened-sources in "world" favorites file... * Messages for package virtual/udev-171: * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. * Messages for package sys-kernel/hardened-sources-3.5.4-r1: * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. * If you are upgrading from a previous kernel, you may be interested * in the following document: * - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml * * Hardened Gentoo provides three different predefined grsecurity level: * [server], [workstation], and [virtualization]. Those who intend to * use one of these predefined grsecurity levels should read the help * associated with the level. Because some options require >=gcc-4.5, * users with more, than one version of gcc installed should use gcc-config * to select a compatible version. * * Users of grsecuritys RBAC system must ensure they are using * sys-apps/gradm-2.9.1*, which is compatible with hardened-sources-3.5.4-r1. * It is strongly recommended that the following command is issued * prior to booting a hardened-sources-3.5.4-r1 kernel for the first time: * * emerge -na =sys-apps/gradm-2.9.1* * >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * GNU info directory index is up-to-date. * IMPORTANT: 5 news items need reading for repository 'gentoo'. * Use eselect news to read news items. (chroot) livecd / #
Проверим есть ли в /usr/src/ символическая ссылка Linux, указывающие на наш выбранный исходный код ядра:
(chroot) livecd / # ls -l /usr/src/linux lrwxrwxrwx 1 root root 23 Dec 11 06:29 /usr/src/linux -> linux-3.5.4-hardened-r1
Аминь! После установки исходного кода ядра нам предлагают его сконфигурировать мануально или же автоматически с помощью emerge genkernel. Мануальная конфигурация, ещё чего, пошла бы она взад, не будем заморачиватся и проверим самый якобы простой и универсальный вариант Alternative: Using genkernel
Тем более мало ли какие модули ядра нам понадобятся в будущем, по умолчанию genkernel компилирует поддержку всего оборудования и модулей ядра.
Альтернатива: использование Genkernel
(chroot) livecd / # emerge genkernel * IMPORTANT: 5 news items need reading for repository 'gentoo'. * Use eselect news to read news items. Calculating dependencies... done! >>> Verifying ebuild manifests >>> Starting parallel fetch >>> Emerging (1 of 2) app-arch/cpio-2.11 * Fetching files in the background. To view fetch progress, run * `tail -f /var/log/emerge-fetch.log` in another terminal. * cpio-2.11.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ] * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. >>> Unpacking source... >>> Unpacking cpio-2.11.tar.bz2 to /var/tmp/portage/app-arch/cpio-2.11/work >>> Source unpacked in /var/tmp/portage/app-arch/cpio-2.11/work ..................... >>> Installing (1 of 2) app-arch/cpio-2.11 >>> Emerging (2 of 2) sys-kernel/genkernel-3.4.24_p2 * genkernel-3.4.24_p2.tar.bz2 SHA256 size ;-) ... [ ok ] * dmraid-1.0.0.rc14.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * mdadm-3.1.5.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * LVM2.2.02.88.tgz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * device-mapper.1.02.22.tgz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * busybox-1.20.1.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * open-iscsi-2.0-872.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * e2fsprogs-1.42.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * fuse-2.8.6.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * unionfs-fuse-0.24.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * gnupg-1.4.11.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. >>> Unpacking source... >>> Unpacking genkernel-3.4.24_p2.tar.bz2 to /var/tmp/portage/sys-kernel/genkern el-3.4.24_p2/work >>> Source unpacked in /var/tmp/portage/sys-kernel/genkernel-3.4.24_p2/work >>> Compiling source in /var/tmp/portage/sys-kernel/genkernel-3.4.24_p2/work/gen kernel-3.4.24_p2 ... >>> Source compiled. >>> Test phase [not enabled]: sys-kernel/genkernel-3.4.24_p2 >>> Install genkernel-3.4.24_p2 into /var/tmp/portage/sys-kernel/genkernel-3.4.2 4_p2/image/ category sys-kernel * Copying files to /var/cache/genkernel/src... >>> Completed installing genkernel-3.4.24_p2 into /var/tmp/portage/sys-kernel/ge nkernel-3.4.24_p2/image/ ecompressdir: bzip2 -9 /usr/share/man >>> Installing (2 of 2) sys-kernel/genkernel-3.4.24_p2 * Documentation is available in the genkernel manual page * as well as the following URL: * http://www.gentoo.org/doc/en/genkernel.xml * This package is known to not work with reiser4. If you are running * reiser4 and have a problem, do not file a bug. We know it does not * work and we dont plan on fixing it since reiser4 is the one that is * broken in this regard. Try using a sane filesystem like ext3 or * even reiser3. * The LUKS support has changed from versions prior to 3.4.4. Now, * you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah. >>> Recording sys-kernel/genkernel in "world" favorites file... * Messages for package app-arch/cpio-2.11: * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. * Messages for package sys-kernel/genkernel-3.4.24_p2: * This profile has not been tested thoroughly and is not considered to be * a supported server profile at this time. For a supported server * profile, please check the Hardened project (http://hardened.gentoo.org). * This profile is merely a convenience for people who require a more * minimal profile, yet are unable to use hardened due to restrictions in * the software being used on the server. This profile should also be used * if you require GCC 4.1 or Glibc 2.4 support. If you dont know if this * applies to you, then it doesnt and you should probably be using * Hardened, instead. * Copying files to /var/cache/genkernel/src... * Documentation is available in the genkernel manual page * as well as the following URL: * http://www.gentoo.org/doc/en/genkernel.xml * This package is known to not work with reiser4. If you are running * reiser4 and have a problem, do not file a bug. We know it does not * work and we dont plan on fixing it since reiser4 is the one that is * broken in this regard. Try using a sane filesystem like ext3 or * even reiser3. * The LUKS support has changed from versions prior to 3.4.4. Now, * you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah. >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * Regenerating GNU info directory index... * Processed 73 info files. * IMPORTANT: 5 news items need reading for repository 'gentoo'. * Use eselect news to read news items. (chroot) livecd / #
Теперь, скомпилировать ядро, запустив genkernel all. Имейте в виду, хотя, как Genkernel компилирует ядро, которое поддерживает практически все оборудование, этот процесс займет некоторое время!
Обратите внимание, что, если ваш загрузочный раздел не использует ext2 или ext3, то вам придется вручную настроить ядро.
(chroot) livecd / # genkernel all * Gentoo Linux Genkernel; Version 3.4.24_p2 * Running with options: all * Linux Kernel 3.5.4-hardened-r1 for x86... * kernel: Using config from /usr/share/genkernel/arch/x86/kernel-config * kernel: >> Running mrproper... * >> Running oldconfig... * kernel: >> Cleaning... * >> Compiling 3.5.4-hardened-r1 bzImage... * ERROR: Failed to compile the "bzImage" target... * -- Grepping log... -- SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --oldconfig Kconfig .config:297:warning: symbol value 'm' invalid for ACPI_DOCK .config:415:warning: symbol value 'm' invalid for PCCARD_NONSTATIC .config:722:warning: symbol value 'm' invalid for IP_DCCP_CCID3 .config:723:warning: symbol value 'm' invalid for IP_DCCP_TFRC_LIB .config:937:warning: symbol value 'm' invalid for RFKILL_INPUT .config:1304:warning: symbol value 'm' invalid for PATA_HPT3X3_DMA .config:1428:warning: symbol value 'm' invalid for FIXED_PHY .config:1803:warning: symbol value 'm' invalid for ISDN .config:2905:warning: override: reassigning to symbol LOGITECH_FF .config:2910:warning: override: reassigning to symbol PANTHERLORD_FF .config:2915:warning: override: reassigning to symbol THRUSTMASTER_FF .config:2916:warning: override: reassigning to symbol ZEROPLUS_FF .config:2930:warning: override: reassigning to symbol USB_SUPPORT .config:2931:warning: override: reassigning to symbol USB_ARCH_HAS_HCD .config:2932:warning: override: reassigning to symbol USB_ARCH_HAS_OHCI .config:2933:warning: override: reassigning to symbol USB_ARCH_HAS_EHCI .config:2934:warning: override: reassigning to symbol USB .config:2935:warning: override: reassigning to symbol USB_DEBUG .config:3137:warning: symbol value 'm' invalid for MMC_RICOH_MMC .config:3173:warning: symbol value 'm' invalid for RTC_LIB .config:3174:warning: symbol value 'm' invalid for RTC_CLASS .config:3299:warning: symbol value 'm' invalid for GFS2_FS_LOCKING_DLM -- choice[1-3]: 2 Memory model > 1. Flat Memory (FLATMEM_MANUAL) 2. Sparse Memory (SPARSEMEM_MANUAL) choice[1-2]: 1 Allow for memory compaction (COMPACTION) [N/y/?] (NEW) Enable KSM for page mergi ng (KSM) [N/y/?] (NEW) Low address space to protect from user allocation (DEFAUL T_MMAP_MIN_ADDR) [65536] (NEW) Enable recovery from hardware memory errors (MEMO RY_FAILURE) [N/y/?] (NEW) Transparent Hugepage Support (TRANSPARENT_HUGEPAGE) [N /y/?] (NEW) Cross Memory Support (CROSS_MEMORY_ATTACH) [Y/n/?] (NEW) Enable clea ncache driver to cache clean pages if tmem is present (CLEANCACHE) [N/y/?] (NEW) Enable frontswap to cache swap pages if tmem is present (FRONTSWAP) [N/y/?] (NE W) Allocate 3rd-level pagetables from highmem (HIGHPTE) [Y/n/?] y -- IPMI (ACPI_IPMI) [N/m/?] (NEW) Processor Aggregator (ACPI_PROCESSOR_AGGREGAT OR) [N/m/?] (NEW) Thermal Zone (ACPI_THERMAL) [M/n/?] m Disable ACPI for systems before Jan 1st this year (ACPI_BLACKLIST_YEAR) [0] 0 Debug Statements (ACPI_DEBUG) [N/y/?] n PCI slot detection driver (ACPI_PCI_SLOT) [N/m/y/?] (NEW) Container and Modu le Devices (EXPERIMENTAL) (ACPI_CONTAINER) [M/y/?] m Smart Battery System (ACPI_SBS) [N/m/y/?] n Hardware Error Device (ACPI_HED) [N/m/y/?] (NEW) Allow ACPI methods to be in serted/replaced at run time (ACPI_CUSTOM_METHOD) [N/m/y/?] (NEW) Boottime Grap hics Resource Table support (ACPI_BGRT) [N/m/y/?] (NEW) ACPI Platform Error In terface (APEI) (ACPI_APEI) [N/y/?] (NEW) * -- 3. Direct (PCI_GODIRECT) > 4. Any (PCI_GOANY) choice[1-4?]: 4 PCI Express support (PCIEPORTBUS) [Y/n/?] y PCI Express Hotplug driver (HOTPLUG_PCI_PCIE) [N/m/?] n Root Port Advanced Error Reporting support (PCIEAER) [Y/n/?] y PCI Express ECRC settings control (PCIE_ECRC) [N/y/?] (NEW) PCIe AER error injector support (PCIEAER_INJECT) [N/m/y/?] (NEW) PCI Express ASPM co ntrol (PCIEASPM) [Y/?] y -- Marvell Bluetooth driver support (BT_MRVL) [N/m/?] (NEW) * * Wireless * Wireless (WIRELESS) [Y] (NEW) y cfg80211 - wireless configuration API (CFG80211) [M/n/?] m nl80211 testmode command (NL80211_TESTMODE) [N/y/?] (NEW) enable develop er warnings (CFG80211_DEVELOPER_WARNINGS) [N/y/?] (NEW) cfg80211 regulatory debugging (CFG80211_REG_DEBUG) [N/y/?] (NEW) enable powersave by default (CF G80211_DEFAULT_PS) [Y/n/?] (NEW) cfg80211 DebugFS entries (CFG80211_DEBUGFS) [N/y/?] (NEW) cfg80211 wireless extensions compatibility (CFG80211_WEXT) [Y /n/?] (NEW) Wireless extensions sysfs files (WIRELESS_EXT_SYSFS) [N/y/?] (NEW) Common routines for IEEE802.11 drivers (LIB80211) [M/y/?] (NEW) lib80211 de bugging messages (LIB80211_DEBUG) [N/y/?] (NEW) Generic IEEE 802.11 Networking Stack (mac80211) (MAC80211) [M/n/?] m -- * Wireless * Wireless (WIRELESS) [Y] (NEW) y cfg80211 - wireless configuration API (CFG80211) [M/n/?] m nl80211 testmode command (NL80211_TESTMODE) [N/y/?] n enable developer warnings (CFG80211_DEVELOPER_WARNINGS) [N/y/?] n -- SCSI CDROM support (BLK_DEV_SR) [Y/n/m/?] y Enable vendor-specific extensions (for SCSI CDROM) (BLK_DEV_SR_VENDOR) [Y/n/?] y SCSI generic support (CHR_DEV_SG) [M/n/y/?] m SCSI media changer support (CHR_DEV_SCH) [M/n/y/?] m Probe all LUNs on each SCSI device (SCSI_MULTI_LUN) [Y/n/?] y Verbose SCSI error reporting (kernel size +=12K) (SCSI_CONSTANTS) [Y/n/?] y -- SCSI Device Handlers (SCSI_DH) [N/m/y/?] n OSD-Initiator library (SCSI_OSD_INITIATOR) [N/m/y/?] (NEW) * * Serial ATA and Parallel ATA drivers * Serial ATA and Parallel ATA drivers (ATA) [Y/n/m/?] y Verbose ATA error reporting (ATA_VERBOSE_ERROR) [Y/n/?] (NEW) ATA ACPI Suppo rt (ATA_ACPI) [Y/n/?] y -- OCFS2 expensive checks (OCFS2_DEBUG_FS) [N/y/?] n Btrfs filesystem (EXPERIMENTAL) Unstable disk format (BTRFS_FS) [N/m/y/?] (NEW) NILFS2 file system support (EXPERIMENTAL) (NILFS2_FS) [N/m/y/?] (NEW) Dnotify su pport (DNOTIFY) [Y/n/?] y Inotify support for userspace (INOTIFY_USER) [Y/n/?] y Filesystem wide access notification (FANOTIFY) [N/y/?] (NEW) Quota support (QUOT A) [Y/?] y Report quota messages through netlink interface (QUOTA_NETLINK_INTERFACE) [Y/n/? ] y Print quota warnings to console (OBSOLETE) (PRINT_QUOTA_WARNING) [N/y/?] n -- Linked list sorting test (TEST_LIST_SORT) [N/y/?] (NEW) Debug SG table operation s (DEBUG_SG) [N/y/?] n Debug notifier call chains (DEBUG_NOTIFIERS) [N/y/?] (NEW) Debug credential mana gement (DEBUG_CREDENTIALS) [N/y/?] (NEW) Compile the kernel with frame pointers (FRAME_POINTER) [Y/n/?] y Delay each boot printk message by N milliseconds (BOOT_PRINTK_DELAY) [N/y/?] n torture tests for RCU (RCU_TORTURE_TEST) [N/m/y/?] n RCU CPU stall timeout in seconds (RCU_CPU_STALL_TIMEOUT) [60] (NEW) Print additi onal diagnostics on RCU CPU stall (RCU_CPU_STALL_INFO) [N/y/?] (NEW) Enable trac ing for RCU (RCU_TRACE) [N/y/?] (NEW) Kprobes sanity tests (KPROBES_SANITY_TEST) [N/y/?] (NEW) Self test for the backtrace code (BACKTRACE_SELF_TEST) [N/m/y/?] (NEW) Force extended block device numbers and spread them (DEBUG_BLOCK_EXT_DEVT) [N/y/?] (NEW) Force weak per-cpu definitions (DEBUG_FORCE_WEAK_PER_CPU) [N/y/?] (NEW) Debug access to per_cpu maps (DEBUG_PER_CPU_MAPS) [N/y/?] (NEW) Linux Ker nel Dump Test Tool Module (LKDTM) [N/m/y/?] n CPU notifier error injection module (CPU_NOTIFIER_ERROR_INJECT) [N/m/y/?] (NEW) Fault-injection framework (FAULT_INJECTION) [N/y/?] n -- SHIPPED scripts/genksyms/keywords.hash.c SHIPPED scripts/genksyms/parse.tab.h SHIPPED scripts/genksyms/parse.tab.c HOSTCC scripts/genksyms/lex.lex.o scripts/genksyms/lex.lex.c_shipped: In function 'yylex1': scripts/genksyms/lex.lex.c_shipped:904:1: warning: ignoring return value of 'fwr ite', declared with attribute warn_unused_result -- CC arch/x86/kernel/ioport.o CC init/calibrate.o CC init/init_task.o CC arch/x86/kernel/ldt.o ld: cannot open output file init/init_task.o: No space left on device make[1]: *** [init/init_task.o] Error 1 make: *** [init] Error 2 make: *** Waiting for unfinished jobs.... CC arch/x86/kernel/dumpstack.o Assembler messages: Fatal error: cant create arch/x86/kernel/.tmp_dumpstack.o: No space left on dev ice arch/x86/kernel/ldt.c:292:1: fatal error: opening dependency file arch/x86/kerne l/.ldt.o.d: No space left on device compilation terminated. make[2]: *** [arch/x86/kernel/ldt.o] Error 1 make[2]: *** Waiting for unfinished jobs.... LD arch/x86/kvm/built-in.o /bin/sh: arch/x86/kvm/.built-in.o.cmd: No space left on device make[2]: *** [arch/x86/kvm/built-in.o] Error 1 make[1]: *** [arch/x86/kvm] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: *** [arch/x86/kernel/dumpstack.o] Error 2 make[1]: *** [arch/x86/kernel] Error 2 make: *** [arch/x86] Error 2 * Gentoo Linux Genkernel; Version 3.4.24_p2 * Running with options: all * ERROR: Failed to compile the "bzImage" target... * -- End log... -- * Please consult /var/log/genkernel.log for more information and any * errors that were reported above. * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * /var/log/genkernel.log so that your issue can be dealt with effectively. * * Please do *not* report compilation failures as genkernel bugs! * (chroot) livecd / # genkernel all * Gentoo Linux Genkernel; Version 3.4.24_p2 * Running with options: all * Linux Kernel 3.5.4-hardened-r1 for x86... * kernel: Using config from /usr/share/genkernel/arch/x86/kernel-config cp: cannot create regular file '/usr/src/linux/.config--2012-12-11--07-36-19.bak ': No space left on device * ERROR: Could not backup kernel config (/usr/src/linux/.config) * -- Grepping log... -- * Linux Kernel 3.5.4-hardened-r1 for x86... * kernel: Using config from /usr/share/genkernel/arch/x86/kernel-config * Gentoo Linux Genkernel; Version 3.4.24_p2 * Running with options: all * ERROR: Could not backup kernel config (/usr/src/linux/.config) * -- End log... -- * Please consult /var/log/genkernel.log for more information and any * errors that were reported above. * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * /var/log/genkernel.log so that your issue can be dealt with effectively. * * Please do *not* report compilation failures as genkernel bugs! * (chroot) livecd / #
А какже.... Как мы видим сборка ядра накрылась медным тазом, мол: "No space left on device". Смотрим
(chroot) livecd / # df -h df: cannot read table of mounted file systems: No such file or directory
Ага..., шиш там - запускаем другое SSH окно и смотрим опять:
livecd ~ # df -h Filesystem Size Used Avail Use% Mounted on rootfs 125M 33M 92M 27% / udev 10M 152K 9.9M 2% /dev df: '/mnt/cdrom': No such file or directory /dev/loop0 117M 117M 0 100% /mnt/livecd rc-svcdir 1.0M 80K 944K 8% /mnt/livecd/lib/rc/init.d shm 125M 0 125M 0% /dev/shm tmpfs 125M 13M 113M 10% /mnt/livecd/lib/firmware tmpfs 125M 0 125M 0% /mnt/livecd/usr/portage /dev/sda3 3.7G 2.1G 1.4G 61% /mnt/gentoo /dev/sda1 31M 395K 29M 2% /mnt/gentoo/boot livecd ~ # df -i Filesystem Inodes IUsed IFree IUse% Mounted on rootfs 31795 7411 24384 24% / udev 31062 654 30408 3% /dev df: '/mnt/cdrom': No such file or directory /dev/loop0 24345 24345 0 100% /mnt/livecd rc-svcdir 31795 73 31722 1% /mnt/livecd/lib/rc/init.d shm 31795 1 31794 1% /dev/shm tmpfs 31795 157 31638 1% /mnt/livecd/lib/firmware tmpfs 31795 1 31794 1% /mnt/livecd/usr/portage /dev/sda3 240480 240480 0 100% /mnt/gentoo /dev/sda1 8192 12 8180 1% /mnt/gentoo/boot livecd ~ #
Видим, что этому мать его Gentoo, не хватает инодов (индексных дескрипторов) на основном /dev/sda3 и опять оригинальный мануал, где минимум требовалосьMemory 256 MB - Diskspace 2.5 GB (excluding swap space) - Swap space At least 256 MB, оказался до лампочки - сука;(
БлиаАааатЪ... Теперь нужно поотмонтировать все разделы и пересоздать их со значением [-i bytes-per-inode] в интервале (min 1024/max 67108864). Куда ж смотрели мануалисты писавшие оригинальные иглишЪ надпук!??? БлиаАааатЪ твою Gento за ногу. Пересоздаём файловую систему на /dev/sda3 с максимальным количеством inode (1 kb = 1 inode):
livecd ~ # mkfs.ext3 -i 1024 /dev/sda3 mke2fs 1.41.14 (22-Dec-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 3845856 inodes, 961280 blocks 48064 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=984612864 118 block groups 8192 blocks per group, 8192 fragments per group 32592 inodes per group Superblock backups stored on blocks: 8192, 24576, 40960, 57344, 73728, 204800, 221184, 401408, 663552 Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 27 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. livecd ~ # df -i Filesystem Inodes IUsed IFree IUse% Mounted on rootfs 31795 7410 24385 24% / udev 31062 654 30408 3% /dev df: '/mnt/cdrom': No such file or directory /dev/loop0 24345 24345 0 100% /mnt/livecd rc-svcdir 31795 73 31722 1% /mnt/livecd/lib/rc/init.d shm 31795 1 31794 1% /dev/shm tmpfs 31795 157 31638 1% /mnt/livecd/lib/firmware tmpfs 31795 1 31794 1% /mnt/livecd/usr/portage /dev/sda3 3845856 12 3845844 1% /mnt/gentoo /dev/sda1 8192 11 8181 1% /mnt/gentoo/boot
Ну вот, теперь у нас вместо 240480 инодов стало 3845844, хотя и не факт что их хватит!... Но.., в таком случае под иноды (индексные дескрипторы) будет отведено больше места на жестком диске и вместо 3.7G при обычном форматировании раздела /dev/sda3, на нём /dev/sda3 останется всего лишь 2.8G - т.е. для 3845844 инодов будет отведено почти 1 ГБ!
Повторение мать мучения, повторяем genkernel all и идём спать:)
(chroot) livecd / # genkernel all * Gentoo Linux Genkernel; Version 3.4.24_p2 * Running with options: all * Linux Kernel 3.5.4-hardened-r1 for x86... * kernel: Using config from /usr/share/genkernel/arch/x86/kernel-config * kernel: >> Running mrproper... * >> Running oldconfig... * kernel: >> Cleaning... * >> Compiling 3.5.4-hardened-r1 bzImage... * >> Not installing firmware as its included in the kernel already (CON FIG_FIRMWARE_IN_KERNEL=y)... * >> Compiling 3.5.4-hardened-r1 modules...
Выводы
Выводы, после попытки установить Gentoo на VMware с 256 МБ RAM и 1 CPU, напрашиваются печальные!
- Мануал НЕ полный;
- Минимальные рекомендуемые параметры установки не удовлетворяются реальными требованиями в ходе установки;
- Рекомендованная функция emerge-webrsync установки так званых Portage, устанавливает Portage без профилей /usr/portage/profiles/, без наличия которых дальнейшая установка накрывается медным тазом;
- В стандартной конфигурации файловой системы с требованиями превышающими минимальные возникает нехватка инодов, в связи с чем требуется создание файловой системы с увеличением числа инодов ручной конфигурацией расходуемых байтов на один инод;
- Сборка всей системы включая пакеты из исходных кодов;
- Большие требования к расходу процессорного времени.
В итоге потрачено почти 2-е суток времени, почти 24-е часа процессорного времени, Gentoo Linux выжрало все 4.2 ГБ отведённого под VM образ, на момент прерывания компиляции ядра оставалось только 256 МВ свободного места...
На мой личный взгляд Gentoo Linux - это очередной Ублюдок, незаконно рождённый потомок Linux-а со своим геморроем вместо традиционных, проверенных временем ценностей! Причисленные Gentoo Linux немногие достоинства, которыми являются ручная конфигурация всего, по сути не являются такими уже и достоинствами ибо ручную конфигурацию и перекомпиляцию можно выполнить практически на любом Linux дистрибутиве!
Тем, кто на распутье выбора ОС для виртуального частного сервера хочется дать, как на мой взгляд, профессиональную рекомендацию использовать только самые старые, устоявшиеся и проверенные временем UNIX дистрибутивы, среди которых:
Неплохим кандидатом ещё может быть CentOS, всё же остальное, как ранее упоминалось - это просто ублюдки, незаконно рождённые потомки Linux-а со своими причудами и далеко не лучшего качества, удобства, стабильности, производительности и тех. поддержки.
А если у вас уйма свободного времени и упорства, то можете продолжить компиляцию и установку Gentoo Linux руководствуясь мануалами по ссылкам ниже, там осталось всего-навсего прошкандыбать ещё пару разделов:))