]> piware.de Git - bin.git/blob - postinst-setup-fedora
postinst-setup-fedora updates
[bin.git] / postinst-setup-fedora
1 #!/bin/sh
2 set -e
3
4 # remove stuff that we do not need
5 dnf remove -y mdadm mlocate nano rsyslog sssd telnet trousers rxvt-unicode abrt plymouth linux-atm-libs quota realmd selinux-policy || true
6
7 # install stuff that we do want
8 dnf install -y iwl6000g2a-firmware NetworkManager-wifi \
9     sudo ecryptfs-utils vim-enhanced iwl6000g2a-firmware \
10     xorg-x11-server-Xorg xorg-x11-drv-libinput xorg-x11-drv-intel \
11     dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts \
12     xorg-x11-server-utils xorg-x11-utils xbacklight \
13     i3 i3lock lxdm wmctrl dunst pcmanfm gvfs-mtp \
14     pavucontrol pulseaudio-utils alsa-plugins-pulseaudio \
15     gstreamer1-plugin-mpg123 gstreamer1-plugins-good \
16     qemu-kvm qemu-img openvpn mutt weechat pidgin-otr \
17     simple-scan sane-backends sane-backends-drivers-scanners \
18     pandoc texlive-beamer texlive-latex-bin texlive-collection-fontsrecommended \
19     texlive-hyphen-german texlive-hyphen-english texlive-fancyhdr texlive-dinbrief \
20     texlive-german \
21     gnome-terminal firefox network-manager-applet evince shotwell rhythmbox \
22     offlineimap gnome-keyring pinentry-gnome3 \
23     postfix duplicity systemd-container gnome-disk-utility powertop \
24     git gtimelog libappindicator-gtk3 \
25     schroot mock \
26
27 # codecs
28 dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
29 dnf install -y gstreamer1-{libav,plugins-{ugly,bad-free}} --setopt=strict=0
30
31 # restore /etc git branch
32 if [ ! -d /etc/.git ]; then
33     [ -e /backup-etc ] || git clone git+ssh://martin@piware.de/home/martin/backup/`hostname`-etc-fedora/ /backup-etc
34     cp -av /backup-etc/* /etc/
35     cp -av /backup-etc/.git/ /etc/
36     rm -rf /backup-etc
37 fi
38
39
40 # other setup
41 grep -q lib/mock /etc/fstab || cat << EOF >> /etc/fstab
42
43 tmpfs /var/tmp tmpfs defaults 0 0
44 tmpfs /var/lib/mock tmpfs defaults 0 0
45 #/proc /ubuntu/proc none bind 0 0
46 #/sys /ubuntu/sys none bind 0 0
47 #/dev /ubuntu/dev none rbind 0 0
48 #/home /ubuntu/home none rbind 0 0
49 #/srv /ubuntu/srv none bind 0 0
50 #/tmp /ubuntu/tmp none bind 0 0
51 EOF
52
53 # have schroot use tmpfs
54 if [ ! -L /var/lib/schroot/unpack ]; then
55     rmdir /var/lib/schroot/unpack
56     ln -s /tmp /var/lib/schroot/unpack
57 fi
58
59 # root's ssh stuff
60 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
61     mkdir -p /root/.ssh
62     chmod 700 /root/.ssh
63     cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
64 fi
65
66 # disable SELinux to unbreak ecryptfs
67 sed -i '/^SELINUX=/ s/=.*$/=disabled/' /etc/selinux/config
68 setenforce 0 || true
69
70 rm -f /etc/systemd/system/default.target
71 systemctl set-default graphical.target
72
73 systemctl enable --now postfix
74
75 # Red Hat VPN certs and connections
76 rpm -i ~martin/Dokumente/Arbeit/RedHat/redhat-internal*.rpm
77
78 # create user
79 groupadd --gid 1000 martin
80 useradd --comment "Martin Pitt" --uid 1000 --gid 1000 --groups wheel,ecryptfs,mock martin
81 passwd martin
82
83 # crontabs
84 crontab -u martin - <<EOF
85 # m h  dom mon dow   command
86 05 * * * * \$HOME/bin/backup >/dev/null
87 EOF