Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: TinyErestor on January 14, 2018, 08:45:38 AM

Title: new bootcode modopt
Post by: TinyErestor on January 14, 2018, 08:45:38 AM
because one of my computer needs an option to the module forcedeth, I have tc-config extended to react on kernel parameter modopt=.
This is a diff -u from the original tc-config of TC-8 to my changed one:
Code: (diff) [Select]
--- /etc/init.d/tc-config
+++ tc8-rootfs/etc/init.d/tc-config
@@ -60,6 +60,7 @@
                                xvesa* ) XVESA=${i#*=} ;;
                                rsyslog=* ) RSYSLOG=${i#*=}; SYSLOG=1 ;;
                                blacklist* ) BLACKLIST="$BLACKLIST ${i#*=}" ;;
+                               modopt* ) MODOPT="$MODOPT ${i#*=}" ;;
                                iso* ) ISOFILE=${i#*=} ;;
@@ -98,6 +99,13 @@
                echo "$i" | tr ',' '\n' | while read j ; do
                        echo "blacklist $j" >> /etc/modprobe.d/blacklist.conf
+       done
+if [ -n "$MODOPT" ]; then
+       mkdir -p /etc/modprobe.d
+       for i in $MODOPT; do
+               echo "options,$i" | tr ',' ' '  >> /etc/modprobe.d/options.conf

This causes for example the kernel argument modopt=forcedeth,msi=0 to generate a line
options forcedeth msi=0
to be put into /etc/modprobe.d/options.conf. By this, the modules foredeth will be loaded with the argument msi=0.

Because this is no bug resolution, I have put this into TCB talk.

Title: Re: new bootcode modopt
Post by: andyj on January 14, 2018, 09:47:48 AM
Another way would be to put /etc/modprobe.d/options.conf into it's own initrd and load it after rootfs in extlinux.conf. Then you don't have to update your version of the TC rootfs everytime there is a change.
Title: Re: new bootcode modopt
Post by: curaga on January 14, 2018, 10:28:24 AM
I don't think this is necessary, most modules accept such options directly on the kernel line. Try "forcedeth.msi=0", etc. Alternatively, blacklist it and load manually in bootlocal.sh.