Marc Singer wrote:
I know that I can detect an NSLU2 by looking at /proc/cpuinfo and checking the Hardware: line for the NSLU2 moniker. I can also detect whether or not APEX is installed on the system by calling apex-env and checking for a release version, though this is a little less reliable. It is possible that there is another system with APEX that isn't NSLU2, so I would rather not use that criteria. Is there another, or perhaps a best way to detect the presence of NSLU2 hardware?
From the first-stage boot-loader, second-stage boot-loader or userland level?
For userland, /proc/cpuinfo should be authoritative.For second-stage boot-loader, you can check for the same things that the stock NSLU2 RedBoot checks for before it boots (the SerComm trailer in the last block of flash, including a specific nslu2 product id which slugimage preserves on all images it creates). All custom firmware released for the NSLU2 contains this trailer (Vendor, Unslung, SlugOS, OpenWrt, Debian, Gentoo).
For first-stage boot-loader, you have to trust that the user installed the correct version of Apex on the device.
-- Rod