Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit bc1217e
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 23:15:54 2024 -0600

    use spinner in ccu

commit b3487a7
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 22:28:20 2024 -0600

    add spinner to dl ota

commit c226228
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 21:52:49 2024 -0600

    update readme

commit 40965be
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 21:49:34 2024 -0600

    ...

commit b5a09a1
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 21:46:43 2024 -0600

    Update README.md

commit b48d036
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 21:45:28 2024 -0600

    ...

commit e137b20
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 21:38:00 2024 -0600

    use spinner in cru

commit aae88e2
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 20:44:39 2024 -0600

    use spinner

commit c901028
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 20:40:02 2024 -0600

    fix the name :laughing:

commit 4983740
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 20:39:07 2024 -0600

    add spinner

commit ffc10fb
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 20:28:47 2024 -0600

    silence cmd output

    - fix typo in message

commit 2576a6b
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 19:41:44 2024 -0600

    ...

commit f9b5fed
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 19:39:54 2024 -0600

    rm files before redownloading

commit 012d8eb
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 19:36:28 2024 -0600

    no need to create dirs

    - silence cmd output

commit a1c5858
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 19:00:39 2024 -0600

    update pkg

commit a987dee
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 18:42:26 2024 -0600

    mv that here

commit eaf8e74
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 17:49:18 2024 -0600

    disp comp name

commit 8ba5104
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 17:26:39 2024 -0600

    mute dl output

commit 28b242e
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 17:07:48 2024 -0600

    ...

commit 197372f
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 17:07:09 2024 -0600

    silence dl output

commit ee81f3a
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 17:01:16 2024 -0600

    use func as other comps

    - display info messages about unmounting /dev in sup

commit 7b9e4c4
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:58:55 2024 -0600

    unmount /dev in sup when doing nothing

commit 2ac8723
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:58:11 2024 -0600

    ...

commit 81961fa
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:57:43 2024 -0600

    avoid redundant chk

commit 2de19ff
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:35:34 2024 -0600

    include chk when using sup

commit 75069cf
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:12:52 2024 -0600

    improve messages

commit 63df796
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 16:03:21 2024 -0600

    reboot atfer updating

commit a9cf87e
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 15:53:06 2024 -0600

    silence dl output

commit 55fcf3d
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 15:50:24 2024 -0600

    silence output

commit 40cbf24
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 14:32:03 2024 -0600

    improve status messages

commit 7b18350
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 14:12:46 2024 -0600

    looks like it works now

    - disable xtrace
    - now, proceed to silence output

commit 0731e2d
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 05:58:52 2024 -0600

    Update nuts-cru

    use noninteractive

commit 156ff3d
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 05:11:46 2024 -0600

    test

commit 099fb26
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 04:40:41 2024 -0600

    ...

commit 4decfaf
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 04:25:27 2024 -0600

    add xtrace

commit ba654c3
Author: UriHerrera <[email protected]>
Date:   Mon Jan 15 03:18:01 2024 -0600

    rm xtrace

    - let's see which output we have to silence

commit 81163b1
Author: UriHerrera <[email protected]>
Date:   Sun Jan 14 12:50:33 2024 -0600

    test this

commit 884ea42
Author: UriHerrera <[email protected]>
Date:   Sun Jan 14 02:10:28 2024 -0600

    enter dir and extract archive

commit c188fa5
Author: UriHerrera <[email protected]>
Date:   Sun Jan 14 01:25:27 2024 -0600

    set tar -v

commit 6ac9209
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 13:27:10 2024 -0600

    use a func to unmount dirs

    on failure

    - streamline update process

commit dc4cc1b
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 13:03:36 2024 -0600

    Update nuts-cru

    fucking extract the fucking archive to the fucking directory

commit d26231d
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 12:16:52 2024 -0600

    ...

commit 390567d
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 12:12:34 2024 -0600

    create dir

commit d908d2b
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 11:53:49 2024 -0600

    fffs

commit 066a393
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 11:52:17 2024 -0600

    ugh...

commit 05bfdf6
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 11:49:38 2024 -0600

    wtf

commit 20b811e
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 11:38:01 2024 -0600

    :shrug:

commit e2f1115
Author: UriHerrera <[email protected]>
Date:   Sat Jan 13 11:34:48 2024 -0600

    ....

commit af82b95
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 13:57:09 2024 -0600

    add toggle to del backups on updates

commit b06e7ad
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 13:50:33 2024 -0600

    update nuts

    - fix redirections
    - add key to conf file to determine whether to remove backups during update, default is yes

commit a8203f0
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 13:11:12 2024 -0600

    test this

