site  contact  subhomenews

Hopeful fix fstrim on USB SSD

January 28, 2025 — BarryK

I posted about compiling the kernel 6.12.11 with change to hopefully support TRIM over USB:

...there is also a link to forum discussion.

After more reading, I have devised code in the 'init' script in the initrd, that intends to detect if a USB SSD supports TRIM, then enables usage of fstrim. This is the modified code:

###execute TRIM on ssd###
TRIMflg=''
if [ "$WKG_FS" == "ext4" ];then #200302 200621 now have full hdparm.
#20250127 discard_granularity test not work 6.12.x kernel...
#TESTdiscard="$(cat /sys/block/${WKG_DRV}/queue/discard_granularity 2>/dev/null)"
TESTdiscard="$(cat /sys/block/${WKG_DRV}/queue/discard_max_bytes 2>/dev/null)"
if [ -n "$TESTdiscard" ];then
if [ "$TESTdiscard" != "0" ];then
TRIMflg='1'
fi
fi
#20250128 hdparm detect and CONFIG_USB_UAS kernel now maybe can run fstrim...
if [ "$TESTdiscard" == "0" ];then
hdparm -I /dev/${WKG_DRV} | grep 'Data Set Management TRIM supported'
if [ $? -eq 0 ];then
#fstrim may still not work, depends if usb interface supports usb-attached-scsi
#ref: https://askubuntu.com/questions/860618/fstrim-on-external-ssd-drives-dont-work
#ref: https://www.jeffgeerling.com/blog/2020/enabling-trim-on-external-ssd-on-raspberry-pi
#figuring out my own method, this matches scsi number to drive:
T1="$(ls -d -1 /sys/bus/scsi/drivers/sd/*/block/${WKG_DRV} | head -n 1)"
#ex: /sys/bus/scsi/drivers/sd/6:0:0:0/block/sdb
if [ -n "$T1" ];then
T2="$(echo -n "$T1" | rev | cut -f 3 -d '/' | rev)" #ex: 6:0:0:0
T3="$(find /sys/devices/ -path "*/scsi_disk/${T2}/*" -name provisioning_mode)"
#ex: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/host6/target6:0:0/6:0:0:0/scsi_disk/6:0:0:0/provisioning_mode
if [ -n "$T3" ];then
T4="$(cat "$T3")"
if [ "$T4" == "full" ];then
echo unmap > $T3
#ex: this changes /sys/block/sdb/queue/discard_max_bytes from 0 to 4294966784
fi
#test again...
TESTdiscard="$(cat /sys/block/${WKG_DRV}/queue/discard_max_bytes 2>/dev/null)"
if [ "$TESTdiscard" != "0" ];then
TRIMflg='1'
fi
fi
fi
fi
fi
fi
export TRIMflg #read in /sbin/fscheck

Now, if the USB interface supports USB-attached-SCSI-protocol (UASP), then hopefully fstrim will work after doing the above.  

Tags: easy

Kernel 6.12.11 compiled on Easy Scarthgap

January 28, 2025 — BarryK

Easy Scarthgap 6.5.6 has the 6.12.10 kernel. I have compiled 6.12.11, making these two changes (bold):

# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
# CONFIG_USB_XHCI_DBGCAP is not set
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PCI_RENESAS=y


# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_ONETOUCH=m
CONFIG_USB_STORAGE_KARMA=m
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_STORAGE_ENE_UB6250=y
CONFIG_USB_UAS=y

The first change was due to I read somewhere that a USB3 interface, with a Renesas chip, was being treated as USB2 only, and enabling this fixed it.

The second change is in response to discussion here:

https://forum.puppylinux.com/viewtopic.php?t=13709

...but I still don't know how that helps to detect if a USB SSD supports trim.

I recently compiled 6.12.10 kernel for Easy Daedalus, see blog post:

...and will leave it at that.    

Tags: easy

OpenEmbedded Scarthgap revision-4 compile

January 27, 2025 — BarryK

This is a complete recompile in my fork of OpenEmbedded/Yocto of the packages used to build EasyOS Scarthgap-series. This is based upon OE/Yocto release 5.0.6:

https://wiki.yoctoproject.org/wiki/Releases

Which I have named "revision-4", and all the binary packages have "-r4" in their name, for example "acpid-2.0.34-r4-nocona-64.tar.xz". The current release of EasyOS, 6.5.6, is built with "revision-3" build in OE, which is based on the Yocto 5.0.4 release. Here are the package version changes r3 to r4:

chromium-x11     131.0.6778.85 131.0.6778.139
expat 2.6.3 2.6.4
flatpak 1.15.6 1.15.8
go 1.22.6 1.22.8
libgsf 1.14.52 1.14.53
librsvg 2.57.1 2.58.2
libstd-rs 1.75.0 1.80.1
libxml2 2.12.8 2.12.9
mbedtls 3.6.1 3.6.2
openvpn 2.6.10 2.6.12
orc 0.4.39 0.4.40
php 8.2.20 8.2.26
pup-tools 20221101 20250115
python3 3.12.6 3.12.8
python3-django 5.0.9 5.0.10
python3-lxml 5.0.0 5.0.2
python3-requests 2.31.0 2.32.3
python3-tornado 6.4 6.4.2
python3-urllib3 2.2.1 2.2.2
python3-werkzeug 3.0.3 3.0.6
qemu 8.2.3 8.2.7
sip 6.8.3 6.8.6
sqlite3 3.45.1 3.45.3
systemd-boot 255.4 255.13
tzdata 2024a 2024b
vim 9.1.0698 9.1.0764
xserver-xorg 21.1.13 21.1.14

Chromium needs special mention, as we were stuck, the Chromium developers upped the minimum required rust version from 1.75 to 1.80. The OE/Yocto Scarthgap release only has the former. The guys though, have a way around this, with something called a "meta-lts-mixins" layer, see here:

https://git.yoctoproject.org/meta-lts-mixins

...what that means practically, is that this has backported rust 1.80.1 to Scarthgap. See my post here:

https://github.com/OSSystems/meta-browser/pull/863#issuecomment-2615264822   

Tags: easy

Fix for version depth limit

January 25, 2025 — BarryK

Alfons discovered a little bug. He sent me a snapshot of Easy Version Control (in the Filesystem menu), showing that the depth-limit is 5, yet there are now 6 versions. In other words, when he updated to Scarthgap 6.5.6, it was the 6th, so the oldest version, 6.4.4, should have been deleted.

The cause was that /var/local/version-history-depth did not exist. This is read by the 'init' script in the initrd, but if the file doesn't exist then depth calculation will be messed up.

File /var/local/version-history-depth only gets created when Easy Version Control is run, and it looks like Alfons had never run it before. And of course the session has to be saved after running Easy Version Control.

I fixed it in the 'init' script by creating it if it doesn't exist, and assigning a default of "5".    

Tags: easy

Linux kernel 6.12.10 compiled in Easy Daedalus

January 24, 2025 — BarryK

I posted about compiling 6.12.10 for Easy Scarthgap:

...as well as the droidcam v4l2loopback-dc.ko and broadcom wl.ko kernel modules.

Ditto for Easy Daedalus.

Also have now compiled the NVIDIA 565.77 kernel modules and packaged as an SFS (installable vis SFSget), for both Scarthgap and Daedalus.

The next release of Daedalus will have the 6.12.10 kernel. Ongoing for both, now using the 6.12.x kernel.    

Tags: easy

Fix partition icons redraw every bootup

January 23, 2025 — BarryK

You have probably noticed this. When the desktop starts up, some of the partition icons get redrawn, some don't. The internal drive sd* partitions do not, the internal nvme* partitions do get redrawn, as do any USB partitions.

The internal nvme* parttions icons do not need to be redrawn, as they are always there, and the device name will not change.

This bug has been there since 2018! That's how long it has taken me to fix it. This morning decided, about time to fix it, so did. It makes the startup a bit faster.

Here is the commit:

https://github.com/bkauler/woofq/commit/f6ce712ec207bb8c3f67e7c6454c3d674950fbd4  

...it was just a stray space character making two strings unequal when they should have been equal.    

Tags: easy

EasyOS Scarthgap-series version 6.5.6 released

January 22, 2025 — BarryK

The previous release, version 6.5.4.2, was released on January 12:

Note that the Daedalus-series latest is 6.5.5. This is a separate build of EasyOS, built with Devuan DEB packages, whereas Scarthgap is built from packages compiled by me in OpenEmbedded.

If you are running Scarthgap 6.5.4.2 and happy with it, there is no need to update to 6.5.6; in fact, there could be new issues|problems with the kernel bump from 6.6.x to 6.12.x. This latest version has targeted working on a very recent laptop with Intel Ultra 7 CPU and integrated GPU. Highlights:

Release notes:

http://distro.ibiblio.org/easyos/amd64/releases/scarthgap/2025/6.5.6/release-notes.htm

Download:

http://distro.ibiblio.org/easyos/amd64/releases/scarthgap/2025/6.5.6/

Feedback is welcome at the forum:

https://forum.puppylinux.com/viewtopic.php?p=140974#p140974

Have fun!      

Tags: easy

EasyOS audio and video work on Zenbook S 13

January 22, 2025 — BarryK

This has been a saga of about a week. I posted about purchase of Asus Zenbook S 13, with Intel Ultra 7 CPU:

And attempting to get Linux working on it:

With EasyOS, as soon as the i915 kernel GPU module loads, get a pink screen and only recoverable by holding down the power button.

I posted about examining the modules loaded by Manjaro, and created a config file to compile the 6.12.10 kernel for EasyOS Scarthgap. Still only a pink screen. Examined errors in "dmesg", did a lot of online reading. This went on for many days, but here is the working end result...

Reading dmesg, the GPU was failing to initialize, and reported as "wedged".  The issue seems to be related to the amount of memory allocated to the GPU; in the UEFI-setup it is set to 64M -- online reports are that increasing to 256MB fixes the problem. However, in my UEFI-setup there are only two choices, 32MB or 64MB.

Another recommendation is "intel_iommu=off" in the kernel commandline. Yes, that works, get a desktop. However, that seems a bit drastic, and another option "intel_iommu=igfx_off" works.

With the latter, the GPU still works; however, is disabled in VMs (Virtual Machines); at least that is what I uderstand from online reading. I can live with that.

I'm going to put "intel_iommu=igfx_off" as the default on the kernel commandline for the EasyOS USB-stick.

Note also, the 6.12.10 kernel, with updated firmware, audio works from the internal loadspeakers.

There is still a mystery; Manjaro does not require that "intel_iommu=igfx_off". I suppose there is some other kernel config setting that I did not pick up on.

Anyway, I was very happy today, seeing the desktop come up, and audio working!

Kernel source, patches and config here:

https://distro.ibiblio.org/easyos/source/kernel/6.12.x/6.12.10-20250121/

...the broadcom wl.ko and droidcam v4l2loopback-dc.ko compiled successfully. Running the kernel right now, aufs working ok. I will probably bump Easy Scarthgap and Daedalus to the 6.12.x kernel from now on.

EDIT:
Very interesting, the Manajaro kernel has been configured with this:

# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set

whereas, in EasyOS kernel, it is:

CONFIG_INTEL_IOMMU_DEFAULT_ON=y

So Manjaro kernel is defaulting to Intel IOMMU turned off. Looking at the grub bootup, the kernel commandline:

lang=en_US keytable=us tz=UTC misobasedir=manjaro misolabel=MANJARO_XFCE_2421 quiet systemd.show_status=1 splash apparmor=1 security=apparmor driver=nonfree nouveau.modeset=0 i915.modeset=1 radeon.modeset=1

...not turned on there, so Manjaro has avoided the problem by running with "Intel_iommu=off". Hmmm, perhaps EasyOS is doing it a better way.       

Tags: easy