Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit a1ce31a
Author: UriHerrera <[email protected]>
Date:   Mon Jan 22 18:42:05 2024 -0600

    ...

commit e48f5fe
Author: UriHerrera <[email protected]>
Date:   Mon Jan 22 18:41:48 2024 -0600

    ...

commit 62f2ab0
Author: UriHerrera <[email protected]>
Date:   Mon Jan 22 18:40:59 2024 -0600

    ...

commit 98359bb
Author: UriHerrera <[email protected]>
Date:   Mon Jan 22 18:39:03 2024 -0600

    ...

commit 82f3851
Author: UriHerrera <[email protected]>
Date:   Mon Jan 22 18:38:15 2024 -0600

    deprecate using build list for upgrade check
  • Loading branch information
UriHerrera committed Jan 30, 2024
1 parent 5e29ebe commit 28f0499
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
3 changes: 0 additions & 3 deletions tmp/nuts-ccu
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ declare -A FILES_TO_DOWNLOAD=(
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/other/common-password"]="/etc/pam.d/common-password"
# Add pwquality.conf (which is missing for some reason!).
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/conf/pwquality.conf"]="/etc/security/pwquality.conf"
# Replace build list.
# Ensure it is the build list for the target update. It should match the checksum of ROOTLISTSUM in nuts.conf.
["https://raw.githubusercontent.com/Nitrux/storage/master/Lists/3.2.1/nitrux-nx-desktop-plasma-2bcfb28b-amd64.buildlist"]="/installed_pkgs_end.txt"
)

for URL in "${!FILES_TO_DOWNLOAD[@]}"; do
Expand Down
5 changes: 0 additions & 5 deletions tmp/nuts-query.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# nuts-query.info 2023 (c) Nitrux Latinoamericana S.C.
#

# Define the checksum of the build list in the update file.
#
[ROOT]
ROOTLISTSUM=2a1787a3835514d17bf8d7a00337afc9

# Define the minimum target for the update.
#
[RELEASE]
Expand Down
25 changes: 9 additions & 16 deletions usr/bin/nuts
Original file line number Diff line number Diff line change
Expand Up @@ -373,27 +373,20 @@ done
dl_file "https://raw.githubusercontent.com/Nitrux/nuts/$NUTS_BRANCH/tmp/nuts-query.info" > /dev/null 2>&1


# -- Make the comparison of the build lists.
# -- This way, we know that the user is running this tool on an installation that can be upgraded; thus, this tool works as intended.
# -- If the checksum matches, exit because the root is already current.
# -- If the checksum doesn't match, then continue because the root is out of date or the list differs from the value in the query file.
# -- Also establish a minimum version target to check.
# -- Make a comparison of the current installation version against the minimum target for upgrade.
# -- This way, we know that the user is running this tool on an installation that we can upgrade; thus, this tool works as intended.
# -- If the check matches, it means there's an update.
# -- if the check doesn't match, it means there's no update.
# -- Comparing the checksum of /installed_pkgs_end.txt to verify versions is now deprecated.

DISTRIB_RELEASE=$(grep 'DISTRIB_RELEASE' /etc/lsb-release | cut -d'=' -f2)
MINTARGET=$(grep 'MINTARGET=' /tmp/nuts-query.info | cut -d'=' -f2)
if [[ "$DISTRIB_RELEASE" != "$MINTARGET" ]]; then
puts_info "This version of ${TARGET_DIST^} can't be upgraded, quitting."
exit 1
fi

LOCAL_SUM=$(md5sum /installed_pkgs_end.txt | cut -c -32)
REMOTE_SUM=$(tail /tmp/nuts-query.info | grep 'ROOTLISTSUM=' | cut -c -44 | rev | cut -c -32 | rev)

if [[ "$LOCAL_SUM" == "$REMOTE_SUM" ]]; then
puts_info "No updates were found for ${TARGET_DIST^}. Bye."
if [[ "$DISTRIB_RELEASE" != "$MINTARGET" ]]; then
puts_info "System is up-to-date. No updates were found for ${TARGET_DIST^} $DISTRIB_RELEASE. Bye."
exit 0
else
puts_info "Checking for updates to ${TARGET_DIST^}, continuing..."
puts_info "An update was found for ${TARGET_DIST^} $DISTRIB_RELEASE, continuing..."
fi


Expand Down Expand Up @@ -451,7 +444,7 @@ done

# -- Step 2: Actual Update sub-process

# -- This process is also done inside the chroot and it is the same as Calamares, except for user creation, mounts and bootloader configuration.
# -- This process is also done inside the chroot.
# -- After using overlay_ch, it's essential to remember that **EVERY COMMAND IS RUNNING AS ROOT AND ON THE LOWER DIRECTORY OF THE OVERLAY**.

OVERLAYROOT="/usr/sbin/overlayroot-chroot"
Expand Down

0 comments on commit 28f0499

Please sign in to comment.