relayd: statistics are broken

2012-03-07 Thread Erik Lax

Hi,

There is a bug in relayd's handling of statistics collected from each 
prefork (0,1,2,3,4,..). Once received over IMSG, statistics should be 
saved in a rl_stats[RELAY_MAXPROC + 1] array per relay (rlay-rl_stats). 
However all ends up in rlay-rl_stats[0] overwriting other children's 
statistics in a holy mess.


So, fixing this bug, and you should start to see up to five times more 
statistics than before. :)


This is due to the unset variable proc_id which is used as if it were 
incremented for each forked child. This proc_id should be the same as 
p-p_instance and env-sc_ps-ps_instance. So I have two suggested fixes.


1. Use the big patch below, it removes the proc_id variable and imho. 
cleans up the current struct relayd* env confusion.
2. Use the small quick-fix patch below, it sets up proc_id properly. 
However env is NULL dereferenced for sc_timeout in relay_udp.c, thus 
crashing in a simple dns forward test. If the big patch is applied, 
env is always set in relay.c and relay_udp.c, so we should let this 
patch decide if another bug report is needed.


Regards
Erik

Two patched attached below.

-- cut --
Index: relay.c
===
RCS file: /cvs/src/usr.sbin/relayd/relay.c,v
retrieving revision 1.144
diff -u -r1.144 relay.c
--- relay.c21 Jan 2012 13:40:48 -1.144
+++ relay.c7 Mar 2012 10:24:57 -
@@ -332,6 +332,9 @@

 if (config_init(ps-ps_env) == -1)
 fatal(failed to initialize configuration);
+
+/* Set to current prefork id */
+proc_id = p-p_instance;

 /* We use a custom shutdown callback */
 p-p_shutdown = relay_shutdown;
-- cut --
Index: pfe.c
===
RCS file: /cvs/src/usr.sbin/relayd/pfe.c,v
retrieving revision 1.72
diff -u -r1.72 pfe.c
--- pfe.c21 Jan 2012 13:40:48 -1.72
+++ pfe.c7 Mar 2012 00:30:19 -
@@ -46,7 +46,7 @@
 int pfe_dispatch_hce(int, struct privsep_proc *, struct imsg *);
 int pfe_dispatch_relay(int, struct privsep_proc *, struct imsg *);

