Skip to main content

We introduced our update utility, the Nitrux Update Tool System or “nuts,” three months ago. We’ve been updating the utility ever since; however, the latest updates have significantly improved its workflow.


Out with the old, in with the new

The original idea of the Nitrux Update Tool System was the following.

  1. Creates a backup of the root directory using SquashFS and stores it locally.
  2. Downloads the latest ISO image using the BitTorrent protocol and updates the system using rsync.
  3. When restoring a backup, use the locally generated SquashFS file (instead of downloading an ISO).

However, as time passed, we identified a problem in step no. 2 that caused the following issue.

It turns out that after using the utility, the Plasma Wayland session would stop working for no apparent reason. To make matters more confusing, the Plasma X11 session (after restoring the session file) would work, but with some quirks. So, we set out to find out what was going on.

We hadn’t identified this problem during the creation of the utility since the initial Nitrux Update Tool System testing was performed in distribution versions where the Plasma Wayland session was not the default. As noted earlier, the Plasma X11 session worked fine. We documented the triaging process on another issue at the utility repository.

The result was a significant overhaul of the update process in the Nitrux Update Tool System. The most notable change is that the utility will now follow an OTA-style update process to improve the reliability of the post-update installation. So, the workflow has changed as follows, encompassing the changes made recently and over the previous months.

  1. Creates a backup of the root directory using SquashFS and the XFS partition and stores them locally.
  2. Downloads an OTA-style update file using axel and updates the system using rsync.
  3. Depending on the situation, the utility uses rsync, the locally generated SquashFS file, or the XFS tools when restoring a backup.

Initially, as part of the update process, the utility would download the latest ISO file, then mount it, and then mount the SquashFS inside the ISO. After these actions, the utility would call rsync and synchronize the root directory. The initial logic was to exclude specific directories from this operation, such as those in /etc, as it’d cause problems with user accounts, for example. However, this process caused the issue mentioned earlier.

After much triage, we figured it’d be better to maintain a workflow where we’d still use a SquashFS archive per the original concept. But, rather than excluding directories when calling rsync, we’d create an archive with the directories and files we wanted to upgrade. Also, instead of relying on the BitTorrent protocol for the downloads, use a faster HTTP method by replacing aria2c with axel. The archives will be uploaded to Sourceforge, so we’re also leveraging their mirrors to provide fast downloads whenever possible.

  • ⚠️ Important: We emphasize that simply downloading the archive won’t yield a functional system; as mentioned earlier, it only contains updated files, not a complete and functional installation.

In other words, we removed one step from the original process while making the process more reliable. However, that was not the only change.

Additional improvements to the Nitrux Update Tool System

Other changes include the following.

  • Add a new self-update operation. This new operation allows the user to update the utility independently of the distribution.
    • 🔰 Information: See the help for more information.
  • Improve rescue operation by correctly resolving directory paths.
  • Improve logic when creating XFS partition backup.
  • Use wget to verify Internet connection when using GNOME Boxes.
  • Fix syntax when calling xfsrestore.
  • Delete uncompressed backup to avoid wasting storage space.
  • Improve status messages overall.
  • Add flags to switch between branches of the utility. This option allows the user to change which branch from the Git repository is used to pull the new files for updating the utility. By default, the branch used is “main.”
    • 🔰 Information: See the help for more information. These flags were added for people who want to help troubleshoot the utility.
  • Unmount stuff when errors occur during the execution of a component.
  • Maintain the value of the branch in the configuration file during self-update.
  • Clean up unused code.
  • Display version of components.
  • Fix links for MauiKit libraries on update.
  • Update stuff in /etc that we add since SquashFS does not support including sub-directories when creating an archive.
  • Run update-grub when the cleanup script runs instead of after during the update process.
  • Delete the newest backup of the root directory after using it, as it is deleted anyway when the restore operation is executed again.
  • Use exit instead of shift, as no positional arguments are passed to the main component.

Updating older versions of the Nitrux Update Tool System

Do the following to update versions of nuts that do not have the self-update operation, such as those included before Nitrux 3.0.1.

sudo overlayroot-chroot

mount -t devtmpfs dev /dev

rm -f /usr/bin/{nuts,nuts-cru,nuts-crr}
git clone --depth=1 https://github.com/Nitrux/nuts.git
cp nuts/usr/bin/nuts /usr/bin && cp nuts/etc/nuts.conf /etc
rm -r nuts && sync

umount /dev

exit

sudo reboot

Updating Nitrux using the Nitrux Update Tool System 2.0.x

The process to update the distribution using this new revision of the utility remains the same.

  • ⚠️ Important: Update nuts before attempting to update the distribution.
sudo nuts update

Version 2.0.2 of the Nitrux Update Tool System will be included in Nitrux 3.0.1+.