Re: Switch from legacy ata(4) to CAM-based ATA

2011-04-21 Thread Ted Faber
On Wed, Apr 20, 2011 at 03:35:38PM -0700, Doug Barton wrote:
 On 04/20/2011 15:18, Scott Long wrote:
 I agree with what Alexander is saying, but I'd like to take it a step 
 further.  We should all be using [...] mount-by-label
 
 +1
 
 When I first saw this on linux my gut reaction was e,
 different. But now that I've worked with it a bit, I really like
 it. Doing this by default in 9.0 would be a really useful step
 forward, and would allow greater innovation down the road.
 
 Is there a handy tutorial somewhere for making this change in
 FreeBSD? Or is it even possible to do in a rational way?

Judging from the thread that followed this: no.

I agree with you that there should be and that mount-by-label is the way
to go.

I seem to recall some flakiness with mounting labelled gmirrors.  Anyone
know if that's been resolved?

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


signature.asc
Description: Digital signature


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ted Faber
On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote:
 I also have this in make.conf:
 CUPS_OVERWRITE_BASE=yes
 WITHOUT_LPR=yes
 
 which print/cups-base uses to do make any lpr related binaries in
 /usr/bin non-executable, so they are skipped over and the cups
 specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
 stops LPR being built by buildworld.

The clear winner, and one I was unaware of.

Thanks, Tom.


-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgp4QFrvNdcSN.pgp
Description: PGP signature


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ted Faber
On Thu, Jun 24, 2010 at 08:29:57AM -0700, Ted Faber wrote:
 On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote:
  I also have this in make.conf:
  CUPS_OVERWRITE_BASE=yes
  WITHOUT_LPR=yes
  
  which print/cups-base uses to do make any lpr related binaries in
  /usr/bin non-executable, so they are skipped over and the cups
  specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
  stops LPR being built by buildworld.
 
 The clear winner, and one I was unaware of.
 
 Thanks, Tom.

CUPS_OVERWRITE_BASE seems to do an odd thing.  It doesn't install the
cups binaries in /usr/bin, but it does do a chmod  on everything it
replaces in /usr/bin .  For example

praxis:~$ ls -l /usr/bin/lpr
-r-sr-sr-x  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr
# portupgrade -f cups-base-1.4.3
praxis:~$ ls -l /usr/bin/lpr
--  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr

I'll still use it, but interesting behavior.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpMBBMf5Jte6.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 10:10:59AM +0300, Andriy Gapon wrote:
 on 23/06/2010 10:02 Andriy Gapon said the following:
  I don't dispute that it is found broken in particular environments, I just 
  think
  that the analysis could be incorrect.
 
 Which also brings the question - what arch(s) is affected?
 I tested on amd64.

Right.  I'm i386 and I have the problem.  Good point!

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpVLIqZ5Js9n.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote:
 I have to admit that I'm more than a little surprised that this
 problem does not affect modules that in src, but maybe that's because
 I don't know all that much about FreeBSD's build infrastructure.  Are
 the src modules being linked with a linker script that is not being
 used for out-of-src modules?  Are the people affected by this not
 using the base compiler to build ports?(I see that this affects PC-BSD
 as well, and I'd be a little surprised to learn that it wasn't using
 the base compiler).

I had the problem on i386, base compiler.  It also affects the sample
module in /usr/share/examples/kld/cdev/ which also uses the base
compiler, if you want a case w/o th eports infrastructure.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpk7CXCsISMP.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 08:45:31AM -0700, Ted Faber wrote:
 On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote:
  I have to admit that I'm more than a little surprised that this
  problem does not affect modules that in src, but maybe that's because
  I don't know all that much about FreeBSD's build infrastructure.  Are
  the src modules being linked with a linker script that is not being
  used for out-of-src modules?  Are the people affected by this not
  using the base compiler to build ports?(I see that this affects PC-BSD
  as well, and I'd be a little surprised to learn that it wasn't using
  the base compiler).
 
 I had the problem on i386, base compiler.  It also affects the sample
 module in /usr/share/examples/kld/cdev/ which also uses the base
 compiler, if you want a case w/o the ports infrastructure.

Just so it gets into Google:

