commit edc4729b55074737a9a9a37a1d09181648c47e75 Author: julien Date: Mon Sep 8 15:26:25 2025 +0200 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..04fdceb --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# Easy Slack ! + +Pour installer facilement une Slackware 15 fonctionnelle, pour une station de travail avec XFCE ou un serveur sans interface graphique. + +## Installation + +### Partitionner le/s disques + +À faire... + +### Installer le système + +Un petit `# setup` pour lancer le script d'installation de Slackware. + +Ensuite suivre les indications à l’exception des deux points suivant : + +1. Au moment de choisir les groupes de paquets à installer, exclure : + +* `E/` et `KDE/` pour une station de travail. +* `E/`, `KDE/`, `T/`, `TCL/`, `X/`, `XAP/`, `XFCE/` et `Y/` pour un serveur sans interface graphique. + +2. Passer l'installation de `lilo` ou `elilo` comme chargeurs d’amorçage. + +> Attention à ne pas redémarrer, le système n'est pas encore bootable ! + +## Configuration + +### Chroot + +Avant de redémarrer entrer dans un shell, puis dans le système fraîchement installé à l'aide de `chroot` : + +``` +# chroot /mnt +``` + +### Script de post-installation + +Télécharger et décompresser le script : + +``` +# cd tmp/ +# wget https://git.netig.net/julien/easy-slack/archive/main.tar.gz +# tar -xvzf main.tar.gz +``` + +Puis l'exécuter : + +``` +# cd easy-slack/ +# ./post-install.sh +``` + +La machine redémarrera automatiquement une fois le script terminé. + +## Utilisation + +### Mise à jour + +Pour mettre à jour le système avec `slackpkg` : + +``` +# slackpkg update +# slackpkg upgrade-all +``` + +Soyez vigilant aux paquets mis à jour avant de lancer la mise à jour, si le noyau en fait partie, il faudra avant de redémarrer la machine exécuter les deux commandes suivantes : + +1. Régénérer les modules de noyau `generic`. + +``` +# /usr/share/mkinitrd/mkinitrd_command_generator.sh -r | bash +``` + +2. Ainsi que les entrées du menu de démarrage de `grub`. + +``` +# grub-mkconfig -o /boot/grub/grub.cfg +``` + +### SlackBuilds.org + +Vous souhaiteriez des logiciels supplémentaires ? + +Faites un petit tour sur [SlackBuilds.org](https://slackbuilds.org/) vous y trouverez une collection de scripts de construction de paquets maintenue par la communauté. + +Pour les installer facilement nous utiliserons `sbotools` (déjà installé si vous avez utilisé le script `post-install.sh`), une collection de scripts Perl pour utiliser [SlackBuilds.org](https://slackbuilds.org/) à la manière d'un système de ports BSD. + +... diff --git a/etc/skel/.bash_profile b/etc/skel/.bash_profile new file mode 100644 index 0000000..837c53c --- /dev/null +++ b/etc/skel/.bash_profile @@ -0,0 +1,4 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + diff --git a/etc/skel/.bashrc b/etc/skel/.bashrc new file mode 100644 index 0000000..daf8ea5 --- /dev/null +++ b/etc/skel/.bashrc @@ -0,0 +1,29 @@ +PROMPT_COMMAND=__prompt_command + +__prompt_command() { + # Store current exit code + local EXIT="$?" + + # Define some colors + local RESET='\[\e[0m\]' + local RED='\[\e[0;31m\]' + local GREEN='\[\e[0;32m\]' + local BOLD_GRAY='\[\e[1;30m\]' + + # Start with an empty PS1 + PS1="" + + if [[ $EXIT -eq 0 ]]; then + # Add green if exit code 0 + PS1+="${GREEN}0${RESET} " + else + # Add red if exit code non 0 + PS1+="${RED}${EXIT}${RESET} " + fi + # These are the default prompts for root and user + if [ $(id -u) -eq 0 ]; then + PS1+="\u@\h:\w ($(ls | wc -l)) ${RESET}# " + else + PS1+="\u@\h:\w ($(ls | wc -l)) ${RESET}$ " + fi +} \ No newline at end of file diff --git a/post-install.sh b/post-install.sh new file mode 100755 index 0000000..2e60e16 --- /dev/null +++ b/post-install.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +# +# To be executed before rebooting within a chroot. +# + +# Desktop or server ? +echo +echo "Type desktop or server depending on what you want to do." +read -p "> " desktop_or_server + +# BIOS or UEFI ? +echo +echo "Type bios or uefi depending on the machine you have." +read -p "> " bios_or_uefi + +################################################################################ +### Bootloader + +# BIOS +if [[ $bios_or_uefi = bios ]]; then + echo "Enter the disk id where you want the bootloader to be installed. (eg. sda)" + read -p "> " grub_disk + grub-install --modules=part_gpt /dev/$grub_disk +fi + +# UEFI +if [[ $bios_or_uefi = uefi ]]; then + grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi +fi + +# Generate grub menu +grub-mkconfig -o /boot/grub/grub.cfg + +################################################################################ +### Configuration + +# Set localization +echo +echo "Enter your UTF-8 locale or let empty for keeping default one. (eg. fr_FR)" +read -p "> " utf8_locale +if [[ -n $utf8_locale ]]; then + sed -i 's/export LANG=en_US.UTF-8/export LANG='$utf8_locale'.UTF-8/g' /etc/profile.d/lang.sh +fi + +# Slackpkg mirror +sed -i '/# https:\/\/mirrors.slackware.com\/slackware\/slackware64-15.0\//s/^# //g' /etc/slackpkg/mirrors +slackpkg update gpg + +# Slackpkg blacklist +sed -i '/#\[0-9\]+_SBo/s/^#//g' /etc/slackpkg/blacklist +echo "e/" >> /etc/slackpkg/blacklist + +# Install Sbotools +cd /tmp +wget https://slackbuilds.org/slackbuilds/15.0/system/sbotools.tar.gz +tar -xvzf sbotools.tar.gz +cd sbotools +wget https://pghvlaans.github.io/sbotools/downloads/sbotools-3.8.1.tar.gz +./sbotools.SlackBuild +cd + +# Use generic kernel +/usr/share/mkinitrd/mkinitrd_command_generator.sh -r | bash +grub-mkconfig -o /boot/grub/grub.cfg + +# Copy bash config +cp etc/skel/.bash_profile /root +cp etc/skel/.bashrc /root +cp etc/skel/.bash_profile /etc/skel +cp etc/skel/.bashrc /etc/skel + +################################################################################ +### Usage specific configuration + +# Desktop configuration +if [[ $desktop_or_server = desktop ]]; then + # Blacklist irrelevant groups + echo "kde/" >> /etc/slackpkg/blacklist + # X11 keymap + if [[ -n $utf8_locale ]]; then + echo + echo "Enter your keymap. (eg. fr-latin9)" + read -p "> " keymap + cp /usr/share/X11/xorg.conf.d/90-keyboard-layout-evdev.conf /etc/X11/xorg.conf.d/ + sed -i '0,/Option "XkbLayout" "us"/s//Option "XkbLayout" "'$keymap'"/' /etc/X11/xorg.conf.d/90-keyboard-layout-evdev.conf + fi + # Runlevel + sed -i 's/id:3:initdefault:/id:4:initdefault:/g' /etc/inittab + # Copy Slackware icon + cp usr/share/icons/Slackware.svg /usr/share/icons/ + # Copy XFCE config + cp -r etc/skel/.config /etc/skel +fi + +# Server configuration +if [[ $desktop_or_server = server ]]; then + # Blacklist irrelevant groups + echo -e "kde/\nx/\nxap\nxfce/\ny/" >> /etc/slackpkg/blacklist +fi + +################################################################################ +### User + +# Add the first user +adduser + +################################################################################ +### End + +# Exit from chroot +exit + +# End message +echo +echo ">>> Done !" +sleep 10 + +# Reboot +reboot diff --git a/sbopkg/SHA256SUM b/sbopkg/SHA256SUM new file mode 100644 index 0000000..4223ee0 --- /dev/null +++ b/sbopkg/SHA256SUM @@ -0,0 +1 @@ +c302e306523b234bb025f1a74ee66d3037cfd25f2cc6ffd5f909e4d6278b5db6 sbopkg-0.38.2-noarch-1_wsr.tgz \ No newline at end of file diff --git a/sbopkg/sbopkg-0.38.2-noarch-1_wsr.tgz b/sbopkg/sbopkg-0.38.2-noarch-1_wsr.tgz new file mode 100644 index 0000000..b71cf7a Binary files /dev/null and b/sbopkg/sbopkg-0.38.2-noarch-1_wsr.tgz differ diff --git a/usr/share/icons/Slackware.svg b/usr/share/icons/Slackware.svg new file mode 100644 index 0000000..0323345 --- /dev/null +++ b/usr/share/icons/Slackware.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + +