USB key && can't mount /root during boot

2010-10-23 Thread Matthias Apitz

Hello,

I have now again the same problem (see Subject) again with a new laptop
Acer Aspire One D250 and neither of the two values in loader.conf:


kern.cam.boot_delay="1"

kern.cam.scsi_delay="1"

seems to help. The 10 sec delay is not even visible during the boot, the
message to enter manually the root device just pops up without any
delay. What does this mean?

Thanks

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re[2]: sysconf -- a sysctl(8)-like utility for managing /etc/rc.conf et. al.

2010-10-23 Thread Anthony Pankov
Greetings.

Just for note.

Some time ago i thought about the same problem.
I started something then had delayed it forever in favour of fast wrong
way.

So, the aim was:

---
NAME
 modcfg - modify configuration

SYNOPSIS
 modcfg  -f config_file -t config_type {-s param=val | -u param}
 modcfg -l
 modcfg -i plugin

DESCRIPTION
 The modcfg utility modifies configuration file in
 accordance to parameters.

 The following options are available:
 -f config_file- the file itself which to be modified
 -t config_type- type of config_file. Type specifies the internal
 structure of config_file, or, more roughly,
 program which this file belongs to. To
 list available types see -l option.
 -s param=val - set configuration parameter 'param' to value
'val'.
 -u param - unset configuration parameter 'param' (or set it to 
default).

 -l   - list all supported types of config files.

 -i plugin- install plugin 'plugin' for modcfg utility.
Plugin is used to support additional configuration file 
type.

EXAMPLES
 The command
  modcfg -f /etc/rc.conf  -t rc  -s keymap=ru.cp1251
 sets parameter 'keymap' to value 'ru.cp1251'in file rc.conf.
 
 The command
  modcfg -f /etc/rc.conf  -t rc  -u keymap
 resets parameter 'keymap' to default value.

 To install obtained plugin 'samba.mcfg' use
  modcfg -i samba.mcfg
 After that configuration type 'samba' will be supported.
 
---

INTERNALLY

 modcfg itself is very simple. It parse command line options, then load
 plugin (module) for specified 'config_type', then call _set(file,param,
 value) or _unset(file,param) function from this module.
 So, plugin (module) should have functions such as:
  _set(file, param, value) or, better name, {$type}_set. rc_set, for
  example.
  _unset(file, param)
  _description - for display in module list.

FUTURE
 Of course, better way is to run modcfg as:
  modcfg rc {-s ... | -u ...}
 i.e. reduce "-f /etc/rc.conf  -t rc" to the key "rc",
 i.e. add another call scheme
  modcfg subsystem {-s ... | -u ...}

 For rc it is trivial. But in general, for all installed programs and
 they instances, it is not possible now.



Wednesday, October 13, 2010, 3:06:25 AM, you wrote:

DT> On Tue, 2010-10-12 at 12:10 -0700, Doug Barton wrote:
>> On 2010-10-11 at 10:40 -0700, Doug Barton wrote: 
>> | So to summarize, the general idea is a good one and needed, and an area
>> | that I'd like to see more work in. Perhaps it might be a good idea to
>> | move the discussion about that to freebsd...@?
>> |
>> |On 2010-10-11 at 12:22 -0700, Devin Teske wrote: 
>> |> I'll look into signing up for the rc mailing list (didn't see that when
>> |> I checked last -- I'll have to look again). Maybe I'll post v2.0 to
>> |> there (but will cc back hackers cause I know folks may not be part of
>> |> both).
>> 
>> The canonical way to deal with that is to post the message to the proper
>> list (-rc@), then post a brief note to the other list (-hackers@) saying
>> where the discussion is being continued. We discourage people from
>> cc'ing multiple FreeBSD lists.


DT> This thread is moving over to the -rc@ list.
DT> New thread: sysrc(8) -- a sysctl(8)-like utility for managing rc.conf(5)

DT> The first post to the -rc@ list will be version 2.0 of the script which
DT> attempts to address the following (which were discussed in this thread
DT> here on -hackers@):

DT> 1. Style -- remove some personal styles in favor of standardized styles.
DT> (the FreeBSD environment doesn't need all the extra things that are
DT> required to run in an embedded environment -- which the first version
DT> was coded for)

