-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_install.sh
122 lines (97 loc) · 4.82 KB
/
new_install.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
#################################
# Purpose of this Script:
# This will get a basic install of Arch Linux up with Cinnamor desktop, Bluetooth, Zsh, KVM, and sane defaults .
##### Installation prior to chroot'ing #####
##### LVM
sudo pacman -Syu lvm2
### Optimize LVM for SSD
# Edit /etc/lvm/lvm.conf to enable TRIM on LVM:
sudo sed -i 's/issue_discards = 0/issue_discards = 1/' /etc/lvm/lvm.conf
#####
## This might be needed instead of the following method.
# https://stackoverflow.com/questions/8157931/bash-executing-commands-from-within-a-chroot-and-switch-user
#chroot /chroot_dir /bin/bash -c "su - -c ./startup.sh"
##### Set up commands to run in chroot environment #####
# https://stackoverflow.com/questions/8157931/bash-executing-commands-from-within-a-chroot-and-switch-user
# https://bbs.archlinux.org/viewtopic.php?id=154755
cat << EOF | arch-chroot /mnt
sudo pacman -Syu chromium wget -y
# Chromium
# https://wiki.archlinux.org/index.php/chromium
# https://aur.archlinux.org/packages/chromium-widevine/
sudo pacman -Syu chromium wget -y
wget https://aur.archlinux.org/cgit/aur.git/snapshot/chromium-widevine.tar.gz
tar -xvf chromium-widevine.tar.gz
cd chromium-widevine
makepkg -sri PKGBUILD
##### Fix for Nemo's "Open Terminal Here" and Guake #####
# https://medium.com/cognitio/open-guake-terminal-here-nemo-plugin-cd8e1af9ec0a
# https://github.com/slgobinath/ubuntu-tweaks/blob/master/open-terminal-here/open-terminal-here.py
# https://github.com/Guake/guake/issues/424
# https://forums.linuxmint.com/viewtopic.php?t=240669
# https://github.com/linuxmint/nemo-extensions/blob/master/nemo-python/README
sudo mkdir /usr/share/nemo-python
sudo mkdir /usr/share/nemo-python/extensions
sudo wget https://raw.githubusercontent.com/slgobinath/ubuntu-tweaks/master/open-terminal-here/open-terminal-here.py --output-document /usr/share/nemo-python/extensions/open-terminal-here.py
nemo -q
##### SublimeText3 - Standard #####
# https://www.sublimetext.com/docs/3/linux_repositories.html#pacman
# Install the GPG key:
curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
sudo pacman -Syu sublime-text
##### Font - Iosevka #####
# Will need to set this as system default font . . . Somehow.
# https://github.com/be5invis/Iosevka
# https://aur.archlinux.org/packages/ttf-iosevka
cd /home/$USERNAME/
mkdir new_install
cd new_install
wget https://aur.archlinux.org/cgit/aur.git/snapshot/ttf-iosevka.tar.gz
unzip ttf-iosevka.tar.gz
tar -xvf ttf-iosevka.tar
cd ttf-iosevka
sudo makepkg -si PKGBUILD
##### Bluetooth #####
# https://github.com/blueman-project/blueman/issues/547
# https://wiki.archlinux.org/index.php/Bluetooth_headset
# https://wiki.archlinux.org/index.php/bluetooth
sudo pacman -Syul pulseaudio pulseaudio-bluetooth pulseaudio-alsa bluez bluez-libs bluez-utils bluez-firmware pavucontrol blueman
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
##### Scanning
sudo pacman -Syu sane
# Install driver for ADS-2000
wget https://aur.archlinux.org/cgit/aur.git/snapshot/brscan4.tar.gz
gunzip brscan4.tar.gz
tar -xvf brscan4.tar
cd brscan4
makepkg -si PKGBUILD
# Permission problem for the scanner. Needs sudo to run. The below fixes that.
sudo echo 'ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="60a0", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"' /usr/lib/udev/rules.d/49-sane-missing-scanner.rules
# Unplug and plug scanner back in.
##### KVM
# Nested Virtualization
sudo touch /etc/modprobe.d/kvm_intel.conf
sudo echo "options kvm_intel nested=1" >> /etc/modprobe.d/kvm_intel.conf
###
## Enable the "host passthrough" mode to forward all CPU features to the guest system:
# - If using QEMU, run the guest virtual machine with the following command: qemu-system-x86_64 -enable-kvm -cpu host.
# - If using virt-manager, change the CPU model to host-passthrough (it will not be in the list, just write it in the box).
# - If using virsh, use virsh edit vm-name and change the CPU line to <cpu mode='host-passthrough' check='partial'/>
### Install QEMU core and libvirt abstraction CLI.
sudo pacman -Syu qemu libvirt -y
## Install tools to manage basic networking for VMs.
sudo pacman -Syu ebtables dnsmasq bridge-utils openbsd-netcat -y
## Install libvirt GUI management.
sudo pacman -Syu q virt-manager -y
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
## libvirt/kvm has issues with internal networking of IPv6.
sudo touch /etc/modprobe.d/blacklist-ipv6.conf
sudo echo "install ipv6 /bin/true" >> /etc/modprobe.d/blacklist-ipv6.conf
sudo echo "blacklist ipv6" >> /etc/modprobe.d/blacklist-ipv6.conf
# reboot system
# See what is accessing a certain device:
sudo fuser -m -v /dev/sda5
EOF