Page 1 of 1

Hardware specific cheatcode/modules

Posted: 15 Jan 2017, 17:14
by markdown
Is it possible to trigger specific cheatcodes or load specific modules based on the detected hardware?

I use Porteus as a Live OS on multiple systems and some of the blacklists in my modprobe config are contradictory between the various systems. Also certain optimizations for HiDPI displays will look ridiculous on regular displays. It would be ideal to trigger these changes only if compatible hardware is detected.

Thanks.

Re: Hardware specific cheatcode/modules

Posted: 16 Jan 2017, 10:23
by tome
You can try add test to your /etc/rc.d/rc.local

For chosen hardware execute in terminal
dmidecode -t 1 | grep "Serial Number"

next copy your Serial Number, replace mynum below with copied Serial Number, and paste all to /etc/rc.d/rc.local:

Code: Select all

check1=`dmidecode -t 1 | grep "Serial Number"`
[[ $check1 == *"mynum"* ]] && activate /your/path

Re: Hardware specific cheatcode/modules

Posted: 18 Jan 2017, 10:32
by markdown
tome wrote:You can try add test to your /etc/rc.d/rc.local

For chosen hardware execute in terminal
dmidecode -t 1 | grep "Serial Number"

next copy your Serial Number, replace mynum below with copied Serial Number, and paste all to /etc/rc.d/rc.local:

Code: Select all

check1=`dmidecode -t 1 | grep "Serial Number"`
[[ $check1 == *"mynum"* ]] && activate /your/path
Thanks, but it doesn't seem to work when blacklisting modules. Here is my code:

Code: Select all

check1=`lspci | grep -i broad`
[[ $check1 == *"Broadcom Corporation BCM4350 802.11ac Wireless Network Adapter (rev 08)"* ]] && echo "blacklist wl" > /etc/modprobe.d/b43_blacklist.conf
The blacklist file is rightly created only on machines with the specific hardware, but it doesn't have the necessary effect.

Is it possible that the rc.local scripts are run much later than the rootcopy stage? That might explain why creating a static blacklist file in rootcopy works, but a dynamically generated file via rc.local doesn't.

Re: Hardware specific cheatcode/modules

Posted: 18 Jan 2017, 10:47
by Bogomips
markdown wrote:Is it possible that the rc.local scripts are run much later than the rootcopy stage?
Believe that to be the case. If look at /var/log/porteus-livedbg note rootcopy type mentioned there, so processed at initrd stage AFAIK.

Re: Hardware specific cheatcode/modules

Posted: 18 Jan 2017, 19:25
by tome
Is it possible that the rc.local scripts are run much later than the rootcopy stage?
It is always.

Maybe instead of "echo "blacklist wl" > /etc/modprobe.d/b43_blacklist.conf" try "modprobe -r wl"