Hardware specific cheatcode/modules

Post here if you are a new Porteus member and you're looking for some help.
markdown
White ninja
White ninja
Posts: 8
Joined: 03 Jan 2017, 11:52
Distribution: porteus
Location: marktown

Hardware specific cheatcode/modules

Post#1 by markdown » 15 Jan 2017, 17:14

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.

tome
Contributor
Contributor
Posts: 675
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Russia is causing the immense damage to humanity
Contact:

Re: Hardware specific cheatcode/modules

Post#2 by tome » 16 Jan 2017, 10:23

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
You have mind and feelings. Be wise and clever.

markdown
White ninja
White ninja
Posts: 8
Joined: 03 Jan 2017, 11:52
Distribution: porteus
Location: marktown

Re: Hardware specific cheatcode/modules

Post#3 by markdown » 18 Jan 2017, 10:32

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.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Hardware specific cheatcode/modules

Post#4 by Bogomips » 18 Jan 2017, 10:47

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.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

tome
Contributor
Contributor
Posts: 675
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Russia is causing the immense damage to humanity
Contact:

Re: Hardware specific cheatcode/modules

Post#5 by tome » 18 Jan 2017, 19:25

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"
You have mind and feelings. Be wise and clever.

Post Reply