DT> 2. Remove a disgusting-amount of comments (the first release of the
DT> script had a hurdle to climb in that it had to establish rapport with
DT> the targeted audience -- y'all).

DT> 3. Remove shell inheritance of SUCCESS/FAILURE (this was silly for a
DT> finished product).

DT> 4. Remove unnecessary code-sense (some things just don't need to be
DT> tested for in a known environment -- such as FreeBSD vs. embedded).

DT> 5. Remove dependency checks (have(), depend(), and show_deps() are
DT> gone).

DT> 6. Remove fake "function" keywords (public objections win)

DT> 7. Rename sysrc() function to sysrc_get() to:
DT> a. prevent confusion between the script and the internal function
DT> b. to coincide with the remainder of related functions (sysrc_get,
DT> sysrc_set, sysrc_find, and sysrc_desc).

DT> 8. Fix sysrc_get() function to mask positional parameters (don't expand
DT> "1", "2", etc.)

DT> 9. Fix sysrc_get() function to clean the environment prior to sourcing
DT> rc.conf(5) files (preventing expansion of normals such as PS1, TERM,
DT> etc.)

DT> 10. New function: `sysrc_find $varname'
DT> Find which file holds the effective last-assignment to a given variable
DT> within the rc.conf(5) file(s). If the variable is found in any of the
DT> rc.conf(5) 

Re: Tested wanted: BSD-licensed libgcc replacement, libcompiler_rt

2010-10-23 Thread Ed Schouten
Hi all,

* Ed Schouten , 20101022 16:30:
> At EuroBSDCon I was talking with some committers active in the area of
> Clang (brooks, kwm, others) about replacing our libgcc shipped with GCC
> 4.2.1 with a BSD-licensed version. The LLVM folks have a BSD licensed
> implementation called libcompiler_rt. See:
> 
>   http://compiler-rt.llvm.org/

I was talking with Robert Watson about this the other day. The codebase
of compiler-rt also contains the libBlocksRuntime.so library, which
is fundamental in making Grand Central Dispatch (GCD) work. Because of
its small size (12 KB), I think I'll also include it in the import.

This means that after the import, libdispatch is the only port needed to
make Grand Central Dispatch work on FreeBSD HEAD.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpssyE3e4sFK.pgp
Description: PGP signature


Re: Radeon DRI/3D status

2010-10-23 Thread Juergen Lock
In article <20101019204409.ga5...@logik.internal.network> you write:
>Hello.
Hi!
>
>What's the current status of DRI/3D support with the 4xxx range of ATI
>cards?
>
>I'm on 8.0-RELEASE and have just installed a (borrowed) 4870 card. I
>get working dual monitor support but only software rasterization in
>xorg.
>
>The intention is to replace a broken x1950 card with something at least
>slightly newer but I can't find any real information (other than an
>apparently outdated wiki page) that suggests anything is or isn't
>supported.

 See /usr/ports/UPDATING entry from 20100207, you need to define
WITHOUT_NOUVEAU to get opengl on Radeon HD [234]xxx.

 HTH,
Juergen
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


fix pnpinfo on arch=amd64

2010-10-23 Thread Alexander Best
this tiny patch will fix pnpinfo so it doesn't core dump (bus error) any
longer on arch=amd64.

cheers.
alex

-- 
a13x
diff --git a/contrib/pnpinfo/pnpinfo.c b/contrib/pnpinfo/pnpinfo.c
index 790cfd8..c09f4ef 100644
--- a/contrib/pnpinfo/pnpinfo.c
+++ b/contrib/pnpinfo/pnpinfo.c
@@ -588,7 +588,7 @@ main(int argc, char **argv)
 {
 int num_pnp_devs;
 
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 /* Hey what about a i386_iopl() call :) */
 if (open("/dev/io", O_RDONLY) < 0)
errx(1, "can't get I/O privilege");
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: addition of sysctl nodes after compile time

2010-10-23 Thread Alexander Best
On Thu Oct 21 10, Robert Watson wrote:
> 
> On Tue, 19 Oct 2010, Alexander Best wrote:
> 
> >does this limitation still exist?
> 
> Sysctls can be added dynamically using the sysctl_add_oid(9) KPI, which has 
> existed (as far as I'm aware) at least since FreeBSD 4.x.  It could be that 
> this KPI provides the functionality required to do what the comment 
> describes.

thanks a lot for the hint. maybe i'll hack into the cd driver and see if i can
make the minimum and maximum timeout values apply to specific devices.

cheers.
alex

> 
> Robert

-- 
a13x
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-23 Thread Alexander Best
On Thu Oct 21 10, Dag-Erling Smørgrav wrote:
> Alexander Best  writes:
> > no need to get upset. you asked where i found the information regarding the
> > wear impact of spinning down disks and i gave you the answer.
> 
> I am upset by your claim that "doing spin downs upon reboot might be
> even worse than not doing spindowns upon shutdown", because you should
> know better, and following your advice could damage people's hardware.

well...since currently hdds don't spindown during shutdown the current behavior
is in fact damaging hardware. i don't quite understand why this hasn't been
fixed yet. the patch is available and known to work. it won't cause any
problems with SCSI devices like mav's current implementation, since the
spindown code is limited to ATA devices.

instead of talking and talking somebody should drop the changes into HEAD!

cheers.
alex

> 
> DES
> -- 
> Dag-Erling Smørgrav - d...@des.no

-- 
a13x
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: fix pnpinfo on arch=amd64

2010-10-23 Thread Garrett Cooper
On Sat, Oct 23, 2010 at 5:22 PM, Alexander Best  wrote:
> this tiny patch will fix pnpinfo so it doesn't core dump (bus error) any
> longer on arch=amd64.

1. I had to modify the Makefile to get it to work.
2. FWIW, I don't there's really much point in adding a check for only
x86 architectures, if the tool is capable of more than that.
3. Might as well close the file descriptor after opening it.

SIGBUS occurs because it doesn't have permission to write via outb.
It's a shame that there isn't a more proper way to catch this SIGBUS
fault minus adding a SIGBUS handler (but that might have other
undesired side effects).
Thanks,
-Garrett
Index: contrib/pnpinfo/pnpinfo.c
===
--- contrib/pnpinfo/pnpinfo.c	(revision 214169)
+++ contrib/pnpinfo/pnpinfo.c	(working copy)
@@ -506,7 +506,7 @@
 	} else {
 	/* Handle large resouce data types */
 	u_char buf[2];
-	if (!get_resource_info((char *)buf, 2))
+	if (!get_resource_info(buf, 2))
 		break;
 	large_len = (buf[1] << 8) + buf[0];
 
@@ -586,13 +586,13 @@
 int
 main(int argc, char **argv)
 {
+int fd;
 int num_pnp_devs;
 
-#ifdef __i386__
 /* Hey what about a i386_iopl() call :) */
-if (open("/dev/io", O_RDONLY) < 0)
-	errx(1, "can't get I/O privilege");
-#endif
+if ((fd = open("/dev/io", O_RDONLY)) < 0)
+	err(1, "can't get I/O privileges");
+(void) close(fd);
 
 printf("Checking for Plug-n-Play devices...\n");
 
Index: contrib/pnpinfo/Makefile
===
--- contrib/pnpinfo/Makefile	(revision 214169)
+++ contrib/pnpinfo/Makefile	(working copy)
@@ -2,6 +2,6 @@
 
 PROG=	pnpinfo
 MAN8=	pnpinfo.8
-CFLAGS= -Wall
+CFLAGS= -Wall -I${.CURDIR}/../../sys
 
 .include 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Why is TUNABLE_INT discouraged?

2010-10-23 Thread Garrett Cooper
2010/10/18 Dag-Erling Smørgrav :
> Garrett Cooper  writes:
>> PS I added uquad_t for consistency in the APIs, even though quad_t was
>> deprecated, but I didn't bump __FreeBSD_version__ -- wasn't sure if I
>> should have done that).
>
> You should bump __FreeBSD_version__ anyway so third-party or shared code
> can use the new API if it is available and the old one if it isn't.
>
>> Let's try with the patch attached...
>
> Mailman strips binary attachments.  The correct MIME type is
> text/x-patch.

Ok. Let's retry with a .patch extension and by bumping __FreeBSD_version__.
Thanks!
-Garrett
Index: sys/kern/kern_environment.c
===
--- sys/kern/kern_environment.c	(revision 214258)
+++ sys/kern/kern_environment.c	(working copy)
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -442,32 +443,115 @@
 }
 
 /*
- * Return a string value from an environment variable.
+ * Return the multiplier for a user specified suffix from a getenv call.
  */
+uintmax_t
+getenv_parse_suffix(const char suffix)
+{
+	uintmax_t multiplier = 1;
+
+	switch (suffix) {
+	case 't': case 'T':
+		multiplier *= 1024;
+	case 'g': case 'G':
+		multiplier *= 1024;
+	case 'm': case 'M':
+		multiplier *= 1024;
+	case 'k': case 'K':
+		multiplier *= 1024;
+	case '\0':
+		break;
+	default:
+		multiplier = 0;
+	}
+
+	return (multiplier);
+}
+
+/*
+ * Return a signed quantity from an environment variable.
+ */
 int
-getenv_string(const char *name, char *data, int size)
+getenv_signed(const char *name, intmax_t *data, const intmax_t min,
+const intmax_t max)
 {
-	char *tmp;
+	uintmax_t	multiplier;
+	intmax_t	iv;
+	int		ret_code;
+	char		*value;
+	char		*vtp;
 
-	tmp = getenv(name);
-	if (tmp != NULL) {
-		strlcpy(data, tmp, size);
-		freeenv(tmp);
-		return (1);
-	} else
-		return (0);
+	ret_code = 0;
+
+	value = getenv(name);
+	if (value == NULL)
+		return (ret_code);
+	iv = strtoq(value, &vtp, 0);
+	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0') ||
+	(multiplier = getenv_parse_suffix(vtp[0])) == 0) {
+		/* 
+		 * Catch errors in parsing the number, bad input, or the
+		 * suffix if one was specified.
+		 */
+		;
+	} else {
+		iv *= multiplier;
+		if (min <= iv && iv <= max) {
+			*data = iv;
+			ret_code = 1;
+		}
+	}
+	freeenv(value);
+	return (ret_code);
 }
 
 /*
+ * Return an unsigned quantity from an environment variable.
+ */
+int
+getenv_unsigned(const char *name, uintmax_t *data, const uintmax_t min,
+const uintmax_t max)
+{
+	uintmax_t	multiplier;
+	uintmax_t	uiv;
+	int		ret_code;
+	char		*value;
+	char		*vtp;
+
+	ret_code = 0;
+
+	value = getenv(name);
+	if (value == NULL)
+		return (ret_code);
+	uiv = strtouq(value, &vtp, 0);
+	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0') ||
+	(multiplier = getenv_parse_suffix(vtp[0])) == 0) {
+		/* 
+		 * Catch errors in parsing the number, bad input, or the
+		 * suffix if one was specified.
+		 */
+		;
+	} else {
+		uiv *= multiplier;
+		if (min <= uiv && uiv <= max) {
+			*data = uiv;
+			ret_code = 1;
+		}
+	}
+	freeenv(value);
+	return (ret_code);
+}
+
+/*
  * Return an integer value from an environment variable.
  */
 int
 getenv_int(const char *name, int *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_signed(name, &tmp, INT_MIN, INT_MAX);
 	if (rval)
 		*data = (int) tmp;
 	return (rval);
@@ -479,10 +563,10 @@
 int
 getenv_uint(const char *name, unsigned int *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_unsigned(name, &tmp, 0, UINT_MAX);
 	if (rval)
 		*data = (unsigned int) tmp;
 	return (rval);
@@ -494,10 +578,10 @@
 int
 getenv_long(const char *name, long *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_signed(name, &tmp, LONG_MIN, LONG_MAX);
 	if (rval)
 		*data = (long) tmp;
 	return (rval);
@@ -509,51 +593,90 @@
 int
 getenv_ulong(const char *name, unsigned long *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_unsigned(name, &tmp, 0, ULONG_MAX);
 	if (rval)
 		*data = (unsigned long) tmp;
 	return (rval);
 }
 
 /*
+ * Return a pointer from an environment variable.
+ */
+int
+getenv_pointer(const char *name, uintptr_t *data)
+{
+	intmax_t tmp;
+	int rval;
+
+	rval = getenv_unsigned(name, &tmp, 0, UINTPTR_MAX);
+	if (rval)
+		*data = (uintptr_t) tmp;
+	return (rval);
+}
+
+/*
  * Return a quad_t value from an environment variable.
  */
 int
 getenv_quad(const char *name, quad_t *data)
 {
-	char	*value;
-	char	*vtp;
-	quad_t	iv;
+	intmax_t tmp;
+	int rval;
 
-	value = getenv(name);
-	if (value == NULL)
+	rval = getenv_signed(name, &tmp, QUAD_MIN, QUAD_MAX);
+	if (rval)
+		*data = (quad_t) tmp;
+	return (rval);
+}
+
+/*
+ * Return a uquad_t value from an environment variable.
+ */
+int
+getenv_uquad(const char *name, uquad_t *data)
+{
+	intm

Re: Why is TUNABLE_INT discouraged?

2010-10-23 Thread Garrett Cooper
2010/10/23 Garrett Cooper :
> 2010/10/18 Dag-Erling Smørgrav :
>> Garrett Cooper  writes:
>>> PS I added uquad_t for consistency in the APIs, even though quad_t was
>>> deprecated, but I didn't bump __FreeBSD_version__ -- wasn't sure if I
>>> should have done that).
>>
>> You should bump __FreeBSD_version__ anyway so third-party or shared code
>> can use the new API if it is available and the old one if it isn't.
>>
>>> Let's try with the patch attached...
>>
>> Mailman strips binary attachments.  The correct MIME type is
>> text/x-patch.
>
>    Ok. Let's retry with a .patch extension and by bumping __FreeBSD_version__.

Sorry.. forgot the uquad_t addition to sys/types.h :(...
Index: sys/kern/kern_environment.c
===
--- sys/kern/kern_environment.c	(revision 214258)
+++ sys/kern/kern_environment.c	(working copy)
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -442,32 +443,115 @@
 }
 
 /*
- * Return a string value from an environment variable.
+ * Return the multiplier for a user specified suffix from a getenv call.
  */
+uintmax_t
+getenv_parse_suffix(const char suffix)
+{
+	uintmax_t multiplier = 1;
+
+	switch (suffix) {
+	case 't': case 'T':
+		multiplier *= 1024;
+	case 'g': case 'G':
+		multiplier *= 1024;
+	case 'm': case 'M':
+		multiplier *= 1024;
+	case 'k': case 'K':
+		multiplier *= 1024;
+	case '\0':
+		break;
+	default:
+		multiplier = 0;
+	}
+
+	return (multiplier);
+}
+
+/*
+ * Return a signed quantity from an environment variable.
+ */
 int
-getenv_string(const char *name, char *data, int size)
+getenv_signed(const char *name, intmax_t *data, const intmax_t min,
+const intmax_t max)
 {
-	char *tmp;
+	uintmax_t	multiplier;
+	intmax_t	iv;
+	int		ret_code;
+	char		*value;
+	char		*vtp;
 
-	tmp = getenv(name);
-	if (tmp != NULL) {
-		strlcpy(data, tmp, size);
-		freeenv(tmp);
-		return (1);
-	} else
-		return (0);
+	ret_code = 0;
+
+	value = getenv(name);
+	if (value == NULL)
+		return (ret_code);
+	iv = strtoq(value, &vtp, 0);
+	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0') ||
+	(multiplier = getenv_parse_suffix(vtp[0])) == 0) {
+		/* 
+		 * Catch errors in parsing the number, bad input, or the
+		 * suffix if one was specified.
+		 */
+		;
+	} else {
+		iv *= multiplier;
+		if (min <= iv && iv <= max) {
+			*data = iv;
+			ret_code = 1;
+		}
+	}
+	freeenv(value);
+	return (ret_code);
 }
 
 /*
+ * Return an unsigned quantity from an environment variable.
+ */
+int
+getenv_unsigned(const char *name, uintmax_t *data, const uintmax_t min,
+const uintmax_t max)
+{
+	uintmax_t	multiplier;
+	uintmax_t	uiv;
+	int		ret_code;
+	char		*value;
+	char		*vtp;
+
+	ret_code = 0;
+
+	value = getenv(name);
+	if (value == NULL)
+		return (ret_code);
+	uiv = strtouq(value, &vtp, 0);
+	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0') ||
+	(multiplier = getenv_parse_suffix(vtp[0])) == 0) {
+		/* 
+		 * Catch errors in parsing the number, bad input, or the
+		 * suffix if one was specified.
+		 */
+		;
+	} else {
+		uiv *= multiplier;
+		if (min <= uiv && uiv <= max) {
+			*data = uiv;
+			ret_code = 1;
+		}
+	}
+	freeenv(value);
+	return (ret_code);
+}
+
+/*
  * Return an integer value from an environment variable.
  */
 int
 getenv_int(const char *name, int *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_signed(name, &tmp, INT_MIN, INT_MAX);
 	if (rval)
 		*data = (int) tmp;
 	return (rval);
@@ -479,10 +563,10 @@
 int
 getenv_uint(const char *name, unsigned int *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_unsigned(name, &tmp, 0, UINT_MAX);
 	if (rval)
 		*data = (unsigned int) tmp;
 	return (rval);
@@ -494,10 +578,10 @@
 int
 getenv_long(const char *name, long *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_signed(name, &tmp, LONG_MIN, LONG_MAX);
 	if (rval)
 		*data = (long) tmp;
 	return (rval);
@@ -509,51 +593,90 @@
 int
 getenv_ulong(const char *name, unsigned long *data)
 {
-	quad_t tmp;
+	intmax_t tmp;
 	int rval;
 
-	rval = getenv_quad(name, &tmp);
+	rval = getenv_unsigned(name, &tmp, 0, ULONG_MAX);
 	if (rval)
 		*data = (unsigned long) tmp;
 	return (rval);
 }
 
 /*
+ * Return a pointer from an environment variable.
+ */
+int
+getenv_pointer(const char *name, uintptr_t *data)
+{
+	intmax_t tmp;
+	int rval;
+
+	rval = getenv_unsigned(name, &tmp, 0, UINTPTR_MAX);
+	if (rval)
+		*data = (uintptr_t) tmp;
+	return (rval);
+}
+
+/*
  * Return a quad_t value from an environment variable.
  */
 int
 getenv_quad(const char *name, quad_t *data)
 {
-	char	*value;
-	char	*vtp;
-	quad_t	iv;
+	intmax_t tmp;
+	int rval;
 
-	value = getenv(name);
-	if (value == NULL)
+	rval = getenv_signed(name, &tmp, QUAD_MIN, QUAD_MAX);
+	if (rval)
+		*data = (quad_t) tmp;
+	return (rval);
+}
+
+/*
+ * Return a uquad_t value from an env

[PATCH] Add SF_ARCHIVED to EPERM in chflags(2) ERROR section

2010-10-23 Thread Garrett Cooper
The SF_ARCHIVED flag isn't noted in the chflags(2) ERROR section.
The attached patch adds the entry.
If no one has any objections, could someone help me commit this?
Thanks!
-Garrett
Index: lib/libc/sys/chflags.2
===
--- lib/libc/sys/chflags.2	(revision 213377)
+++ lib/libc/sys/chflags.2	(working copy)
@@ -148,14 +148,14 @@
 the effective user ID is not the super-user.
 .It Bq Er EPERM
 One of
-.Dv SF_IMMUTABLE , SF_APPEND ,
+.Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND ,
 or
 .Dv SF_NOUNLINK
 is set and the user is either not the super-user or
 securelevel is greater than 0.
 .It Bq Er EPERM
 A non-super-user tries to set one of
-.Dv SF_IMMUTABLE , SF_APPEND ,
+.Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND ,
 or
 .Dv SF_NOUNLINK .
 .It Bq Er EPERM
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: USB key && can't mount /root during boot

2010-10-23 Thread Matthias Apitz
El día Saturday, October 23, 2010 a las 10:49:56AM +0200, Matthias Apitz 
escribió:

> I have now again the same problem (see Subject) again with a new laptop
> Acer Aspire One D250 and neither of the two values in loader.conf:
> 
> 
> kern.cam.boot_delay="1"
> 
> kern.cam.scsi_delay="1"
> 
> seems to help. The 10 sec delay is not even visible during the boot, the
> message to enter manually the root device just pops up without any
> delay. What does this mean?

After a lot of testing I got it to woork with:

kern.cam.boot_delay="1"
kern.cam.scsi_delay="3000"

i.e. it works with 3000, but not with 1

Thanks

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Broadcom BCM4310 / bwi(4) and interface bwi0 is not showing up

2010-10-23 Thread Matthias Apitz

Hello,

I have a new laptop Acer Aspire One D250 and I want to install a
8-CURRENT as of CVS from May 2009 (as I use this on all my laptops).
The laptop comes with as Wifi chip:

no...@pci0:1:0:0:   class=0x028000 card=0xe01b105b chip=0x431514e4
rev=0x01 hdr=0x00
vendor = 'Broadcom Corporation'
device = 'BCM4310 USB Controller'
class  = network

I learned after searching around that it should be supported by bwi(4)
and one should install the firmware kmod from the ports. I have in
loader.conf:

if_bwi_load="YES"
bwi_v3_ucode_load="YES"

and a kldstat shows that both are loaded. But the bwi0 interface is not
showing up. 

If I do a kldunload/kldload it says:

pci0: driver added
found-> vendor=0x8086, dev=0x27d8, revid=0x02
domain=0, bus=0, slot=27, func=0
class=04-03-00, hdrtype=0x00, mfdev=0
cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=16
powerspec 2  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:27:0: reprobing on driver added
found-> vendor=0x8086, dev=0x27da, revid=0x02
domain=0, bus=0, slot=31, func=3
class=0c-05-00, hdrtype=0x00, mfdev=0
cmdreg=0x0001, statreg=0x0280, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=b, irq=17
pci0:0:31:3: reprobing on driver added
pci1: driver added
found-> vendor=0x14e4, dev=0x4315, revid=0x01
domain=0, bus=1, slot=0, func=0
class=02-80-00, hdrtype=0x00, mfdev=0
cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=16
powerspec 3  supports D0 D1 D2 D3  current D0
MSI supports 1 message, 64 bit
pci0:1:0:0: reprobing on driver added
pci2: driver added
pci3: driver added
found-> vendor=0x1969, dev=0x1062, revid=0xc0
domain=0, bus=3, slot=0, func=0
class=02-00-00, hdrtype=0x00, mfdev=0
cmdreg=0x0007, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=18
powerspec 3  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:3:0:0: reprobing on driver added
pci4: driver added
pci5: driver added

and a 'dmesg | fgrep bwi' shows:

Preloaded elf module "/boot/kernel/if_bwi.ko" at 0xc10ed228.
Preloaded elf module "/boot/modules/bwi_v3_ucode.ko" at 0xc10ed2d4.
firmware: 'bwi_v3_ucode' version 0: 0 bytes loaded at 0xc10d33d4
firmware: 'bwi_v3_ucode11' version 0: 21680 bytes loaded at 0xc10d33d4
firmware: 'bwi_v3_ucode2' version 0: 16360 bytes loaded at 0xc10d8884
firmware: 'bwi_v3_ucode4' version 0: 20096 bytes loaded at 0xc10dc86c
firmware: 'bwi_v3_ucode5' version 0: 22280 bytes loaded at 0xc10e16ec
firmware: 'bwi_v3_a0g0bsinitvals2' version 0: 18 bytes loaded at 0xc10e6df4
firmware: 'bwi_v3_a0g0bsinitvals5' version 0: 158 bytes loaded at 0xc10e6e06
firmware: 'bwi_v3_a0g0initvals2' version 0: 2520 bytes loaded at 0xc10e6ea4
firmware: 'bwi_v3_a0g0initvals5' version 0: 1818 bytes loaded at 0xc10e787c
firmware: 'bwi_v3_a0g1bsinitvals5' version 0: 158 bytes loaded at 0xc10e7f96
firmware: 'bwi_v3_a0g1initvals5' version 0: 1818 bytes loaded at 0xc10e8034
firmware: 'bwi_v3_b0g0bsinitvals2' version 0: 18 bytes loaded at 0xc10e874e
firmware: 'bwi_v3_b0g0bsinitvals5' version 0: 158 bytes loaded at 0xc10e8760
firmware: 'bwi_v3_b0g0initvals2' version 0: 2520 bytes loaded at 0xc10e87fe
firmware: 'bwi_v3_b0g0initvals5' version 0: 1818 bytes loaded at 0xc10e91d6
firmware: 'bwi_v3_pcm4' version 0: 1320 bytes loaded at 0xc10e98f0
firmware: 'bwi_v3_pcm5' version 0: 1320 bytes loaded at 0xc10e9e18

What I am missing here? Thanks

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"