Re: My Cyrix CPU is a filthy rotten liar!

2014-04-26 Thread Edwin Amsler
Good call. That would work around this current problem nicely. Though, I don’t 
know if this problem is with this specific core, or Cyrix chips in general.

I won’t be too worried about the whole exercise. I was going to use it for a 
project, but I realized how silly that would be given that you can pull Core 2 
Duos with 2GB of RAM out of a dumpster these days.

On Apr 26, 2014, at 2:14 PM, Miod Vallat  wrote:

>> The question I have is can I disable the random number generator?s use of 
>> that instruction? I?d rather be on -current than years old.
> 
> Apart from the following hammer, I see no easy way to achieve this.
> 
> Index: i386/machdep.c
> ===
> RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
> retrieving revision 1.536
> diff -u -p -r1.536 machdep.c
> --- i386/machdep.c29 Mar 2014 18:09:29 -  1.536
> +++ i386/machdep.c26 Apr 2014 19:13:14 -
> @@ -1964,7 +1964,8 @@ identifycpu(struct cpu_info *ci)
>   }
> 
>   if (ci->ci_flags & CPUF_PRIMARY) {
> - if (cpu_ecxfeature & CPUIDECX_RDRAND)
> + if (cpu_ecxfeature & CPUIDECX_RDRAND &&
> + vendor != CPUVENDOR_CYRIX)
>   has_rdrand = 1;
> #ifndef SMALL_KERNEL
>   if (ci->ci_feature_sefflags & SEFF0EBX_SMAP)



Re: rc.subr(8) capabilities - echo and custom rc_${SUB}

2014-04-26 Thread Ingo Schwarze
Hi Michal,

Michal Lesiak wrote on Sat, Apr 26, 2014 at 11:47:00PM +0200:

> I'm converting a .rc script made by someone a coupe of years ago for
> the same product I'm currently working on. It's important for this
> tale as this may mean that this actually worked for some previous
> versions.
> I'm working on 5.2 version.

That's unsupported for nearly a year now.
Consider upgrading to 5.5 after May 1.

> 1. I have a custom "rc_register()" sub defined in my .rc script, but
> I cannot make rc subsystem recognize that - trying to run that ends
> with calling rc_usage(). I've checked up (briefly) rc.subr and I
> cannot see there any possibility to have custom rc_${SUB} functions
> implemented.
> So, is it possible or maybe it was possible some time ago?

Saying

  /etc/rc.d/foo register

to have rc_cmd() call rc_register() is not possible, and as far
as i can see it never was.  The rc_cmd() switch called rc_err()
for *) from rev. 1.1, and rc_usage since rev. 1.47.

Maybe someone at your place hacked up /etc/rc.d/rc.subr, adding
custom code to that file?

