|
NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
How to enable kernel options?
Hello,
Can anyone tell me how to check if the following options are enable: Quote:
|
|
||||
These kinds of options are set (or unset) at the time the kernel is compiled. Each kernel will have a specific configuration file that is used to set the desired options, and then the kernel will be built with reference to the desired configuration file. The configuration files are found in the source code tree, in the directory usr/src/sys/arch/amd64/conf/, for example. For i386 you would replace "amd64" with "i386".
For example, the generic kernel distributed with the system is configured by the file called GENERIC. With that background, to answer your first question, you would look into the configuration file used to compile the binary kernel in question. If you're using a kernel supplied with the system this can be found on the web, e.g., http://ftp.netbsd.org/pub/NetBSD/Net...4/conf/GENERIC For the second question: If you want to change option values, or enable/disable options, then you need to create a new configuration file with all the options you want in it. This would often be done by taking an existing config file, like GENERIC, and editing it a bit. Then you would compile a new kernel using the new configuration file. To learn more about all this you can study the NetBSD Guide, Section 32 Compiling the kernel . Hope that helps. Last edited by IdOp; 12th November 2019 at 03:05 PM. Reason: pre-pend usr/ to directory; wording |
|
|||
Thank you for the information.
|
|
|||
I got it. Thanks.
|
|
||||
Quote:
Quote:
TBH, there's no need to either fetch the GENERIC config remotely or extract syssrc.tgz just to get the file, as config(1) can extract the configuration embedded in a loaded kernel ELF at any time with the -x option, and print it to stdout; For a quick config lookup, I keep this in my ~/.shrc: Code:
chkconf() { echo "Which option would you like to check?" read VAR if config -x /netbsd | grep -q $VAR; then echo found else echo not found fi }
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ |
|
||||
Quote:
Dropping it here as it may come in handy to others; it's by no means the perfect tool to automate the process, but at least returns a first draft for ad-hoc configurations Code:
#!/bin/sh if [ "X"$1 = X"-s" ]; then shift; VS="-v strip=1" fi /usr/bin/awk `echo ${VS:-"-v strip=0"}` ' BEGIN { progname = "deconf"; comment_chars = "#-#"; if (ARGC < 2) { print "Usage: " progname " [-s] GENERIC_FILE"; print "Reading dmesg(8) output from standart input" \ " and output config template."; bailout = 1; exit; } if ((getline < (gen = ARGV[1])) == -1) { print progname ": " gen ": not found or not readable" > "/dev/stderr"; bailout = 1; exit; } close(gen); ARGV[1] = "-"; # read output from dmesg from standart input } /^[a-z]+[0-9]+[ ]+at[ ]+[a-z]+[0-9]+/ { sub(/:$/, "", $3); dmesg[$1] = $3; } END { if (bailout) exit(1); while(getline < gen) { if (match($0, /^[a-z]+[*?0-9]+[ \t]+at[ \t]+[a-z]+[*?0-9]+/)) { split(substr($0, RSTART, RLENGTH), spec); gdev = ggdev = spec[1]; gwhere = ggwhere = spec[3]; matches = 0; sub(/[*?0-9]+$/, "", ggdev); sub(/[*?0-9]+$/, "", ggwhere); for(s in dmesg) { if ((substr(s, 1, length(s)-1) == ggdev) && (substr(dmesg[s], 1, length(dmesg[s])-1) == ggwhere)) { #print gdev " -> " gwhere " : " s " -> " dmesg[s]; if ((gdev ~ /[*?]+$/ && gwhere ~ /[*?]+$/) || (gdev == s && gwhere ~ /[*?]+$/) || (gdev == s && gwhere == dmesg[s]) || (gdev ~ /[*?]+$/ && gwhere == dmesg[s])) { matches++; delete dmesg[s]; continue; } } # phys can have any parent if ((substr(s, 1, length(s)-1) == ggdev) && ggwhere == "mii") { matches++; delete dmesg[s]; } } if (matches == 0) { if (!strip) print comment_chars $0; } else print; } else { if ((/^[ \t]*$/ || /^[ \t]*#/) && strip) continue; print; } } close(gen); matches = 0; for(s in dmesg) matches++; if (matches) { print "\n# deconfig orphaned records: "; for(s in dmesg) { print "#" s " at " dmesg[s]; } } } ' $@
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
enable php in apache2 | MatthiasKoch | OpenBSD Packages and Ports | 2 | 30th September 2016 11:54 AM |
OpenBSD 5.0 - How to enable dfs ? | mayuka | OpenBSD General | 5 | 13th November 2011 07:09 AM |
Enable SNMP? | dzudja100 | FreeBSD Ports and Packages | 1 | 20th May 2010 05:52 PM |
boot bug with USB enable | nORKy | FreeBSD Installation and Upgrading | 5 | 12th June 2008 04:56 PM |