Re: Setting up default boot from a wd0d

2011-06-27 Thread Christopher Zimmermann
On 06/24/11 16:51, Anand Buddhdev wrote:
 Hello list users,
 
 I have a virtual server for testing, on which I have installed OpenBSD 4.8.
 The installation is on wd0a, and there's just a single / partition.
 
 I then did a second installation, and setup OpenBSD 4.9 on wd0d, also with a
 single / partition.
 
 At this point, I can reboot the server, and at the boot prompt, I can
 manually boot into one or the other system as follows:
 
 boot boot hd0a:/bsd (for OpenBSD 4.8)
 boot boot hd0d:/bsd (for OpenBSD 4.9)
 
 Next, I wished to make the 4.9 installation the default. Therefore, I did
 the following:
 
 1. Booted into 4.9
 2. Logged in as root
 3. cd /usr/mdec; ./installboot /boot ./biosboot wd0
 4. echo 'boot hd0d:/bsd'  /etc/boot.conf
 
 My expectation was that after a reboot, the OpenBSD booter would load up,
 look for wd0d:/etc/boot.conf, find the boot command in there, and boot
 automatically into 4.9. This is based on my reading of the boot.conf man
 page, section 5:
 
 5.   If the file */etc/boot.conf* exists on the filesystem *boot* was loaded
   from, open and parse it.  This file may contain any commands *boot*
   accepts at the interactive prompt.  Though default settings usually
   suffice, they can be changed here.
 
 However, this didn't happen. Instead, the server booted off hd0a:/bsd, and
 into 4.8.
 
 Is this a bug, or have I missed something?


The output of installboot -v (-n) could be helpful.
Then read and understand boot_i386(8).
On i386 BIOS loads MBR, (which maybe loads another MBR, ) which loads
the PBR (biosboot), which loads second stage bootloader (/boot), which
loads kernel (/bsd).
Your problem is possibly that the MBR still loads the PBR/biosboot from
your wd0a disklabel partition. Thats because your MBR only knows one
OpenBSD MBR partition, which starts with your wd0a disklabel partition.

I see two possible solutions to achieve dualbooting:

- use only one OpenBSD biosboot and boot bootloader and install both on
  wd0a. You can configure this bootloader with /etc/boot.conf on wd0a.
- If you really, really want to load the bootloaders from wd0d, then
  create another MBR partition using fdisk having same size and
  location as your wd0d disklabel partition. Then you can dualboot by
  activating either your real OpenBSD partition, starting at wd0a or
  this fake partition starting at wd0d.


Christopher



Re: OpenBSD's choosing of a boot device -- scd

2011-06-27 Thread Frédéric Perrin
Hello Ted,

