]> piware.de Git - bin.git/blob - postinst-setup-fedora
Add postinst-setup-fedora
[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     pandoc texlive-beamer texlive-latex-bin texlive-collection-fontsrecommended \
18     texlive-hyphen-german texlive-hyphen-english \
19     gnome-terminal firefox network-manager-applet evince shotwell rhythmbox \
20     offlineimap gnome-keyring pinentry-gnome3 \
21     postfix duplicity systemd-container gnome-disk-utility powertop \
22     git gtimelog libappindicator-gtk3 \
23     schroot mock \
24
25 # TODO: restore /etc git
26
27 # other setup
28 grep -q /ubuntu /etc/fstab || cat << EOF >> /etc/fstab
29
30 tmpfs /var/tmp tmpfs defaults 0 0
31 tmpfs /var/lib/mock tmpfs defaults 0 0
32 /proc /ubuntu/proc none bind 0 0
33 /sys /ubuntu/sys none bind 0 0
34 /dev /ubuntu/dev none rbind 0 0
35 /home /ubuntu/home none rbind 0 0
36 /srv /ubuntu/srv none bind 0 0
37 /tmp /ubuntu/tmp none bind 0 0
38 EOF
39
40 systemctl enable ubuntu-apt-cacher-ng
41
42 # have schroot use tmpfs
43 rmdir /var/lib/schroot/unpack
44 ln -s /tmp /var/lib/schroot/unpack
45
46 # root's ssh stuff
47 if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
48     mkdir -p /root/.ssh
49     chmod 700 /root/.ssh
50     cp /home/martin/.ssh/id_rsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
51 fi
52
53 # disable SELinux to unbreak ecryptfs
54 sed -i '/^SELINUX=/ s/=.*$/=disabled/' /etc/selinux/config
55 setenforce 0 || true
56
57 rm -f /etc/systemd/system/default.target
58 systemctl set-default graphical.target
59
60 systemctl enable --now postfix
61
62 # create user
63 groupadd --gid 1000 martin
64 useradd --comment "Martin Pitt" --uid 1000 --gid 1000 --groups wheel,ecryptfs,mock martin
65 passwd martin
66
67 # crontabs
68 crontab -u martin - <<EOF
69 # m h  dom mon dow   command
70 05 * * * * \$HOME/bin/backup >/dev/null
71 EOF