Andriy Gapon went a few rounds of debugging with me and it turns out
that the problem was that the binutils port had installed a loader in
/usr/local/bin/ld that was incompatible with the module system.
(/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
commands from cupsd, though it's evidently a bit of a dangerous idea.)
Basically if the linker you're using to compile isn't /usr/bin/ld you
may have problems building kernel modules.

The easiest way to detect this is to get the -v output (version number)
from the linker in use and compare it against /usr/bin/ld .  I was able
to do that by adding LDFLAGS += -v to the Makefile in question.

Thanks Andriy!

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpXJGFp1X6q8.pgp
Description: PGP signature


Re: building world with debugging symbols [broken?]

2010-06-22 Thread Ted Faber
On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote:
 I saw similar behaviour a couple of years ago when I switched from
 using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules.
 The problem ended up being a change in the linker script used by GNU
 ld for linking kernel modules.  It used to always put some magic
 symbols used by the linker to implement things like sysinits into the
 module.  It was changed to only provide those symbols, which
 apparently means that the linker would discard those symbols if
 nothing referenced them(and nothing did reference them).  I had to
 work around it by adding the following to my link line:
 
 -u __start_set_sysinit_set -u __start_set_sysuninit_set \
 -u __start_set_sysctl_set -u __start_set_modmetadata_set \
 -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \
 -u __stop_set_sysctl_set -u __stop_set_modmetadata_set

HPS:

I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port
made the module and the result loads and creates the /dev/cuse file.

Here's a diff relative to
/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so
it's clear what I did.


--- Makefile.kmod.orig  2010-02-11 03:28:02.0 -0800
+++ Makefile.kmod   2010-06-22 14:02:52.0 -0700
@@ -30,4 +30,10 @@
 KMOD=  cuse4bsd
 SRCS=  cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h
 
+LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \
+ -u __start_set_sysctl_set -u __start_set_modmetadata_set \
+ -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \
+ -u __stop_set_sysctl_set -u __stop_set_modmetadata_set
+
+
 .include bsd.kmod.mk

Running nm -o on the two modules, the difference seems to be that the -u
results in some additional absolute symbols being defined:

Bad module:
$ nm -o /boot/modules/cuse4bsd.ko| grep sys
/boot/modules/cuse4bsd.ko:275c r
__set_sysinit_set_sym_cuse_kern_init_sys_init
/boot/modules/cuse4bsd.ko:2758 r 
__set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
/boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
/boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit

Good module:

$ nm -o ./cuse4bsd.ko  | grep sys
./cuse4bsd.ko:28cc r __set_sysinit_set_sym_cuse_kern_init_sys_init
./cuse4bsd.ko:28c8 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
./cuse4bsd.ko: U __start_set_sysctl_set
./cuse4bsd.ko:28cc A __start_set_sysinit_set
./cuse4bsd.ko:28c8 A __start_set_sysuninit_set
./cuse4bsd.ko: U __stop_set_sysctl_set
./cuse4bsd.ko:28d0 A __stop_set_sysinit_set
./cuse4bsd.ko:28cc A __stop_set_sysuninit_set
./cuse4bsd.ko:3194 d cuse_kern_init_sys_init
./cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit


-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpQWyNSjmQCd.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-22 Thread Ted Faber
On Wed, Jun 23, 2010 at 02:38:06AM +0200, Hans Petter Selasky wrote:
 It appears many kmods are broken because the linker is stripping away static 
 data declared with the section attribute in FreeBSD 8.1-RC1.
 
 cite
 
 I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd port
 made the module and the result loads and creates the /dev/cuse file.

Hi.

I'm the fellow in Hans's cite.../cite.

If someone's looking into this, it's worth mentioning that the sample
cdev kmodule in /usr/share/examples/kld/cdev/ also exhibits the
behavior.  On my 8.1-PRERELEASE system that module does not create the
/dev/cedv device, but if you add the line 

LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \
   -u __start_set_sysctl_set -u __start_set_modmetadata_set \
   -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \
   -u __stop_set_sysctl_set -u __stop_set_modmetadata_set

right before the 

.include bsd.kmod.mk

in /usr/share/examples/kld/cdev/module/Makefile and remake everything,
the module creates the /dev/cdev file when it's loaded.

That magical line was suggested by Ryan Stone in another thread:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=120718+0+current/freebsd-hackers

Happy hunting, and I'm happy to test patches or provide more information.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgploXUNQKXc1.pgp
Description: PGP signature