knulli-cfw / distribution

Main KNULLI distribution
https://knulli.org
Other
414 stars 27 forks source link

Knulli renames all my files to lowercase #81

Open erganmedia opened 3 months ago

erganmedia commented 3 months ago

Knulli build version

20240721

Your architecture

RG35XX H

Issue description

After using the network transfer feature to copy my portmaster files to the ports folder, knulli suddenly changed all my filenames (not only the files I copied) to lowercase. Now I lost all my Favourites and also all my cover images do not match anymore with the rom names, so I don't see any cover art anymore. I don't know if network transfer caused this, or if there is some weird knulli behaviour.

I am using a one card setup.

Detailed reproduction steps

my assumption is that this renaming was caused by the ext4 file format.

Details of any attempts to fix this yourself

No response

Details of any modifications you have made to Knulli.

none

Logs and data

No response

HoroTW commented 3 months ago

Hi there,

First of all, sorry to hear that!

Because ext4 is a case-sensitive filesystem (by default) and does not inherently change the case of filenames. In fact, it ensures that filenames retain their case-sensitivity, i.e. File.txt and file.txt are considered completely different files.... So it's unlikely that ext4 itself is the cause of your filenames being converted to lowercase...

I'm at a loss as to how this could happen but lets clear some more related things, maybe we can find out what happened:

  1. Did you use an SMB network share or how did you transfer the files (there are other options such as SFTP)
  2. What program did you use for the transfer?
  3. Are you using Windows as your operating system?

But even with all that, it is very unlikely that ALL files were changed to lowercase... However, I went ahead and checked Knullis Samba and mount settings, but I see nothing that would directly cause filenames to be converted to lowercase...

I'm not aware of any script in Knulli that would cause this... You mentioned you copied a port (these run scripts as part of their installation and some do rename things ... so maybe there is a way for that....)

  1. Which port(s) did you copy, maybe the problem lies in the script of the port

~Horo

erganmedia commented 3 months ago
  1. I believe it was the SMB network share because it appeared on my Mac as a network folder.
  2. Finder app in macOS
  3. macOS :)
  4. GTA Vice City, Need For Speed 2 SE, Tamagotchi, Pixelheat, Space Cadet Pinball.

But now that you mention it, it makes sense that one of those ports renamed everything. I believe that after trying the Tamagotchi, all my files were renamed. (at least this was when I realised it)

//edit: BTW, it was not possible to start the Need For Speed 2 SE port with Knulli. I checked the script and noticed that it renames some files to lowercase. Since I couldn't get the port to work, I suspect that this script might be causing the renaming issue. I also tried to install Need For Speed on Muos, and it worked fine. I'm not asking you to debug the PortMaster script for NFS, but if it indeed causes the renaming issue, it could potentially affect all Knulli users. You might find this information relevant.

Just in case you're interested, here's the script

#!/bin/bash

XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

if [ -d "/opt/system/Tools/PortMaster/" ]; then
  controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
  controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
  controlfolder="$XDG_DATA_HOME/PortMaster"
else
  controlfolder="/roms/ports/PortMaster"
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt
export PORT_32BIT="Y"

[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

get_controls

GAMEDIR=/$directory/ports/nfs2se
CONFDIR="$GAMEDIR/conf/"

CUR_TTY=/dev/tty0
$ESUDO chmod 666 $CUR_TTY

> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

cd $GAMEDIR

export LD_LIBRARY_PATH="/usr/lib/arm-linux-gnueabihf/":"/usr/lib32":"$GAMEDIR/libs/":"$LD_LIBRARY_PATH"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

$ESUDO rm -rf ~/.nfs2se
ln -sfv /$directory/ports/nfs2se/conf/.nfs2se  ~/

# Process directories
find . -depth -type d | grep -e "[A-Z]" | while read -r dir; do
    newdir=$(echo "$dir" | tr '[A-Z]' '[a-z]' | sed 's/-1$//')

    # Simple progress message
    echo "Renaming $dir" > "$CUR_TTY"

    mv "$dir" "$dir-1" > "$CUR_TTY"
    mv "$dir-1" "$newdir" > "$CUR_TTY"
done

# Process files
find . -type f | grep -e "[A-Z]" | while read -r file; do
    newfile=$(echo "$file" | tr '[A-Z]' '[a-z]' | sed 's/-1$//')

    # Simple progress message
    echo "Renaming $file" > "$CUR_TTY"

    mv "$file" "$file-1" > "$CUR_TTY"
    mv "$file-1" "$newfile" > "$CUR_TTY"
done

#export TEXTINPUTINTERACTIVE="Y"

$GPTOKEYB "nfs2se" -c "./nfs2se.gptk" &
$GAMEDIR/nfs2se
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0