commit 4fa77a1
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 12:30:18 2024 -0600

    Update nuts-ccu

    maintain logic to remove old kernel

commit e0406d2
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 12:18:06 2024 -0600

    FFS

commit 136537f
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 11:47:45 2024 -0600

    test this

commit 45922a8
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 11:14:28 2024 -0600

    ...

commit aa88094
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 11:14:04 2024 -0600

    clean ccu, rm stuff using cru

commit b7eb69d
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 10:30:58 2024 -0600

    Update nuts-cru

    shut it

commit e4f2430
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 10:07:51 2024 -0600

    test create stuff

commit 59a098a
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 10:06:08 2024 -0600

    also create this file

commit 4ca5948
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 09:46:16 2024 -0600

    also create the file

commit 6c9aa12
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 08:53:25 2024 -0600

    fix files urls

commit b0f2dc9
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 08:48:12 2024 -0600

    only create this one

commit 0074038
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 08:47:07 2024 -0600

    Update nuts-cru

    create dirs

commit 8de1ca3
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 08:38:45 2024 -0600

    Revert "Update nuts-ccu"

    This reverts commit 31c7c52.

commit 31c7c52
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 08:03:17 2024 -0600

    Update nuts-ccu

    ensure links exist and point to their target

commit ce4c2e1
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 07:57:08 2024 -0600

    ensure the appimage is an appimage

    and that it's downloaded from the correct url, and that the grub scripts are executable

commit 3b28c14
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 07:32:59 2024 -0600

    ...

commit b88017e
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 07:31:36 2024 -0600

    Update nuts-ccu

    - use existing dl function
    -  add a step to move these files from /tmp to their intended target locations

commit f3d6e69
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 07:15:32 2024 -0600

    ...

commit 345d2a1
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 07:12:04 2024 -0600

    apply logic when mv plasma x11 session file

commit 9ef0a7f
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 06:52:13 2024 -0600

    update cru and readme

commit c33c6a6
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 06:24:33 2024 -0600

    make it executable

    :facepalm:

commit 0b672f6
Author: UriHerrera <[email protected]>
Date:   Fri Jan 12 05:53:30 2024 -0600

    test this

commit ff2c6f0
Author: UriHerrera <[email protected]>
Date:   Thu Jan 11 18:49:31 2024 -0600

    test this method

commit db58735
Author: UriHerrera <[email protected]>
Date:   Fri Jan 5 09:47:28 2024 -0600

    ...

commit e7a9e71
Author: UriHerrera <[email protected]>
Date:   Fri Jan 5 04:38:51 2024 -0600

    test this

commit 5a3c9eb
Author: UriHerrera <[email protected]>
Date:   Fri Jan 5 02:05:47 2024 -0600

    ...

commit d20b26c
Author: UriHerrera <[email protected]>
Date:   Fri Jan 5 02:05:02 2024 -0600

    test this

commit 9e20b0b
Author: UriHerrera <[email protected]>
Date:   Wed Jan 3 18:16:31 2024 -0600

    don't unmount home?

commit 3e97067
Author: UriHerrera <[email protected]>
Date:   Wed Jan 3 10:15:50 2024 -0600

    rm refs to list in cru

commit a7dc9ec
Author: UriHerrera <[email protected]>
Date:   Wed Jan 3 09:37:30 2024 -0600

    sort stuff

commit 45ace43
Author: UriHerrera <[email protected]>
Date:   Wed Jan 3 09:10:26 2024 -0600

    ensure these links exist

commit 874b932
Author: UriHerrera <[email protected]>
Date:   Wed Jan 3 09:09:11 2024 -0600

    chk sqs

commit f1c9a97
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 02:35:31 2023 -0600

    ...

commit 80d40c5
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 02:34:22 2023 -0600

    emphasize the necessity to reboot to load changes

    into the overlay

commit a393e25
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 02:28:58 2023 -0600

    ....

commit 8bfa2e3
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 02:22:55 2023 -0600

    use func to make the change to the lower dir

    when switching branches

commit 5e6c1ef
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 02:05:33 2023 -0600

    clean up restore, rm nuts-ccr

    - and remove nuts-cc-file.list because the list was originally intended to be used when rsync synced the sqs from the iso

commit 780461f
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 01:33:31 2023 -0600

    don't unmount sqs dir

    - I.. uh, I guess we don't unmount it? This wasn't fialing before but now it does. :shrug:
    - Attempting to unmount the dir causes everything else to not run, i.e., nuts-ccu isn't executed until nuts-cru is executed again.

