-
Notifications
You must be signed in to change notification settings - Fork 0
/
arch-7567-bumblebee.txt
349 lines (214 loc) · 8.47 KB
/
arch-7567-bumblebee.txt
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# Dell-Inspiron-7567-Arch-Install---UEFI
#Install Arch Linux with encrypted FS and UEFI
# Download the ISO
$ wget -c http://br.mirror.archlinux-br.org/iso/2018.08.01/archlinux-2018.08.01-x86_64.iso && wget -c http://br.mirror.archlinux-br.org/iso/2018.08.01/sha1sums.txt && head -1 sha1sums.txt | sha1sum -c -
# Build a bootable USB
- # dd bs=4M if=archlinux-2018.08.01-x86_64.iso of=/dev/sdX status=progress oflag=sync
# Boot from USB
- Secure Boot must be disabled (BIOS).
# Connect to Internet or local network
- # ip link set enp2s0 up # enp2s0 must be the ETH
- # systemctl start dhcpcd.service
- # ping google.com
- # ip address show enp2s0 | grep inet (You`ll get an IP from the output)
# Set a root password
- # passwd
-- Remote --
# Connect to SSH from a second Machinne
- $ ssh [email protected] # IP from the ip address show output
# Erase the Disk
- Run lsblk to find thr primary disk (replace /dev/sda where needed)
- # shred --verbose --random-source=/dev/urandom --iterations=1 /dev/sda
# Partition the Disk
- # cfdisk /dev/sda
- Partition 1 = 100M - EFI
- Partition 2 = 250M - Linux
- Partition 3 = 100% - Linux
# Create file systems
/dev/sda1
- # mkfs.vfat -F32 /dev/sda1
/dev/sda2
- # mkfs.ext4 /dev/sda2
# Encrypt the system partition
- # cryptsetup --verbose --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 3000 -y --use-random luksFormat /dev/sda3
# Unlock the partition (archlinux will be the device mapper name)
- # cryptsetup open --type luks /dev/sda3 archlinux
# Create the device mapper
- # pvcreate /dev/mapper/archlinux
- # vgcreate vg0 /dev/mapper/archlinux
- # lvcreate --size 8G vg0 --name swap
- # lvcreate -l +100%FREE vg0 --name root
# Create the swap and root FS
- # mkfs.ext4 /dev/mapper/vg0-root
- # mkswap /dev/mapper/vg0-swap
# Mount them
- # mount /dev/mapper/vg0-root /mnt
- # swapon /dev/mapper/vg0-swap
- # mkdir /mnt/boot
- # mount /dev/sda2 /mnt/boot
- # mkdir /mnt/boot/efi
- # mount /dev/sda1 /mnt/boot/efi
# Install the system and some more stuffs
- # pacstrap /mnt base base-devel vim git efibootmgr grub-efi-x86_64 wpa_supplicant dialog
# Generate the fstab
- # genfstab -U -p /mnt >> /mnt/etc/fstab
# chroot to the new system
- # arch-chroot /mnt
# Set en_US locale
- # sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
- # echo LANG=en_US.UTF-8 > /etc/locale.conf
- # export LANG=en_US.UTF-8
# Generate the locale
- # locale-gen
# Set the timezone and clock
- # ln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime #If file exists, do a mv /etc/localtime /etc/localtime.old and rerun
# Set the HW clock to UTC
- # hwclock --systohc --utc
# Set the Hostname
- # echo Dell7K15 > /etc/hostname
# Set the root pass
- # passwd
# Add a system user
- # useradd -m -g users -G wheel,games,power,optical,storage,scanner,lp,audio,video -s /bin/bash d7kuser
# Set the system user password
- # passwd d7kuser
# Add "encrypt lvm2 resume" to mkinitcpio.conf
- # vim /etc/mkinitcpio.conf
- Add encrypt lvm2 resume before filesystems to HOOKS
# Re-generate our initrams image
- # mkinitcpio -p linux
# Setup Grub
- # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux
- Edit the line GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:cryptpart resume=/dev/mapper/vg0-swap rw" in /etc/default/grub
-Uncomment GRUB_ENABLE_CRYPTODISK=y
# Generate the grub.cfg
- grub-mkconfig -o /boot/grub/grub.cfg
# Allow the system user to use sudo
- # EDITOR=nano visudo
- uncomment %wheel line
# Install NetworkManager
- # pacman -S networkmanager network-manager-applet wireless_tools wpa_actiond
- # systemctl enable NetworkManager
# Exit the system
- # exit
# Unmount and reboot (remove the installation media)
- # umount -R /mnt
- # swapoff -a
- # reboot
-- Local --
# System Update
- $ sudo pacman -Syu
# Install SSH
- $ sudo pacman -S openssh
- $ sudo systemctl enable sshd
- $ sudo systemctl start sshd
-- Remote --
# Connect to SSH from a second Machinne
- $ ssh [email protected] # IP from the ip address show output
# Install Bash Completion
- $ sudo pacman -S bash-completion
# Create default dirs
- $ sudo pacman -S xdg-users-dirs
- $ xdg-users-dirs
# Install Net-Tools
- $ sudo pacman -S net-tools
# Install TRIM
- $ sudo pacman -S util-linux
- $ sudo systemctl enable fstrim.service
# NTP
- $ sudo timedatectl set-ntp true
# YAOURT
- $ sudo pacman -S --needed base-devel wget yajl
- $ cd /tmp
- $ git clone https://aur.archlinux.org/package-query.git
- $ cd package-query/
- $ makepkg -si && cd /tmp/
- $ git clone https://aur.archlinux.org/yaourt.git
- $ cd yaourt/
- $ makepkg -si
- $ yaourt -Sy
# Multilib
- $ sudo nano /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist
# Install intel-ucode
- $ sudo pacman -S intel-ucode
- $ sudo grub-mkconfig -o /boot/grub/grub.cfg
# Install fwupd para BIOS updates
- $ sudo pacman -S fwupd
# Install Xorg
- $ sudo pacman -S xorg-server xorg-apps xf86-input-mouse xf86-input-keyboard xterm xf86-input-synaptics xorg-xinit xorg-twm xterm xorg-xclock mesa
# Install Cinammon
- $ sudo pacman -S cinnamon nemo-fileroller cinnamon-translations
# Install GDM
- $ sudo pacman -S gdm
- $ systemctl enable gdm
- $ systemctl start gdm
# Install Nvidia Driver
- $ sudo pacman -S nvidia nvidia-utils nvidia-settings
# Install audio, video and file stuffs
- $ sudo pacman -S pulseaudio pulseaudio-alsa pavucontrol alsa-firmware alsa-utils a52dec faac faad2 flac jasper lame libdca libdv libmad libmpeg2 libtheora libvorbis libxv wavpack x264 xvidcore gstreamer gst-plugins-base gst-plugins-base-libs gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gvfs gvfs-afc gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-smb
# Install Bluetooth
- $ sudo pacman -S bluez blueman bluez-utils
- $ sudo modprobe btusb
- $ sudo systemctl enable bluetooth
- $ sudo systemctl start bluetooth
# Disable System Beep
- # echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
# Install Bumbleblee
- $ yaourt -S bumblebee mesa xf86-video-intel lib32-virtualgl lib32-nvidia-utils
- $ sudo systemctl enable bumbleblee
- $ sudo systemctl start bumblebee
- $ optirun glxspheres64
# Configure the HDMI port to a second monitor
- $ sudo echo "Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "VirtualHeads" "2"
EndSection" > /usr/share/X11/xorg.conf.d/20-intel.conf
- $ sudo mv /etc/bumblebee/xorg.conf.nvidia /etc/bumblebee/xorg.conf.nvidia.bkp
- $ sudo echo "Section "ServerLayout"
Identifier "Layout0"
Option "AutoAddDevices" "true"
Option "AutoAddGPU" "false"
EndSection
Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "ProbeAllGpus" "false"
Option "NoLogo" "true"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Screen"
Identifier "Screen0"
Device "DiscreteNVidia"
EndSection" > /etc/bumblebee/xorg.conf.nvidia
# Manage your displays typing Display from Cinnamon Menu
# Install some more stuffs
- $ sudo pacman -S firefox unzip unrar p7zip mlocate sshfs chromium vlc pidgin deluge smplayer audacious qmmp gimp xfburn thunderbird ttf-dejavu gedit gnome-system-monitor gnome-terminal libreoffice sysstat ibus
- $ yaourt -S sublime-text-dev --noconfirm
- $ yaourt -S skypeforlinux-stable-bin --noconfirm
- $ yaourt -S spotify --noconfirm
- $ yaourt -S mailspring --noconfirm
- $ yaourt -S remmina-git --noconfirm
- $ yaourt -S variety-git --noconfirm
- $ yaourt -S pamac-aur -- noconfirm
# Install network tools
- $ sudo pacman -S net-tools dnsutils nmap
- $ yaourt -S ipscan
# Install warsaw
- $ yaourt -S warsaw-bin
- $ systemctl enable warsaw.service
- $ systemctl start warsaw.service
# Install Wine
- $ yaourt -Sy wine-staging winetricks
- $ yaourt -S lib32-giflib lib32-libldap lib32-gnutls lib32-mpg123 lib32-openal lib32-v4l-utils lib32-libpulse lib32-alsa-plugins lib32-alsa-lib lib32-libxcomposite lib32-libxinerama lib32-opencl-icd-loader lib32-libxslt lib32-libva lib32-gtk3 lib32-gst-plugins-base-libs lib32-vulkan-icd-loader lib32-sdl2 cups samba dosbox
# Install Steam
- $ yaourt -Sy steam steam-native-runtime steam-fonts ttf-liberation
- $ sudo pacman -Syy nvidia nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia # To solve glxChooseVisual Failed
# Configure ~/.bashrc to remove dupe
- $ echo vim ~/.bashrc and paste at the bottom
HISTCONTROL=ignoredups:erasedups
shopt -s histappend
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"