Closed jadupl2 closed 2 years ago
That's correct. The armhf version of Raspberry Pi OS is based on Raspbian, arm64 version is based on Debian.
How can a script check to see if it's running on a raspberry pi ?
On Tue, Mar 15, 2022 at 11:11 AM XECDesign @.***> wrote:
That's correct. The armhf version of Raspberry Pi OS is based on Raspbian, arm64 version is based on Debian.
— Reply to this email directly, view it on GitHub https://github.com/RPi-Distro/repo/issues/293#issuecomment-1068101871, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQUGCMJGPITSHNNIYB72HLVACSC5ANCNFSM5QY7MCIA . You are receiving this because you authored the thread.Message ID: @.***>
How can a script check to see if it's running on a raspberry pi ?
What are you checking exactly? Somebody could be running Raspbian on a system that's not a Raspberry Pi, so checking the OS wouldn't necessarily be 100% accurate.
You could check that the architecture with dpkg --print-architecture
, if that's what you want to check.
If you actually need to know whether you're running on a pi, regardless of the architecture, you can look at /proc/cpuinfo and look at the Hardware
field. Or, you can look at /proc/device-tree/model
.
I'm running a post-installation script that creates a new user with the same group of the 'pi' user. Doing that only on Raspberry Pi. I will use info in /proc/cpuinfo Thank You very much
On Tue, Mar 15, 2022 at 11:19 AM XECDesign @.***> wrote:
What are you checking exactly? Somebody could be running Raspbian on a system that's not a Raspberry Pi, so checking the OS wouldn't necessarily be 100% accurate.
You could check that the architecture with dpkg --print-architecture, if that's what you want to check.
If you actually need to know whether you're running on a pi, regardless of the architecture, you can look at /proc/cpuinfo and look at the Hardware field. Or, you can look at /proc/device-tree/model.
— Reply to this email directly, view it on GitHub https://github.com/RPi-Distro/repo/issues/293#issuecomment-1068111680, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQUGCIPHYFS2YUMWB7NZTTVACS6VANCNFSM5QY7MCIA . You are receiving this because you authored the thread.Message ID: @.***>
Command 'lsb_release -a' or 'cat /etc/os-release' or 'cat /usr/lib/os-release' return 'debian' on 64 bits version instead of 'raspbian' Would be nice if this could be fixed, many scripts check the O/S name when running.
Thank You
------ 32 bits of Raspbian
$ cat /usr/lib/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=raspbian <<<<<<<<<<<<<<<<<< ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" jacques@raspi0:/etc $
----- 64 bits of Rapbian
jacques@raspi8:~ $ cat /usr/lib/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian <<<<<<<<<<<<<<<<<<< HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" jacques@raspi8:~ $