-static struct relayd*env = NULL;
+struct relayd *env = NULL;

 static struct privsep_proc procs[] = {
 { parent,PROC_PARENT,pfe_dispatch_parent },
Index: relay.c
===
RCS file: /cvs/src/usr.sbin/relayd/relay.c,v
retrieving revision 1.144
diff -u -r1.144 relay.c
--- relay.c21 Jan 2012 13:40:48 -1.144
+++ relay.c7 Mar 2012 00:30:20 -
@@ -135,8 +135,7 @@
 volatile sig_atomic_t relay_sessions;
 objid_t relay_conid;

-static struct relayd*env = NULL;
-int proc_id;
+extern struct relayd *env;

 static struct privsep_proc procs[] = {
 { parent,PROC_PARENT,relay_dispatch_parent },
@@ -305,7 +304,7 @@

 switch (rlay-rl_proto-type) {
 case RELAY_PROTO_DNS:
-relay_udp_privinit(env, rlay);
+relay_udp_privinit(rlay);
 break;
 case RELAY_PROTO_TCP:
 case RELAY_PROTO_HTTP:
@@ -367,7 +366,7 @@
 bzero(crs, sizeof(crs));
 resethour = resetday = 0;

-cur = rlay-rl_stats[proc_id];
+cur = rlay-rl_stats[env-sc_ps-ps_instance];
 cur-cnt += cur-last;
 cur-tick++;
 cur-avg = (cur-last + cur-avg) / 2;
@@ -390,7 +389,7 @@
 cur-last_day = 0;

 crs.id = rlay-rl_conf.id;
-crs.proc = proc_id;
+crs.proc = env-sc_ps-ps_instance;
 proc_compose_imsg(env-sc_ps, PROC_PFE, -1, IMSG_STATISTICS, -1,
crs, sizeof(crs));

@@ -2009,7 +2008,7 @@
 SPLAY_INSERT(session_tree, rlay-rl_sessions, con);

 /* Increment the per-relay session counter */
-rlay-rl_stats[proc_id].last++;
+rlay-rl_stats[env-sc_ps-ps_instance].last++;

 /* Pre-allocate output buffer */
 con-se_out.output = evbuffer_new();
@@ -2050,7 +2049,7 @@
 bzero(cnl, sizeof(*cnl));
 cnl-in = -1;
 cnl-id = con-se_id;
-cnl-proc = proc_id;
+cnl-proc = env-sc_ps-ps_instance;
 cnl-proto = IPPROTO_TCP;

 bcopy(con-se_in.ss, cnl-src, sizeof(cnl-src));
@@ -2236,7 +2235,7 @@

 bzero(bnd, sizeof(bnd));
 bnd.bnd_id = con-se_id;
-bnd.bnd_proc = proc_id;
+bnd.bnd_proc = env-sc_ps-ps_instance;
 bnd.bnd_port = port;
 bnd.bnd_proto = proto;
 bcopy(con-se_in.ss, bnd.bnd_ss, sizeof(bnd.bnd_ss));
@@ -2486,7 +2485,7 @@
 fatalx(relay_dispatch_pfe: invalid table id);

 DPRINTF(%s: [%d] state %d for 
-host %u %s, __func__, proc_id, st.up,
+host %u %s, __func__, env-sc_ps-ps_instance, st.up,
 host-conf.id, host-conf.name);

 if ((st.up == HOST_UNKNOWN  host-up == HOST_DOWN) ||
Index: relay_udp.c
===
RCS file: /cvs/src/usr.sbin/relayd/relay_udp.c,v
retrieving revision 1.24
diff -u -r1.24 relay_udp.c
--- relay_udp.c9 May 2011 12:08:47 -1.24

Re: Patch from FreeBSD to support 1gigabit Marvell 88E8056/88E1149

2012-03-07 Thread Brad Davis

On Tue, Feb 28, 2012 at 16:43:21 +1100, Jonathan Gray wrote:

This is not quite what FreeBSD has:

If you look at msk_phy_power it is not just for EC_U but rather:
== SK_YUKON_EC_U ||
== SK_YUKON_EX ||

= SK_YUKON_FE_P



(linux has this as the SKY2_HW_ADV_POWER_CTL flag)

additionally,

OURREG5 keeps PCI_CTL_TIM_VMAIN_AV_MSK bits, not written 0 setting 
OURREG1 to 0 missing

B2_GP_IO workaround for yukon-ultra/extreme missing



Mea Culpa, Jonathan is right because I actually took my patch from 
NetBSD (if_skreg.h 1.13 and if_msk.c 1.22).  I'm sorry for the hassle.


Brad



Encontra y busca descuentos hasta del 70 % en Tu Oasis Hoy

2012-03-07 Thread Tu Oasis
Vivi tu dia con increibles descuentos en Tu Oasis
Recibm y encontra las ofertas que buscas.
!Escucha estas oportunidades!
Recomenda Tu Oasis: por cada amigo que invites, vos y il reciben
$10 de regalo para la primer compra.

Para ver las ofertas, dirigite a
www.tuoasis.com

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

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
btnregistrarme.jpg]

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

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

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

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

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

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



installation to (W)hole disk - saner default

2012-03-07 Thread David Vasek

Hello all.

While I would always defend everybody's right to use OpenBSD to shoot 
himself in his foot, I don't think it is neither practical nor ethical to 
hint him to do so.


So if the installer finds a valid MBR which contains some partition(s), 
then don't make whole disk (overwriting everything) the default choice and 
let it up to the user. For those who still want to use whole disk in this 
not so frequent case, it requires exactly one key press more.


Will it fit on the floppies and is it is worth the extra 16 bytes? (Yes, 
it can be made in a little more compact way.)


Regards,
David


Index: src//distrib/amd64/common/install.md
===
RCS file: /cvs/src/distrib/amd64/common/install.md,v
retrieving revision 1.29
diff -u -p -r1.29 install.md
--- src//distrib/amd64/common/install.md6 Jul 2011 20:02:16 -   
1.29
+++ src//distrib/amd64/common/install.md7 Mar 2012 15:19:35 -
@@ -54,6 +54,9 @@ md_prep_fdisk() {
_d=whole
if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
fdisk $_disk
+   if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+   _d=
+   fi
if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
_q=, use the (O)penBSD area,
_d=OpenBSD
Index: src//distrib/armish/ramdisk/install.md
===
RCS file: /cvs/src/distrib/armish/ramdisk/install.md,v
retrieving revision 1.14
diff -u -p -r1.14 install.md
--- src//distrib/armish/ramdisk/install.md  17 Apr 2011 20:57:10 -  
1.14
+++ src//distrib/armish/ramdisk/install.md  7 Mar 2012 15:19:35 -
@@ -42,6 +42,9 @@ md_prep_fdisk() {
_d=whole
if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
fdisk $_disk
+   if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+   _d=
+   fi
if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
_q=, use the (O)penBSD area,
_d=OpenBSD
Index: src//distrib/beagle/ramdisk/install.md
===
RCS file: /cvs/src/distrib/beagle/ramdisk/install.md,v
retrieving revision 1.2
diff -u -p -r1.2 install.md
--- src//distrib/beagle/ramdisk/install.md  17 Apr 2011 20:57:11 -  
1.2
+++ src//distrib/beagle/ramdisk/install.md  7 Mar 2012 15:19:35 -
@@ -42,6 +42,9 @@ md_prep_fdisk() {
_d=whole
if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
fdisk $_disk
+   if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+   _d=
+   fi
if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
_q=, use the (O)penBSD area,
_d=OpenBSD
Index: src//distrib/i386/common/install.md
===
RCS file: /cvs/src/distrib/i386/common/install.md,v
retrieving revision 1.53
diff -u -p -r1.53 install.md
--- src//distrib/i386/common/install.md 6 Jul 2011 20:02:16 -   1.53
+++ src//distrib/i386/common/install.md 7 Mar 2012 15:19:35 -
@@ -56,6 +56,9 @@ md_prep_fdisk() {
_d=whole
if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
fdisk $_disk
+   if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+   _d=
+   fi
if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
_q=, use the (O)penBSD area,
_d=OpenBSD
Index: src//distrib/landisk/ramdisk/install.md
===
RCS file: /cvs/src/distrib/landisk/ramdisk/install.md,v
retrieving revision 1.26
diff -u -p -r1.26 install.md
--- src//distrib/landisk/ramdisk/install.md 17 Apr 2011 20:57:10 -  
1.26
+++ src//distrib/landisk/ramdisk/install.md 7 Mar 2012 15:19:35 -
@@ -50,6 +50,9 @@ md_prep_fdisk() {
_d=whole
if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
fdisk $_disk
+   if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+   _d=
+   fi
if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
_q=, use the (O)penBSD area,

Re: installation to (W)hole disk - saner default

2012-03-07 Thread Dmitrij D. Czarkoff
On Wed, 2012-03-07 at 17:32 +0100, David Vasek wrote:
 So if the installer finds a valid MBR which contains some partition(s), 
 then don't make whole disk (overwriting everything) the default choice and 
 let it up to the user. For those who still want to use whole disk in this 
 not so frequent case, it requires exactly one key press more.
  
I'm not sure about this part, actually. I won't make statements about
the OpenBSD community as whole, but in my experience using the whole
disk is the most typical action.

--
Dmitrij D. Czarkoff



Re: installation to (W)hole disk - saner default

2012-03-07 Thread David Vasek

On Wed, 7 Mar 2012, Dmitrij D. Czarkoff wrote:


On Wed, 2012-03-07 at 17:32 +0100, David Vasek wrote:

So if the installer finds a valid MBR which contains some partition(s),
then don't make whole disk (overwriting everything) the default choice and
let it up to the user. For those who still want to use whole disk in this
not so frequent case, it requires exactly one key press more.

 
I'm not sure about this part, actually. I won't make statements about
the OpenBSD community as whole, but in my experience using the whole
disk is the most typical action.


Yes, but not nuking everything already there. Not the most typical action.

Regards,
David



Re: installation to (W)hole disk - saner default

2012-03-07 Thread Dmitrij D. Czarkoff
On Wed, 2012-03-07 at 18:32 +0100, David Vasek wrote:
 On Wed, 7 Mar 2012, Dmitrij D. Czarkoff wrote:
 
  On Wed, 2012-03-07 at 17:32 +0100, David Vasek wrote:
  So if the installer finds a valid MBR which contains some partition(s),
  then don't make whole disk (overwriting everything) the default choice and
  let it up to the user. For those who still want to use whole disk in this
  not so frequent case, it requires exactly one key press more.
   
  I'm not sure about this part, actually. I won't make statements about
  the OpenBSD community as whole, but in my experience using the whole
  disk is the most typical action.
 
 Yes, but not nuking everything already there. Not the most typical action.

At least most typical for me. I actually performed some multiboot
installations with OpenBSD as one of the systems, but this is an
untypical scenario anyway. There is absolutely no sense to take it into
account for setting the installer's defaults, as it is completely
impossible to create sane defaults for multiboot installations. That
said, if the user is concerned with the data already present on HDD, we
may safely assume that [s]he pays enough attention to the installer's
messages, as [s]he is guaranteed to f*ck up otherwise.

--
Dmitrij D. Czarkoff



SMBus support for AMD Hudson-2.

2012-03-07 Thread Brynet
Hudson-2/SB900 was tested by Jorg Willekens, works the same as the SB800.

...
piixpm0 at pci0 dev 20 function 0 AMD Hudson-2 SMBus rev 0x13: polling
iic0 at piixpm0
spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600
spdmem1 at iic0 addr 0x51: 4GB DDR3 SDRAM PC3-10600
spdmem2 at iic0 addr 0x52: 4GB DDR3 SDRAM PC3-10600
spdmem3 at iic0 addr 0x53: 4GB DDR3 SDRAM PC3-10600
..

ok?

-Bryan.

Index: piixpm.c
===
RCS file: /cvs/src/sys/dev/pci/piixpm.c,v
retrieving revision 1.36
diff -u -p -u -r1.36 piixpm.c
--- dev/pci/piixpm.c28 May 2011 14:56:32 -  1.36
+++ dev/pci/piixpm.c5 Mar 2012 00:02:40 -
@@ -85,6 +85,8 @@ struct cfdriver piixpm_cd = {
 };
 
 const struct pci_matchid piixpm_ids[] = {
+   { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON2_SMB },
+
{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB200_SMB },
{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB300_SMB },
{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB400_SMB },
@@ -124,11 +126,13 @@ piixpm_attach(struct device *parent, str
 
sc-sc_iot = pa-pa_iot;
 
-   if (PCI_VENDOR(pa-pa_id) == PCI_VENDOR_ATI 
+   if ((PCI_VENDOR(pa-pa_id) == PCI_VENDOR_AMD 
+   PCI_PRODUCT(pa-pa_id) == PCI_PRODUCT_AMD_HUDSON2_SMB) ||
+   (PCI_VENDOR(pa-pa_id) == PCI_VENDOR_ATI 
PCI_PRODUCT(pa-pa_id) == PCI_PRODUCT_ATI_SBX00_SMB 
-   PCI_REVISION(pa-pa_class) = 0x40) {
+   PCI_REVISION(pa-pa_class) = 0x40)) {
/* 
-* On the AMD SB800, the SMBus I/O registers are well
+* On the AMD SB800+, the SMBus I/O registers are well
 * hidden.  We need to look at the SMBus0En Power
 * Management register to find out where they live.
 * We use indirect IO access through the index/data



midi: don't spin in the kernel

2012-03-07 Thread Alexandre Ratchov
Certain midi uarts don't have interrupts, so when data is sent, the
driver spins (at IPL_AUDIO) until the uart becomes ready. This is not
a big problem because uarts have ~16-32 byte fifos, and programs don't
send large chunks of data, so uarts always appear ready. Except for
large messages, which cause spinning.

This diff is to avoid spinning and to make midi output code simpler.
On my system, interrupt time during a large transfer drops from 5%
to ~0%.

If you use external midi synths connected to umidi, eap, autri, and/or
mpu, I'd like to know if this diff causes any regression. To test,
just do your usual stuff involving midi output.

thanks

-- Alexandre

Index: midi.c
===
RCS file: /cvs/src/sys/dev/midi.c,v
retrieving revision 1.26
diff -u -p -r1.26 midi.c
--- midi.c  2 Jul 2011 22:20:07 -   1.26
+++ midi.c  7 Mar 2012 20:50:43 -
@@ -232,51 +232,14 @@ void
 midi_out_do(struct midi_softc *sc)
 {
struct midi_buffer *mb = sc-outbuf;
-   unsignedi;
-   int error;
 
-   /*
-* If output interrupts are not supported then we write MIDI_MAXWRITE
-* bytes instead of 1, and then we wait sc-wait
-*/
-
-   i = sc-props  MIDI_PROP_OUT_INTR ? 1 : MIDI_MAXWRITE;
-   while (i != 0) {
-   if (mb-used == 0)
+   while (mb-used  0) {
+   if (!sc-hw_if-output(sc-hw_hdl, mb-data[mb-start]))
break;
-   error = sc-hw_if-output(sc-hw_hdl, mb-data[mb-start]);
-   /*
-* 0 means that data is being sent, an interrupt will
-* be generated when the interface becomes ready again
-*
-* EINPROGRESS means that data has been queued, but
-* will not be sent immediately and thus will not
-* generate interrupt, in this case we can send
-* another byte. The flush() method can be called
-* to force the transfer.
-*
-* EAGAIN means that data cannot be queued or sent;
-* because the interface isn't ready. An interrupt
-* will be generated once the interface is ready again
-*
-* any other (fatal) error code means that data couldn't
-* be sent and was lost, interrupt will not be generated
-*/
-   if (error == EINPROGRESS) {
-   MIDIBUF_REMOVE(mb, 1);
-   if (MIDIBUF_ISEMPTY(mb)) {
-   if (sc-hw_if-flush != NULL)
-   sc-hw_if-flush(sc-hw_hdl);
-   midi_out_stop(sc);
-   return;
-   }
-   } else if (error == 0) {
-   MIDIBUF_REMOVE(mb, 1);
-   i--;
-   } else if (error == EAGAIN) {
-   break;
-   } else {
-   MIDIBUF_INIT(mb);
+   MIDIBUF_REMOVE(mb, 1);
+   if (MIDIBUF_ISEMPTY(mb)) {
+   if (sc-hw_if-flush != NULL)
+   sc-hw_if-flush(sc-hw_hdl);
midi_out_stop(sc);
return;
}
@@ -286,7 +249,7 @@ midi_out_do(struct midi_softc *sc)
if (MIDIBUF_ISEMPTY(mb))
midi_out_stop(sc);
else
-   timeout_add(sc-timeo, sc-wait);
+   timeout_add(sc-timeo, 1);
}
 }
 
@@ -554,13 +517,11 @@ midiclose(dev_t dev, int fflag, int devt
/*
 * some hw_if-close() reset immediately the midi uart
 * which flushes the internal buffer of the uart device,
-* so we may lose some (important) data. To avoid this, we sleep 2*wait,
-* which gives the time to the uart to drain its internal buffers.
-*
-* Note: we'd better sleep in the corresponding hw_if-close()
+* so we may lose some (important) data. To avoid this,
+* sleep 20ms (around 64 bytes) to give the time to the
+* uart to drain its internal buffers.
 */
-
-   tsleep(sc-wchan, PWAIT, mid_cl, 2 * sc-wait);
+   tsleep(sc-wchan, PWAIT, mid_cl, hz * MIDI_MAXWRITE / MIDI_RATE);
sc-hw_if-close(sc-hw_hdl);
sc-isopen = 0;
return 0;
@@ -582,9 +543,6 @@ midi_attach(struct midi_softc *sc, struc
struct midi_info  mi;
 
sc-isdying = 0;
-   sc-wait = (hz * MIDI_MAXWRITE) /  MIDI_RATE;
-   if (sc-wait == 0)
-   sc-wait = 1;
sc-hw_if-getinfo(sc-hw_hdl, mi);
sc-props = mi.props;
sc-isopen = 0;
Index: midivar.h
===
RCS file: /cvs/src/sys/dev/midivar.h,v
retrieving revision 

Re: installation to (W)hole disk - saner default

2012-03-07 Thread Kenneth R Westerback
On Wed, Mar 07, 2012 at 05:32:09PM +0100, David Vasek wrote:
 Hello all.
 
 While I would always defend everybody's right to use OpenBSD to
 shoot himself in his foot, I don't think it is neither practical nor
 ethical to hint him to do so.
 
 So if the installer finds a valid MBR which contains some
 partition(s), then don't make whole disk (overwriting everything)
 the default choice and let it up to the user. For those who still
 want to use whole disk in this not so frequent case, it requires
 exactly one key press more.
 
 Will it fit on the floppies and is it is worth the extra 16 bytes?
 (Yes, it can be made in a little more compact way.)
 
 Regards,
 David

Corrupt MBR's and the prevalence of installing one OS per disk led to
the current choice. It is STRONGLY preferred to use the whole disk for
the boot disk, so why should we encourage anything else?

If you want to avoid accidentally zapping your disk just fdisk it
to have the desired OpenBSD partition BEFORE running the OpenBSD
install.

 Ken



Re: libstdc++ clang build fixes

2012-03-07 Thread Jonathan Gray
anyone?

On Sat, Dec 17, 2011 at 03:25:41PM +1100, Jonathan Gray wrote:
 From Dimitry Andric in FreeBSD:
 
 o Make the value_type, vector_type, iterator, __mutex_type types of
 free_list class so we can access them
 o In some cases template keywords must be inserted to treat classes as
 dependent template names
 
 Index: include/ext/bitmap_allocator.h
 ===
 RCS file: /cvs/src/gnu/gcc/libstdc++-v3/include/ext/bitmap_allocator.h,v
 retrieving revision 1.1.1.1
 diff -u -p -r1.1.1.1 bitmap_allocator.h
 --- include/ext/bitmap_allocator.h15 Oct 2009 17:11:31 -  1.1.1.1
 +++ include/ext/bitmap_allocator.h17 Dec 2011 04:18:39 -
 @@ -549,11 +549,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 */
class free_list
{
 +  public:
  typedef size_t*  value_type;
  typedef __detail::__mini_vectorvalue_type vector_type;
  typedef vector_type::iteratoriterator;
  typedef __mutex  __mutex_type;
  
 +  private:
  struct _LT_pointer_compare
  {
bool
 Index: include/ext/ropeimpl.h
 ===
 RCS file: /cvs/src/gnu/gcc/libstdc++-v3/include/ext/ropeimpl.h,v
 retrieving revision 1.1.1.1
 diff -u -p -r1.1.1.1 ropeimpl.h
 --- include/ext/ropeimpl.h15 Oct 2009 17:11:31 -  1.1.1.1
 +++ include/ext/ropeimpl.h17 Dec 2011 04:18:39 -
 @@ -382,7 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 {
   _Rope_RopeLeaf_CharT, _Alloc* __l
 = (_Rope_RopeLeaf_CharT, _Alloc*)this;
 - __l-_Rope_RopeLeaf_CharT, _Alloc::~_Rope_RopeLeaf();
 + __l-template _Rope_RopeLeaf_CharT, _Alloc::~_Rope_RopeLeaf();
   _L_deallocate(__l, 1);
   break;
 }
 @@ -390,7 +390,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 {
   _Rope_RopeConcatenation_CharT,_Alloc* __c
 = (_Rope_RopeConcatenation_CharT, _Alloc*)this;
 - __c-_Rope_RopeConcatenation_CharT, _Alloc::
 + __c-template _Rope_RopeConcatenation_CharT, _Alloc::
 ~_Rope_RopeConcatenation();
   _C_deallocate(__c, 1);
   break;
 @@ -399,7 +399,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 {
   _Rope_RopeFunction_CharT, _Alloc* __f
 = (_Rope_RopeFunction_CharT, _Alloc*)this;
 - __f-_Rope_RopeFunction_CharT, _Alloc::~_Rope_RopeFunction();
 + __f-template _Rope_RopeFunction_CharT, 
 _Alloc::~_Rope_RopeFunction();
   _F_deallocate(__f, 1);
   break;
 }
 @@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 {
   _Rope_RopeSubstring_CharT, _Alloc* __ss =
 (_Rope_RopeSubstring_CharT, _Alloc*)this;
 - __ss-_Rope_RopeSubstring_CharT, _Alloc::
 + __ss-template _Rope_RopeSubstring_CharT, _Alloc::
 ~_Rope_RopeSubstring();
   _S_deallocate(__ss, 1);
   break;
 @@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  {
size_t __old_len = __r-_M_size;
_CharT* __new_data = (_CharT*)
 - _Data_allocate(_S_rounded_up_size(__old_len + __len));
 + _Rope_rep_base_CharT, 
 _Alloc::_Data_allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
  
uninitialized_copy_n(__r-_M_data, __old_len, __new_data);
 @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
   if (__result_len  __lazy_threshold)
 goto lazy;
   __section = (_CharT*)
 -   _Data_allocate(_S_rounded_up_size(__result_len));
 +   _Rope_rep_base_CharT, 
 _Alloc::_Data_allocate(_S_rounded_up_size(__result_len));
   try
 { (*(__f-_M_fn))(__start, __result_len, __section); }
   catch(...)



Re: installation to (W)hole disk - saner default

2012-03-07 Thread Jan Stary
On Mar 07 18:32:00, David Vasek wrote:
 On Wed, 7 Mar 2012, Dmitrij D. Czarkoff wrote:
 
 On Wed, 2012-03-07 at 17:32 +0100, David Vasek wrote:
 So if the installer finds a valid MBR which contains some partition(s),
 then don't make whole disk (overwriting everything) the default choice and
 let it up to the user. For those who still want to use whole disk in this
 not so frequent case, it requires exactly one key press more.
  
 I'm not sure about this part, actually. I won't make statements about
 the OpenBSD community as whole, but in my experience using the whole
 disk is the most typical action.
 
 Yes, but not nuking everything already there. Not the most typical action.

Nukin everything that's there with one big OpenBSD partition
has so far been the most frequent case for me.



Re: installation to (W)hole disk - saner default

2012-03-07 Thread Alexander Hall
David Vasek va...@fido.cz wrote:

Hello all.

While I would always defend everybody's right to use OpenBSD to shoot 
himself in his foot, I don't think it is neither practical nor ethical
to 
hint him to do so.

So if the installer finds a valid MBR which contains some partition(s),

then don't make whole disk (overwriting everything) the default choice
and 
let it up to the user. For those who still want to use whole disk in
this 
not so frequent case, it requires exactly one key press more.

Will it fit on the floppies and is it is worth the extra 16 bytes?
(Yes, 
it can be made in a little more compact way.)

Regards,
David


Index: src//distrib/amd64/common/install.md
===
RCS file: /cvs/src/distrib/amd64/common/install.md,v
retrieving revision 1.29
diff -u -p -r1.29 install.md
--- src//distrib/amd64/common/install.md   6 Jul 2011 20:02:16 -   
1.29
+++ src//distrib/amd64/common/install.md   7 Mar 2012 15:19:35 -
@@ -54,6 +54,9 @@ md_prep_fdisk() {
   _d=whole
   if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
   fdisk $_disk
+  if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then

[^0][^0] does not do what you want.

/Alexander

+  _d=
+  fi
   if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
   _q=, use the (O)penBSD area,
   _d=OpenBSD
Index: src//distrib/armish/ramdisk/install.md
===
RCS file: /cvs/src/distrib/armish/ramdisk/install.md,v
retrieving revision 1.14
diff -u -p -r1.14 install.md
--- src//distrib/armish/ramdisk/install.md 17 Apr 2011 20:57:10
-  1.14
+++ src//distrib/armish/ramdisk/install.md 7 Mar 2012 15:19:35 -
@@ -42,6 +42,9 @@ md_prep_fdisk() {
   _d=whole
   if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
   fdisk $_disk
+  if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+  _d=
+  fi
   if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
   _q=, use the (O)penBSD area,
   _d=OpenBSD
Index: src//distrib/beagle/ramdisk/install.md
===
RCS file: /cvs/src/distrib/beagle/ramdisk/install.md,v
retrieving revision 1.2
diff -u -p -r1.2 install.md
--- src//distrib/beagle/ramdisk/install.md 17 Apr 2011 20:57:11
-  1.2
+++ src//distrib/beagle/ramdisk/install.md 7 Mar 2012 15:19:35 -
@@ -42,6 +42,9 @@ md_prep_fdisk() {
   _d=whole
   if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
   fdisk $_disk
+  if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+  _d=
+  fi
   if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
   _q=, use the (O)penBSD area,
   _d=OpenBSD
Index: src//distrib/i386/common/install.md
===
RCS file: /cvs/src/distrib/i386/common/install.md,v
retrieving revision 1.53
diff -u -p -r1.53 install.md
--- src//distrib/i386/common/install.md6 Jul 2011 20:02:16 -   
1.53
+++ src//distrib/i386/common/install.md7 Mar 2012 15:19:35 -
@@ -56,6 +56,9 @@ md_prep_fdisk() {
   _d=whole
   if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
   fdisk $_disk
+  if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+  _d=
+  fi
   if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
   _q=, use the (O)penBSD area,
   _d=OpenBSD
Index: src//distrib/landisk/ramdisk/install.md
===
RCS file: /cvs/src/distrib/landisk/ramdisk/install.md,v
retrieving revision 1.26
diff -u -p -r1.26 install.md
--- src//distrib/landisk/ramdisk/install.md17 Apr 2011 20:57:10
-  1.26
+++ src//distrib/landisk/ramdisk/install.md7 Mar 2012 15:19:35 -
@@ -50,6 +50,9 @@ md_prep_fdisk() {
   _d=whole
   if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then
   fdisk $_disk
+  if [[ -n $(fdisk $_disk | grep '^.[^#]: [^0][^0] ') ]]; 
then
+  _d=
+  fi
   if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then
   _q=, use the (O)penBSD area,