> 2. I'm having a very simple problem of getting any STDOUT output
> from the daemon I'm running. Just as well I'm not getting anything
> with simple "echo foo" put into rc_start(), but the more serious
> issue is when the daemon fails to start, prints out a message to
> STDOUT (it's a Perl script) but rc subsystem only says that it has
> failed with all the output from the daemon lost somewhere.
> Is it my fault or is it a design or, as in the previous case, it
> worked and is not working anymore?

See Antoine's answer.

Yours,
  Ingo



Re: rc.subr(8) capabilities - echo and custom rc_${SUB}

2014-04-26 Thread Antoine Jacoutot
On Sat, Apr 26, 2014 at 11:47:00PM +0200, Michał Lesiak wrote:
> Hello,
> 
> I'm converting a .rc script made by someone a coupe of years ago for the
> same product I'm currently working on. It's important for this tale as this
> may mean that this actually worked for some previous versions.
> I'm working on 5.2 version.
> 
> 1. I have a custom "rc_register()" sub defined in my .rc script, but I
> cannot make rc subsystem recognize that - trying to run that ends with
> calling rc_usage(). I've checked up (briefly) rc.subr and I cannot see there
> any possibility to have custom rc_${SUB} functions implemented.
> So, is it possible or maybe it was possible some time ago?
> 
> 2. I'm having a very simple problem of getting any STDOUT output from the
> daemon I'm running. Just as well I'm not getting anything with simple "echo
> foo" put into rc_start(), but the more serious issue is when the daemon
> fails to start, prints out a message to STDOUT (it's a Perl script) but rc
> subsystem only says that it has failed with all the output from the daemon
> lost somewhere.
> Is it my fault or is it a design or, as in the previous case, it worked and
> is not working anymore?

man rc.d

"
 -d  Setting this option will print the function names as they are
 called and prevent the rc.subr(8) framework from redirecting
 stdin and stderr to /dev/null.  This is used to allow debugging
 of failed actions.
"

-- 
Antoine



rc.subr(8) capabilities - echo and custom rc_${SUB}

2014-04-26 Thread Michał Lesiak

Hello,

I'm converting a .rc script made by someone a coupe of years ago for the 
same product I'm currently working on. It's important for this tale as 
this may mean that this actually worked for some previous versions.

I'm working on 5.2 version.

1. I have a custom "rc_register()" sub defined in my .rc script, but I 
cannot make rc subsystem recognize that - trying to run that ends with 
calling rc_usage(). I've checked up (briefly) rc.subr and I cannot see 
there any possibility to have custom rc_${SUB} functions implemented.

So, is it possible or maybe it was possible some time ago?

2. I'm having a very simple problem of getting any STDOUT output from 
the daemon I'm running. Just as well I'm not getting anything with 
simple "echo foo" put into rc_start(), but the more serious issue is 
when the daemon fails to start, prints out a message to STDOUT (it's a 
Perl script) but rc subsystem only says that it has failed with all the 
output from the daemon lost somewhere.
Is it my fault or is it a design or, as in the previous case, it worked 
and is not working anymore?


Regards,
 ML



Re: My Cyrix CPU is a filthy rotten liar!

2014-04-26 Thread Miod Vallat
> On 2014-04-26, Miod Vallat  wrote:
> >> The question I have is can I disable the random number generator?s use of 
> >> that instruction? I?d rather be on -current than years old.
> >
> > Apart from the following hammer, I see no easy way to achieve this.
> >
> > Index: i386/machdep.c
> >===
> > RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
> > retrieving revision 1.536
> > diff -u -p -r1.536 machdep.c
> > --- i386/machdep.c  29 Mar 2014 18:09:29 -  1.536
> > +++ i386/machdep.c  26 Apr 2014 19:13:14 -
> > @@ -1964,7 +1964,8 @@ identifycpu(struct cpu_info *ci)
> > }
> >  
> > if (ci->ci_flags & CPUF_PRIMARY) {
> > -   if (cpu_ecxfeature & CPUIDECX_RDRAND)
> > +   if (cpu_ecxfeature & CPUIDECX_RDRAND &&
> > +   vendor != CPUVENDOR_CYRIX)
> > has_rdrand = 1;
> >  #ifndef SMALL_KERNEL
> > if (ci->ci_feature_sefflags & SEFF0EBX_SMAP)
> >
> >
> 
> Funnily enough it's handled here:

Then this ought to work as well:

Index: i386/locore.s
===
RCS file: /cvs/src/sys/arch/i386/i386/locore.s,v
retrieving revision 1.147
diff -u -p -r1.147 locore.s
--- i386/locore.s   13 Jun 2013 02:26:53 -  1.147
+++ i386/locore.s   26 Apr 2014 21:21:01 -
@@ -401,6 +401,7 @@ try586: /* Use the `cpuid' instruction. 
movl$0,  RELOC(_C_LABEL(cpu_vendor))+12
 
movl$1,%eax
+   xorl%ecx,%ecx
cpuid
movl%eax,RELOC(_C_LABEL(cpu_id))# store cpu_id and features
movl%ebx,RELOC(_C_LABEL(cpu_miscinfo))



Re: make with argument in port Makefile

2014-04-26 Thread Stuart Henderson
On 2014-04-26, Denis Fondras  wrote:
> Hello all,
>
> I'm creating a port for x2goclient (http://www.x2go.org/) but I don't
> want to build the browser plugin and the documentation, only the heavy
> client. So instead of the regular "make", I have to launch "make
> build_client".
>
> Here is my Makefile :
>
> --8<---
> # AGPL-3+
> COMMENT=X2GO is for having a graphical desktop of computers over
> a low bandwidth connection.
> DISTNAME=   x2goclient-4.0.2.0
> REVISION=   1
> CATEGORIES= x11 net
> MASTER_SITES=   http://code.x2go.org/releases/source/x2goclient/
>
> HOMEPAGE=   http://www.x2go.org/
>
> LIB_DEPENDS=x11/nx/nxproxy
>
> NO_TEST=Yes
>
> CONFIGURE_STYLE= make
> --8<---
>
> I tried to add "MAKE_FLAGS= build_client" or change to "CONFIGURE_STYLE=
> make build_client" but without success.
>
> Currently I have a patch-Makefile file to strip the x2goclient Makefile
> and remove everything I won't build but it doesn't seem very clean.
>
> What is the usual way to do this ?
>
> Thanks you in advance,
> Denis
>
>

ALL_TARGET

(Please direct any replies to ports@ where this should have originally gone..)



Re: A misconfigured disklabel can crash the kernel on listing its mounted directory contents (5.4)

2014-04-26 Thread Kevin Chadwick
previously on this list Kevin Chadwick contributed:

> /bin/dd if=/dev/zero of=/dev/sd?c 

Whoops, you should use the raw device on OpenBSD too. The following is
much faster at zeroing

/bin/dd if=/dev/zero of=/dev/rsd?c bs=32k

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)

In Other Words - Don't design like polkit or systemd
___

I have no idea why RTFM is used so aggressively on LINUX mailing lists
because whilst 'apropos' is traditionally the most powerful command on
Unix-like systems it's 'modern' replacement 'apropos' on Linux is a tool
to help psychopaths learn to control their anger.

(Kevin Chadwick)

___



make with argument in port Makefile

2014-04-26 Thread Denis Fondras
Hello all,

I'm creating a port for x2goclient (http://www.x2go.org/) but I don't
want to build the browser plugin and the documentation, only the heavy
client. So instead of the regular "make", I have to launch "make
build_client".

Here is my Makefile :

--8<---
# AGPL-3+
COMMENT=X2GO is for having a graphical desktop of computers over
a low bandwidth connection.
DISTNAME=   x2goclient-4.0.2.0
REVISION=   1
CATEGORIES= x11 net
MASTER_SITES=   http://code.x2go.org/releases/source/x2goclient/

HOMEPAGE=   http://www.x2go.org/

LIB_DEPENDS=x11/nx/nxproxy

NO_TEST=Yes

CONFIGURE_STYLE= make
--8<---

I tried to add "MAKE_FLAGS= build_client" or change to "CONFIGURE_STYLE=
make build_client" but without success.

Currently I have a patch-Makefile file to strip the x2goclient Makefile
and remove everything I won't build but it doesn't seem very clean.

What is the usual way to do this ?

Thanks you in advance,
Denis



Re: My Cyrix CPU is a filthy rotten liar!

2014-04-26 Thread Stuart Henderson
On 2014-04-26, Miod Vallat  wrote:
>> The question I have is can I disable the random number generator?s use of 
>> that instruction? I?d rather be on -current than years old.
>
> Apart from the following hammer, I see no easy way to achieve this.
>
> Index: i386/machdep.c
>===
> RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
> retrieving revision 1.536
> diff -u -p -r1.536 machdep.c
> --- i386/machdep.c29 Mar 2014 18:09:29 -  1.536
> +++ i386/machdep.c26 Apr 2014 19:13:14 -
> @@ -1964,7 +1964,8 @@ identifycpu(struct cpu_info *ci)
>   }
>  
>   if (ci->ci_flags & CPUF_PRIMARY) {
> - if (cpu_ecxfeature & CPUIDECX_RDRAND)
> + if (cpu_ecxfeature & CPUIDECX_RDRAND &&
> + vendor != CPUVENDOR_CYRIX)
>   has_rdrand = 1;
>  #ifndef SMALL_KERNEL
>   if (ci->ci_feature_sefflags & SEFF0EBX_SMAP)
>
>

Funnily enough it's handled here:

http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=5702e965d759dde8a098d8108660721ba2b93a7d

http://rt.openssl.org/Ticket/Display.html?id=3005&user=guest&pass=guest



Re: My Cyrix CPU is a filthy rotten liar!

2014-04-26 Thread Miod Vallat
> The question I have is can I disable the random number generator?s use of 
> that instruction? I?d rather be on -current than years old.

Apart from the following hammer, I see no easy way to achieve this.

Index: i386/machdep.c
===
RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.536
diff -u -p -r1.536 machdep.c
--- i386/machdep.c  29 Mar 2014 18:09:29 -  1.536
+++ i386/machdep.c  26 Apr 2014 19:13:14 -
@@ -1964,7 +1964,8 @@ identifycpu(struct cpu_info *ci)
}
 
if (ci->ci_flags & CPUF_PRIMARY) {
-   if (cpu_ecxfeature & CPUIDECX_RDRAND)
+   if (cpu_ecxfeature & CPUIDECX_RDRAND &&
+   vendor != CPUVENDOR_CYRIX)
has_rdrand = 1;
 #ifndef SMALL_KERNEL
if (ci->ci_feature_sefflags & SEFF0EBX_SMAP)



Re: A misconfigured disklabel can crash the kernel on listing its mounted directory contents (5.4)

2014-04-26 Thread Kevin Chadwick
previously on this list Z contributed:

> In brief, I was trying to format a usb stick as ext2, and was going back
> and forth between linux and openbsd to get it working on both (I'm
> fairly new to openbsd). The disklabel I ended up with is pasted below.
> It seems misconfigured,

You shouldn't need to use disklabel for a usb stick.

Not sure if this is still needed but mkfs.ext2 -I 128 became needed
for OpenBSD to mount it but that was made obvious from the xconsole
output.

ext2fs works fine for me but I have seen some panics when unplugging;
ext2fs doesn't get that much love on OpenBSD so you may get more
reliability (no panics) using msdosfs or ntfs-3g from ports. The latter
requires raw access though for some strange reason and so won't work
with securelevel=2 (not default).

You can also mount ffs (ufs) on linux read only by specifying ufs type
44bsd to mount.

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)

In Other Words - Don't design like polkit or systemd
___

I have no idea why RTFM is used so aggressively on LINUX mailing lists
because whilst 'apropos' is traditionally the most powerful command on
Unix-like systems it's 'modern' replacement 'apropos' on Linux is a tool
to help psychopaths learn to control their anger.

(Kevin Chadwick)

___



Re: A misconfigured disklabel can crash the kernel on listing its mounted directory contents (5.4)

2014-04-26 Thread Kenneth Westerback
I'm pretty sure that Linux does not manufacture disklabels that are
compatible with OpenBSD. And visa versa! And if you're
creating/mounting filesystems you are *not* an unprivileged user and
you *definitely* can crash systems if you're not careful. :-)

That said, if you can provide details on the crash this particular one
may be avoidable.

 Ken


On 26 April 2014 11:41, Z  wrote:
> Hi, I've never used mailing lists so please correct mistakes and forgive
> me if this is not a bug, but as I understand it you should not be able
> to crash the kernel as an unpriviledged user.
>
> In brief, I was trying to format a usb stick as ext2, and was going back
> and forth between linux and openbsd to get it working on both (I'm
> fairly new to openbsd). The disklabel I ended up with is pasted below.
> It seems misconfigured, but is the result of using (on arch linux)
> cfdisk to delete all partitions and create a new one, and then mkfs.ext2
> to create the filesystem. Previously I had created a working ext2
> partition on openbsd, but linux could not read it.
>
> I can mount this disk fine, but when I go to list the mount directory
> with ls -l, the whole computer crashes. I've verified this is true many
> times both at the console and also when ssh'd into the pc. It just
> freezes and accepts no input. The ssh connection hangs. Nothing except a
> physical poweroff does anything.
>
> I should point out that the usb stick can be read and written to
> normally on linux, so it doesn't seem to be a physical hardware problem.
> I should also say that the method I'm using to mount the stick as a non
> priviledged user seems a little fishy - namely chmodding 660 /dev/sd1*
> and making my user a member of the operators group. Or perhaps this is
> the normal way on OpenBSD, I don't know.
>
> I'm using 5.4 on an IBM Thinkpad T60. I'm happy to post a full
> dmesg/usbdevs/pcidump etc if it helps, but thought it might be too much
> for a first post.
>
>> disklabel sd1
> # /dev/rsd1c:
> type: SCSI
> disk: SCSI disk
> label: Cruzer Blade
> duid: 704ebc363be23fd4
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 973
> total sectors: 15633408
> boundstart: 0
> boundend: 15633408
> drivedata: 0
>
> 16 partitions:
> #size   offset  fstype [fsize bsize  cpg]
>   a: 156334080  ext2fs   # 
> /home/z/mounts/key
>   c: 156334080 ISO9660
>
>> disklabel -d sd1
> # /dev/rsd1c:
> type: SCSI
> disk: SCSI disk
> label: Cruzer Blade
> duid: 
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 973
> total sectors: 15633408
> boundstart: 0
> boundend: 15633408
> drivedata: 0
>
> 16 partitions:
> #size   offset  fstype [fsize bsize  cpg]
>   c: 156334080  unused
>   i: 15633346   62  ext2fs
>
>
> PS - excuse the email username "z" - I haven't got around to properly
> configuring smtpd yet.



My Cyrix CPU is a filthy rotten liar!

2014-04-26 Thread Edwin Amsler
Tried running OpenBSD on an ancient Nortel Contivity 100.

The issue is that the CPU claims to support RdRand despite being a 286MHz Cyrix 
6x686MX.

So, as soon as OpenBSD tries to use that instruction for /dev/random, the 
kernel jumps into debug land with the following:

kernel: privileged instruction fault trap, code=0
Stopped at  rdrand+0x12:%edx

I noticed that the RdRand instruction came in at OpenBSD 5.3, so I’ll try 5.2 
and see where I get. I should also mention that the only serial terminal I have 
right now is a Casio Cassiopeia running Windows CE 2.11, so I can’t save the 
full boot log yet.

The question I have is can I disable the random number generator’s use of that 
instruction? I’d rather be on -current than years old.



Re: A misconfigured disklabel can crash the kernel on listing its mounted directory contents (5.4)

2014-04-26 Thread Kevin Chadwick
previously on this list Z contributed:

> In brief, I was trying to format a usb stick as ext2, and was going back
> and forth between linux and openbsd to get it working on both (I'm
> fairly new to openbsd). The disklabel I ended up with is pasted below.
> It seems misconfigured,

forgot to say make sure you zero atleast the first megabyte of the usb
if your having problems.

/bin/dd if=/dev/zero of=/dev/sd?c 

wait a few seconds then press ^C (control-C)

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)

In Other Words - Don't design like polkit or systemd
___

I have no idea why RTFM is used so aggressively on LINUX mailing lists
because whilst 'apropos' is traditionally the most powerful command on
Unix-like systems it's 'modern' replacement 'apropos' on Linux is a tool
to help psychopaths learn to control their anger.

(Kevin Chadwick)

___



Re: heartbleed: is 5.1-stable vulnerable as it reports

2014-04-26 Thread Yassen Damyanov
Pardon me, just saw that it says 1.0.0f, not 1.0.1f.
Fear makes the wolf look bigger!
Y.





> On Saturday, April 26, 2014 7:25 PM, Yassen Damyanov  
> wrote:
> > Hello list,
> 
> I worry about my 5.1 servers being at risk due to the heartbleed bug, as they 
> report openssl 1.0.1f which is known to be vulnerable:
> 
> mgate1:~ # uname -a
> OpenBSD mgate1.itlabs.bg 5.1 GENERIC#2 amd64
> 
> 
> mgate1:~ # openssl version -a
> OpenSSL 1.0.0f 4 Jan 2012
> built on: date not available
> platform: information not available
> options:  bn(64,64) rc4(8x,int) des(idx,cisc,16,int) blowfish(idx)
> compiler: information not available
> OPENSSLDIR: "/etc/ssl"
> 
> 
> (These 5.1s are installed using openbsd-stable.org builds.)
> 
> 
> I've seen claims that OBSD 5.2 and below and not affected, which seems to 
> contradict the fact that mine has that particular openssl version.
> 
> 
> Can someone help me sort this out?
> 
> Thanks in advance!
> Yassen



heartbleed: is 5.1-stable vulnerable as it reports

2014-04-26 Thread Yassen Damyanov
Hello list,

I worry about my 5.1 servers being at risk due to the heartbleed bug, as they 
report openssl 1.0.1f which is known to be vulnerable:

mgate1:~ # uname -a
OpenBSD mgate1.itlabs.bg 5.1 GENERIC#2 amd64


mgate1:~ # openssl version -a
OpenSSL 1.0.0f 4 Jan 2012
built on: date not available
platform: information not available
options:  bn(64,64) rc4(8x,int) des(idx,cisc,16,int) blowfish(idx)
compiler: information not available
OPENSSLDIR: "/etc/ssl"


(These 5.1s are installed using openbsd-stable.org builds.)


I've seen claims that OBSD 5.2 and below and not affected, which seems to 
contradict the fact that mine has that particular openssl version.


Can someone help me sort this out?

Thanks in advance!
Yassen



Re: how to lauch slapd before ypldap ?

2014-04-26 Thread Antoine Jacoutot
On Sat, Apr 26, 2014 at 06:14:36PM +0200, Stéphane Guedon wrote:
> I have a slapd running on my server, and ypldap and ypbind.
> 
> The problem is to start them in the correct order at boot.
> 
> For now, ypldap start first and block the whole boot process.
> 
> How can I make sure slapd start before yp-stuff ?
> 
> Thanks for advices.

Just start ypldap from /etc/rc.local

-- 
Antoine



how to lauch slapd before ypldap ?

2014-04-26 Thread Stéphane Guedon
I have a slapd running on my server, and ypldap and ypbind.

The problem is to start them in the correct order at boot.

For now, ypldap start first and block the whole boot process.

How can I make sure slapd start before yp-stuff ?

Thanks for advices.

[demime 1.01d removed an attachment of type application/pgp-signature which had 
a name of signature.asc]



A misconfigured disklabel can crash the kernel on listing its mounted directory contents (5.4)

2014-04-26 Thread Z
Hi, I've never used mailing lists so please correct mistakes and forgive
me if this is not a bug, but as I understand it you should not be able
to crash the kernel as an unpriviledged user. 

In brief, I was trying to format a usb stick as ext2, and was going back
and forth between linux and openbsd to get it working on both (I'm
fairly new to openbsd). The disklabel I ended up with is pasted below.
It seems misconfigured, but is the result of using (on arch linux)
cfdisk to delete all partitions and create a new one, and then mkfs.ext2
to create the filesystem. Previously I had created a working ext2
partition on openbsd, but linux could not read it.

I can mount this disk fine, but when I go to list the mount directory
with ls -l, the whole computer crashes. I've verified this is true many
times both at the console and also when ssh'd into the pc. It just
freezes and accepts no input. The ssh connection hangs. Nothing except a
physical poweroff does anything.

I should point out that the usb stick can be read and written to
normally on linux, so it doesn't seem to be a physical hardware problem.
I should also say that the method I'm using to mount the stick as a non
priviledged user seems a little fishy - namely chmodding 660 /dev/sd1*
and making my user a member of the operators group. Or perhaps this is
the normal way on OpenBSD, I don't know.

I'm using 5.4 on an IBM Thinkpad T60. I'm happy to post a full
dmesg/usbdevs/pcidump etc if it helps, but thought it might be too much
for a first post.

> disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Cruzer Blade
duid: 704ebc363be23fd4
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 973
total sectors: 15633408
boundstart: 0
boundend: 15633408
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  a: 156334080  ext2fs   # 
/home/z/mounts/key
  c: 156334080 ISO9660

> disklabel -d sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Cruzer Blade
duid: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 973
total sectors: 15633408
boundstart: 0
boundend: 15633408
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  c: 156334080  unused
  i: 15633346   62  ext2fs


PS - excuse the email username "z" - I haven't got around to properly
configuring smtpd yet.



Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Wed, Apr 23, 2014 at 03:16:52PM +0200, Alessandro DE LAURENZIS wrote:
> Your patch is still applicable to 5.4 stable (with only minor refinements),
> but unfortunately it doesn't change anything for this BGE chip...

Thanks, this motivated me to poke a bit further at it.

Just to make sure: Did you try to enable wol with 'ifconfig bge0 wol'?

> Do you think a PCMCIA Eth card with one of the mentioned chips could be
> a reasonable solution? I mean, my understanding is that the BIOS plays a
> role in WoL stuff, so I'm wondering if a PCMCIA will stay powered on
> even when the system is switched off, like the Ethernet port is supposed
> to be...

I doubt PCMCIA would work. Cards going into PCI slots should work.
Some have a small power cable coming off the NIC that can be plugged
into the mainboard. Newer cards use the PCI bus directly for this
via the PME# signal.

Anyway, I've revised my bge diff a bit. It first checks if ASF is disabled
and allows WOL if it is disabled. We really don't want to trust ASF.
http://www.intel.com/content/dam/doc/white-paper/asf-standards-based-systems-management-paper.pdf
It's a component of AMT. AMT has pretty bad security:
http://web.it.kth.se/~maguire/DEGREE-PROJECT-REPORTS/100402-Vassilios_Ververis-with-cover.pdf

Not sure if we can trust the EEPROM not to tell lies about ASF
being disabled. But that can be discussed with others once I know
whether this diff makes wol work for you. I hope I got the power-down
sequnce right for all cards, it's based on what Linux does but
I don't have any hardware to test this.

Diff is against -current from a week ago or so. Might work with 5.5.

Index: mii/brgphyreg.h
===
RCS file: /cvs/src/sys/dev/mii/brgphyreg.h,v
retrieving revision 1.16
diff -u -p -r1.16 brgphyreg.h
--- mii/brgphyreg.h 13 Jan 2013 05:40:05 -  1.16
+++ mii/brgphyreg.h 23 Apr 2014 14:11:06 -
@@ -206,6 +206,7 @@
 #define BRGPHY_AUXCTL_TX_TST   0x0400  /* TX test, always 1 */
 #define BRGPHY_AUXCTL_DIS_PRF  0x0080  /* dis part resp filter */
 #define BRGPHY_AUXCTL_DIAG_MODE0x0004  /* Diagnostic mode */
+#define BRGPHY_AUXCTL_WOL_ENBL 0x000A  /* Enable WOL */
 
 #define BRGPHY_MII_AUXSTS  0x19/* AUX status */
 #define BRGPHY_AUXSTS_ACOMP0x8000  /* autoneg complete */
Index: pci/if_bge.c
===
RCS file: /cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.353
diff -u -p -r1.353 if_bge.c
--- pci/if_bge.c24 Feb 2014 20:00:48 -  1.353
+++ pci/if_bge.c23 Apr 2014 15:33:54 -
@@ -202,6 +202,10 @@ void bge_sig_pre_reset(struct bge_softc 
 void bge_stop_fw(struct bge_softc *, int);
 void bge_reset(struct bge_softc *);
 void bge_link_upd(struct bge_softc *);
+#ifndef SMALL_KERNEL
+int bge_wol(struct ifnet *, int);
+void bge_wol_power(struct bge_softc *);
+#endif
 
 void bge_ape_lock_init(struct bge_softc *);
 void bge_ape_read_fw_ver(struct bge_softc *);
@@ -3064,6 +3068,35 @@ bge_attach(struct device *parent, struct
if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_MSI)
CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) &
~BGE_MSIMODE_ONE_SHOT_DISABLE);
+   
+#ifndef SMALL_KERNEL
+   if (hwcfg & BGE_HWCFG_NO_GPIO2)
+   sc->bge_flags |= BGE_NO_GPIO2;
+
+   if (BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5700) {
+   /* Check if ASF is enabled. */
+   if (!(sc->bge_flags & BGE_NO_EEPROM)) {
+   if (bge_read_eeprom(sc, (caddr_t)&hwcfg,
+   BGE_EE_FEATURE_CFG_OFFSET, sizeof(hwcfg)) == 0) {
+   hwcfg = ntohl(hwcfg);
+   if (hwcfg & BGE_HWCFG_ASF)
+   sc->bge_flags |= BGE_ASF_MODE;
+   }
+   } else if (hwcfg & BGE_HWCFG_ASF) {
+   sc->bge_flags |= BGE_ASF_MODE;
+   }
+   }
+
+   /* Allow WoL if ASF is unsupported or disabled. */
+   if (!(sc->bge_flags & BGE_ASF_MODE)) {
+   ifp->if_capabilities |= IFCAP_WOL;
+   ifp->if_wol = bge_wol;
+
+   /* This heuristic matches the Linux driver. */
+   if (!(hwcfg & BGE_HWCFG_EEPROM_WRITE_PROTECT))
+   sc->bge_flags |= BGE_WOL_NEEDS_VAUX;
+   }
+#endif
 
/* Hookup IRQ last. */
DPRINTFN(5, ("pci_intr_establish\n"));
@@ -3160,6 +3193,9 @@ bge_activate(struct device *self, int ac
rv = config_activate_children(self, act);
if (ifp->if_flags & IFF_RUNNING)
bge_stop(sc);
+#ifndef SMALL_KERNEL
+   bge_wol_power(sc);
+#endif
break;
case DVACT_RESUME:
if (ifp->if_flags & IFF_UP)
@@ -4728,3 +4764,177 @@ bge_link_upd(struct bge_softc *sc)
BGE_MACSTAT_CFG_CHANGED|BGE_MAC

Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Wed, Apr 23, 2014 at 10:52:10PM +0200, Alessandro DE LAURENZIS wrote:
> In order to adapt your code to 5.4-Rel, I did the following
> modification:
> 
> From:
> 
> +   /* Configure 10Mbps, the chip draws too much power in D3cold. */
> +   if (!(sc->bge_flags & BGE_FIBER_TBI) &&
> +   !(sc->bge_flags & BGE_FIBER_MII)) {
> +   sc->bge_ifmedia.ifm_media = IFM_ETHER|IFM_10_T;
> +   if_flags = ifp->if_flags;
> +   ifp->if_flags |= IFF_UP;
> +   bge_ifmedia_upd(ifp);
> +   ifp->if_flags = if_flags;
> +   }
> 
> to:
> 
> +   /* Configure 10Mbps, the chip draws too much power in D3cold. */
> +   if !(sc->bge_flags) {
> +   sc->bge_ifmedia.ifm_media = IFM_ETHER|IFM_10_T;
> +   if_flags = ifp->if_flags;
> +   ifp->if_flags |= IFF_UP;
> +   bge_ifmedia_upd(ifp);
> +   ifp->if_flags = if_flags;
> +   }
> 
> (because BGE_FIBER_TBI and BGE_FIBER_MII are undefined); even if
> probably not semantically correct, that gives me a clean compile; in any
> case, I do not think this part is related to WoL, right?

These constants were renamed. You can use the names from the old diff:
BGE_PHY_FIBER_TBI and BGE_PHY_FIBER_MII

> Now:
> 
> # ifconfig bge0 wol
> ifconfig: SIOCSIFXFLAGS: Not supported
> 
> and the interface is still powered off after a "halt -p" command.
> 
> How can I help in continuing the debug?
> 
> Thanks a lot for your efforts.

The interesting question is:
Does your bge card support ASF? Is ASF enabled?

I've got one positive ("wol just works with your diff") test report
reply to my post tech@.
http://marc.info/?l=openbsd-tech&m=139826976013354&w=2



Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Thu, Apr 24, 2014 at 10:31:47AM +0200, Alessandro DE LAURENZIS wrote:
> After further checks, I noticed that there still was a part of the patch
> not correctly applied. I modified a bit the code and renamed the two
> constants. Now there is no error after "ifconfig bge0 wol".

Ok, so far so good.

> But the i/f is still powered off. Even removing the check on the ASF
> presence, the result is identical.
> 
> I'm wondering if it could be an ACPI side effect... Any way to force
> it to not disable the Eth?

Hmmm... I'm not sure. Usually if drivers leave the card powered up
it stays powered up.

The generic PCI code puts devices into the lowest possible power state
in sys/dev/pci.c:pci_powerdown(). Is this function called after bge_stop()?
Putting printfs into them should be enough to find out.

Ah... I think I see the problem now. Is bge_wol_power() ever being called?
It looks like the code only calls it when suspending, but not when shutting
down.

Can you please check for me if bge_activate() is called when you
shut down the machine, and with what value? Just add a printf like this:

int
bge_activate(struct device *self, int act)
{
struct bge_softc *sc = (struct bge_softc *)self;
struct ifnet *ifp = &sc->arpcom.ac_if;
int rv = 0;


printf("%s: %d\n", __func__, act);



Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Wed, Apr 23, 2014 at 11:21:33PM +0200, Alessandro DE LAURENZIS wrote:
> How can I check? For sure, there is no mention in the BIOS setup...

To find out if ASF is enabled, change this:

/* Allow WoL if ASF is unsupported or disabled. */
if (!(sc->bge_flags & BGE_ASF_MODE)) {
ifp->if_capabilities |= IFCAP_WOL;
ifp->if_wol = bge_wol;

/* This heuristic matches the Linux driver. */
if (!(hwcfg & BGE_HWCFG_EEPROM_WRITE_PROTECT))
sc->bge_flags |= BGE_WOL_NEEDS_VAUX;
}

to this:

/* Allow WoL if ASF is unsupported or disabled. */
if (!(sc->bge_flags & BGE_ASF_MODE)) {
ifp->if_capabilities |= IFCAP_WOL;
ifp->if_wol = bge_wol;

/* This heuristic matches the Linux driver. */
if (!(hwcfg & BGE_HWCFG_EEPROM_WRITE_PROTECT))
sc->bge_flags |= BGE_WOL_NEEDS_VAUX;
} else {
printf("%s: I'm suffering from ASF\n", sc->bge_dev.dv_xname);
}

If ASF is present, you can either ignore the danger and remove the
if (!(sc->bge_flags & BGE_ASF_MODE)) check and always enable WOL (this
approach will probably never be part of the official OpenBSD code base),
or try to find a way to disable ASF (but I can't tell you how because
I don't know how it can be disabled).



Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Thu, Apr 24, 2014 at 10:20:34PM +0200, Alessandro DE LAURENZIS wrote:
> but:
> 
> # dmesg | egrep DEBUG 
>   
>   
> #
> (no response)
> 
> # egrep DEBUG /var/log/*
> #
> (no response)
> 
> Where should I find the placeholder (and the output of the relevant
> printf)? I'm a bit confused...

The message should be in dmesg where you looked if the function is called.

I suspect the function is never called, which explains why the
patch doesn't make a difference for wol. I believe the wol logic
added by the patch is never triggered.

Does the message show up if you suspend/resume?



Re: Eth port (bge) physically powered down after "halt -p"

2014-04-26 Thread Stefan Sperling
On Fri, Apr 25, 2014 at 08:53:42AM +0200, Alessandro DE LAURENZIS wrote:
> Some other debug here, and this time with (I hope) more useful info.

Thanks!

> First of all, I confirm that the debug messages triggered by the added
> printf instructions are *NOT* logged by dmesg (and /var/log/*), but are
> instead visible on the screen (it takes a while to find out that,
> 'cause this laptop has an almost totally broken LCD, as I said
> previously).
> 
> Now:
> 
> 1) after a "halt -p" command, the bge_activate function is triggered
> with value 5:
> 
> BGE WOL DEBUG
> bge_activate:5

Great. This means we're missing the POWERDOWN case.

Can you try adding this 'case' block to the switch (act) statement
in bge_activate?

case DVACT_POWERDOWN:
rv = config_activate_children(self, act);
if (ifp->if_flags & IFF_RUNNING)
bge_stop(sc);
#ifndef SMALL_KERNEL
bge_wol_power(sc);
#endif
break;



Re: Get statistics of websites visited without proxy/squid

2014-04-26 Thread Stuart Henderson
On 2014-04-25, lilit-aibolit  wrote:
> Hi misc, I know this is not truly OpenBSD related, but I'd like to know
> if there is any possibility to collect such statistics.
> I'm using NAT with PF for my LAN and I don't have any proxy applications 
> like squid.
> I have already started collecting traffic statistics with nfsen, but it 
> collect only IP.
> Is there any lightweight solution?

I've done simple request logging before with urlsnarf from the dsniff package,
but a proper proxy will get you better information.



Re: adsl card advice

2014-04-26 Thread Stuart Henderson
On 2014-04-25, Kevin Chadwick  wrote:
> I've now got to find a simple fibre bridge at an OK price. I asked the ISPs
> about the ones they supply doing bridge mode and they suggested one if I
> asked specifically for it but I found it was an ADSL one.

Since you're in the UK .. the standard openreach modems (eci/huawei vdsl modem
which are confusingly named "fibre", and also the actual fibre ONTs for FTTP)
just act as a bridge and work fine with RFC4638 for 1500 MTU (ifconfig em0
mtu 1508; ifconfig pppoe0 mtu 1500).

Only problem is if you're using an ISP which doesn't use the standard
modem but their own integrated vdsl modem+router instead, easiest option
there is probably to get a standard eci/huawei modem off ebay, there are
loads on all the time.



Re: Parallela boards on OpenBSD ?

2014-04-26 Thread Martin Wheeler
> Looks like their support is GNU/Linux-centric, but I know we have other
> ARM-based CPU ports already so we're at least halfway there. I wish I
> was in a position to buy hardware for donation to the developers to
> speed up the process, and if I was, I would.

If OBSD wants one, let me know where to send it.

- Martin



Re: Parallela boards on OpenBSD ?

2014-04-26 Thread Shawn K. Quinn
On Sat, Apr 26, 2014, at 02:02 AM, Tomáš Bodžár wrote:
>   Out of curiosity was anyone in any form of contact with
> http://www.parallella.org/2014/04/10/parallella-pre-order-shipping-update/regarding
> possible support in BSD?

Looks like their support is GNU/Linux-centric, but I know we have other
ARM-based CPU ports already so we're at least halfway there. I wish I
was in a position to buy hardware for donation to the developers to
speed up the process, and if I was, I would.

-- 
  Shawn K. Quinn
  skqu...@rushpost.com



Parallela boards on OpenBSD ?

2014-04-26 Thread Tomáš Bodžár
  Out of curiosity was anyone in any form of contact with
http://www.parallella.org/2014/04/10/parallella-pre-order-shipping-update/regarding
possible support in BSD?