Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ff51564
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 07:08:28 2024 -0600

    mv to prod

commit 2b92d70
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 07:02:55 2024 -0600

    rm this file

commit b50a8c3
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 05:19:22 2024 -0600

    sort openrc services

commit a22f9d9
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 04:50:36 2024 -0600

    silence output

commit e93836e
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 04:50:22 2024 -0600

    ensure the link is deleted

commit 524f66a
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 04:10:07 2024 -0600

    use testing

commit 7550ddc
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 02:43:38 2024 -0600

    rm this

commit 2568735
Author: Uri Herrera <[email protected]>
Date:   Wed Aug 7 02:42:49 2024 -0600

    test ota, update ccu

commit 84863a2
Author: Uri Herrera <[email protected]>
Date:   Sat Jul 13 05:34:26 2024 -0600

    rm refs to build list

commit 88c264d
Author: Uri Herrera <[email protected]>
Date:   Sat Jul 13 05:33:54 2024 -0600

    the build list will not be included anymore

    so, don't use it
  • Loading branch information
UriHerrera committed Aug 7, 2024
1 parent 67c8a12 commit 084200d
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 38 deletions.
121 changes: 100 additions & 21 deletions tmp/nuts-ccu
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ puts_success() {
}


# -- Print warning messages to stderr.

puts_warning() {
if [ -n "$1" ]; then
printf "%s: \e[33mWarning:\e[0m %s\n" "$TOOL_NAME" "$*" >&2
fi
}


# -- Display version of running component.

puts_info "$TOOL_NAME $COMP_NAME version $CCU_VERSION."
Expand Down Expand Up @@ -161,6 +170,10 @@ declare -A FILES_TO_DOWNLOAD=(
# Add hook scripts for initramfs.
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/initramfs-tools/hooks/amd64_microcode"]="/usr/share/initramfs-tools/hooks/amd64_microcode"
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/initramfs-tools/hooks/intel_microcode"]="/usr/share/initramfs-tools/hooks/intel_microcode"
# Replace elogind files.
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/other/elogind/logind.conf"]="/etc/elogind/logind.conf"
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/other/elogind/sleep.conf"]="/etc/elogind/sleep.conf"
["https://raw.githubusercontent.com/Nitrux/iso-tool/legacy/configs/files/other/elogind/sleep.conf.d/10-elogind.conf"]="/etc/elogind/sleep.conf.d/10-elogind.conf"
)

for URL in "${!FILES_TO_DOWNLOAD[@]}"; do
Expand Down Expand Up @@ -235,48 +248,114 @@ else
fi


# -- Sort OpenRC services.

puts_info "Updating OpenRC services, continuing..."