commit 5637830
Author: UriHerrera <[email protected]>
Date:   Wed Dec 20 01:18:59 2023 -0600

    better error handling

commit aad3671
Author: UriHerrera <[email protected]>
Date:   Tue Dec 19 21:17:24 2023 -0600

    Update nuts-query.info

commit 82b2ee1
Author: UriHerrera <[email protected]>
Date:   Tue Dec 19 21:10:52 2023 -0600

    use the var

commit 92a48d7
Author: UriHerrera <[email protected]>
Date:   Thu Dec 14 21:27:07 2023 -0600

    make message clearer

commit 9eccc41
Author: UriHerrera <[email protected]>
Date:   Thu Dec 7 13:55:08 2023 -0600

    add a minimum release target when checking for updates

commit a600b72
Author: UriHerrera <[email protected]>
Date:   Wed Nov 1 03:13:20 2023 -0600

    Update nuts-query.info

commit 17c6c85
Author: UriHerrera <[email protected]>
Date:   Tue Oct 31 23:52:32 2023 -0600

    add xtrace

commit 3d8929e
Author: UriHerrera <[email protected]>
Date:   Tue Oct 31 16:44:54 2023 -0600

    test new ota
  • Loading branch information
UriHerrera committed Jan 16, 2024
1 parent e4529a7 commit 09e991f
Show file tree
Hide file tree
Showing 11 changed files with 774 additions and 653 deletions.
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

