-
Notifications
You must be signed in to change notification settings - Fork 0
/
gentoo_install
174 lines (107 loc) · 4.04 KB
/
gentoo_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# this is how to install gentoolinux (my first attempt) on qemu
# Soures : https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation
------------------------parted----------------------------------
parted -a optimal /dev/vdb
mklabel gpt
unit mib
#creating 2MB primary part
mkpart primary 1 3
name 1 grub
set 1 bios_grub on
# to see changes
print
# creating 128MB boot part
mkpart primary 3 131
name 2 boot
set 2 boot on
# creating 512MB swap part
mkpart primary 131 643
name 3 swap
# creating root partion on the rest space -1MB from the end
mkpart primary 643 -1
name 4 rootfs
---------------------filesystems--------------------------------
mkfs.fat -F 32 /dev/vdb2 # efi boot part
mkfs.ext4 /dev/vdb3 # root part
mkswap /dev/vdb3
swapon /dev/vdb3
---------------------mount root---------------------------------
mount /dev/vdb4 /mnt/gentoo
# verify time so that ssl/tls work during download
date
# if wrong time or date set it ntp server
# this will send public ip to server !!!!
ntpd -q -g
# or manually
date MMDDhhmmYYYY
date 051602162020
--------------------stage download------------------------------
cd /mnt/gentoo
links https://www.gentoo.org/downloads/mirrors/
# then select a mirror "Germany" in my case
# let the download finish and extract with
tar xpvg stage*.tar.bz2 --xattrs-include='*.*' --numeric-owner
--------------------compile flags-------------------------------
# no need to modify /mnt/gentoo/etc/portage/make.conf
# unless you know what you are doing "compile flags" |
# https://gcc.gnu.org/onlinedocs/ <=
--------------------source mirror-------------------------------
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
#select a mirror to download the source code "Germany"
--------------------?????????????-------------------------------
mkdir --parents /mnt/gentoo/etc/portage/repos.conf/
cd /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
--------------------copy dns------------------------------------
cp -L /etc/resolv.cong /mnt/gentoo/etc/resolv.conf
--------------------chrooting-----------------------------------
# '/proc/, /sys/, /dev/' need to be mounted
# to the repective folders in the '/mnt/gentoo' folder wich is
# going to be the now root '/'
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
# '--rbind' or '-R' for mounting in two places simultaneously
# '--make-rslave' is for systemd support
# change the root to /mnt/gentoo
chroot /mnt/gentoo /bin/bash
# load shell config to memory
source /etc/profile
#change prompt to know that you are in chroot
export PS1="(chroot) ${PS1}"
-------------------mounting boot--------------------------------
mount /dev/vdb2 /boot/
-------------------portage config-------------------------------
# to sync portage repos :
# if behind a firewall use :
emerge-webrsync # this uses 'http/ftp'
# if not use :
emerge --sync
# selecting a profile :
eselect profile list
#choos the same profile as the stage*.tar.bz2 package :
eselect profile set [number]
# updating '@world set'
emerge --ask --update --verbose --deep --newuse @world
-------------------gentoo licenses------------------------------
# by default gentoo accepts only @FREE licenses, see :
portageq envvar ACCEPT_LICENSE
# there are many licenses see the gentoo wiki
--------------------timezones-----------------------------------
# choose a time zone from :
ls /usr/share/zoneinfo
echo "time/zone" > /etc/timezone
emerge --config sys-libs/timezone-data
------------------------locales---------------------------------
# choose a locale from :
nano /usr/share/i18n/SUPPORTED
echo "en_US.UTF-8 UTF-8" > /etc/local.gen
locale-gen
# now setting a system wide locale :
# choose from :
eselect locale list
eselect locale set [num] # this will set /etc/env.d/02locale
# to LANG="en_US.UTF-8 UTF-8"
env-update && source /etc/profile && export PS1="(chroot) ${PS1}"
------------------------kernel-----------------------------------