WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: new bootcode modopt  (Read 534 times)

Offline TinyErestor

  • WikiUser
  • *
  • Posts: 15
new bootcode modopt
« on: January 14, 2018, 08:45:38 AM »
Hi,
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#*=} ;;
                        esac
                ;;
@@ -98,6 +99,13 @@
                echo "$i" | tr ',' '\n' | while read j ; do
                        echo "blacklist $j" >> /etc/modprobe.d/blacklist.conf
                done
+       done
+fi
+
+if [ -n "$MODOPT" ]; then
+       mkdir -p /etc/modprobe.d
+       for i in $MODOPT; do
+               echo "options,$i" | tr ',' ' '  >> /etc/modprobe.d/options.conf
        done
 fi

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.

Regards

Online andyj

  • Hero Member
  • *****
  • Posts: 622
Re: new bootcode modopt
« Reply #1 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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9879
Re: new bootcode modopt
« Reply #2 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.
The only barriers that can stop you are the ones you create yourself.