linuxinstall/install.sh

144 lines
4.9 KiB
Bash
Raw Normal View History

#!/bin/bash
PACKAGES=(
2024-09-04 22:29:03 +02:00
"linux-lts" "linux-firmware" "base" "base-devel" "grub" "vi" "emacs" "vim" "nano"
2024-05-21 11:01:08 +02:00
"micro" "neovim" "bash-completion" "btop" "gdu" "git" "curl" "wget" "rsync"
"unzip" "zip" "gdb" "jdk-openjdk" "openjdk-doc" "tcpdump" "openssh" "bind" "inetutils"
"nmap" "firefox" "firefox-i18n-fr" "libreoffice" "libreoffice-fr" "rpcbind" "nfs-utils"
"xfce4" "xfce4-goodies" "yakuake" "gimp" "xorg" "xf86-video-vesa" "xf86-video-dummy"
"ttf-dejavu" "ttf-liberation" "ttf-bitstream-vera" "acpid" "sdl12-compat" "sdl_ttf"
"sdl_gfx" "sdl_image" "sdl_mixer" "sdl_net" "sdl_sound" "sdl2_gfx" "sdl2_image"
2024-09-04 22:29:03 +02:00
"sdl2_mixer" "sdl2_net" "sdl2_ttf" "dosfstools" "ntfs-3g" "subversion" "cvs" "cifs-utils"
"breezy" "python" "wireshark-qt" "wireshark-cli" "evince" "dbus" "mlocate" "gvfs"
"strace" "net-tools" "postfix" "sudo" "gtksourceview3" "mplayer" "cronie" "optipng"
"lib32-glibc" "libvirt" "qt5" "xterm" "graphviz" "vlc" "pulseaudio" "pulseaudio-alsa"
2024-09-04 22:29:03 +02:00
"tmux" "sleuthkit" "tk" "tcl" "junit" "lightdm" "samba" "bind" "krb5" "tree" "pam_mount"
"time" "noto-fonts" "noto-fonts-cjk" "noto-fonts-emoji" "noto-fonts-extra" "numlockx"
2024-04-30 00:49:09 +02:00
"lightdm-gtk-greeter" "tigervnc" "xfce4-pulseaudio-plugin" "docker" "docker-compose"
2024-04-30 18:18:23 +02:00
"android-tools" "opam" "jdk17-openjdk" "vde2" "shellcheck" "man-db" "man-pages"
2024-09-04 22:29:03 +02:00
"man-pages-fr" "duf" "eza" "bat" "clang" "socat" "iputils" "termshark" "cups" "cups-pdf"
2024-09-11 16:19:00 +02:00
"bluefish"
2024-04-30 00:49:09 +02:00
)
PACKAGES_AUR=(
2024-09-11 16:33:08 +02:00
"saxon6" "staruml" "xfce4-pulseaudio-plugin" "pa-applet-git" "sublime-text"
2024-04-30 00:49:09 +02:00
"android-studio" "android-sdk" "android-sdk-platform-tools" "android-sdk-build-tools"
"android-platform" "android-platform-21" "oracle-instantclient-basic"
2024-09-11 16:33:08 +02:00
"oracle-instantclient-jdbc" "oracle-instantclient-odbc"
2024-04-30 00:49:09 +02:00
"oracle-instantclient-sdk" "oracle-instantclient-sqlplus" "oracle-instantclient-tools"
2024-04-30 18:18:23 +02:00
"ncurses5-compat-libs" "visual-studio-code-bin" "google-chrome" "brave-bin"
)
2024-04-30 01:47:47 +02:00
SERVICES=(
"systemd-networkd.service" "systemd-resolved.service" "systemd-timesyncd.service"
2024-09-04 22:29:03 +02:00
"docker.service" "ovs-vswitchd.service" "cups.service" "smb" "nmb" "winbind"
2024-04-30 01:47:47 +02:00
)
# Enable time synchronization
timedatectl set-ntp true
2024-09-04 22:29:03 +02:00
# Increase parallel downloads in pacman
sed -i "s/#ParallelDownloads = 5/ParallelDownloads = 16/" /etc/pacman.conf
# Update the keyring
pacman -Sy --noconfirm archlinux-keyring
2024-09-03 16:34:46 +02:00
pacman -S "${PACKAGES[@]}"
# Set the timezone
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
# Set the hardware clock time standard
hwclock --systohc
# Generate the locales
sed -i "s/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/" /etc/locale.gen
sed -i "s/#fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/" /etc/locale.gen
locale-gen
# Set the default locale
echo "LANG=en_US.UTF-8" > /etc/locale.conf
# Set the keyboard layout
echo "KEYMAP=fr-latin1" > /etc/vconsole.conf
2024-09-04 22:29:03 +02:00
echo "template" > /etc/hostname
mkdir /mnt/hd
echo "
iluvatar.iut-fbleau.fr:/export /export nfs rw,hard,intr,nodev,nosuid,proto=tcp,retrans=2 0 0
/dev/loop0 /mnt/hd ext3 user,noauto,loop 0 0
/tmp/image.ext3 /mnt/hd ext3 user,noauto,loop 0 0
" >> /etc/fstab
# Droits sur tcpdump
chmod 4755 /usr/sbin/tcpdump
# Droits d'accès à kpageflags et startx
chmod 444 /proc/kpageflags
chmod 700 /usr/bin/startx
2024-09-04 22:29:03 +02:00
#on suid dumpcap pour wireshark
chmod 4755 /usr/bin/dumpcap
chmod 700 /usr/bin/wall
2024-05-21 10:41:53 +02:00
# Disable multicast DNS and LLMNR
sed -i 's/#LLMNR=no/LLMNR=no/g' /etc/systemd/resolved.conf
sed -i 's/#MulticastDNS=no/MulticastDNS=no/g' /etc/systemd/resolved.conf
# Configure the network for DHCP
echo "[Match]
Name=en*
[Network]
DHCP=yes
" > /etc/systemd/network/20-wired.network
2024-04-30 01:48:29 +02:00
# Enable case-insensitive completion
echo 'set completion-ignore-case On' >> /etc/inputrc
2024-09-04 22:29:03 +02:00
# Create local users
useradd -d /home/user1 -g users -m -s /bin/bash -c "Utilisateur local" user1
echo "user1:user1" | chpasswd
2024-04-30 01:47:47 +02:00
2024-09-04 22:29:03 +02:00
useradd -d /home/util -g users -m -s /bin/bash -c "Utilisateur local 2" util
echo "mot de passe de util"
passwd util
2024-04-30 01:49:05 +02:00
2024-04-30 01:49:55 +02:00
# Installation de la librairie graphique de Denis
cd /tmp
wget -O bibliotheque-graphique-iut.tar.gz https://grond.iut-fbleau.fr/IUT/bibliotheque-graphique/archive/main.tar.gz
tar xzvf bibliotheque-graphique-iut.tar.gz
2024-04-30 01:49:55 +02:00
cd bibliotheque-graphique
./configure
make
make install
2024-09-04 22:29:03 +02:00
su - util <<'EOF'
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg --syncdeps --install --needed --noconfirm
yay -Syu --noconfirm "${PACKAGES_AUR[@]}"
EOF
# Fix Oracle SQL Developer
sed -i '/^#!\/bin\/bash/a export JAVA_HOME=\/usr\/lib\/jvm\/java-17-openjdk\nexport LD_LIBRARY_PATH=\/usr\/lib\/jvm\/java-17-openjdk\/lib\/server:\/usr\/lib\/jvm\/java-17-openjdk\/lib' /usr/bin/oracle-sqldeveloper
2024-09-04 22:29:03 +02:00
# Android Studio config
chmod 1755 /opt/android-sdk/platform-tools/adb
chmod 1755 /opt/android-sdk/tools/emulator
# Patch Imunes
sed -i '/readConfigFile/s/^/#/' /usr/lib/imunes/imunes.tcl
# Enable the services
2024-04-30 01:47:47 +02:00
systemctl enable "${SERVICES[@]}"
2024-09-04 22:29:03 +02:00
cp -R configfiles/* /
2024-05-21 11:04:29 +02:00
# DNS configuration
2024-09-05 14:51:07 +02:00
ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf