Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 84d16f0
Author: Uri Herrera <[email protected]>
Date:   Thu Dec 5 12:08:11 2024 -0600

    Update nuts-query.info

commit fbfccf7
Author: Uri Herrera <[email protected]>
Date:   Thu Dec 5 12:07:52 2024 -0600

    Update changelog

commit 61e2124
Author: Uri Herrera <[email protected]>
Date:   Thu Dec 5 00:20:45 2024 -0600

    ????

    it does download the file, so wtf is the problem then?

commit 62b3eb6
Author: Uri Herrera <[email protected]>
Date:   Thu Dec 5 00:08:54 2024 -0600

    chk this func

commit b5f688a
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 23:55:34 2024 -0600

    rm the fkn spinner

    i'm tired, i don't care about debugging this any more time

commit edeb8d1
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 23:41:09 2024 -0600

    test delaying spinner

commit 29898f0
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 23:29:43 2024 -0600

    *sigh*

commit 3b43527
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 23:13:28 2024 -0600

    ffs fkn spinner

commit 56eddfd
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 23:01:18 2024 -0600

    ...

commit 62cfc2a
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 22:37:07 2024 -0600

    debug spinner

commit 6361485
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 22:15:01 2024 -0600

    ....sigh

    rm quotation marks

commit 32fbb30
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 22:12:23 2024 -0600

    debug the fkn spinner

commit 7a31b11
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:55:48 2024 -0600

    fix the fkn spinner in nuts-ccu, again

commit bcf5e36
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:41:16 2024 -0600

    put spinner in initrd generation

commit 8600a55
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:39:39 2024 -0600

    fix the spinner in nuts-ccu

    which was working fkn fine, wtf?

commit 4cd0c73
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:39:18 2024 -0600

    put the branch in quotation marks

commit 38e3e83
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:12:13 2024 -0600

    chk ota

commit 92c341a
Author: Uri Herrera <[email protected]>
Date:   Wed Dec 4 21:12:08 2024 -0600

    update messages, rm unnecessary tasks

    when cleaning up, add kernel param

commit 668f415
Author: Uri Herrera <[email protected]>
Date:   Sun Nov 17 22:33:31 2024 -0600

    sync params in /etc/default/grub

commit e3fc3be
Author: Uri Herrera <[email protected]>
Date:   Sun Nov 17 22:24:45 2024 -0600

    rm param
  • Loading branch information
UriHerrera committed Dec 5, 2024
1 parent 27274a0 commit d67ba79
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 131 deletions.
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
nuts (2.2.0) nitrux; urgency=medium

* Fix problem in nuts-ccu that would cause absurdly long elapsed time values.
* Remove unnecesary code from the cleanup component.
* Improve status messages for better readability.
* Ensure new kernel paramaters are addded to GRUB.

-- Uri Herrera <[email protected]> Thu, 05 Dec 2024 12:08:00 -0500

nuts (2.1.9) nitrux; urgency=medium

* Improve status messages for better readability.
Expand Down
205 changes: 78 additions & 127 deletions tmp/nuts-ccu
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ download_appimage() {
local destination="/Applications/$name"

rm -f "$destination"
axel -a -q -k -U "$user_agent" -n 8 "$url" -o "$destination"
axel -q -k -U "$user_agent" -n 8 "$url" -o "$destination"
chmod +x "$destination"
}

Expand All @@ -116,37 +116,17 @@ download_binary() {
local destination="/usr/bin/$name"

rm -f "$destination"
axel -a -q -k -U "$user_agent" -n 8 "$url" -o "$destination"
axel -q -k -U "$user_agent" -n 8 "$url" -o "$destination"
chmod +x "$destination"
}

spinner() {
local pid=$!
local delay=0.1
local elapsed=0
local dots=0

while ps -p "$pid" > /dev/null; do
if [ $dots -lt 3 ]; then
dots=$((dots + 1))
else
dots=1
fi
printf " [%-3s] Elapsed time: %.1f seconds" "$(printf '%*s' $dots | tr ' ' '.')" "$elapsed"
sleep $delay
elapsed=$(echo "$elapsed + $delay" | bc)
printf "\r"
done
printf "\n"
}

