5 Replies Latest reply on Aug 30, 2005 2:36 PM by Jarrod Boland

    Grammar for modules.conf

    Erik Johannessen

      Has anyone written a grammar for Modules.conf for Redhat or found one that works well? The file seems to have quite the complicated layout, and other than just using the generic grammar, I don't see a neat way of addressing it. (and thats hardly neat)


      - Erik Johannessen

        • 1. Re: Grammar for modules.conf

          Can you post an example file?

          • 2. Re: Grammar for modules.conf
            Erik Johannessen

            In its simplest form:


            alias parport_lowlevel parport_pc

            alias eth0 3c59x

            alias sound-slot-0 i810_audio

            post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :

            pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :

            alias usb-controller usb-uhci

            alias scsi_hostadapter qla2300

            options scsi_mod max_scsi_luns=4



            The man page says:

            The configuration file consists of a set of lines.

            All empty lines, and all text on a line after a '#', will be ignored.

            Lines may be continued by ending the line with a '\'.

            The remaining lines should all conform to one of the following formats:


            above module module_list

            alias alias_name result

            below module module_list

            define VARIABLE WORD



            elseif EXPRESSION


            if EXPRESSION

            include PATH_TO_CONFIG_FILE


            install module command ...


            options module MODULE_SPECIFIC_OPTIONS










            probe name module_list

            probeall name module_list

            prune filename

            post-install module command ...

            post-remove module command ...

            pre-install module command ...

            pre-remove module command ...

            remove module command ...

            persistdir directory_name


            All arguments to a directive will be processed to handle shell meta-

            characters, which means that "shell tricks" like wild-cards and

            commands enclosed in back-quotes can be used:



            path[net]=/lib/modules/`uname -r`/net



            I'd be happy with one that can handle the simple form for now ;)



            alias scsi_hostadapter aic7xxx

            • 3. Re: Grammar for modules.conf
              Sean Berry

              gemsbl1d% cat //rac10g1poc/etc/modules.conf

              alias eth0 tg3

              alias eth1 tg3

              alias scsi_hostadapter mptbase

              alias scsi_hostadapter1 mptscsih

              alias scsi_hostadapter0 qla2300_conf

              alias scsi_hostadapter2 qla2300

              alias scsi_hostadapter3 qla2300_conf

              alias scsi_hostadapter4 qla2300

              alias usb-controller usb-ohci

              options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

              options scsi_mod max_scsi_luns=128

              options qla2300 ql2xfailover=1 ql2xmaxqdepth=64 qlport_down_retry=16 qlogin_retry_count=1 ql2xuseextopts=1

              alias eth2 e1000

              alias eth3 e1000

              alias bond0 bonding

              alias bond1 bonding

              options bond0 mode=1 miimon=100 downdelay=200 updelay=200

              options bond1 -o bonding1 mode=1 miimon=100 downdelay=200 updelay=200


              • 4. Re: Grammar for modules.conf
                Erik Johannessen

                You can use the /etc/resolv.conf grammar, it seems to work for the basic format of the modules.conf file.


                Still would be nice to have a complete grammar file for it.

                • 5. Re: Grammar for modules.conf

                  It looks like you need something with a simple hierarchical format. You might try taking the httpd.gm rules that start and end sections and apply those to the "if/else" sections of this file. Unfortunately, I don't have a lot of time to write grammars these days. I'll try to take a peek at it in a week or two.