Ted Unangst ted.unan...@gmail.com writes:
 2011/6/26 Fridiric Perrin f...@resel.fr:
 I'm currently toying with OpenBSD's boot process. I see in
 arch/i386/stand//libsa/dev_i386.c:bdevs that one can boot from a an
 scd device. However, `apropos scd' doesn't tell me anything

 Some kind of old CDROM that was never supported. I was supposed to
 have deleted all references to it eight years ago, but you found some
 that I missed. Now it's even more deleted.

OK, I'll just ignore it. BTW, you can save 10 bytes or so of memory by
reducing the size of bdevs[] now :-).

--
FrC)dC)ric Perrin -- http://tar-jx.bz



openbsd hard disk information

2011-06-27 Thread Friedrich Locke
Dear list member,

i have installed OpenBSD on my desktop; every thing is ok, expect for
disk information report.
It is showed as wd0. I am confused because as far as i know it is a sata device.

Why does it (OpenBSD) see it as an old wd.

Thanks in advance.



Re: openbsd hard disk information

2011-06-27 Thread Rod Whitworth
On Mon, 27 Jun 2011 08:31:43 -0300, Friedrich Locke wrote:

Dear list member,

i have installed OpenBSD on my desktop; every thing is ok, expect for
disk information report.
It is showed as wd0. I am confused because as far as i know it is a sata 
device.

Yep, and the old one is pata.

So they are both ATA devices


Why does it (OpenBSD) see it as an old wd.

It doesn't. It sees it as a new wd.

man wd would have told you all that.

Maybe you are an old man?  8=)



*** NOTE *** Please DO NOT CC me. I am subscribed to the list.
Mail to the sender address that does not originate at the list server is 
tarpitted. The reply-to: address is provided for those who feel compelled to 
reply off list. Thankyou.

Rod/
---
This life is not the real thing.
It is not even in Beta.
If it was, then OpenBSD would already have a man page for it.



Re: openbsd hard disk information

2011-06-27 Thread David Coppa
On Mon, Jun 27, 2011 at 1:31 PM, Friedrich Locke
friedrich.lo...@gmail.com wrote:
 Dear list member,

 i have installed OpenBSD on my desktop; every thing is ok, expect for
 disk information report.
 It is showed as wd0. I am confused because as far as i know it is a sata 
 device.

 Why does it (OpenBSD) see it as an old wd.

Probably your SATA drive is configured in Legacy mode from the BIOS:
go check for it in your bios settings.

Ciao,
David



Re: openbsd hard disk information

2011-06-27 Thread David Gwynne
On 27/06/2011, at 9:31 PM, Friedrich Locke wrote:

 Dear list member,

 i have installed OpenBSD on my desktop; every thing is ok, expect for
 disk information report.
 It is showed as wd0. I am confused because as far as i know it is a sata
device.

 Why does it (OpenBSD) see it as an old wd.

why not? all you should care about is that you can talk to the blocks on your
disk, how you get to them is hopefully not important.

the reason is sata disks still respond to ata commands, and a lot of sata
controllers appear as largely compatible to a traditional ata controller
supported by the legacy ata stack. just luck i guess :)

dlg



Re: openbsd hard disk information

2011-06-27 Thread Otto Moerbeek
On Mon, Jun 27, 2011 at 01:44:39PM +0200, David Coppa wrote:

 On Mon, Jun 27, 2011 at 1:31 PM, Friedrich Locke
 friedrich.lo...@gmail.com wrote:
  Dear list member,
 
  i have installed OpenBSD on my desktop; every thing is ok, expect for
  disk information report.
  It is showed as wd0. I am confused because as far as i know it is a sata 
  device.
 
  Why does it (OpenBSD) see it as an old wd.
 
 Probably your SATA drive is configured in Legacy mode from the BIOS:
 go check for it in your bios settings.
 
 Ciao,
 David

But beware, if yu change the bios mode to ahci, the disk shows up as a
sd(4) device. On that case, you'll have to edit your existing fstab. 

-Otto



Re: openbsd hard disk information

2011-06-27 Thread Peter Hessler
On 2011 Jun 27 (Mon) at 13:54:32 +0200 (+0200), Otto Moerbeek wrote:
:On Mon, Jun 27, 2011 at 01:44:39PM +0200, David Coppa wrote:
:
: On Mon, Jun 27, 2011 at 1:31 PM, Friedrich Locke
: friedrich.lo...@gmail.com wrote:
:  Dear list member,
: 
:  i have installed OpenBSD on my desktop; every thing is ok, expect for
:  disk information report.
:  It is showed as wd0. I am confused because as far as i know it is a sata 
device.
: 
:  Why does it (OpenBSD) see it as an old wd.
: 
: Probably your SATA drive is configured in Legacy mode from the BIOS:
: go check for it in your bios settings.
: 
: Ciao,
: David
:
:But beware, if yu change the bios mode to ahci, the disk shows up as a
:sd(4) device. On that case, you'll have to edit your existing fstab. 
:
:   -Otto
:

Only if you don't use DUIDs in your fstab (default these days...)

-- 
If time heals all wounds, how come the belly button stays the same?



Re: openbsd hard disk information

2011-06-27 Thread Otto Moerbeek
On Mon, Jun 27, 2011 at 02:00:26PM +0200, Peter Hessler wrote:

 On 2011 Jun 27 (Mon) at 13:54:32 +0200 (+0200), Otto Moerbeek wrote:
 :On Mon, Jun 27, 2011 at 01:44:39PM +0200, David Coppa wrote:
 :
 : On Mon, Jun 27, 2011 at 1:31 PM, Friedrich Locke
 : friedrich.lo...@gmail.com wrote:
 :  Dear list member,
 : 
 :  i have installed OpenBSD on my desktop; every thing is ok, expect for
 :  disk information report.
 :  It is showed as wd0. I am confused because as far as i know it is a sata 
 device.
 : 
 :  Why does it (OpenBSD) see it as an old wd.
 : 
 : Probably your SATA drive is configured in Legacy mode from the BIOS:
 : go check for it in your bios settings.
 : 
 : Ciao,
 : David
 :
 :But beware, if yu change the bios mode to ahci, the disk shows up as a
 :sd(4) device. On that case, you'll have to edit your existing fstab. 
 :
 : -Otto
 :
 
 Only if you don't use DUIDs in your fstab (default these days...)

In current, yet, but not in the latest release, iirc.

-Otto



Re: Setting up default boot from a wd0d

2011-06-27 Thread Kenneth R Westerback
On Mon, Jun 27, 2011 at 08:57:27AM +0200, Christopher Zimmermann wrote:
 On 06/24/11 16:51, Anand Buddhdev wrote:
  Hello list users,
  
  I have a virtual server for testing, on which I have installed OpenBSD 4.8.
  The installation is on wd0a, and there's just a single / partition.
  
  I then did a second installation, and setup OpenBSD 4.9 on wd0d, also with a
  single / partition.
  
  At this point, I can reboot the server, and at the boot prompt, I can
  manually boot into one or the other system as follows:
  
  boot boot hd0a:/bsd (for OpenBSD 4.8)
  boot boot hd0d:/bsd (for OpenBSD 4.9)
  
  Next, I wished to make the 4.9 installation the default. Therefore, I did
  the following:
  
  1. Booted into 4.9
  2. Logged in as root
  3. cd /usr/mdec; ./installboot /boot ./biosboot wd0
  4. echo 'boot hd0d:/bsd'  /etc/boot.conf

The boot loader in the MBR is barely intelligent enough to load the
/boot program from the first FFS in the bootable OpenBSD partition.
Which will be 'a' unless you have worked very hard to make a
completely confused disk layout.

So it is likely not loading the /boot you think it is, nor looking at
the /etc/boot.conf file you think it is.

Don't think too harshly of it. It has less than 512 bytes to live in.

As Nick says: DON'T DO THIS! 'a' is the root. Period. Feel free to
experiment otherwise but such configurations will not ever be
supported and will work by accident if at all.

 Ken

  
  My expectation was that after a reboot, the OpenBSD booter would load up,
  look for wd0d:/etc/boot.conf, find the boot command in there, and boot
  automatically into 4.9. This is based on my reading of the boot.conf man
  page, section 5:
  
  5.   If the file */etc/boot.conf* exists on the filesystem *boot* was loaded
from, open and parse it.  This file may contain any commands 
  *boot*
accepts at the interactive prompt.  Though default settings 
  usually
suffice, they can be changed here.
  
  However, this didn't happen. Instead, the server booted off hd0a:/bsd, and
  into 4.8.
  
  Is this a bug, or have I missed something?
 
 
 The output of installboot -v (-n) could be helpful.
 Then read and understand boot_i386(8).
 On i386 BIOS loads MBR, (which maybe loads another MBR, ) which loads
 the PBR (biosboot), which loads second stage bootloader (/boot), which
 loads kernel (/bsd).
 Your problem is possibly that the MBR still loads the PBR/biosboot from
 your wd0a disklabel partition. Thats because your MBR only knows one
 OpenBSD MBR partition, which starts with your wd0a disklabel partition.
 
 I see two possible solutions to achieve dualbooting:
 
 - use only one OpenBSD biosboot and boot bootloader and install both on
   wd0a. You can configure this bootloader with /etc/boot.conf on wd0a.
 - If you really, really want to load the bootloaders from wd0d, then
   create another MBR partition using fdisk having same size and
   location as your wd0d disklabel partition. Then you can dualboot by
   activating either your real OpenBSD partition, starting at wd0a or
   this fake partition starting at wd0d.
 
 
 Christopher



Re: Setting up default boot from a wd0d

2011-06-27 Thread Anand Buddhdev
On 27 June 2011 04:46, Nick Holland n...@holland-consulting.net wrote:

Hello Nick,

 I then did a second installation, and setup OpenBSD 4.9 on wd0d, also with
 a
  single / partition.

 bad.


Why is this bad? What's wrong with having 2 OpenBSD installations on a
single disk?


 it's an unsupported configuration -- OpenBSD boots from the 'a'
 partition.  Anything else...you are pretty much on your own, and your
 results will probably not be portable across platforms.  Things may break.

 You say this is a virtual server...why are you trying to multiboot a
 virtual server?  Build a new VM!  Or maybe bolt a new disk onto an old
 VM, if you want easy access to the old files.


It's a virtual server because I'm using it for testing.

My scenario is that I have a small Soekris board running an older OpenBSD
(installed on a CF card).

I'd like to upgrade to a newer OpenBSD without overwriting the current setup
(to use as a fallback in case something is wrong with the new install). This
is why I did the second installation in wd0d. If I manually boot 4.9 from
wd0d, everything just works. Why do you say that this is an unsupported
configuration? I know that the convention is to use 'a' for / and the other
partitions for other things, but it can't be a crime to use a 'd' partition
as the root for another OpenBSD installation.


 I can't think of any good reason to have different versions on the same
 machine, 'specially a past version.  Some people want to pretend to
 develop (on -current) and use -release/-stable for production, but if
 you are developing, eat your own dog food, and USE -current, you aren't
 doing anyone any favor by busting -current and using something else.
 The closest justification I can find is on an amd64 system, to test both
 amd64 and i386 code.


I just explained that I'd like to install a new version on an existing CF
card, so that I can fall back to the old version in case anything goes
wrong.

Actually, I know of a way to make this work, which involves moving the new
'd' partition into the place of 'a', and moving the old 'a' partition into
the place of 'd'. This works, and allows for auto booting into the new
installation while still preserving the old one for fallback.

However, it involves the ugly step of moving partitions around inside the
disklabel. Surely the ability to boot off another partition would be
elegant, no?


 If you really want to have multiple versions of OpenBSD on one physical
 i386/amd64 machine, use some kind of boot manager program which hides
 inactive partitions.  You can do this manually using bsd.rd and fdisk,
 changing the desired partition to type 'a6' and flagged active, and the
 unwanted partition as some other type and NOT flagged active.  However,
 I've tried this, I know exactly what needs to be done, and I've made a
 lot of mistakes trying to do what I know needed to be done.  Mistakes
 result in unbootable disks to corrupt file systems (big lesson: boot
 from bsd.rd, don't try to use fdisk to change the ID of a running
 system.  That's the corrupted FS).


Ok, so just to be clear: you're suggesting that I create *two* OpenBSD
slices on a disk using fdisk, and then hide the one I don't want to boot
from?



Re: Setting up default boot from a wd0d

2011-06-27 Thread Peter Hessler
On 2011 Jun 27 (Mon) at 14:32:47 +0200 (+0200), Anand Buddhdev wrote:
:My scenario is that I have a small Soekris board running an older OpenBSD
:(installed on a CF card).
:
:I'd like to upgrade to a newer OpenBSD without overwriting the current setup
:(to use as a fallback in case something is wrong with the new install).

Buy two CF cards.  This way, you can even install and test without
touching the currently running system.


-- 
One way to stop a runaway horse is to bet on him.



aucat(1) mixing streams from different users

2011-06-27 Thread Jona Joachim
Hi,
I start mpd and aucat with default settings using rc scripts.
aucat thus runs as user _sndio and mpd runs as _mpd.
Access to sndio between mpd and programs running as a different user are
mutually exclusive, so when mpd is playing music nothing else can access
the sound device.
According to the aucat(1) manpage:
[...] the server can be started by the super-user, [...]  but for
privacy reasons only one user may have connections to it at a given
time.
I was wondering if this is intended behaviour because aucat here does
not run as root but as _sndio.

Best regards,
Jona

-- 
Worse is better
Richard P. Gabriel



Re: Setting up default boot from a wd0d

2011-06-27 Thread Anand Buddhdev
On 27 June 2011 14:40, Peter Hessler phess...@theapt.org wrote:

On 2011 Jun 27 (Mon) at 14:32:47 +0200 (+0200), Anand Buddhdev wrote:
 :My scenario is that I have a small Soekris board running an older OpenBSD
 :(installed on a CF card).
 :
 :I'd like to upgrade to a newer OpenBSD without overwriting the current
 setup
 :(to use as a fallback in case something is wrong with the new install).

 Buy two CF cards.  This way, you can even install and test without
 touching the currently running system.


Hi Peter,

Yes, that's also another option we can (and do) use for some systems. I'm
just amazed that the OpenBSD boot loader can't be configured (by default) to
boot off another partition.

Anyway, from all the answers here (some of which are rather preachy and
evangelical: don't do this), I've gathered that what I am asking for isn't
possible. That's ok. I'll just fall back to some of the other options we
have (new CF card, swapping partitions in the disklabel), all of which work.

Thanks everyone for taking the time to answer my question.

Regards,

Anand



Re: aucat(1) mixing streams from different users

2011-06-27 Thread Alexandre Ratchov
On Mon, Jun 27, 2011 at 02:42:42PM +0200, Jona Joachim wrote:
 Hi,
 I start mpd and aucat with default settings using rc scripts.
 aucat thus runs as user _sndio and mpd runs as _mpd.
 Access to sndio between mpd and programs running as a different user are
 mutually exclusive, so when mpd is playing music nothing else can access
 the sound device.
 According to the aucat(1) manpage:
 [...] the server can be started by the super-user, [...]  but for
 privacy reasons only one user may have connections to it at a given
 time.
 I was wondering if this is intended behaviour because aucat here does
 not run as root but as _sndio.

This is ok, the _sndio user is to avoid running the server with root
privileges, it's not involved in the authentication process. You can
find slightly more details about how it works in the AUTHENTICATION
section of the sndio(7) man page.

The simpler -- and most natural imho -- would be configure mpd to use
unix domain sockets (instead of TCP) and to run it as your user id
instead of _mpd.

If you can't, you can cheat by copying mpd's ~/.aucat_cookie in your
home directory (it must have mode 0600) this way aucat will consider
_mpd and you are the same person. After all, I guess you run _mpd for
you ;)

-- Alexandre



Re: Setting up default boot from a wd0d

2011-06-27 Thread Nick Holland

On 06/27/2011 08:32 AM, Anand Buddhdev wrote:

On 27 June 2011 04:46, Nick Hollandn...@holland-consulting.net  wrote:

Hello Nick,


I then did a second installation, and setup OpenBSD 4.9 on wd0d, also with
a

single / partition.


bad.



Why is this bad? What's wrong with having 2 OpenBSD installations on a
single disk?


it isn't supported.

The developers make (and document) certain assumptions about how a 
system is to be used.  You violated those assumptions.  That simple.



it's an unsupported configuration -- OpenBSD boots from the 'a'
partition.  Anything else...you are pretty much on your own, and your
results will probably not be portable across platforms.  Things may break.

...


My scenario is that I have a small Soekris board running an older OpenBSD
(installed on a CF card).

I'd like to upgrade to a newer OpenBSD without overwriting the current setup
(to use as a fallback in case something is wrong with the new install). This
is why I did the second installation in wd0d. If I manually boot 4.9 from
wd0d, everything just works. Why do you say that this is an unsupported
configuration? I know that the convention is to use 'a' for / and the other
partitions for other things, but it can't be a crime to use a 'd' partition
as the root for another OpenBSD installation.


I say it is unsupported because it is.  I get to hang around with the 
developers (a very special privilege, I must tell you).  I get yelled at 
if I suggest something that isn't fully supported.


It's not a legal crime to do things wrong with OpenBSD (hey, OpenBSD 
defends your right to do anything you want with it far more than most 
other OSs), but it isn't just a convention -- it's how you do things 
properly.  If you do things improperly and things don't work as you 
imagine, you are 100% on your own, and we will assume things WILL BREAK.



Ok, so your goal is rollback from a failed upgrade.  There are better 
ways of doing this, a few of them:

1) Alternate flash cards.
2) image the existing disk to another machine (flash cards are 
relatively small, relatively fast to do this), revert the image if needed.
3) don't sweat it -- practice on a different machine, and just do your 
upgrade.  Soekris are popular machines in the OpenBSD world, and the 
upgrade process works well.  Likelihood of a problem when just using it 
as intended is very low.


All these are supported processes.

Now, you have to look at the risks of having the system fail BECAUSE you 
are doing unsupported things with it.  I've played with multibooting 
OpenBSD systems.  Can be done, but FAR more likely to blow out your 
system trying to protect it from upgrade failures than an upgrade 
failure itself is to occur.


I.e., by trying to avoid one unlikely problem, you are much more likely 
to create downtime by creating new problems that never should have 
existed.  Some people call that job security, I call that bad system 
administration.


Simple systems have simple problems.  Complex systems blow their guts 
all over the place and take hours or days to repair.


...

Actually, I know of a way to make this work, which involves moving the new
'd' partition into the place of 'a', and moving the old 'a' partition into
the place of 'd'. This works, and allows for auto booting into the new
installation while still preserving the old one for fallback.


You just think you know how this is working.
Read faq14, 'specially the section on how i386/amd64 boots, pay special 
attention to the PBR.  You are using PARTS of one system, parts of 
another.  Maybe that's good enough...sometimes.



However, it involves the ugly step of moving partitions around inside the
disklabel. Surely the ability to boot off another partition would be
elegant, no?


Maybe (not likely), but the developers have spent their time on more 
real issues, like making sure upgrades go smoothly and the system can 
boot properly and Just Work on many different kinds of machines, rather 
than trying to support bad solutions to non-problems.


What you propose has complexities you don't seem to appreciate.  Making 
it all work properly and perfectly on all the buggy BIOSs of the PC 
world is non-trivial...and when you get done with it, so what?.




If you really want to have multiple versions of OpenBSD on one physical
i386/amd64 machine, use some kind of boot manager program which hides
inactive partitions.  You can do this manually using bsd.rd and fdisk,
changing the desired partition to type 'a6' and flagged active, and the
unwanted partition as some other type and NOT flagged active.  However,
I've tried this, I know exactly what needs to be done, and I've made a
lot of mistakes trying to do what I know needed to be done.  Mistakes
result in unbootable disks to corrupt file systems (big lesson: boot
from bsd.rd, don't try to use fdisk to change the ID of a running
system.  That's the corrupted FS).



Ok, so just to be clear: you're suggesting that I create *two* OpenBSD
slices on a disk 

Re: aucat(1) mixing streams from different users

2011-06-27 Thread Jona Joachim
On 2011-06-27, Alexandre Ratchov a...@caoua.org wrote:
 On Mon, Jun 27, 2011 at 02:42:42PM +0200, Jona Joachim wrote:
 Hi,
 I start mpd and aucat with default settings using rc scripts.
 aucat thus runs as user _sndio and mpd runs as _mpd.
 Access to sndio between mpd and programs running as a different user are
 mutually exclusive, so when mpd is playing music nothing else can access
 the sound device.
 According to the aucat(1) manpage:
 [...] the server can be started by the super-user, [...]  but for
 privacy reasons only one user may have connections to it at a given
 time.
 I was wondering if this is intended behaviour because aucat here does
 not run as root but as _sndio.

 This is ok, the _sndio user is to avoid running the server with root
 privileges, it's not involved in the authentication process. You can
 find slightly more details about how it works in the AUTHENTICATION
 section of the sndio(7) man page.

 The simpler -- and most natural imho -- would be configure mpd to use
 unix domain sockets (instead of TCP) and to run it as your user id
 instead of _mpd.

 If you can't, you can cheat by copying mpd's ~/.aucat_cookie in your
 home directory (it must have mode 0600) this way aucat will consider
 _mpd and you are the same person. After all, I guess you run _mpd for
 you ;)

I see, this is the new authentication mechanism kicking in :)
Thanks for the explanation, now that I know what's causing it, it's easy to fix.

Best regards,
Jona

-- 
Worse is better
Richard P. Gabriel



parameter scope in bourne vs ksh functions

2011-06-27 Thread Christopher Zimmermann
Hi,

ksh(1) states this:

Functions defined with the function reserved word are treated differently
in the following ways from functions defined with the () notation:

[...]

o   Parameter assignments preceding function calls are not kept in the
shell environment (executing Bourne-style functions will keep
assignments).

This does not work for me:

$ i=foo
$ function fun { echo $i; }
$ fun
foo
$ i=bar
$ fun
bar
$ function fun2 { echo $j; }
$ fun2

$ j=foo
$ fun2
foo
$


Have I got something wrong there?


Christopher



Re: parameter scope in bourne vs ksh functions

2011-06-27 Thread Ted Unangst
On Mon, Jun 27, 2011 at 11:00 AM, Christopher Zimmermann
madro...@zakweb.de wrote:
 Hi,

 ksh(1) states this:

 Functions defined with the function reserved word are treated differently
in the following ways from functions defined with the () notation:

[...]

o   Parameter assignments preceding function calls are not kept in the
shell environment (executing Bourne-style functions will keep
assignments).

 This does not work for me:

 $ i=foo
 $ function fun { echo $i; }

That doesn't count as an assignment preceding a function call.
Compare with what happens running the test below.

function f1 {
echo $i;
}
f2() {
echo $i;
}

i=foo
i=1 f1
f1

i=bar
i=2 f2
f2



4.8 and 4.9 Panic on Supermicro P8SCi

2011-06-27 Thread listmail
Hi,

At the end of May, there was discussion on the list regarding the panic
related to interdrm when installing 4.8 or 4.9 on Supermicro P8SCi mobos. At
the time, it looked like a fix was going to be checked in.

I was hoping that a new ISO might be posted with this fix, but I don't see
anything later than March 2nd on the ftp site. Does anyone know if there is a
patched installer available? 

Thanks,
--Bill



Re: 4.8 and 4.9 Panic on Supermicro P8SCi

2011-06-27 Thread Nick Holland

On 06/27/2011 02:03 PM, listmail wrote:

Hi,

At the end of May, there was discussion on the list regarding the panic
related to interdrm when installing 4.8 or 4.9 on Supermicro P8SCi mobos. At
the time, it looked like a fix was going to be checked in.

I was hoping that a new ISO might be posted with this fix, but I don't see
anything later than March 2nd on the ftp site. Does anyone know if there is a
patched installer available?

Thanks,
--Bill



pub/OpenBSD/snapshots/arch
is what you are looking for on your favorite mirror.

And maybe a read-through of http://www.openbsd.org/faq/faq5.html
(this will probably answer the questions you are about to ask in 
response to the above...)


Nick.



Re: parameter scope in bourne vs ksh functions

2011-06-27 Thread Christopher Zimmermann
On 06/27/11 17:49, Ted Unangst wrote:
 On Mon, Jun 27, 2011 at 11:00 AM, Christopher Zimmermann
 madro...@zakweb.de wrote:
 Hi,

 ksh(1) states this:

 Functions defined with the function reserved word are treated differently
in the following ways from functions defined with the () notation:

[...]

o   Parameter assignments preceding function calls are not kept in the
shell environment (executing Bourne-style functions will keep
assignments).

 This does not work for me:

 $ i=foo
 $ function fun { echo $i; }
 
 That doesn't count as an assignment preceding a function call.
 Compare with what happens running the test below.
 
 function f1 {
 echo $i;
 }
 f2() {
 echo $i;
 }
 
 i=foo
 i=1 f1
 f1
 
 i=bar
 i=2 f2
 f2

$ function f1 { echo $i; }
$ f2 () { echo $i; }
$ i=foo
$ i=1 f1
1
$ echo $i
foo
$ i=1 true
$ echo $i
foo
$ i=1 f2
1
$ echo $i
1

Ok, I got it. But wtf? Thats creepy! Is there any rationale behind this
strange bourne behaviour?!?



Re: splassert: assertwaitok: want -1 have 1

2011-06-27 Thread Stuart Henderson
On 2011-05-21, Ed  D. li...@rensseltucky.com wrote:
 I'm posting this because I haven't yet found
 a resolution ot this problem.

From what I understand, this is fixed with this commit in -current

-
PatchSet 3072 
Date: 2011/04/17 21:44:27
Author: stsp
Branch: HEAD
Tag: (none) 
Log:
in_ifinit() is not prepared to be called from interrupt context so add
addresses from process context by scheduling a work queue.
Fixes an assertwaitok panic. ok henning

Members: 
if_spppsubr.c:1.84-1.85 

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.84 src/sys/net/if_spppsubr.c:1.85
--- src/sys/net/if_spppsubr.c:1.84  Tue Jan 11 15:42:05 2011
+++ src/sys/net/if_spppsubr.c   Sun Apr 17 20:44:27 2011
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.84 2011/01/11 15:42:05 deraadt Exp $
*/
+/* $OpenBSD: if_spppsubr.c,v 1.85 2011/04/17 20:44:27 stsp Exp $   */
 /*
  * Synchronous PPP/Cisco link level subroutines.
  * Keepalive protocol implemented in both Cisco and PPP modes.
@@ -47,6 +47,7 @@
 #include sys/syslog.h
 #include sys/malloc.h
 #include sys/mbuf.h
+#include sys/workq.h
 
 #if defined (__OpenBSD__)
 #include sys/timeout.h
@@ -410,8 +411,7 @@
 HIDE void sppp_qflush(struct ifqueue *ifq);
 int sppp_update_gw_walker(struct radix_node *rn, void *arg, u_int);
 void sppp_update_gw(struct ifnet *ifp);
-HIDE void sppp_set_ip_addrs(struct sppp *sp, u_int32_t myaddr,
- u_int32_t hisaddr);
+HIDE void sppp_set_ip_addrs(void *, void *);
 HIDE void sppp_clear_ip_addrs(struct sppp *sp);
 HIDE void sppp_set_phase(struct sppp *sp);
 
@@ -3024,19 +3024,38 @@
addlog(\n);
 }
 
+struct sppp_set_ip_addrs_args {
+   struct sppp *sp;
+   u_int32_t myaddr;
+   u_int32_t hisaddr;
+};
+
 HIDE void
 sppp_ipcp_tlu(struct sppp *sp)
 {
+   struct ifnet *ifp = sp-pp_if;
+   struct sppp_set_ip_addrs_args *args;
+
+   args = malloc(sizeof(*args), M_TEMP, M_NOWAIT);
+   if (args == NULL)
+   return;
+
+   args-sp = sp;
+
/* we are up. Set addresses and notify anyone interested */
-   u_int32_t myaddr, hisaddr;
-   sppp_get_ip_addrs(sp, myaddr, hisaddr, 0);
+   sppp_get_ip_addrs(sp, args-myaddr, args-hisaddr, 0);
if ((sp-ipcp.flags  IPCP_MYADDR_DYN) 
(sp-ipcp.flags  IPCP_MYADDR_SEEN))
-   myaddr = sp-ipcp.req_myaddr;
+   args-myaddr = sp-ipcp.req_myaddr;
if ((sp-ipcp.flags  IPCP_HISADDR_DYN) 
(sp-ipcp.flags  IPCP_HISADDR_SEEN))
-   hisaddr = sp-ipcp.req_hisaddr;
-   sppp_set_ip_addrs(sp, myaddr, hisaddr);
+   args-hisaddr = sp-ipcp.req_hisaddr;
+
+   if (workq_add_task(NULL, 0, sppp_set_ip_addrs, args, NULL)) {
+   free(args, M_TEMP);
+   printf(%s: workq_add_task failed, cannot set 
+   addresses\n, ifp-if_xname);
+   }
 }
 
 HIDE void
@@ -4689,15 +4708,27 @@
 }
 
 /*
+ * Work queue task adding addresses from process context.
  * If an address is 0, leave it the way it is.
  */
 HIDE void
-sppp_set_ip_addrs(struct sppp *sp, u_int32_t myaddr, u_int32_t hisaddr)
+sppp_set_ip_addrs(void *arg1, void *arg2)
 {
-   STDDCL;
+   struct sppp_set_ip_addrs_args *args = arg1;
+   struct sppp *sp = args-sp;
+   u_int32_t myaddr = args-myaddr;
+   u_int32_t hisaddr = args-hisaddr;
+   struct ifnet *ifp = sp-pp_if;
+   int debug = ifp-if_flags  IFF_DEBUG;
struct ifaddr *ifa;
struct sockaddr_in *si;
struct sockaddr_in *dest;
+   int s;
+   
+   /* Arguments are now on local stack so free temporary storage. */
+   free(args, M_TEMP);
+
+   s = splsoftnet();
 
/*
 * Pick the first AF_INET address from the list,
@@ -4748,10 +4779,12 @@
if (debug  error) {
log(LOG_DEBUG, SPP_FMT sppp_set_ip_addrs: in_ifinit 
 failed, error=%d\n, SPP_ARGS(ifp), error);
+   splx(s);
return;
}
sppp_update_gw(ifp);
}
+   splx(s);
 }
 
 /*



Re: parameter scope in bourne vs ksh functions

2011-06-27 Thread Ted Unangst
On Mon, Jun 27, 2011 at 2:44 PM, Christopher Zimmermann
madro...@zakweb.de wrote:
 Ok, I got it. But wtf? Thats creepy! Is there any rationale behind this
 strange bourne behaviour?!?

I would guess historical accident or some quirk of the implementation.
 Then once it was discovered, it became unfixable because of back
compat.  Fortunately, ksh is not strictly tied to bourne
compatibility.



umount(8) by device + overloaded mountpoint is not catched

2011-06-27 Thread Christopher Zimmermann
Hi,

when umount(8)ing by device, umount fetches the mountpoint via
getmntinfo(3), because unmount(2) only supports unmounting via
mountpoint.
This means it is simply impossible to unmount a specific filesystem
from an overloaded mountpoint. I think umount(8) should detect this
case, warn the user and give up. Instead it plays roulette and calls
unmount(2) on the mountpoint.
This should be easy to fix, but it will require some restructuring of
the code. That's because the current code cannot discriminate between
the unmount by special device and unmount by mountpoint cases in
the getmntname() function where the evaluation of the statfs(2)
structures from getmntinfo(3) happens.


Regards,

Christopher



Here's an umount run in which it went wrong.

$ mount
/dev/wd0a on / type ffs (local)
mfs:1701 on /tmp type mfs (asynchronous, local, nodev, nosuid,
size=2096816 512-blocks)
/dev/wd0d on /usr type ffs (local, nodev)
/dev/wd0e on /usr/local type ffs (local, nodev)
/dev/sd0d on /var type ffs (local, nodev, nosuid, softdep)
/dev/sd0e on /home type ffs (local, nodev, nosuid, softdep)
/dev/sd1i on /vol/sd1i type msdos (local, uid=0, gid=10, mask=0660, direxec)
/dev/wd0i on /vol/sd1i type msdos (local, uid=0, gid=10, mask=0770)
$ sudo umount /dev/sd1i
$ mount
/dev/wd0a on / type ffs (local)
mfs:1701 on /tmp type mfs (asynchronous, local, nodev, nosuid,
size=2096816 512-blocks)
/dev/wd0d on /usr type ffs (local, nodev)
/dev/wd0e on /usr/local type ffs (local, nodev)
/dev/sd0d on /var type ffs (local, nodev, nosuid, softdep)
/dev/sd0e on /home type ffs (local, nodev, nosuid, softdep)
/dev/sd1i on /vol/sd1i type msdos (local, uid=0, gid=10, mask=0660, direxec)
$



ZTE MF 180 USB modem

2011-06-27 Thread Jeff Ross

Hi,

I have a friend in the Peace Corp in Morocco.  He's using a ZTE MF 180 
USB modem connecting with Maroc Telecom on his windows based Acer 
Netbook.  I'm already sick of walking him through removing the latest 
windows 'sploit of the week, especially given that we do it through 
e-mail and across a lot of time zones :-)


I'm thinking about making him a USB bootable OpenBSD installation with 
KDE to get him onto a secure platform but the modem has to work.


Has anyone had any experience with the MF 180?  Mr Google didn't turn up 
anything for OpenBSD.


Thanks,

Jeff



Raid configuration help.

2011-06-27 Thread Zeb Packard
Hello all, I'm new so if I do anything rude please let me know so I can adjust.

I set up an openbsd file server using sftp, with a raid 1
configuration and failover with Carp. My plan was to use rsync to sync
up the file sharing directories and I believe I got a little bit ahead
of myself when I thought I could rsync the /etc folder to streamline
the configuration of my servers. It's quite possible that one of my
systems was broken from an earlier attempt at reinstalling (which
synced a functional, yet broken configuration with a good system), at
the time I thought the raid automatically fixed the attempt at
reinstalling, but after looking at my fstab file I'm pretty certain
the raid hadn't been functioning properly for a while. (very stable
system though that fails so gracefully) Anyways, long story short, I
have a lot of work on that system, I'm not hoping to recover the
beast, I just want to copy my files off of it and transfer them to a
working system, but it is booting read-only with /etc/nologin in place
and I cannot figure out why.

Please help.

Zeb Packard



Sistema Compranet 5.0 Actualizaciones y uso

2011-06-27 Thread Ana Garcia
[IMAGE]

Empresa Registrada ante la STPS Reg. COLG640205CP30005 Smguenos en
Twitter@pmscapacitacion o bien en Facebook PMS de Mixico

Conozca de la mano de un experto el correcto uso de este sistema !No deje
pasar oportunidades de Negocio!

Manejo Sptimo del Sistema Compranet 5.0

 29 de Junio Guadalajara / 01 de Julio Monterrey

Este taller esta orientado al uso del sistema Compranet 5.0, el
participante podra realizar una bzsqueda de licitaciones, manejara
correctamente el envmo de propuestas, conociendo al detalle el
funcionamiento de esta nueva plataforma.

!Beneficios que obtendra con este programa!

Le aseguramos que con este programa usted adquirira los conocimientos
necesarios para convertirse en un proveedor de gobierno altamente
efectivo.

Duracisn: 10 horas impartidas por nuestro experto en la materia Mtro.
Alberto Ledesma G.

?A Quiin va Dirigido?

Empresarios, Contratistas, Servidores Pzblicos y personas relacionadas
con cualquier Proceso de Contrataciones y

Licitaciones de Adquisiciones, Arrendamientos y Servicios.

Solicite mas informes y analice este excelente evento. !Reservaciones!

Solicite Mayores informes, Llamenos al (33) 8851-2365, (33) 8851-2741

Uno de nuestros asesores con gusto le atendera
Responda esta invitacisn con sus datos para enviar el programa completo.

Empresa:
Nombre:
Telifono:
Email:
Nzmero de Interesados:

!Gracias!

Copyright (C) 2010, PMS Capacitacisn Efectiva de Mixico  S.C. Derechos
Reservados. PMS de Mixico, El logo de PMS de Mixico son marcas
registradas. ADVERTENCIA PMS de Mixico no cuenta con alianzas
estratigicas de ningzn tipo dentro de la Repzblica Mexicana. NO SE DEJE
ENGAQAR - DIGA NO A LA PIRATERIA. Todos los logotipos, marcas comerciales
e imagenes son propiedad de sus respectivas corporaciones y se utilizan
con fines informativos solamente.

Este Mensaje ha sido enviado a misc@openbsd.org como usuario de Pms de
Mixico o bien un usuario le refiris para recibir este boletmn.
Como usuario de Pms de Mixico, en este acto autoriza de manera expresa
que Pms de Mixico le puede contactar vma correo electrsnico u otros
medios.
Si usted ha recibido este mensaje por error, haga caso omiso de el y
reporte su cuenta respondiendo este correo con el subject BAJACOMPRANET

Unsubscribe to this mailing list, reply a blank message with the subject
UNSUBSCRIBE BAJACOMPRANET
Tenga en cuenta que la gestisn de nuestras bases de datos es de suma
importancia y no es intencisn de la empresa la inconformidad del
receptor.

[demime 1.01d removed an attachment of type image/png which had a name of 
nlogo.png]



Sistema Compranet 5.0 Actualizaciones y uso

2011-06-27 Thread Adriana Hernandez
[IMAGE]

Empresa Registrada ante la STPS Reg. COLG640205CP30005 Smguenos en
Twitter@pmscapacitacion o bien en Facebook PMS de Mixico

Conozca de la mano de un experto el correcto uso de este sistema !No deje
pasar oportunidades de Negocio!

Manejo Sptimo del Sistema Compranet 5.0

29 de Junio Guadalajara / 01 de Julio Monterrey

Este taller esta orientado al uso del sistema Compranet 5.0, el
participante podra realizar una bzsqueda de licitaciones, manejara
correctamente el envmo de propuestas, conociendo al detalle el
funcionamiento de esta nueva plataforma.

!Beneficios que obtendra con este programa!

Le aseguramos que con este programa usted adquirira los conocimientos
necesarios para convertirse en un proveedor de gobierno altamente
efectivo.

Duracisn: 10 horas impartidas por nuestro experto en la materia Mtro.
Alberto Ledesma G.

?A Quiin va Dirigido?

Empresarios, Contratistas, Servidores Pzblicos y personas relacionadas
con cualquier Proceso de Contrataciones y

Licitaciones de Adquisiciones, Arrendamientos y Servicios.

Solicite mas informes y analice este excelente evento. !Reservaciones!

Solicite Mayores informes, Llamenos al (33) 8851-2365, (33) 8851-2741

Uno de nuestros asesores con gusto le atendera
Responda esta invitacisn con sus datos para enviar el programa completo.

Empresa:
Nombre:
Telifono:
Email:
Nzmero de Interesados:

!Gracias!

Copyright (C) 2010, PMS Capacitacisn Efectiva de Mixico  S.C. Derechos
Reservados. PMS de Mixico, El logo de PMS de Mixico son marcas
registradas. ADVERTENCIA PMS de Mixico no cuenta con alianzas
estratigicas de ningzn tipo dentro de la Repzblica Mexicana. NO SE DEJE
ENGAQAR - DIGA NO A LA PIRATERIA. Todos los logotipos, marcas comerciales
e imagenes son propiedad de sus respectivas corporaciones y se utilizan
con fines informativos solamente.

Este Mensaje ha sido enviado a misc@openbsd.org como usuario de Pms de
Mixico o bien un usuario le refiris para recibir este boletmn.
Como usuario de Pms de Mixico, en este acto autoriza de manera expresa
que Pms de Mixico le puede contactar vma correo electrsnico u otros
medios.
Si usted ha recibido este mensaje por error, haga caso omiso de el y
reporte su cuenta respondiendo este correo con el subject BAJACOMPRANET

Unsubscribe to this mailing list, reply a blank message with the subject
UNSUBSCRIBE BAJACOMPRANET
Tenga en cuenta que la gestisn de nuestras bases de datos es de suma
importancia y no es intencisn de la empresa la inconformidad del
receptor.

[demime 1.01d removed an attachment of type image/png which had a name of 
nlogo.png]