# ====== START ======

############################################################################################################
# When updating packages the stuff below will be overwritten, thus we must apply changes from iso-tool. #
############################################################################################################

puts_info "Updating misc. and configuration files, continuing..."
puts_info "Updating services, misc. and configuration files, continuing..."

#######################################################################################
# Always apply these changes because the packages from Debian will overwrite them. #
Expand Down Expand Up @@ -179,7 +159,6 @@ declare -A FILES_TO_DOWNLOAD=(

for URL in "${!FILES_TO_DOWNLOAD[@]}"; do
dl_file "$URL" > /dev/null 2>&1 &
spinner
wait $!

if ! wait $!; then
Expand Down Expand Up @@ -251,23 +230,21 @@ 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/{acpi-support,acpid,console-setup.sh,dbus,debugfs-mount-openrc,elogind,fprintd-openrc,keyboard-setup.sh,mountbinds,network-manager,nohang-desktop-openrc,ntpsec-openrc,plymouth-openrc,powertop-openrc,rmnologin,sddm,sudo,tlp,uuidd,x11-common} /etc/runlevels/default/ || true

$(which cp) /etc/init.d/{avahi-daemon-openrc,bcm-drv,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/{bcm-drv,bluez-meshd-openrc,bluez-obexd-openrc,bluez-openrc,cron,cups,irqbalance,preload,rapl-power,rsyslog-openrc,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/{plymouth-openrc,savecache,sendsigs,umountfs,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/{apparmor,bootmisc.sh,brightness,cgroups,eudev,hostname.sh,hwclock.sh,kmod,mount-configfs,mountall-bootclean.sh,mountall.sh,mountdevsubfs.sh,mountkernfs.sh,networking,plymouth-log,procps,rc.local,ufw,urandom} /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

Expand All @@ -294,6 +271,7 @@ ORIGINAL_DIR=$(pwd)
TEMP_DIR1=$(mktemp -d)
git clone --depth=1 https://github.com/Nitrux/storage.git "$TEMP_DIR1"
cd "$TEMP_DIR1"
rm -r /etc/skel/Desktop/Documentation
cp -R Other/Documentation /etc/skel/Desktop
cd "$ORIGINAL_DIR"

Expand All @@ -303,10 +281,17 @@ cd "$ORIGINAL_DIR"
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"

if [ -f "$DEST_FILE" ]; then
puts_info "$DEST_FILE already exists, continuing..."
else
exit 1
if curl -L -o "$DEST_FILE" "$FILE_URL"; then
chmod +x "$DEST_FILE"
puts_success "File downloaded and made executable: $DEST_FILE"
else
puts_error "Failed to download file from $FILE_URL."
exit 1
fi
fi


Expand All @@ -315,7 +300,7 @@ fi
sed -i "s/reverse_sorted_list=.*/reverse_sorted_list=\$(echo \"\$list\" | tr ' ' '\\n' | sort -Vr)/" /etc/grub.d/10_linux


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

######################################################
# End of misc-fixes and edit-conf from iso-tool #
Expand All @@ -328,85 +313,42 @@ puts_success "Success! misc. and configuration files have been updated, continui

puts_info "Applying changes introduced in the new release, continuing..."

# -- Ensure that xone is built with DKMS with kernels newer than 6.11.
# -- The driver version from upstream builds up to kernel 6.10, so we need to remove that and download the fork.

VERSION="unknown"
SOURCE_DIR="/usr/src/xone-$VERSION"
LOG_FILE="/var/lib/dkms/xone/$VERSION/build/make.log"
REPO_URL="https://github.com/tskaar/xone.git"
BRANCH="fix-6.12"

LATEST_KERNEL=$(find /boot -name 'vmlinuz-*' -exec basename {} \; | cut -d- -f2- | sort -V | tail -n 1)

rm -rf "$SOURCE_DIR"

git clone -b "$BRANCH" --single-branch "$REPO_URL" "$SOURCE_DIR" || {
echo "Failed to clone repository." >&2
exit 1
}

if dkms install -m xone -v "$VERSION" -k "$LATEST_KERNEL"; then
[ ! -f /etc/modprobe.d/xone-blacklist.conf ] && install -D -m 644 "$SOURCE_DIR/install/modprobe.conf" /etc/modprobe.d/xone-blacklist.conf
[ ! -f /usr/local/bin/xone-get-firmware.sh ] && install -D -m 755 "$SOURCE_DIR/install/firmware.sh" /usr/local/bin/xone-get-firmware.sh

for MODULE in xpad mt76x2u; do
if lsmod | grep -q "^$MODULE"; then
modprobe -r "$MODULE"
fi
done
else
[ -r "$LOG_FILE" ] && cat "$LOG_FILE" >&2
exit 1
fi

puts_success "Success! new changes applied to the system, continuing..."


######################################################
# Start of update AppImages and static binaries #
# Start of update AppImages and static binaries. #
######################################################

puts_info "Updating system AppImages and static binaries, continuing..."

user_agent="BrightSign/8.2.55.5 (XT1144) Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.3 Chrome/69.0.3497.128 Safari/537.36"

latest_release_url=$(curl -sL "https://api.github.com/repos/linuxhw/hw-probe/releases/tags/1.6" | grep -oE 'https://github.com/linuxhw/hw-probe/releases/download/1.6/hw-probe.*x86_64.AppImage' | head -n 1)

filename=$(basename "$latest_release_url")

download_appimage "$filename" "$latest_release_url" &
spinner
mv /Applications/hw-probe-* /Applications/hw-probe

latest_release_url=$(curl -sL https://api.github.com/repos/srevinsaju/Firefox-Appimage/releases/tags/firefox | grep -oE 'https://github.com/srevinsaju/Firefox-Appimage/releases/download/firefox/firefox.*x86_64.AppImage' | head -n 1)

filename=$(basename "$latest_release_url")

download_appimage "$filename" "$latest_release_url" &
spinner
mv /Applications/firefox-* /Applications/firefox

download_appimage "appimaged" "https://github.com/AppImage/appimaged/releases/download/continuous/appimaged-x86_64.AppImage" &
spinner
mv /Applications/appimaged /etc/skel/.local/bin
download_appimage "$filename" "$latest_release_url"

download_binary "zap" "https://github.com/srevinsaju/zap/releases/download/continuous/zap-amd64" &
spinner

download_appimage "nx-software-center" "https://github.com/Nitrux/nx-software-center/releases/download/latest/nx-software-center-latest-x86_64.AppImage"
spinner
mv /Applications/firefox-* /Applications/firefox

puts_success "System AppImages and static binaries have been updated, continuing..."

####################################################
# End of update AppImages and static binaries #
# End of update AppImages and static binaries. #
####################################################

puts_info "Regenerating initramfs for available kernels, continuing..."

# -- Update the initramfs.

update-initramfs -c -k all

puts_success "Success! The initramfs was regenerated for all available kernels, continuing..."


puts_info "Updating GRUB menu entries, continuing..."

# -- Update GRUB.
# -- Whenever we add new parameters, ensure that these are added to existing installations.
Expand All @@ -415,42 +357,45 @@ GRUB_FILE="/etc/default/grub"
BACKUP_FILE="/etc/default/grub.bak"

REQUIRED_PARAMS=(
"amdgpu.cik_support=1"
"amdgpu.ppfeaturemask=0xffffffff"
"amdgpu.si_support=1"
"amdgpu.vm_update_mode=3"
"apparmor=1"
"cfi=kcfi"
"hardened_usercopy=1"
"hpet=disable"
"init_on_free=1"
"intel_pstate=enable"
"libahci.ignore_sss=1"
"modprobe.blacklist=iTCO_wdt"
"modprobe.blacklist=sp5100_tco"
"nosgx"
"nvidia_drm.modeset=1"
"nvme_core.multipath=Y"
"overlayroot=tmpfs:swap=1,recurse=0"
"page_alloc.shuffle=1"
"quiet"
"radeon.cik_support=0"
"radeon.si_support=0"
"randomize_kstack_offset=on"
"rcu_nocbs=all"
"rcupdate.rcu_expedited=1"
"rcutree.enable_rcu_lazy=1"
"security=apparmor"
"slab_nomerge"
"slub_debug=FZ"
"usbcore.autosuspend=-1"
"vdso32=0"
"vsyscall=none"
"zswap.compressor=zstd"
"zswap.enabled=1"
"zswap.max_pool_percent=20"
"zswap.zpool=zsmalloc"
"splash"
"amdgpu.cik_support=1"
"amdgpu.ppfeaturemask=0xffffffff"
"amdgpu.si_support=1"
"amdgpu.vm_update_mode=3"
"apparmor=1"
"clocksource=tsc"
"hardened_usercopy=1"
"hpet=disable"
"init_on_free=1"
"intel_pstate=enable"
"libahci.ignore_sss=1"
"modprobe.blacklist=iTCO_wdt"
"modprobe.blacklist=sp5100_tco"
"nohz=on"
"nosgx"
"nvidia_drm.modeset=1"
"nvme_core.multipath=Y"
"overlayroot=tmpfs:swap=1,recurse=0"
"page_alloc.shuffle=1"
"quiet"
"radeon.cik_support=0"
"radeon.si_support=0"
"randomize_kstack_offset=on"
"rcu_nocbs=all"
"rcupdate.rcu_expedited=1"
"rcutree.enable_rcu_lazy=1"
"security=apparmor"
"slab_nomerge"
"slub_debug=FZ"
"splash"
"tsc=nowatchdog"
"tsc=reliable"
"usbcore.autosuspend=-1"
"vdso32=0"
"vsyscall=none"
"zswap.compressor=zstd"
"zswap.enabled=1"
"zswap.max_pool_percent=20"
"zswap.zpool=zsmalloc"
)

param_exists() {
Expand Down Expand Up @@ -566,13 +511,19 @@ if [ -n "$current_line" ]; then
fi
done

mapfile -t sorted_params < <(printf '%s\n' "${unique_params[@]}" | sort -f)
filtered_params=()
for param in "${unique_params[@]}"; do
if [[ " ${REQUIRED_PARAMS[*]} " == *" $param "* ]]; then
filtered_params+=("$param")
fi
done

updated_params="${sorted_params[*]}"
else
updated_params="${REQUIRED_PARAMS[*]}"
unique_params=("${filtered_params[@]}")
fi

mapfile -t sorted_params < <(printf '%s\n' "${unique_params[@]}" | sort -f)
updated_params="${sorted_params[*]}"

new_line="GRUB_CMDLINE_LINUX_DEFAULT=\"${updated_params}\""

if grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=' "$GRUB_FILE"; then
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.7.0
MINTARGET=3.7.1

# Define the name of the file and its checksum.
#
[OTA]
OTAFILE=ota-2024.10.31-17.42-amd64.squashfs
OTASUM=75a5dd93e4d78639c4d90f8ead777bc2
OTAFILE=ota-2024.12.04-18.20-amd64.squashfs
OTASUM=dff563e8af18d9a3d19cb443379c8cd5

# 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.10.31-17.42-amd64.squashfs,https://netactuate.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://netix.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://freefr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://phoenixnap.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://ufpr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://liquidtelecom.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://yer.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://newcontinuum.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs,https://versaweb.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.10.31-17.42-amd64.squashfs
MIRRORLIST=https://master.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://netactuate.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://netix.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://freefr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://phoenixnap.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://ufpr.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://liquidtelecom.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://yer.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://newcontinuum.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs,https://versaweb.dl.sourceforge.net/project/nitruxos/Updates/ota-2024.12.04-18.20-amd64.squashfs

0 comments on commit d67ba79

Please sign in to comment.