-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-gnome.sh
234 lines (193 loc) · 8.55 KB
/
init-gnome.sh
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#!/usr/bin/env bash
# installing according to handbook up until "Installing stage3"
# Starts to differ at "Installing base system" at eselect profile
fetch_stage3() {
cd /mnt/gentoo
echo "Fetch stage3"
echo "links http://ftp.fi.muni.cz/pub/linux/gentoo/releases/amd64/autobuilds/current-stage3-amd64"
echo "wget http://ftp.fi.muni.cz/pub/linux/gentoo/releases/amd64/autobuilds/current-stage3-amd64/stage3-amd64-20150730.tar.bz2"
tar xvjpf stage3-*.tar.bz2 --xattrs
#TODO wget lepší make conf.
# nastav makeopts jako pocet jader+1
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t 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
#entering chroot
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
echo "MAKEOPTS=\"-j"$((`nproc` + 1))\" >> /etc/portage/make.conf # PRESUNUTO DO CHROOTU
emerge-webrsync
eselect profile list # default/linux/amd64/13.0/desktop/gnome/systemd
mkdir -p /etc/portage/{package.mask,package.unmask,sets,repos.conf,package.accept_keywords,package.use,env,package}
emerge app-portage/cpuinfo2cpuflags
cpuinfo2cpuflags-x86 >> /etc/portage/make.conf # test if admin stage got it
cd /etc/portage/sets/
wget https://raw.githubusercontent.com/killua-eu/Mage/master/sets/{portage,boot,kernel,tools} #core nedavam
echo 'INPUT_DEVICES="evdev libinput synaptics tslib wacom"' >> /etc/portage/make.conf
echo 'VIDEO_CARDS="intel modsetting v4l vesa"' >> /etc/portage/make.conf
flaggie systemd
flaggie openssl -bindist
flaggie openssh -bindist
https://raw.githubusercontent.com/killua-eu/Mage/master/sets/{unarchivers,czech,gnome-desktop}
emerge -uDNa @boot @czech @gnome-desktop @kernel @portage @tools
systemctl enable gdm.service
systemctl enable NetworkManager
echo 'VIDEO_CARDS="intel"' >> /etc/portage/make.conf
ln -sf /proc/self/mounts /etc/mtab
cd /usr/src/linux
make nconfig
make && make modules_install
make install
mkdir -p /boot/efi/boot
cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi
nano /etc/fstab
passwd
echo 'GRUB_CMDLINE_LINUX="rootfstype=ext4 real_init=/usr/lib/systemd/systemd"' >> /etc/default/grub
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg
useradd -m -G users,wheel,video,plugdev,portage,games,usb,lp,lpadmin -s /bin/bash <user> # not audio due to pulseaudio
passwd <user>
echo 'LINGUAS="en cs"' >> /etc/portage/make.conf
echo 'ACCEPT_LICENSE="*"' >> /etc/portage/make.conf
echo "en_US ISO-8859-1
en_US.UTF-8 UTF-8
cs_CZ.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
localectl set-locale LANG=en_US.utf8
timedatectl set-timezone Europe/Prague
flaggie media-sound/pulseaudio +equalizer
echo "options snd-hda-intel model=dell-m4-1" >> /etc/modprobe.d/alsa.conf # DELL
# dell - kernel audio stuff modularized
# todo
* For passwordless login to unlock your keyring, you need to set an empty password on your keyring.
* eselect gnome-shell-extensions
* be in the 'games' group.
* Just run 'gpasswd -a <USER> games', then have <USER> re-login.
* To get previous working directory inherited in new opened tab you
* will need to add the following line to your ~/.bashrc:
* . /etc/profile.d/vte.sh
* . /usr/libexec/mc/mc.sh
*
* Messages for package sys-boot/grub-2.02_beta2-r7:
* The grub directory has changed from /boot/grub2 to /boot/grub.
* Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg.
* For information on how to configure GRUB2 please refer to the guide:
* http://wiki.gentoo.org/wiki/GRUB2_Quick_Start
*
* You may consider installing the following optional packages:
* dev-libs/libisoburn for Create rescue media (grub-mkrescue)
* sys-fs/mdadm for Enable RAID device detection
**add yourself to plugdev
#
ls /usr/share/zoneinfo
echo "Europe/Prague" > /etc/timezone
emerge --config sys-libs/timezone-data
echo "en_US ISO-8859-1
en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
eselect locale list # select en_US.utf8
# download sets
emerge @portage
flaggie dracut +amd64
cpuinfo2cpuflags-x86 >> /etc/portage/make.conf # test if admin stage got it
eix-update
eix-sync
emerge -uDN @kernel @boot @core @tools
cd /usr/src/linux
make nconfig
make && make modules_install
make install # copy stuff to /boot
mkdir -p /var/mage/repos
ln -s /usr/portage /var/mage/repos/gentoo
ln -s /usr/local/portage /var/mage/repos/local
ln -s /var/lib/layman /var/mage/repos/layman
ln -s /usr/lib/portage /var/mage/repos/layman
{gentoo,distfiles,local,layman}
mkdir -p /tmp/portage
mv /usr/portage/* /var/portage/gentoo/
mkdir -p /boot/efi/boot
cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi
dracut --hostonly
grub2-install /dev/sda
grub2-install /dev/sdb
grub2-mkconfig -o /boot/grub/grub.cfg
# errors
# /run/lvm/lvmetad.socket: connect failed: No such file or directory
# WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
# No volume groups found
# can be ignored
echo "
# <fs> <mountpoint> <type> <opts> <dump/pass>
LABEL="boot" /boot ext2 noauto,noatime 1 2
LABEL="root" / brtfs defaults,noatime,compress=lzo,autodefrag,subvol=root 0 0
LABEL="root" /home brtfs defaults,noatime,compress=lzo,autodefrag,subvol=home 0 0
LABEL="swap" none swap sw 0 0
" >> /etc/fstab
}
# todo: fstab ma nejaka preddefinovana cosi, co se musi zakomentovat
mdadm --detail --scan >> /etc/mdadm.conf
####
nano -w /etc/conf.d/hostname # nejede augtool ls /etc/conf.d/hostname
nano -w /etc/conf.d/net
useradd -m -G users,wheel,portage -s /bin/bash pavel
passwd
passwd pavel
systemd_shit() {
ln -sf /proc/self/mounts /etc/mtab
emerge --unmerge virtual/libudev sysfs/udev
emerge sys-apps/systemd
echo "GRUB_CMDLINE_LINUX=\"init=/usr/lib/systemd/systemd\"" >> /etc/default/grub
}
#######################################################################
#######################################################################
#######################################################################
mk_btrfs_single_perf {
# set some global to see that mk_partition was run?
# if mk_partition works on /dev/sda, then the parameter should be /dev/sda
mkfs.ext4 /dev/sda2
mkswap /dev/sda3
swapon /dev/sda3
mkfs -t btrfs -L "sysroot" -m single -d single /dev/sda4
# We mount the default volume for the root partition on /mnt/btrfs but will be putting
# the actual contents into subvolumes with different btrfs features enabled or disabled.
mkdir /mnt/btrfs
mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag /dev/sda4 /mnt/btrfs
# The new root filesystem will go onto a subvolume (activeroot) which is created on the
# btrfs disk and then mounted to /mnt/gentoo
mkdir /mnt/gentoo
btrfs subvol create /mnt/btrfs/activeroot
mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag,subvol=activeroot /dev/sda4 /mnt/gentoo
-o noatime,discard,ssd,autodefrag,compress=lzo,space_cache ${1}
mkdir /mnt/gentoo/boot
mount /dev/sda2 /mnt/gentoo/boot
#Note
#If /tmp/ needs to reside on a separate partition, be sure to change its permissions after mounting:
root #chmod 1777 /mnt/gentoo/tmp
btrfs subvol create /mnt/btrfs/home
mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag,subvol=home /dev/sda4 /mnt/gentoo/home
btrfs subvol create /mnt/btrfs/distfiles
btrfs subvol create /mnt/btrfs/vm
btrfs subvol create /mnt/btrfs/vmcrypt
btrfs subvol create /mnt/btrfs/tmp
btrfs subvol create /mnt/btrfs/mysql
PORTAGE_TMPDIR=/var/tmp # memory mapped
PORTDIR=/usr/portage -> PORTDIR=/var/gentoo/portage
DISTDIR=/usr/portage/distfiles -> /var/gentoo/distfiles
PKGDIR=/usr/portage/packages -> /var/gentoo/packages
PORTDIR_OVERLAY=/usr/local/portage -> PORTDIR_OVERLAY=/var/gentoo/local
PORTDIR_OVERLAY=/usr/local/portage -> PORTDIR_OVERLAY=/var/gentoo/local
/var/lib/layman -> /var/gentoo/layman
root #btrfs subvol create /mnt/newmirror/distfiles
root #mount -t btrfs -o defaults,noatime,autodefrag,subvol=distfiles /dev/sdc3 /mnt/newroot/distfiles
root #btrfs subvol create /mnt/newmirror/vm
root #mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag,subvol=vm /dev/sdc3 /mnt/newroot/vm
root #btrfs subvol create /mnt/newmirror/vmcrypt
root #mount -t btrfs -o defaults,noatime,autodefrag,subvol=vmcrypt /dev/sdc3 /mnt/newroot/vmcrypt
}
* Messages for package mail-mta/nullmailer-1.13-r5:
* To create an initial setup, please do:
* emerge --config =mail-mta/nullmailer-1.13-r5