setting kernel env variables

John Hay jhay at meraka.org.za
Wed Jan 31 06:25:34 UTC 2007


Hi,

I needed to be able to set the countrycode of my atheros card, but with
the arm that cannot use the loader yet, I tried to add it statically
with the env keyword in the kernel config file. Something like this:

env             "/conf/SMALL-ARM.env"

and then in that file:

hw.ath.countrycode="710"

When that didn't work, I looked through the code and found that the
arm kernel didn't use it. So I looked at how it was done on the i386
and did the same for the arm. So is this the right place to set
kern_envp or is there a better place?


Index: arm/xscale/ixp425/avila_machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/arm/xscale/ixp425/avila_machdep.c,v
retrieving revision 1.2
diff -u -r1.2 avila_machdep.c
--- arm/xscale/ixp425/avila_machdep.c	6 Dec 2006 06:34:54 -0000	1.2
+++ arm/xscale/ixp425/avila_machdep.c	16 Dec 2006 10:11:16 -0000
@@ -532,6 +532,9 @@
 	phys_avail[i++] = 0;
 	phys_avail[i] = 0;
 	
+	if (envmode == 1)
+		kern_envp = static_env;
+
 	/* Do basic tuning, hz etc */
 	init_param1();
 	init_param2(physmem);

John
-- 
John Hay -- John.Hay at meraka.csir.co.za / jhay at FreeBSD.org


More information about the freebsd-arm mailing list