Gentoo Install

———————————————–
Gentoo install walk through – Special request start date 9/14/14
Completed the install on 9/17/14 no Windows Manager or Desktop Envionment
___________________________________________
I will be following the handbook step by step and post my results. The goal will be to have a working and bootable Gentoo install.

VM: Hyper -v

Commands I used serveral times to get the system going

mount /dev/sda4 /mnt/gentoo
mount /dev/sda2 /mnt/gentoo/boot

mount -t proc proc /mnt/gentoo/proc
mount –rbind /sys /mnt/gentoo/sys
mount –rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1=”(chroot) $PS1″
1) run the live cd and verify the network is setup
2) partition the drive for the install
Find the hard drive device name
fdisk -l

Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x70d348b4

3) Partition the device using fdisk /dev/sda
Need the following setup at a minium
Bios Partition > 2M > Type EFI Hex code ef
Boot Partition > 128M > Type Linux Hex code 83
Swap Partition > 512M > Type Swap Hex code 82
Root Partition > Remaining partition or can be extended > Type Linux or extended Hex code 83

/dev/sda1 2048 6143 2048 ef EFI (FAT-12/16/32)
/dev/sda2 * 6144 268287 131072 83 Linux
/dev/sda3 268288 1316863 524288 82 Linux swap / Solaris
/dev/sda4 1316864 41943039 20313088 83 Linux

4) FileSystem creation
Since sda1 is the bios partition , you do not need to setup a filesystem on this partition
sda2 should be ext2
sda4 can be ext4 or what ever you prefer

Initital Errors Encountered. This was due to my own error I initiall made sda2 an extended partition and tried to create a filesystem on it.
mkfs.ext4 /dev/sda2
mke2fs 1.42.10 (18-May-2014)
Found a dos partition table in /dev/sda2
Proceed anyway? (y,n) y
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).

5) Compiling the kernel
Error encountered
make[1]: Nothing to be done for `relocs’.
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
kernel/bounds.c:1:0: error: CPU you selected does not support x86-64 instruction set
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

Fix: uncheck 64bit section since this application was i686 , you can not compil;e a 64bit kernel on a 32bit system.
(7.b of the handbook)
make menuconfig – select your kernel options and save the config file .config
make && make modules_install
make install to install the kernel to the boot partition
5a) Unable to boot into the new system kernel . System was stuck on loading
I found that you will need to remove the config and system images from the boot partition ..(maybe this is a bug I am not sure at the moment) After removing those files the system booted

6) Unable to access the network and driver not compiled .
This was tricky. I needed to find out which linux driver will work for my network card which is realtek.
I used the dmesg command to find which ethernet device was detected by linux
dmesg | grep eth0
0.480060] net eth0: Digital DS21140 Tulip rev 32 at Port 0xec00, 00:15:5d:18:65:06, IRQ 9

This command works on debian
lspci | grep Ethernet
Then recompile the kernel to load the driver . The driver type was found under
> Device Drivers > Network device support > Ethernet driver support > DECchip Tulip (dc2114x) PCI support

After rebooting , I needed to find the name that was assigned to the device
ifconfig -a
enp0s10f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

Then redo the init.d syslink
unlink /etc/init.d/net.eth0
cd /etc/init.d/
ln -s net.lo net.enp0s10f0
Then start the device /etc/init.d/net.enp0s10f0 start

verified pings are working and I can access websites.

7) This purpose of this was to compile and install Gentoo . I may expand this further to include the Windows Manager or Desktop Environment

Additional Resources
https://www.gentoo.org/doc/en/handbook/
http://forums.gentoo.org/viewtopic-t-999222.html?sid=aa1c482f7662347c0377cfc07daafff9
http://wiki.gentoo.org/wiki/Kernel/Upgrade
https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7
http://wiki.gentoo.org/wiki/Safe_CFLAGS#x86.2Famd64
http://wiki.gentoo.org/wiki/Kernel/Upgrade

Updating Gentoo

http://wiki.gentoo.org/wiki/Gentoo_Cheat_Sheet

gentoo_installed-Mas

Computer , server issues and solutions