jmcerrejon / PiKISS

PiKISS for Raspberry Pi: A bunch of scripts with menu to make your life easier.
http://misapuntesde.com
MIT License
892 stars 92 forks source link

Pi detection broken on some kernels #197

Closed theofficialgman closed 1 year ago

theofficialgman commented 1 year ago

It appears that the custom /proc/cpuinfo text is not available in some kernels. We (at Pi-Apps) have been receiving error logs from your software failing to install due to checking /proc/cpuinfo for information that does not exist

eg:

OS: Debian GNU/Linux 12 (bookworm)
OS architecture: 64-bit
Last updated Pi-Apps on: 11/11/2023
Latest Pi-Apps version: 11/11/2023
Kernel: aarch64 6.1.61-v8+
Device model: Raspberry Pi 4 Model B Rev 1.5 
Cpu name: Cortex-A72
Ram size: 7.63 GB
Raspberry Pi OS image version: 2023-10-10
Language: en_US.UTF-8

BEGINNING OF LOG FILE:
-----------------------

Sorry. PiKISS is only available for Raspberry Pi boards.
Failed to install piKiss!

Failed to install piKiss!
◢◣Need help? Copy the ENTIRE terminal output or take a screenshot.
Please ask on Github: https://github.com/Botspot/pi-apps/issues/new/choose
Or on Discord: https://discord.gg/RXSTvaUvuu

your code checking:

    local IS_RASPBERRYPI
    IS_RASPBERRYPI=$(grep </proc/cpuinfo 'BCM2708\|BCM2709\|BCM2835\|BCM2711')
    cd "$INSTALL_DIR" || exit 1

    if [[ -z $IS_RASPBERRYPI ]]; then
        echo "Sorry. PiKISS is only available for Raspberry Pi boards."
        exit 1
    fi

the users are running kernels that identify as 6.1.61-v8+ and 6.1.61-v8_16k+. It is possible these are testing kernels and will be pushed to all users soon on piOS. Your software will also fail to install on pi5 regardless when following install instructions -> curl -sSL https://git.io/JfAPE | bash

Your method of checking is unstable and you should consider instead checking the devicetree compatible string for matches

    if ! grep -q </proc/device-tree/compatible 'bcm2712\|bcm2711\|bcm2837\|bcm2836\|bcm2835'; then
        echo "Sorry. PiKISS is only available for Raspberry Pi boards."
        exit 1
    fi
jmcerrejon commented 1 year ago

Thank.

It's weird. I installed it yesterday with no issues, but now I'm getting the message you mentioned. I've added the code you sent me but is not working. I removed that IF (temporarily) and I'm gonna check what's going on.

jmcerrejon commented 1 year ago

Fixed. My fault 😅

Thanks for all.