From 9ffcd99d748ce12e65e2e27b8f97d9271396dc50 Mon Sep 17 00:00:00 2001 From: Uri Herrera Date: Tue, 9 Jul 2024 00:09:36 -0600 Subject: [PATCH] [ci skip] Squashed commit of the following: commit 7a1c468528832cc342e458d93af3cf9cbd7713d9 Author: Uri Herrera Date: Mon Jul 8 23:57:00 2024 -0600 Update nuts-query.info commit d0b508ebb3b25e63162d568496fcb1e69e909217 Author: Uri Herrera Date: Mon Jul 8 22:30:05 2024 -0600 ... commit b79400303133abcaf9d5bea09a96852ba66ee4d3 Author: Uri Herrera Date: Mon Jul 8 18:42:12 2024 -0600 chk ota commit a12456e0596adc45cf2d9a45b46f36f780eda2a4 Author: Uri Herrera Date: Mon Jul 8 18:35:40 2024 -0600 *sigh* commit e27d3ff51061de118a28b8f2248955fe3a9d0a76 Author: Uri Herrera Date: Mon Jul 8 18:30:28 2024 -0600 fffs commit 321f4187e90854ef25f907118f4f5ee23375eabd Author: Uri Herrera Date: Mon Jul 8 18:07:46 2024 -0600 ffs commit 03fca8be07a7ad147b49ab03cc4c9d2dea41d862 Author: Uri Herrera Date: Mon Jul 8 17:30:07 2024 -0600 chk ota commit d718bbb89787bc628b42360f0710d5703d43fbd1 Author: Uri Herrera Date: Mon Jul 8 17:28:22 2024 -0600 Update nuts-ccu put the new stuff at the end commit 804d633066c19ec9c9ea7a47e685cf0e521b591a Author: Uri Herrera Date: Mon Jul 8 17:09:45 2024 -0600 Update nuts-ccu commit b4066f468a48c5c31e0899882a3c2c9c4b28a638 Author: Uri Herrera Date: Mon Jul 8 17:08:00 2024 -0600 Squashed commit of the following: commit 25b51cbf8a4d13555f28afcc3e59c13a11fbddd0 Author: Uri Herrera Date: Mon Jul 8 15:56:03 2024 -0600 Update nuts-ccu rm unnecessary messages commit 3095eebf5a5f447db8090a875900659688408777 Author: Uri Herrera Date: Mon Jul 8 15:52:07 2024 -0600 Update nuts-ccu organize the cleanup stuff better commit bdee0300b09e661d1bd7cba69580ca69544771fa Author: Uri Herrera Date: Mon Jul 8 16:54:25 2024 -0600 ... commit b72a256bcbd81ecbcdeef2ba2dba6727f1353af6 Author: Uri Herrera Date: Mon Jul 8 13:33:42 2024 -0600 update copyright year, clarify the availability of updates in case there's no update archive commit 605446651131e492e980bd494eec74fe97a86ecf Author: Uri Herrera Date: Mon Jul 8 03:31:48 2024 -0600 chk ota commit db2ce0a50ed00157aa89ce348efcea0f9b9f731b Author: Uri Herrera Date: Tue Jun 25 12:22:50 2024 -0600 ... --- tmp/nuts-ccu | 142 ++++++++++++++++++++--------------------- tmp/nuts-crr | 2 +- tmp/nuts-cru | 8 +-- tmp/nuts-query.info | 10 +-- tmp/nuts-sup | 2 +- tmp/rsync-exclude.list | 2 +- usr/bin/nuts | 10 +-- 7 files changed, 86 insertions(+), 90 deletions(-) diff --git a/tmp/nuts-ccu b/tmp/nuts-ccu index c658f65..afbec94 100755 --- a/tmp/nuts-ccu +++ b/tmp/nuts-ccu @@ -3,7 +3,7 @@ ############################################################################################################################################################################# # The license used for this file and its contents is: BSD-3-Clause # # # -# Copyright <2023> > # +# Copyright <2023-2024> > # # # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # # @@ -133,61 +133,21 @@ spinner() { # ====== START ====== ############################################################################################################ -# Start of misc-fixes and edit-conf from iso-tool # -# When updating packages the stuff below will be overwritten, thus we must apply changes from iso-tool # +# When updating packages the stuff below will be overwritten, thus we must apply changes from iso-tool. # ############################################################################################################ -# -- Add link for applet window buttons. -# -- NOTE: Update the link on every new release of Plasma. - -PLASMA_LIB="5.27.11" - -create_symlink /usr/lib/x86_64-linux-gnu/libkdecorations2private.so.$PLASMA_LIB /usr/lib/x86_64-linux-gnu/libkdecorations2private.so.9 - - -# Check session set in SDDM. - -if grep -q '^Session=plasma$' /etc/sddm.conf.d/kde_settings.conf; then - puts_info "Detected graphical session set to Plasma (X11) in SDDM, leaving session file unchanged, continuing..." -elif grep -q '^Session=plasmawayland$' /etc/sddm.conf.d/kde_settings.conf; then - if [ -f /usr/share/xsessions/plasma.desktop ]; then - mv /usr/share/xsessions/plasma.desktop /usr/share/xsessions/orig.plasma.desktop.bak - fi -else - puts_info "Detected graphical session set to Plasma (Wayland) in SDDM, renaming X session file, continuing..." -fi - - -# -- Replace this line in mkinitramfs so it shuts up about dpkg. -# -- We replace this line here because the package from upstream will put it back to its default value. - -sed -i "s+DPKG_ARCH=\$(dpkg --print-architecture)+DPKG_ARCH=\$(uname -m | sed \"s/x86_64/amd64/\")+g" /usr/sbin/mkinitramfs - - -# -- Change path where NetworkManager saves wireless connections. -# -- We replace this line here because the package from upstream will put it back to its default value. - -echo -e "\n[keyfile]\npath=/var/lib/NetworkManager" | tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null 2>&1 - - -# -- Add variable to PAM for Firefox to work with touchscreens in Wayland. -# -- We replace this line here because the package from upstream will put it back to its default value. - -sed -i "$ a \ " /etc/security/pam_env.conf -sed -i "$ a # Make Firefox work with touchscreens in Wayland" /etc/security/pam_env.conf -sed -i "$ a MOZ_ENABLE_WAYLAND DEFAULT=0 OVERRIDE=1" /etc/security/pam_env.conf - - -# -- Downloaded these files so they overwrite the files from Debian. - puts_info "Updating misc. and configuration files, continuing..." +####################################################################################### +# Always apply these changes because the packages from Debian will overwrite them. # +####################################################################################### + declare -A FILES_TO_DOWNLOAD=( # Replace user-setup-apply so that it shuts up about dpkg. ["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/scripts/others/user-setup-apply"]="/usr/lib/user-setup/user-setup-apply" # Replace update-grub with our version that doesn't break OUR stuff. ["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/scripts/others/update-grub"]="/usr/sbin/update-grub" - # Replace /usr/lib/grub/grub-sort-version with a version that doesn't use apt.pkg do it can generate a usable boot menu. + # Replace /usr/lib/grub/grub-sort-version with a version that doesn't use apt.pkg do it can generate a usable boot menu. ["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/grub_files/grub-sort-version"]="/usr/lib/grub/grub-sort-version" # Replace dnscrypt-proxy default configuration. ["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/other/dnscrypt-proxy-settings/dnscrypt-proxy.toml"]="/etc/dnscrypt-proxy/dnscrypt-proxy.toml" @@ -231,7 +191,25 @@ for URL in "${!FILES_TO_DOWNLOAD[@]}"; do fi done -puts_success "Success! misc. and configuration files have been updated, continuing..." + +# -- Replace this line in mkinitramfs so it shuts up about dpkg. +# -- We replace this line here because the package from upstream will put it back to its default value. + +sed -i "s+DPKG_ARCH=\$(dpkg --print-architecture)+DPKG_ARCH=\$(uname -m | sed \"s/x86_64/amd64/\")+g" /usr/sbin/mkinitramfs + + +# -- Change path where NetworkManager saves wireless connections. +# -- We replace this line here because the package from upstream will put it back to its default value. + +echo -e "\n[keyfile]\npath=/var/lib/NetworkManager" | tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null 2>&1 + + +# -- Add variable to PAM for Firefox to work with touchscreens in Wayland. +# -- We replace this line here because the package from upstream will put it back to its default value. + +sed -i "$ a \ " /etc/security/pam_env.conf +sed -i "$ a # Make Firefox work with touchscreens in Wayland" /etc/security/pam_env.conf +sed -i "$ a MOZ_ENABLE_WAYLAND DEFAULT=0 OVERRIDE=1" /etc/security/pam_env.conf # -- Edit NVIDIA X Settings launcher. @@ -244,43 +222,63 @@ sed -i 's+Categories=System;Settings;+Categories=Settings;+g' /usr/share/applica sed -i 's+Categories=System;Settings;Utility;+Categories=Utility;+g' /usr/share/applications/org.corectrl.CoreCtrl.desktop -# -- Create link for gamescope to work. +# -- Check the session set in SDDM. If the session is Plasma X11, leave the file as-is. If the session is Plasma Wayland, then reset this change. -create_symlink /usr/lib/x86_64-linux-gnu/libwlroots.so.12 /usr/lib/x86_64-linux-gnu/libwlroots.so.11 +if grep -q '^Session=plasma$' /etc/sddm.conf.d/kde_settings.conf; then + puts_info "Detected graphical session set to Plasma (X11) in SDDM, leaving session file unchanged, continuing..." +elif grep -q '^Session=plasmawayland$' /etc/sddm.conf.d/kde_settings.conf; then + if [ -f /usr/share/xsessions/plasma.desktop ]; then + mv /usr/share/xsessions/plasma.desktop /usr/share/xsessions/orig.plasma.desktop.bak + fi +else + puts_info "Detected graphical session set to Plasma (Wayland) in SDDM, renaming X session file, continuing..." +fi -# -- Install xpadneo and xone drivers using their installer scripts. -# -- FIXME: There are no Debian packages available, if and when they are, switch to use them instead. +####################################################### +# These are changes introduced in the new release. # +####################################################### -ORIGINAL_DIR=$(pwd) +# -- Cleanup the prev. NetworkManager configuration. -TEMP_DIR1=$(mktemp -d) -git clone https://github.com/medusalix/xone "$TEMP_DIR1" -cd "$TEMP_DIR1" -sh install.sh -cd "$ORIGINAL_DIR" +files=( + "/etc/NetworkManager/dnsmasq.d/01-dns_cache.conf" + "/etc/NetworkManager/dnsmasq.d/02-dnscrypt-proxy.conf" + "/etc/NetworkManager/dnsmasq.d/03-dnssec.conf" + "/etc/dnsmasq.d/dns-block.conf" +) -TEMP_DIR2=$(mktemp -d) -git clone https://github.com/atar-axis/xpadneo "$TEMP_DIR2" -cd "$TEMP_DIR2" -bash install.sh -cd "$ORIGINAL_DIR" +for file in "${files[@]}"; do + if [ -e "$file" ]; then + rm "$file" + puts_info "Updating NetworkManager configuration, continuing..." + else + puts_error "NetworkManager conf. file: $file does not exist, skipping..." + fi +done -# -- Remove non-functional NXSC. +# -- Install the firmware that the xone script downloads. -rm -f /usr/bin/nx-software-center +DRIVER_URL='http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab' +FIRMWARE_HASH='48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66' +TEMP_DIR=$(mktemp -d) -# -- Remove services from default runlevel. +curl -L -o "$TEMP_DIR/driver.cab" "$DRIVER_URL" > /dev/null 2>&1 +cabextract -F FW_ACC_00U.bin -d "$TEMP_DIR" "$TEMP_DIR/driver.cab" > /dev/null 2>&1 +echo "$FIRMWARE_HASH $TEMP_DIR/FW_ACC_00U.bin" | sha256sum -c > /dev/null 2>&1 +mv "$TEMP_DIR/FW_ACC_00U.bin" /lib/firmware/xow_dongle.bin -SERVICES=("rc.local" "ntpsec" "plymouth" "dnsmasq") -for SERVICE in "${SERVICES[@]}"; do - puts_info "Stopping and disabling $SERVICE... from OpenRC, continuing..." - # rc-service "$SERVICE" stop || puts_error "Failed to stop $SERVICE." - rc-update del "$SERVICE" || puts_error "Failed to disable $SERVICE." -done +# -- Create links for dbab lists in /etc/NetworkManager/dnsmasq.d. + +create_symlink /etc/dnsmasq.d/dbab-map.adblock.conf /etc/NetworkManager/dnsmasq.d/dbab-map.adblock.conf +create_symlink /etc/dnsmasq.d/dbab-map.trashsites.conf /etc/NetworkManager/dnsmasq.d/dbab-map.trashsites.conf + + +puts_success "Success! misc. and configuration files have been updated, continuing..." + ###################################################### # End of misc-fixes and edit-conf from iso-tool # diff --git a/tmp/nuts-crr b/tmp/nuts-crr index f347645..893862f 100755 --- a/tmp/nuts-crr +++ b/tmp/nuts-crr @@ -3,7 +3,7 @@ ############################################################################################################################################################################# # The license used for this file and its contents is: BSD-3-Clause # # # -# Copyright <2023> > # +# Copyright <2023-2024> > # # # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # # diff --git a/tmp/nuts-cru b/tmp/nuts-cru index a38193f..85482fb 100755 --- a/tmp/nuts-cru +++ b/tmp/nuts-cru @@ -3,7 +3,7 @@ ############################################################################################################################################################################# # The license used for this file and its contents is: BSD-3-Clause # # # -# Copyright <2023> > # +# Copyright <2023-2024> > # # # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # # @@ -293,10 +293,8 @@ sync puts_success "Success! Backup has been created." -# -- Download the OTA SquashFS with axel. -# -- Check if the OTA SquashFS already exists so it's not downloaded again. If an OTA file was downloaded then rename it. -# -- However, If the OTA file found doesn't match the checksum in nuts-query.info, it will still cause the utility to exit at a later stage. -# -- Use the list of mirrors from the query file, or exit if downloading the file from all mirrors fails. +# -- Download the OTA SquashFS with axel if it doesn't exist. Use the list of mirrors from the query file, or exit if downloading the file from all mirrors fails. +# -- If the OTA file exist but it doesn't match the checksum in nuts-query.info, delete it and exit. OTA_FILE="$NUTS_DIR_DLS/nuts-ota.squashfs" diff --git a/tmp/nuts-query.info b/tmp/nuts-query.info index 40c8065..aef396b 100644 --- a/tmp/nuts-query.info +++ b/tmp/nuts-query.info @@ -1,20 +1,20 @@ # Default values for nuts-query -# nuts-query.info 2023 (c) Nitrux Latinoamericana S.C. +# nuts-query.info 2023-2024 (c) Nitrux Latinoamericana S.C. # # Define the minimum target for the update. # [RELEASE] -MINTARGET=3.4.1 +MINTARGET=3.5.0 # Define the name of the file and its checksum. # [OTA] -OTAFILE=ota-2024.06.01-19.47-amd64.squashfs -OTASUM=ca74da0c2ff946bc57faa791120bff08 +OTAFILE=ota-2024.07.08-18.41-amd64.squashfs +OTASUM=bce625810f99b8da3e3fbebcc4cdf893 # Define the list of mirrors to download the file. # If multiple mirrors are available, separate them using commas, i.e., url1,url2,url3 # [URL] -MIRRORLIST=https://master.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://netactuate.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://netix.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://freefr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://phoenixnap.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://ufpr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://liquidtelecom.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://yer.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://newcontinuum.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs,https://versaweb.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.06.01-19.47-amd64.squashfs +MIRRORLIST=https://master.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://netactuate.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://netix.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://freefr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://phoenixnap.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://ufpr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://liquidtelecom.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://yer.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://newcontinuum.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs,https://versaweb.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.07.08-18.41-amd64.squashfs diff --git a/tmp/nuts-sup b/tmp/nuts-sup index cc4625a..5a27535 100755 --- a/tmp/nuts-sup +++ b/tmp/nuts-sup @@ -3,7 +3,7 @@ ############################################################################################################################################################################# # The license used for this file and its contents is: BSD-3-Clause # # # -# Copyright <2023> > # +# Copyright <2023-2024> > # # # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # # diff --git a/tmp/rsync-exclude.list b/tmp/rsync-exclude.list index d0e8117..88020f8 100644 --- a/tmp/rsync-exclude.list +++ b/tmp/rsync-exclude.list @@ -1,5 +1,5 @@ # List of files and directories to be excluded when using rsync. -# rsync-exclude.list 2023 (c) Nitrux Latinoamericana S.C. +# rsync-exclude.list 2023-2024 (c) Nitrux Latinoamericana S.C. # This list is used for restore. # diff --git a/usr/bin/nuts b/usr/bin/nuts index ff17829..88895ae 100755 --- a/usr/bin/nuts +++ b/usr/bin/nuts @@ -348,7 +348,7 @@ done # -- For some reason, ping fails in GNOME Boxes even though ping works literally everywhere else. Use wget as an alternative to verify a connection. # -- Exit if connection test fails. - if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 github.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then + if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 raw.githubusercontent.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then puts_success "This computer can reach the Internet, continuing..." else puts_error "This computer cannot reach the Internet, quitting." @@ -396,10 +396,10 @@ done MINTARGET=$(grep 'MINTARGET=' /tmp/nuts-query.info | cut -d'=' -f2) if [[ "$DISTRIB_RELEASE" != "$MINTARGET" ]]; then - puts_info "System is up-to-date. No updates were found for ${TARGET_DIST^} $DISTRIB_RELEASE. Bye." + puts_info "No update is available for ${TARGET_DIST^} $DISTRIB_RELEASE. Bye." exit 0 else - puts_info "An update was found for ${TARGET_DIST^} $DISTRIB_RELEASE, continuing..." + puts_info "An update is available for ${TARGET_DIST^} $DISTRIB_RELEASE, continuing..." fi @@ -511,7 +511,7 @@ done # -- For some reason, ping fails in GNOME Boxes even though ping works literally everywhere else. Use wget as an alternative to verify a connection. # -- Exit if connection test fails. - if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 github.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then + if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 raw.githubusercontent.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then puts_success "This computer can reach the Internet, continuing..." else puts_error "This computer cannot reach the Internet, quitting." @@ -666,7 +666,7 @@ done # -- For some reason, ping fails in GNOME Boxes even though ping works literally everywhere else. Use wget as an alternative to verify a connection. # -- Exit if connection test fails. - if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 github.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then + if ping -q -c 1 -W 1 nxos.org >/dev/null && ping -q -c 1 -W 1 raw.githubusercontent.com >/dev/null || wget -q --spider https://filesamples.com/samples/document/txt/sample1.txt; then puts_success "This computer can reach the Internet, continuing..." else puts_error "This computer cannot reach the Internet, quitting."