-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with product_family in docker on a Synology nas #293
Comments
How is this line executed? Line 219 should be Line 219 in 89853fa
|
Actually it should be: - if [ -f /sys/devices/virtual/dmi/id/product_name ] || [ -f /sys/devices/virtual/dmi/id/product_family ]; then
+ if [ -f /sys/devices/virtual/dmi/id/product_name ] && [ -f /sys/devices/virtual/dmi/id/product_family ]; then |
Because it's hitting the
|
So, we need a different test, to avoid the use of an absent file: if [ -f /sys/devices/virtual/dmi/id/product_name ]; then
# Get model, remove possible null byte
product_name=$(tr -d '\0' < /sys/devices/virtual/dmi/id/product_name)
sys_model="$(echo "$product_name")"
if [ -f /sys/devices/virtual/dmi/id/product_family ]; then
product_family=$(tr -d '\0' < /sys/devices/virtual/dmi/id/product_family)
sys_model="$(echo "$product_name" | grep "$product_family")"
fi
# If product_family is not contained in product_name, both are shown
if [ -z "$sys_model" ]; then
sys_model="${product_family} ${product_name}"
fi
elif [ -f /sys/firmware/devicetree/base/model ]; then Edit: |
Promofaux found a case where In this case, the current code fails. Are there cases where only |
Actually, I don't know - and worse: I don't know how to test this. We can't check all devices that exist out there. Therefore we should assume there are devices that have only a |
Do we even need it? It's only used in Line 857 in 6676f56
|
Because mega is bigger and we can show more information, like this. |
It just seems like a lot of code to possibly spit out Lines 218 to 268 in 6676f56
Screenshot from a raspberry pi 4 |
This is the PR, including the discussion: |
Hmmm, the code that was removed would work on an Rpi:
So was the PR to change it so that device name could only be derived on an x86 machine? |
No. The check is still in there. Line 229 in 6676f56
|
My bad - I missed that entirely! OK, if I extract that I can see the model number when running directly on the pi:
But from within the container it does not work
No biggy I guess! |
Inside containers are very difficult to identify the hardware. |
Figuring out the base device from within a script running in a docker container might be out-of-scope for |
I think it's possible (or at least easier) if the docker socket ( It could be possible using external software, but I think we don't want to add a new dependency just to be able to get this information. |
I already think it's a lot of code just for outputting the device - imagine what I would think about adding in special cases for docker ;) |
Most is the code for cleaning unwanted stuff. |
Note: The command |
Do you think we should add it as an additional source? |
I don't think this will work... Inside a container is not possible to access all hardware info (this is intentional, for security reasons). I added the code to show the Docker Tag inside containers. |
@yubiuser Just seen this and thought it'd be worthwhile to point out that the key is lowercase in the kernel (but you |
Better, but not good ;-)
|
So ... this raises the question: What is the content of |
Some further ideas: dmidecode --type processor
lshw -C CPU
lscpu
If they return empty for you, you should check what the commands return without |
Are you sure this commands are available everywhere? Note: none of the commands above are available inside our container. Since we are going to add PADD on
|
|
pi@pi4:~ $ sudo dmidecode
# dmidecode 3.2
Scanning /dev/mem for entry point.
# No SMBIOS nor DMI entry point found, sorry.
|
Fix released with https://github.com/pi-hole/PADD/releases/tag/v3.10.0 |
The below line path does not appear to exist when I run on docker on my Synology NAS, however I do not see the same thing in docker on a raspberry Pi
PADD/padd.sh
Line 222 in 89853fa
The text was updated successfully, but these errors were encountered: