gentoo_update Introduction

Introduction

gentoo_update (Github repo) is a tool that automatically updates Gentoo Linux.

Motivation

Gentoo Linux gives users maximum flexibility and control over the system. A great example of this is the OS upgrade process. Users have a large selection of different command utilities and a bunch of configuration options to choose from to tailor the upgrade process to their needs. Here is the list of some tools that are commonly used during an upgrade:

[
    eix, equery, emaint, euse, etc-update, dispatch-conf,  
    eselect, elogv, needrestart, eclean, eclean-kernel, 
    qcheck, revdep-rebuild, glsa-check, layman
]

For a successful upgrade, knowing how to use many of these tools is essential. While experienced users might find this manageable, it can be overwhelming for new or inexperienced users.

Additionally, users often delay updates due to the time required, which can compromise system security. Regular updates are vital for maintaining security, so it is recommended to update the system daily.

This project addresses both issues:

  1. complicated update process
  2. potential security issues caused by the lack of regular upgrades

Functionality

Here are some of the things that gentoo_update will be able to do:

  • Install only security updates from Gentoo Linux Security Advisory by default.
  • Optionally run a full system upgrade (@world) with different parameters.
  • Detect and handle update errors.
  • Schedule updates.
  • Generate a post-update report and send it via email and/or IRC chat.
  • Send push notifications to a mobile app.

The program comprises three core components: the updater, the parser, and the notification sender. The updater is a Bash script that executes emerge to update the system and generates detailed logs for each action performed. Upon successful completion of the updater, the parser reads the logs and compiles an update report. The notification sender then dispatches this report to users.

Usage

At the moment gentoo_update can only install GLSA and @word updates and store the output to a dedicated directory. It is available in GURU overlay in app-admin/gentoo_update, and in PyPI. Generally, installing the program from GURU overlay is the preferred method, but PyPI will always have the most recent version (at the time of writing the newest version is 0.1.6).

After enabling GURU overlay it can be installed via:

emerge --ask app-admin/gentoo_update

Alternatively, it can be installed with pip:

emerge --ask dev-python/pip
pip install gentoo_update --break-system-packages

Here are some use cases:
Security update
Running command without specifying –update-mode will use glsa-check to install security patches.

gentoo-update

@world update
Run full system update, merge all new configuration files, restart all services that were updated and display elogs:

gentoo-update --update-mode full \
              --config-update-mode merge \
              --daemon-restart y \
              --read-logs y

Override default behavior and show build logs:

gentoo-update --update-mode full --args "quiet-build=n"

After an update a log file will be created in /var/log/portage/gentoo_update/log_<timestamp>.

Conclusion

gentoo_update aims to be a useful tool that will automate and simplify updating Gentoo Linux. By default it only installs updates from GLSA, but can also be used to update @world, and it can be installed from GURU or PyPI.

I would love to receive some feedback and/or suggestions for this project, feel free to reach out to me via Githubemail or IRC (LabBrat).

This entry was posted in 2023 GSoC, Automated System Updater. Bookmark the permalink.

3 Responses to gentoo_update Introduction

Leave a Reply

Your email address will not be published.