The Nitrux Update Tool System (`nuts`) utility is designed to update [Nitrux OS](https://nxos.org/) and provide a backup option for rollbacks.

> _⚠️ Important: `nuts` is intended to work exclusively in Nitrux OS, and using this utility in other distributions will break them or not work at all. Please do not open issues regarding this use case; they will be closed._
> _⚠️ Important: The Nitrux Update Tool System (`nuts`) is intended to work exclusively in Nitrux OS, and using this utility in other distributions will break them or not work at all. Please do not open issues regarding this use case; they will be closed._
# Overview

`nuts` is a simple and minimalistic system update and rollback utility. It performs three steps:
The Nitrux Update Tool System (`nuts`) is a simple and minimalistic system update and rollback utility. It performs three steps:

1. Creates a backup of the root directory using SquashFS and the XFS partition and stores them locally.
2. Downloads an [OTA-style](https://en.wikipedia.org/wiki/Over-the-air_update) update file using `axel` and updates the system using `rsync`.
2. Downloads an [OTA-style](https://en.wikipedia.org/wiki/Over-the-air_update) update file and updates the system using a custom AppImage.
3. Depending on the situation, the utility uses 'rsync', the locally generated SquashFS file, or the XFS tools when restoring a backup.

> _♦ Information: `nuts` is included by default, starting with Nitrux 2.9.0._
> _♦ Information: The Nitrux Update Tool System (`nuts`) is included by default, starting with Nitrux 2.9.0._
---

Expand All @@ -32,9 +32,8 @@ The Nitrux Update Tool System (`nuts`) utility is designed to update [Nitrux OS]
### What `nuts` is not

- A package manager.
- `nuts` does not interact with any sort of packaging format.
- `nuts` does not interact with any software "repository" either.
- `nuts` does not interact with any package manager to perform any operation.
- `nuts` does not interact with any software "repository".
- `nuts` does not manage packages directly. It has no "knowledge" about filesystem contents, cache, etc.
- An installer.
- `nuts` is inspired by the functional workflow of most Linux installers, that is, extracting a SquashFS file. However, `nuts` does not handle in any way locale configuration, user creation, user management (including updating user settings, i.e., updating Latte Dock, Plasma, or ZSH configuration files), partition configuration (such as modifying `/etc/fstab`), or bootloader configuration (such as modifying `/etc/default/grub`), etc.
- Solely a backup utility.
Expand All @@ -47,12 +46,14 @@ The Nitrux Update Tool System (`nuts`) utility is designed to update [Nitrux OS]
### Requirements

- Nitrux 2.8.0+.
> _♦ Information: The utility will work out of the box starting with the distribution's release; however, the update files can set a minimum version._
- An active Internet connection.
- Up to 1.6 GB of available space in the root partition and more than 3.2 GB in the home partition.
> _⚠️ Important: The update process requires mandatory active internet connectivity via wired or wireless connections. Please connect to a functional network before starting the installer. Additionally, your computer should be capable of reaching GitHub and the domain raw.githubusercontent.com._
- Depending on the update file size, up to 1 GB is available in the home and root partitions.

### Misc. Information

`nuts` can technically work with previous releases that use an immutable root, such as Nitrux 2.6.0, 2.6.1, 2.7.0, and 2.7.1, as long as the partition labels match the specific values (`NX_ROOT` for the root partition and `NX_HOME` for the home partition which is standard since [Nitrux 2.8.0](https://nxos.org/changelog/release-announcement-nitrux-2-8-0/)).
The Nitrux Update Tool System (`nuts`) can technically work with previous releases that use an immutable root, such as Nitrux 2.6.0, 2.6.1, 2.7.0, and 2.7.1, as long as the partition labels match the specific values (`NX_ROOT` for the root partition and `NX_HOME` for the home partition which is standard since [Nitrux 2.8.0](https://nxos.org/changelog/release-announcement-nitrux-2-8-0/)).

To see the partition label run the command `blkid`.

Expand All @@ -66,24 +67,6 @@ sudo cp $HOME/nuts/usr/bin/nuts /usr/bin
sudo cp $HOME/nuts/etc/nuts.conf /etc
```

#### Updating older versions of `nuts`

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 /nuts
cp /nuts/usr/bin/nuts /usr/bin
cp /nuts/etc/nuts.conf /etc
rm -r /nuts
sync
umount /dev
exit
sudo reboot
```

# Usage

`nuts` is designed to be highly autonomous.
Expand All @@ -99,7 +82,7 @@ sudo reboot

**Rescue**: `nuts rescue`
- Restores the backup of the XFS root partition in case of an interrupted update.
- _♦ Information: This operation is a special handling of an unforeseen event. If rsync were to be interrupted, the root would be inconsistent. That means the root is unusable, i.e., the user can't access the GUI or, worse, a TTY, so the user can't restore the SquashFS. This operation will allow the user to restore the root partition from a Live session. This operation does not replace `restore`; it exists if using `restore` is impossible. The user can only use this operation from a Live session._
- _♦ Information: This operation is a special handling of an unforeseen event. If the update process were to be interrupted, the root would be inconsistent. That means the root is unusable, i.e., the user can't access the GUI or, worse, a TTY, so the user can't restore the SquashFS. This operation will allow the user to restore the root partition from a Live session. This operation does not replace `restore`; it exists if using `restore` is impossible. The user can only use this operation from a Live session._

**Self-update**: `nuts self-update`
- Updates `nuts` and its configuration file using the default branch set in the configuration file.
Expand All @@ -111,11 +94,12 @@ sudo reboot
### Options:

```
nuts -h: Displays the help of nuts.
nuts -d: Runs nuts in verbose mode.
nuts -v: Displays the version of nuts.
nuts -h or --help: Show this help.
nuts -v or --version: Show the version.
nuts -d or --debug: Enable verbose output.
nuts --use-main-branch: Defines the main branch of the Nitrux Update Tool System to download its components.
nuts --use-development-branch: Defines the development branch of the Nitrux Update Tool System to download its components.
nuts --keep-backups-on-update: Defines whether the Nitrux Update Tool System deletes backups during the update process.
```

# Licensing
Expand Down
11 changes: 11 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
nuts (2.1.0) nitrux; urgency=medium

* Refactor nuts-cru (update component).
* Remove code to manage kernel from nuts-ccu, diver users to use Kernel Boot to add new kernels.
* Add to toggle removing or keeping backups during updates.
* Improve status messages.
* When using self-update, display a message when there's no updates to apply.
* nuts-ccu also updates the system appimages and static binaries.

-- Uri Herrera <[email protected]> Mon, 15 Jan 2023 19:00:00 -0500

nuts (2.0.2) nitrux; urgency=medium

* Update stuff in /etc that we add since SquashFS does not support including sub-directories when creating an archive.
Expand Down
9 changes: 7 additions & 2 deletions etc/nuts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ NUTS_DIR_XFS=/home/.nuts/xfs
#
DATE_BACKUP_FILE=$(date +%Y.%m.%d-%H.%M)

# Define number of backups to keep when running update.
# Define whether to delete backups when updating.
# New backups are created each time the update process occurs.
#
UPDATE_DELETES_BACKUPS=yes

# Define the number of backups to keep when running the update.
# Each backup is approximately 3.1 GiB.
# Default is 1, which means, when there's more than (2) files, delete all files and keep the newest (1) file
# Default is 1, which means, when there are more than (2) files, delete all files and keep the newest (1) file
#
BACKUPS_TO_KEEP=1

Expand Down
48 changes: 0 additions & 48 deletions tmp/nuts-cc-file.list

This file was deleted.

82 changes: 0 additions & 82 deletions tmp/nuts-ccr

This file was deleted.

Loading

0 comments on commit 09e991f

Please sign in to comment.