This projects aims to create a unified process to manage the post-installation procedure of any GNU/Linux operating system.

Guillaume Bernard 4bfb343114 chore: fedora 29 is now the default version 1 week ago
extra_scripts 9a9e3d1a8a fix: move extra_scripts to profiles 2 weeks ago
profiles 4bfb343114 chore: fedora 29 is now the default version 1 week ago
LICENSE 9cbee6d7e5 Add license 1 year ago
README.md 4c0bd406b0 fix: update example 2 weeks ago
installer.sh 88692d7ff6 fix: multiple fixes in style 2 weeks ago

README.md

GNU/Linux Operating System post-installation

This project is a command line tool to process the steps that follow a fresh installation of your favorite GNU/Linux OS. It is fully tested on Fedora and CentOS but is excpected to work properly on Debian based distributions as well. It uses the power of libShell to be independant to the running platform. As the current version of this library does not support any other system, it is not expected to run properly on OpenSuse, Mageia and other systems.

Download the latest version available

The program is mainly a shell script with configuration files. If you don’t wish to contribute, it is not necessary to clone the repository using git. You can simply download and extract the archive as follow:

curl https://code.guillaume-bernard.fr/guilieb/gnulinux_os_postinstallation/archive/master.tar.gz | tar xz

You’ll get in your current path a new directory, gnulinux_os_postinstallation, this is the code itself.

Run the script and use an existing profile

Profiles

Behind the procedure is implemented the concept of profiles. A profile is a configuration file stored by default in the ./profilesdirectory. This configuration file is written using the Bash script langage and has the .conf extension. Below is an example:

source ${BASH_SOURCE[0]%/*}/base.conf

typeset -x ENABLED_GROUPS="REPOSITORY BASE INTERNET"

FLATPAK[repos]="https://dl.flathub.org/repo/flathub.flatpakrepo@flathub"

REPOSITORY[pkgs]="epel-release"
BASE[pkgs]="macchanger cryptsetup firewall-config setools-console gnupg2"
INTERNET[pkgs]="firefox"

BASE[flatpak]="org.freefilesync.FreeFileSync@flathub"

In this example, we first load the base.conf file which contains the declaration for standard groups of packages to install. A group of package is a list of system-packages (as used in apt or dnf for instance) and a list of Flatpak bundles. You see that ENABLED_GROUPS is a string that contains the groups to install on the system. Groups are treated in the order they are mentionned: if you want to install repository packages, the REPOSITORY group must be in the top position. If a group is mentionned it must have been declared either in base.conf or in the profile itself, as an associative array, using:

typeset -A INTERNET=()

Then, if you want to declare packages for the system package manager, simply register them under the pkgs key, like in the example.

On the other hand, Flatpak needs its remotes to be installed. Remotes are declare in the FLATPAK group under the repos key. Each remote is declared in one line, separated with a @ . The first part contains the remote file (potentially a URL) and the last part is the name given to the remote on the system. Flatpak packages are registered in groups under the flatpak key. Again, the package name is the first part of the first, then a @ and the remote name.

Run the program

You can specify which profile to use, the profile is the name of the profile file without the .conf ending. If nothing is specified, a profile is choosen by default. Its name will be the concatenation of ID, VERSION and VARIANT_ID from /etc/os-release. Those strings are concatenated without any separator, like "fedora28workstation".

USAGE:
        installer.sh [-h] [--help]

                   [--profile NAME]
                   [--groups "ARRAY OF GROUPS"]

                   [--shellconfig-user LOGIN]

                   [--flatpak-user LOGIN]
                   [--global-flatpak]

        --profile NAME: the profile name to use in order to process the installation. This profile is saved in the ./profiles/ directory and should not contain the ending extension (.conf)

        --groups "ARRAY OF GROUPS": the groups you want to install, from the profile. this is a space separated string containing group names.

        --shellconfig-user LOGIN: user for which shellConfig will be installed. You can add this argument as many times as you think necessary.

        --flatpak-user LOGIN: user for which flatpak packages will be installed.

        --global-flatpak: install flatpak packages for all users.

Full example

The example bellow downloads the software and starts it from the command line.

  • shellConfig will be installed for users gbernard and root.

  • flatpak packages will be installed for all users.

  • groups will be loaded from thecentos7workstation and only BASE MULTIMEDIA OFFICE CODECS will be installed on the system.

curl https://code.guillaume-bernard.fr/guilieb/gnulinux_os_postinstallation/archive/master.tar.gz | tar xvz
su -c "./gnulinux_os_postinstallation/installer.sh --profile centos7workstation \
       --shellconfig-user gbernard --shellconfig-user root \
       --global-flatpak \
       --groups 'BASE MULTMEDIA OFFICE CODECS'"