Рубрики
gentoo

(old 2013) Как я ставил gentoo


1. настроил сеть 
ifconfig eth0 inet 192.168.3.13/24
route add default gw 192.168.3.1
echo nameserver 192.168.3.1 > /etc/resolv.conf

(net-setup eth0 можно настроить так)
/etc/init.d/sshd start
passwd root
ssh root@192.168.3.13

2.разбил fdisk /dev/sda
при указание размера можно в конечном цилиндре ставить +500M и размер будет 500 мегабайт
ну или считать цилиндры иногда не удобно считать цилиндры
разбил на 3 раздела 
/dev/sda1  83 boot  (нажал a и выбрал 1)
/dev/sda2  82 swap  (нажал t  и ввел 82)
/dev/sda3  83 /     (дефолт 83)

3. создать файловую систему 
mkfs.ext3 /dev/sda1
mkfs.ext3 /dev/sda3

4.
mkswap /dev/sda2 && swapon /dev/sda2

5. уст дату 
date 022815112012

6.
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
cd /mnt/gentoo

Download a stage3 archive
wget http://distfiles.gentoo.org/releases/x86/current-stage3/stage3-i486-20131029.tar.bz2
time tar xjpfv stage3*

Download the latest Portage snapshot
cd /mnt/gentoo/usr
wget http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2
time tar xjfv portage-lat*

livecd usr # cd /
mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...


7. поставили тайм зону
ls /usr/share/zoneinfo
cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
echo "Europe/Moscow" > /etc/timezone

8.установил время 
date 030600162006 (Format is MMDDhhmmYYYY)

8. именуем  пк
cd /etc
echo "127.0.0.1 manul.felis manul localhost" > hosts
sed -i -e 's/HOSTNAME.*/HOSTNAME="manul"/' conf.d/hostname
hostname manul
hostname -f

9.Kernel Configuration 

###если ядро не будет собираться тут я бы порекомендовал использовать genkernel 
###1) emerge genkernel gentoo-sources
###2) cd /usr/src/linux
###3) genkernel all (либо вот так=) genkernel --splash --no-install --no-clean --menuconfig all)

time emerge gentoo-sources
cd /usr/src/linux
make menuconfig
time make -j2
make modules_install
cp arch/i386/boot/bzImage /boot/kernel



10.fstab
livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/sda1   /boot     ext2    noauto,noatime     1 2
/dev/sda3   /         ext3    noatime            0 1
/dev/sda2   none      swap    sw                 0 0

11.
cd init.d
ln -s net.lo net.eth0
cd ../conf.d
echo 'config_eth0="192.168.1.10 netmask 255.255.255.0 brd 192.168.1.255"' >> net
echo 'routes_eth0="default via 192.168.1.1"' >> net
echo 'hostname="myhostname"' > hostname
rc-update add net.eth0 default
rc-update add sshd default

12.
passwd

13.
/etc/timezone

14.
nano -w /etc/rc.conf
ano -w /etc/conf.d/keymaps

15.
time emerge syslog-ng vixie-cron
rc-update add syslog-ng default
rc-update add vixie-cron default

16.
emerge xfsprogs       (If you use the XFS file system)
emerge jfsutils       (If you use the JFS file system)
emerge reiserfsprogs  (If you use the Reiser file system)
emerge dhcpcd         (If you need a DHCP client)
emerge ppp            (If you need PPPoE ADSL connectivity)

17.
time emerge grub
nano -w /boot/grub/grub.conf

Example grub.conf
default 0
timeout 10

title Gentoo
root (hd0,0)
kernel /boot/kernel root=/dev/sda3

18.
grub
root (hd0,0)
setup (hd0)
quit

19.
Code Listing 2.30: Reboot
exit
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/proc,/boot,}
reboot