$(which rm) -f /etc/runlevels/{default,nonetwork,off,recovery,sysinit,boot}/*

mkdir -p /etc/runlevels/async && rc-update add -s async default

$(which cp) /etc/init.d/{acpi-support,acpid,console-setup.sh,dbus,debugfs-mount-openrc,elogind,fprintd-openrc,mountbinds,network-manager,nohang-desktop-openrc,ntpsec-openrc,plymouth-openrc,powertop-openrc,rmnologin,sddm,sudo,tlp,uuidd} /etc/runlevels/default/ || true

$(which cp) /etc/init.d/{avahi-daemon-openrc,bluez-meshd-openrc,bluez-obexd-openrc,bluez-openrc,cron,cups,irqbalance,nmbd,preload,rsyslog-openrc,smbd,thp-settings,usbmuxd-openrc} /etc/runlevels/async/ || true

# $(which cp) /etc/init.d/rc.local /etc/runlevels/nonetwork/local || true

$(which cp) /etc/init.d/{savecache,sendsigs,umountfs,umountnfs.sh,umountroot} /etc/runlevels/off || true

# $(which cp) /etc/init.d/{bootlogs,killprocs,single} /etc/runlevels/recovery || true

$(which cp) /etc/init.d/{apparmor,bootmisc.sh,brightness,cgroups,checkroot-bootclean.sh,checkroot.sh,eudev,hostname.sh,hwclock.sh,keyboard-setup.sh,kmod,mount-configfs,mountall-bootclean.sh,mountall.sh,mountdevsubfs.sh,mountkernfs.sh,mountnfs.sh,networking,plymouth-log,procps,selinux-autorelabel,ufw,urandom,x11-common} /etc/runlevels/sysinit || true

$(which cp) /etc/init.d/{cryptdisks,cryptdisks-early,cryptmount-openrc,device-mapper-openrc,dmcrypt-openrc,dmeventd-openrc} /etc/runlevels/boot || true


#######################################################
# These are changes introduced in the new release. #
#######################################################

# -- Cleanup the prev. NetworkManager configuration.
# -- Remove the contents of packages using the shell. At this point, we're not keeping or using data in /var/lib/dpkg anyway, so it doesn't matter how these files and directories are removed.

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"
"/etc/resolvconf.conf"
"/usr/sbin/bpftool"
"/usr/share/bash-completion/completions/bpftool"
"/usr/share/doc/bpftool/changelog.Debian.gz"
"/usr/share/doc/bpftool/copyright"
"/usr/share/man/man8/bpftool-btf.8.gz"
"/usr/share/man/man8/bpftool-cgroup.8.gz"
"/usr/share/man/man8/bpftool-feature.8.gz"
"/usr/share/man/man8/bpftool-gen.8.gz"
"/usr/share/man/man8/bpftool-iter.8.gz"
"/usr/share/man/man8/bpftool-link.8.gz"
"/usr/share/man/man8/bpftool-map.8.gz"
"/usr/share/man/man8/bpftool-net.8.gz"
"/usr/share/man/man8/bpftool-perf.8.gz"
"/usr/share/man/man8/bpftool-prog.8.gz"
"/usr/share/man/man8/bpftool-struct_ops.8.gz"
"/usr/share/man/man8/bpftool.8.gz"
"/etc/udev/rules.d/40-ioschedulers.rules"
)

directories=(
"/usr/share/plasma/plasmoids/org.nx.networkmanagement"
)

for file in "${files[@]}"; do
if [ -e "$file" ]; then
rm "$file"
puts_info "Updating NetworkManager configuration, continuing..."
if [ -f "$file" ]; then
puts_info "Deleting $file, continuing..."
rm -f "$file"
else
puts_warning "$file does not exist, skipping..."
fi
done

for dir in "${directories[@]}"; do
if [ -d "$dir" ]; then
puts_info "Deleting directory $dir, continuing..."
rm -rf "$dir"
else
puts_error "NetworkManager conf. file: $file does not exist, skipping..."
puts_warning "Directory $dir does not exist, skipping..."
fi
done


# -- Install the firmware that the xone script downloads.
# -- Remove AppArmor profile that causes Flatpak not to work.

src="/etc/apparmor.d/bwrap-userns-restrict"
target="/etc/apparmor.d/disable/bwrap-userns-restrict"

DRIVER_URL='http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab'
FIRMWARE_HASH='48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66'
if [ ! -e "$target" ]; then
create_symlink "$src" "$target"
fi


# -- Disable DrKonqi.

chmod a-x /usr/lib/x86_64-linux-gnu/libexec/drkonqi

TEMP_DIR=$(mktemp -d)

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
# -- Add tutorials to /etc/skel so they're added to the Desktop directory.

ORIGINAL_DIR=$(pwd)

# -- Create links for dbab lists in /etc/NetworkManager/dnsmasq.d.
TEMP_DIR1=$(mktemp -d)
git clone --depth=1 https://github.com/Nitrux/storage.git "$TEMP_DIR1"
cd "$TEMP_DIR1"
cp -R Other/Documentation /etc/skel/Desktop
cd "$ORIGINAL_DIR"

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

# -- Add nvidia_oc binary to overclock NVIDIA GPUs on Wayland.

FILE_URL="https://github.com/Dreaming-Codes/nvidia_oc/releases/download/0.1.11/nvidia_oc"
DEST_DIR="/usr/bin"
DEST_FILE="$DEST_DIR/nvidia-oc"
if curl -L -o "$DEST_FILE" "$FILE_URL"; then
chmod +x "$DEST_FILE"
else
exit 1
fi

puts_success "Success! misc. and configuration files have been updated, continuing..."

Expand Down
2 changes: 1 addition & 1 deletion tmp/nuts-cru
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ fi

puts_success "Success! OTA update process completed successfully, continuing..."

[[ -f "$AIPKG_MANAGER" ]] && rm "$AIPKG_MANAGER" && /usr/bin/dpkg
[[ -f "$AIPKG_MANAGER" ]] && rm "$AIPKG_MANAGER" /usr/bin/dpkg > /dev/null 2>&1 &


# -- Clean up the updated root after updating.
Expand Down
8 changes: 4 additions & 4 deletions tmp/nuts-query.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# Define the minimum target for the update.
#
[RELEASE]
MINTARGET=3.5.0
MINTARGET=3.5.1

# Define the name of the file and its checksum.
#
[OTA]
OTAFILE=ota-2024.07.08-18.41-amd64.squashfs
OTASUM=bce625810f99b8da3e3fbebcc4cdf893
OTAFILE=ota-2024.08.07-02.03-amd64.squashfs
OTASUM=451190aec6a7ab759a1a265266c1d721

# 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.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
MIRRORLIST=https://master.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://netactuate.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://netix.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://freefr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://phoenixnap.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://ufpr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://liquidtelecom.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://yer.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://newcontinuum.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs,https://versaweb.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.08.07-02.03-amd64.squashfs
12 changes: 0 additions & 12 deletions usr/bin/nuts
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,6 @@ done
# -- Update process begins.
# -- The update process is divided into two sub-processes, the first is backup, and the second is the actual update.

# -- Verify that the build list exists.
# -- Exit if it doesn't.

if [[ ! -f "/installed_pkgs_end.txt" ]]; then
puts_error "Build list not found, quitting."
exit 1
else
puts_info "Build list found, continuing..."
fi


# -- Download the nuts-query file from our repository and then use the checksum listed in the file to compare their values.
# -- This file is always downloaded to a temporary directory, as there's no reason to keep it.
# -- Overwrite the file if it already exists.
Expand All @@ -390,7 +379,6 @@ done
# -- 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)
Expand Down

0 comments on commit 084200d

Please sign in to comment.