Re: Upgrade procedure encrypted filesystem (6.4 -> 6.5)

2019-05-06 Thread Scott Bonds

On 05/06, shadrock uhuru wrote:

hi everyone
when upgrading my laptop which is encrypted with a keydisk
i assume that i boot the 6.5 kernel which will be on a usb stick with
the keydisk inserted,
will the hard drive still be decrypted and upgraded,


yes

also will the encryption step need to be redone 


no


or will the keydisk
continue to unlock the 6.5 filesystem on subsequent reboots.


yes

That's how it worked for my anyway. I'm not an OpenBSD dev and I've not 
read the code, so YMMV.




Re: Is anyone able to use certificates with openbsd iked/ikev2 and Apple iOS (iphone)?

2019-04-05 Thread Scott Bonds

On 04/05, Michael Lam wrote:

Are you able to have 2 clients connected at the same time? When I tried
that (I am using mschap) whenever the 2nd client connects the 1st one's
traffic will not go through anymore (it stays connected but no traffic
can go through).


I've noticed that, if my 2 ikedv2 clients are on the same network using 
NAT and private IPs, instead of having their own public IPs, that they 
kick each other off when either of them connects to my remote ikedv2 
server. At least last time I tried, on OpenBSD 6.3 I think. Both clients 
and server are running OpenBSD.


Searching the interwebs led me to think maybe IPSEC and NAT-T don't 
support that scenario...the flows say to send all the packets to the 
NATted network's public IP, but maybe the NATted network router doesn't 
know where to send it to after that, or rather, only can handle one such 
connection at a time, so, whenever a new one is started, the old one 
gets stomped.


Anyhoo, I don't know what I'm talking about, my usage of OpenBSD has 
only helped me get from complete ignorance of this stuff to slightly 
less ignorant, so, take all this with a grain of salt. :)




Re: Introducing pf-badhost and unbound-adblock

2018-08-06 Thread Scott Bonds

On 08/05, Jordan Geoghegan wrote:

Hi everyone,

I thought I would share a couple scripts I wrote to block ads and bad 
hosts. I have found them to increase web-browsing speed and reduce 
battery consumption, especially on mobile devices. They also help 
reduce pop ups and fake sites, especially on mobile/in apps.


I have also found pf-badhost to reduce noise in my httpd/ssh auth 
logs. I used to get over 10,000 ssh attempts per day on my router, now 
I usually get less than 100 a day. Another added benefit of pf-badhost 
is that it blocks Shodan scans, which may appeal to some.


I shared a similar script on misc@ earlier this year and received 
positive feedback, so I thought I would clean up the scripts and write 
a how-to guide.


Enjoy!

https:/www.geoghegan.ca

https://www.geoghegan.ca/pfbadhost.html

https://www.geoghegan.ca/unbound-adblock.html



Very nice, thank you for sharing and for the nicely written guides.



Re: New laptop recommendations

2018-06-19 Thread Scott Bonds

On 06/19/18 03:37, Rupert Gallagher wrote:


I have 1500EUR for a new laptop. What would you buy with it?



On 06/19, Jordan Geoghegan wrote:

Have you considered one of the Librem laptops by Purism? I hear they're 
quite nice, and are running coreboot straight from the factory.


They run OpenBSD fine with some caveats:

https://forums.puri.sm/t/openbsd-on-librem/1080



thank you for 6.3

2018-04-18 Thread Scott Bonds
Under 6.2 my laptop would hang a few hours after waking from sleep, and 
it was my own damn fault for running an unsupported config (Lenovo x200 
+ coreboot + SeaBIOS). But after upgrading to 6.3 I haven't been able to 
get it to hang and I find myself back in 'it just works' land which is 
so, so nice. So nice.


I don't know who to thank, and maybe the dev that fixed my issue 
wouldn't know *they* fixed it, but...thank you.




pf route-to vs static route

2017-10-03 Thread Scott Bonds
Hi everybody. I used to host my own email and I have ambitions to give 
it another try. I prefer to keep my email on my home server if I can, 
but I use Comcast and they block port 25. So, I thought I'd try setting 
up an IKEDv2 based VPN between my home network (including my email 
server at home) and a VPS which doesn't have any ports blocked, so as to 
have an unblocked path to the internet for my email traffic from my home 
network.


I've got the VPN setup and working fine. I'm able to ping from my home 
servers through the VPN and out the cloud server. I'm able to telnet 
port 25 from my home network too:


$ ping -I $vpn_if_ip 8.8.8.8
$ telnet -b $vpn_if_ip smtp.gmail.com 25

Those work great. Adding a route works great too, i.e.:

# route add smtp.gmail.com $vpn_if
# telnet smtp.gmail.com 25

That works, and I don't need to specify the -b option with telnet once I 
have the static route setup.


What I'm having trouble with is simulating a static route with PF, so 
instead of setting up a static route for every email server in the 
world, I was hoping I could do something like:


pass out inet proto tcp to port smtp nat-to $vpn_if route-to \
   $vpn_gateway_ip@$vpn_if

So that *only* traffic bound for port 25 gets sent over the VPN 
connection, but it does so for all hosts. Anyhow, I haven't been able to 
get it to work, and I realize I don't understand enough about how pf 
route-to and static routes work and are different from each other.


I've read and reread the nat-to and route-to sections in man pf.conf.  
I've used tcpdump on the various interfaces on both sides of the vpn 
connection to try and understand how the packets are moving, where they 
are stopping and why, in both the static routing scenario (which works) 
and my failed attempts at configuring pf to do something similar (which 
doesn't work). I searched for route-to in the Book of PF 3rd Edition, 
but didn't find it there.


Before I give up on this approach and try using an smtpd relay server or 
relayd or just host my mail on the VPS like any sensible PF newb should 
perhaps do, I thought I'd try subjecting myself to public ridicule and 
the possibility that someone else might have attempted something like 
this before and maybe willing to share their insights and help me 
understand PF vs static routes a bit better than I do today. Thanks to 
those who made it to the bottom of this long email--I'll be grateful for 
any pointers.




PSA: autodisklabel '\' must be configured

2017-05-28 Thread Scott Bonds
You might get the error "'\' must be configured" when trying to 
autoinstall, if your autodisklabel layout is only minimums, and the 
minimums add up to more than the total available disk size. So, you 
know, don't do that.


Putting this out there to save someone some troubleshooting time when 
they go searching for that message.




Re: file systems

2017-05-26 Thread Scott Bonds
I've got a 27T drive, single partition, about half full. Combination of 
big files and lots of small ones. 32G of ECC RAM. Hardware RAID5 ATM 
though I've used software RAID5 on the same array and that was good too.  
I keep offline backups of everything. I think it takes around an hour to 
fsck, but I haven't timed it. Not using softdep. Not RO. Not sure what 
the file system is, whatever newfs chose...disklabel says fstype is 
4.2BSD.


On 05/26, Peter Hessler wrote:

On 2017 May 26 (Fri) at 11:35:49 -0300 (-0300), Friedrich Locke wrote:
:Hi folks,
:
:does anybody here run OBSD with a file system bigger than 10TB ?
:How much time boot takes to bring the system up (i mean fsck) ?
:Are you using ffs2 ? With softdep ?
:
:Thanks.

I created a 24T disk with ff2.  I populated 2Tb of it while in async
mode, then pulled the power.  fsck took only 5 minutes.

Later, I repartitioned the machine to the sizes we actually want
(several 5T partitions) and it is running as ftp.hostserver.de.  We
aren't using softdep, and generally run RO on many of the partitions.

Please give it a try on your own hardware, paritition sizes, and
collection of files.

--
Don't say "yes" until I finish talking.
-- Darryl F. Zanuck





Re: cloud docs

2017-05-24 Thread Scott Bonds

unison?

On 05/24, Asbel Kiprop wrote:

Yeah, i was using it for some time and i wonder if there is some more text
document based solution.

2017-05-24 20:33 GMT+03:00 Ulises M. Alvarez :


On 24/05/17 12:22, Asbel Kiprop wrote:


Hello, friends. Is there is some solution (in OpenBSD packages, like
ownCloud, for example) to handle with cloud documents? All i want is
to editsome text files on 3-4 computers with synchronization(like
ONLYOFFICE, i think, but not so complicated)



Hi,
Both, ownCloud and NextCloud, include an editor for text documents; i.e.,
*.txt
--
Ulises M. Alvarez
http://sophie.unam.mx/





Re: tmux.conf syntactic change

2017-04-20 Thread Scott Bonds
Yah, I ran into that too, syntax for that sorta stuff changed, now its 
like this:


bind -T copy-mode-vi v send -X begin-selection

On 04/20, Predrag Punosevac wrote:

Not really a question but one thing I noticed after upgrading dozen or
so OpenBSD servers from 6.0 to 6.1 per official documentation is that my
.tmux.conf file is now broken.

/root/.tmux.conf:16: invalid or unknown command: bind-key -t vi-copy 'v' 
begin-selection
/root/.tmux.conf:17: invalid or unknown command: bind-key -t vi-copy 'y' 
copy-selection

Best,
Predrag





ikedv2 + rdomains + nat = tcp works, udp doesn't

2017-04-03 Thread Scott Bonds
Hi everyone! I like to play with all the cool toys the devs give us, 
because, you know, they are there, and it helps me learn. One of my 
favorite walls to bang my head against is automatically connecting my 
(OpenBSD-stable) laptop to the internet and automatically keeping it 
connected as I open and close my laptop, change locations, etc. To make 
this more of a challenge, I have wlan, wwan, and ethernet connections to 
choose from (ethernet > wlan > wwan), and I like to connect via some 
sort of VPN so I can be at the airport or a cafe and not worry too much 
about the local folks listening in on my traffic.


I have all this working fine using ifstated, some scripts, and SSH based 
VPN, though the CPU usage is a bit high and its not without hiccups. 
Anyhow, I thought I'd try out a different way of accomplishing a similar 
effect and see what happens. This time around I thought I'd try putting 
my connections in separate routing domains so I can test their 
connectivity separately and switch between them quickly. Then I layer 
some PF config to NAT traffic from rdomain 0 to the rdomain I want to 
use for internet access, i.e. rdomain 1 is wwan, rdomain 2 is wlan. That 
all works great. As Darth Vader would say, all too easy.


So then I tried connecting to my vpn server (running OpenBSD) using 
ikedv2 on rdomain 0 and that works great too. I have another NAT rule in 
pf.conf to send traffic over the ipsec flow that ikedv2 negotiated. Ping 
works, TCP requests to websites work, but UDP based DNS lookups do not. 
I'm using a local unbound instance for DNS lookups, so I can work around 
my lack of UDP-ness by configuring it to do TCP based lookups, but I'm 
wondering if anyone might have some idea why TCP works with this setup 
but UDP does not.


Some IPs and MAC addresses replaced with consistent, unique, obvious 
fakes to protect the innocent without, hopefully, interfering with the 
usefulness of the logs:


# cat /etc/pf.conf
match in all scrub (no-df random-id max-mss 1440)
pass out on egress to !egress:network nat-to (athn0:0) rtable 2
pass out on enc0 from vether0 nat-to vether0:0

Note: that IS the entire pf.conf, I'm passing everything while I test 
this configuration out.


# cat /etc/iked.conf
ikev2 "vpn" active ipcomp \
   from egress to 0.0.0.0/0 \
   peer 104.xxx.xxx.xxx \
   srcid client.ggr.com \
   tag IKED

# cat /etc/iked.conf (on vpn server)
ikev2 "vpn" ipcomp \
   from 0.0.0.0/0 to 10.0.0.0/8 \
   from 0.0.0.0/0 to 172.16.0.0/12 \
   from 0.0.0.0/0 to 192.168.0.0/16 \
   peer any \
   srcid server.ggr.com \
   tag IKED

$ ifconfig
lo0: flags=8049 mtu 32768
   index 4 priority 0 llprio 3
   groups: lo
   inet6 ::1 prefixlen 128
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
   inet 127.0.0.1 netmask 0xff00
em0: flags=8802 mtu 1500
   lladdr 00:zz:zz:zz:zz:zz
   index 1 priority 0 llprio 3
   media: Ethernet autoselect (none)
   status: no carrier
athn0: flags=8843 rdomain 2 mtu 1500
   index 2 priority 4 llprio 3
   lladdr 00:yy:yy:yy:yy:yy
   index 2 priority 4 llprio 3
   groups: wlan
   media: IEEE802.11 autoselect (OFDM36 mode 11a)
   status: active
   ieee80211: nwid MyFakeNetwork chan 153 bssid f0:mm:mm:mm:mm:mm 53dBm wpakey 
 wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp 
wpagroupcipher tkip
   inet 10.0.0.136 netmask 0xff00 broadcast 10.0.0.255
enc0: flags=0<>
   index 3 priority 0 llprio 3
   groups: enc
   status: active
vether0: flags=8843 mtu 1500
   lladdr fe:ii:ii:ii:ii:ii
   index 7 priority 0 llprio 3
   groups: vether egress
   media: Ethernet autoselect
   status: active
   inet 192.168.211.1 netmask 0xff00 broadcast 192.168.211.255
pflog0: flags=141 mtu 33144
   index 8 priority 0 llprio 3
   groups: pflog
ppp0: flags=8010 rdomain 1 mtu 1500
   index 27 priority 0 llprio 3
   groups: ppp

$ route -T 0 -n show -inet
Routing tables

Internet:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
default192.168.211.1  UGS146528   860228 - 8 vether0
127.0.0.1  127.0.0.1  UHl   42   115625 32768 1 lo0
192.168.211/24 192.168.211.1  UC 00 - 4 vether0
192.168.211.1  fe:ii:ii:ii:ii:ii  UHLl   1   367197 - 1 vether0
192.168.211.255192.168.211.1  UHb00 - 1 vether0

$ route -T 2 -n show -inet
Routing tables

Internet:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
default10.0.0.1   UGS  23854110 -12 athn0
10.0.0/24  10.0.0.136 UC 1  795 - 4 athn0
10.0.0.1   64:kk:kk:kk:kk:kk  UHLc   1  275   

Re: strange behaviour with etherip bridge over IPSEC and UDP queries

2017-03-28 Thread Scott Bonds
Interesting. I may have a similar problem and was planning to post about 
it soon...in my case I've been playing with rdomains, using PF to NAT
between them, and ikedv2. I've found that when I use ikedv2 to layer 
IPSEC on top of my NATing traffic between rdomains, TCP passes fine, UDP 
does not, though I can see requests and replies moving across enc0 (DNS 
requests that show the answer in the tcpdump output). So, host -T 
google.com 8.8.8.8 (TCP DNS lookup) works but host google.com 8.8.8.8 
(UDP DNS lookup) does not.


On 03/28, Comète wrote:

Hi,

I'm trying to build an IPSEC encrypted tunnel that works as a bridge. For
this, I use isakmpd and etherip, vether, bridge interfaces. On each VPN server
(Host A and B), I've got PF running on the external interface (em2). Both
hosts run OpenBSD 6.0 stable amd64.
Host A is my main server and host B is the
client.

Now the strange part:

- If PF is running on each host (A and B),
UDP queries from B to A network don't work (UDP only, TCP is ok. But I can see
UDP packets with tcpdump going from B to A and coming back but they don't go
out from the interface)

- I disable PF on Host B only with "rcctl disable pf
&& reboot", all is working after reboot, all queries (dns, ntp...) are well
sent from B to A through the VPN. Now, I enable PF again without rebooting
with "pfctl -e && pfctl -f /etc/pf.conf" and it's still working. Then I start
"rcctl enable pf" and reboot, and it doesn't work anymore for UDP queries...
So to resume, if PF is started automatically at boot on host B (rcctl enable
pf) then UDP don't pass but if I start it manually (pfctl -e && pfctl -f
/etc/pf.conf), it works.

I've tried tcpdump -nettti pflog0 during DNS/NTP
queries but I don't see anything blocked. As I said, if I try tcpdump -nettti
em0 I can even see the answer from the DNS server coming back but dig doesn't
get it.

I just don't understand why my UDP packets don't pass, so if you have
a idea, you're welcome ;)

thanks.

This my setup on Host B (Host A is
similar)

ipsec.conf:
---

ike active esp proto etherip from $local_gw
to $remote_gw \
   main auth "hmac-sha1" enc "aes-128" group modp2048
lifetime 1800 \
   quick enc "aes-128-gcm" group modp2048 lifetime 1200 \
srcid $local_gw

ipsecctl -sa
---
ipsecctl -sa
FLOWS:
flow esp in
proto etherip from 10.65.12.10 to 10.65.13.10 peer 10.65.12.10 srcid
10.65.13.10/32 dstid 10.65.12.10/32 type use
flow esp out proto etherip from
10.65.13.10 to 10.65.12.10 peer 10.65.12.10 srcid 10.65.13.10/32 dstid
10.65.12.10/32 type require

SAD:
esp tunnel from 10.65.13.10 to 10.65.12.10
spi 0xd5acc570 enc aes-128-gcm
esp tunnel from 10.65.12.10 to 10.65.13.10 spi
0xe19efd9f enc aes-128-gcm

pf.conf:

ext_if = "em2"
int_if =
"internal"

match in all scrub (no-df random-id max-mss 1200)
antispoof for {
$ext_if, $int_if } inet
set skip on { lo, enc, $int_if }
set loginterface
$ext_if
match out on $ext_if from any to any nat-to ($ext_if)
block log all
pass quick on em0

# VPN
pass in on $ext_if proto udp from any to $ext_if port
{ isakmp, ipsec-nat-t }
pass out on $ext_if proto udp from $ext_if to any port
{ isakmp, ipsec-nat-t }
pass in on $ext_if proto esp from any to $ext_if
pass
out on $ext_if proto esp from $ext_if to any

/etc/hostname.bridge0:
--
link2
add etherip0
add vether0
add em0
group "internal"
up

/etc/hostname.etherip0
--
tunnel 10.65.13.10
10.65.12.10
group internal
up

/etc/hostname.vether0
-
inet 10.14.254.35 255.255.0.0 NONE
description "Interconnexion"
group
"internal"
up

/etc/hostname.em0
--
up

/etc/hostname.em2
--
inet 10.65.13.10 255.255.255.0 NONE
description "Evil
Network"
group "external"
up
!route add -inet 10.65.12.0/24 10.65.13.1
/etc/sysctl.conf

net.inet.ip.forwarding=1
net.inet.etherip.allow=1




Re: dmesg for Lenovo ThinkPad x200 w/coreboot

2017-03-19 Thread Scott Bonds

unfortunately no, I don't know what it is or how to solve it

On 03/19, Robert Campbell wrote:

Thanks Scott, I've followed your instructions and everything seems to be
working well on my x200. I'll let you know if I experience the period
locking you mentioned. We both get this error:

error: [drm:pid0:intel_pipe_config_compare] *ERROR* mismatch in
adjusted_mode.flags(DRM_MODE_FLAG_PHSYNC) (expected 0, found 1)
pipe state doesn't match!

Any idea what it is or how to solve it? I also tried the latest 6.1
snapshot, but it persists. I also get a "RTC BIOS diagnostic error
4" I'm not sure what to make of, wondering if NTP sync will
fix or not.


On Tue, Feb 28, 2017 at 12:24 AM, Scott Bonds <sc...@ggr.com> wrote:


By popular demand (ok, just 2 people asked)...now with instructions on how
to do this yourself: https://ggr.com/how-to-install
-coreboot-on-your-x200.html


On 02/27, Scott Bonds wrote:


I flashed a Lenovo x200 with Coreboot with Intel microcode enabled, ME
removed, and the gigabit ethernet firmware from libreboot. Everything seems
to work. Unlike with Libreboot, which comes with a Grub2 payload, Coreboot
uses the SeaBIOS payload by default and it can boot an encrypted OpenBSD
volume. I'm encountering what seems to be a random lockup every few days,
haven't had a chance to troubleshoot it yet.

For those interested, here's the start of the thread on a similar attempt
using Libreboot instead:
https://marc.info/?l=openbsd-misc=147490313431099=2

The upshot of using Coreboot or Libreboot is that I'm no longer
restricted to using mini pci-e cards that have been whitelisted by Lenovo.
I can use the sweet, sweet umb cards for wwan access, I can upgrade to the
latest iwm driver with MIMO, etc. And for those that haven't experienced an
x200 yet, and you're wondering why anyone would voluntarily use a 10 year
old laptop: the x200 is only $50 before upgrades (I like iwm, umb, an ssd,
new battery, new power adapter, usb3 expresscard), has a great keyboard,
solid build quality, good portability, good expandability (3 internal mini
pci-e, 1 external expresscard slot, 3 USB2 ports), and its relatively easy
to repair.

Downsides are its limited to 8G of RAM and the CPU aren't as sprightly as
the latest+greatest (I've shifted by heavy lifting to servers so not a big
issue for me), extended battery only lasts about 3 hours (enough for how I
roll, but I can understand if you've been spoiled by an all-day battery on
a different laptop), VGA out instead of HDMI (can be solved by an adapter),
audio quality sucks (can be solved by an adapter).

I keep 3 x200s around right now...at $50 each, it doesn't break the bank
to have some backups, and if one goes south its easy to just swap the hard
drive and go. Harder to pull off if my laptop costs $2k. ;)

My original goal was to see what a maximally open source setup might be
like and got as close as I'm likely to get (for now) with
Libreboot+OpenBSD+ral, etc. It was pretty good--I'm excited to see what the
future holds as more of the stack becomes more hacker friendly.

OpenBSD 6.0-stable (GENERIC.MP) #2: Wed Feb 15 17:18:06 PST 2017
  r...@maybe.ggr.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4239552512 (4043MB)
avail mem = 4106588160 (3916MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x7db28020 (8 entries)
bios0: vendor coreboot version "CBET4000 4.5-958-gd09dc6b" date 02/08/2017
bios0: LENOVO 745432U
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT MCFG TCPA APIC DMAR HPET
acpi0: wakeup devices HDEF(S4) USB1(S4) USB2(S4) USB3(S4) EHC1(S4)
USB4(S4) USB5(S4) USB6(S4) EHC2(S4) SLT1(S4) SLT2(S4) SLT3(S4) SLT6(S4)
LANC(S3) LANR(S3) SLPB(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.30 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMO
V,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,
SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,
PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.06 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMO
V,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,
SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,
PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)

Re: better way to detect new display

2017-03-01 Thread Scott Bonds

Thank you for the suggestion. x-on-resize compiles and runs fine. It notices 
resizes, which I suspect I'll find useful down the road :) But, unfortunately, 
it doesn't notice when I plug/unplug my VGA monitor.

I think I'll fall back to Plan B: map the F7 key to trigger a script which will 
run xrandr and switch displays to match what's plugged in. It's a little less 
magical, but it should get the job done and it avoids interrupting my audio 
every 5 seconds, since I'll only run xrandr when I'm trying to switch displays.

On 03/01, David Coppa wrote:

On Wed, Mar 1, 2017 at 11:49 AM, Raf Czlonka <rczlo...@gmail.com> wrote:

On Wed, Mar 01, 2017 at 10:14:39AM GMT, Marcus MERIGHI wrote:

sc...@ggr.com (Scott Bonds), 2017.02.28 (Tue) 02:21 (CET):
> I'm polling using xrandr to check whether a new display was plugged
> in, so I can run a script to switch to it, i.e. plug in an external
> VGA monitor and it lights up automatically, unplug it and my laptop
> automatically switches back to using its internal display.

I have wanted the same and found no way to avoid polling xrandr(1).

If you find a way, would you be so kind to share the solution?

> But, every time I run xrandr my (USB connected) audio stutters, which
> makes me sad because I was hoping to poll for a new display every 5
> seconds, but that's not so great while listening to music.

Does the --nograb parameter of xrandr(1) help?

Marcus

> Does anyone know of a better way to notice a newly plugged in
> display...perhaps one that's more passive/efficient so as not to
> provoke stuttering audio? I don't see any output from hotplugd that I
> could use unfortunately, that seemed like the right place to look
> first. I didn't notice anything I could use in the Xorg log either.
>
> !DSPAM:58b4d0ab225251121513987!



Hi all,

A while ago, Keith Packard wrote small display configuration tool
called x-on-resize[0] which might be exactly what you are looking
for but I have no idea how much effort would it be to get it
working/ported on/to OpenBSD.

[0] https://keithp.com/blogs/x-on-resize/


It builds out-of-the-box

Thanks for making me know about x-on-resize,
David




Re: better way to detect new display

2017-03-01 Thread Scott Bonds

On 03/01, Marcus MERIGHI wrote:

sc...@ggr.com (Scott Bonds), 2017.02.28 (Tue) 02:21 (CET):

I'm polling using xrandr to check whether a new display was plugged
in, so I can run a script to switch to it, i.e. plug in an external
VGA monitor and it lights up automatically, unplug it and my laptop
automatically switches back to using its internal display.


I have wanted the same and found no way to avoid polling xrandr(1).

If you find a way, would you be so kind to share the solution?


yes


But, every time I run xrandr my (USB connected) audio stutters, which
makes me sad because I was hoping to poll for a new display every 5
seconds, but that's not so great while listening to music.


Does the --nograb parameter of xrandr(1) help?


no, the sound still stutters, but that was a good idea



Re: dmesg for Lenovo ThinkPad x200 w/coreboot

2017-02-28 Thread Scott Bonds

Everyone once in a while, while I'm actively using the laptop, it just...locks 
up: what's on the screen stops changing, the hard drive light is pegged on with 
no fluctuation, moving the mouse doesn't move the pointer, typing doesn't 
effect anything, I cannot switch to a different tty (CTRL-ALT-F1)...I haven't 
tried pinging it, but I suspect its completely frozen.

I don't have any evidence that it was stable before and that Coreboot is the 
problem, it could be, or it could be some bad hardware.

On 02/28, thinkpad-e535-user wrote:

  >I flashed a Lenovo x200 with Coreboot with Intel microcode enabled,

  >ME removed, and the gigabit ethernet firmware from libreboot.

  >Everything seems to work. Unlike with Libreboot, which comes with

  >a Grub2 payload, Coreboot uses the SeaBIOS payload by default and it

  >can boot an encrypted OpenBSD volume.

  Great news! I've spent a whole day reading libre-/coreboot docs trying

  to find out if I could boot OpenBSD from an encrypted disk on my x200

  with these, and according to libre one's I could not [0]. Good to know

  that it's actually possible with coreboot and SeaBIOS.

  >I'm encountering what seems to be a random lockup every few days,

  haven't had a chance to troubleshoot it yet.

  What kind of lockup?

  [0] [1]https://libreboot.org/docs/bsd/openbsd.html#encryption

References

  1. https://libreboot.org/docs/bsd/openbsd.html#encryption




better way to detect new display

2017-02-27 Thread Scott Bonds

I'm polling using xrandr to check whether a new display was plugged in, so I 
can run a script to switch to it, i.e. plug in an external VGA monitor and it 
lights up automatically, unplug it and my laptop automatically switches back to 
using its internal display. But, every time I run xrandr my (USB connected) 
audio stutters, which makes me sad because I was hoping to poll for a new 
display every 5 seconds, but that's not so great while listening to music.

Does anyone know of a better way to notice a newly plugged in display...perhaps 
one that's more passive/efficient so as not to provoke stuttering audio? I 
don't see any output from hotplugd that I could use unfortunately, that seemed 
like the right place to look first. I didn't notice anything I could use in the 
Xorg log either.



Re: dmesg for Lenovo ThinkPad x200 w/coreboot

2017-02-27 Thread Scott Bonds

By popular demand (ok, just 2 people asked)...now with instructions on how to 
do this yourself: https://ggr.com/how-to-install-coreboot-on-your-x200.html

On 02/27, Scott Bonds wrote:

I flashed a Lenovo x200 with Coreboot with Intel microcode enabled, ME removed, 
and the gigabit ethernet firmware from libreboot. Everything seems to work. 
Unlike with Libreboot, which comes with a Grub2 payload, Coreboot uses the 
SeaBIOS payload by default and it can boot an encrypted OpenBSD volume. I'm 
encountering what seems to be a random lockup every few days, haven't had a 
chance to troubleshoot it yet.

For those interested, here's the start of the thread on a similar attempt using 
Libreboot instead:
https://marc.info/?l=openbsd-misc=147490313431099=2

The upshot of using Coreboot or Libreboot is that I'm no longer restricted to 
using mini pci-e cards that have been whitelisted by Lenovo. I can use the 
sweet, sweet umb cards for wwan access, I can upgrade to the latest iwm driver 
with MIMO, etc. And for those that haven't experienced an x200 yet, and you're 
wondering why anyone would voluntarily use a 10 year old laptop: the x200 is 
only $50 before upgrades (I like iwm, umb, an ssd, new battery, new power 
adapter, usb3 expresscard), has a great keyboard, solid build quality, good 
portability, good expandability (3 internal mini pci-e, 1 external expresscard 
slot, 3 USB2 ports), and its relatively easy to repair.

Downsides are its limited to 8G of RAM and the CPU aren't as sprightly as the 
latest+greatest (I've shifted by heavy lifting to servers so not a big issue 
for me), extended battery only lasts about 3 hours (enough for how I roll, but 
I can understand if you've been spoiled by an all-day battery on a different 
laptop), VGA out instead of HDMI (can be solved by an adapter), audio quality 
sucks (can be solved by an adapter).

I keep 3 x200s around right now...at $50 each, it doesn't break the bank to 
have some backups, and if one goes south its easy to just swap the hard drive 
and go. Harder to pull off if my laptop costs $2k. ;)

My original goal was to see what a maximally open source setup might be like 
and got as close as I'm likely to get (for now) with Libreboot+OpenBSD+ral, 
etc. It was pretty good--I'm excited to see what the future holds as more of 
the stack becomes more hacker friendly.

OpenBSD 6.0-stable (GENERIC.MP) #2: Wed Feb 15 17:18:06 PST 2017
  r...@maybe.ggr.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4239552512 (4043MB)
avail mem = 4106588160 (3916MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x7db28020 (8 entries)
bios0: vendor coreboot version "CBET4000 4.5-958-gd09dc6b" date 02/08/2017
bios0: LENOVO 745432U
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT MCFG TCPA APIC DMAR HPET
acpi0: wakeup devices HDEF(S4) USB1(S4) USB2(S4) USB3(S4) EHC1(S4) USB4(S4) 
USB5(S4) USB6(S4) EHC2(S4) SLT1(S4) SLT2(S4) SLT3(S4) SLT6(S4) LANC(S3) 
LANR(S3) SLPB(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.30 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.06 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus 5 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpicpu1 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit offline
acpibat0 at acpi0: BAT0 model "COMPATIBLE" serial 18729 type LION oem "SANYO"
acpibat1 at ac

dmesg for Lenovo ThinkPad x200 w/coreboot

2017-02-27 Thread Scott Bonds

I flashed a Lenovo x200 with Coreboot with Intel microcode enabled, ME removed, 
and the gigabit ethernet firmware from libreboot. Everything seems to work. 
Unlike with Libreboot, which comes with a Grub2 payload, Coreboot uses the 
SeaBIOS payload by default and it can boot an encrypted OpenBSD volume. I'm 
encountering what seems to be a random lockup every few days, haven't had a 
chance to troubleshoot it yet.

For those interested, here's the start of the thread on a similar attempt using 
Libreboot instead:
https://marc.info/?l=openbsd-misc=147490313431099=2

The upshot of using Coreboot or Libreboot is that I'm no longer restricted to 
using mini pci-e cards that have been whitelisted by Lenovo. I can use the 
sweet, sweet umb cards for wwan access, I can upgrade to the latest iwm driver 
with MIMO, etc. And for those that haven't experienced an x200 yet, and you're 
wondering why anyone would voluntarily use a 10 year old laptop: the x200 is 
only $50 before upgrades (I like iwm, umb, an ssd, new battery, new power 
adapter, usb3 expresscard), has a great keyboard, solid build quality, good 
portability, good expandability (3 internal mini pci-e, 1 external expresscard 
slot, 3 USB2 ports), and its relatively easy to repair.

Downsides are its limited to 8G of RAM and the CPU aren't as sprightly as the 
latest+greatest (I've shifted by heavy lifting to servers so not a big issue 
for me), extended battery only lasts about 3 hours (enough for how I roll, but 
I can understand if you've been spoiled by an all-day battery on a different 
laptop), VGA out instead of HDMI (can be solved by an adapter), audio quality 
sucks (can be solved by an adapter).

I keep 3 x200s around right now...at $50 each, it doesn't break the bank to 
have some backups, and if one goes south its easy to just swap the hard drive 
and go. Harder to pull off if my laptop costs $2k. ;)

My original goal was to see what a maximally open source setup might be like 
and got as close as I'm likely to get (for now) with Libreboot+OpenBSD+ral, 
etc. It was pretty good--I'm excited to see what the future holds as more of 
the stack becomes more hacker friendly.

OpenBSD 6.0-stable (GENERIC.MP) #2: Wed Feb 15 17:18:06 PST 2017
   r...@maybe.ggr.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4239552512 (4043MB)
avail mem = 4106588160 (3916MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x7db28020 (8 entries)
bios0: vendor coreboot version "CBET4000 4.5-958-gd09dc6b" date 02/08/2017
bios0: LENOVO 745432U
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT MCFG TCPA APIC DMAR HPET
acpi0: wakeup devices HDEF(S4) USB1(S4) USB2(S4) USB3(S4) EHC1(S4) USB4(S4) 
USB5(S4) USB6(S4) EHC2(S4) SLT1(S4) SLT2(S4) SLT3(S4) SLT6(S4) LANC(S3) 
LANR(S3) SLPB(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.30 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz, 1600.06 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus 5 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpicpu1 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit offline
acpibat0 at acpi0: BAT0 model "COMPATIBLE" serial 18729 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: LID_
"PNP0303" at acpi0 not configured
"PNP0F13" at acpi0 not configured
"GOOGCB00" at acpi0 not configured
acpidock0 at acpi0: DOCK not docked (0)

Re: 802.11n MIMO support in -current

2016-12-10 Thread Scott Bonds

wow, that's awesome!
I've been rocking a athn lately but I'll swap back to iwm to help test

On 12/10, Stefan Sperling wrote:

The net80211 stack and iwm(4) driver now support MIMO in -current.

In my own testing, things work just fine. But I have gotten used
to breaking other people's wifi without being aware of it.
So please test -current and let me know about any regressions.

Because iwm(4) devices have 2 antennas MCS 15 is the maximum Tx rate
the hardware will support. Support for 40MHz channels and Tx aggregation
are left for future work.

I owe several people attribution:

This work would have been impossible without the help from Theo Buehler (tb@).
He made significant contributions to the implementation of a new rate
scaling algorithm which supports MIMO.

Thanks to the researchers who released the MiRA paper to the internet.
I have studied a dozen papers or so, and eventually decided to implement
this one because it was the only paper which documented enough details
and which didn't impose impractical requirements.

Genua GmbH has funded most of the time I spent working on this project.
Without this kind of support I would not have attempted this project.




Re: Fwd: Booting BSD on a Libreboot system - documentation needed

2016-10-04 Thread Scott Bonds

I've started a stab at it. My x200 is in pieces at the moment and I want to 
retest my instructions before I submit a PR, so it may be a couple weeks.

On 10/05, Leah Rowe wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Thanks. Can you forward my message to the appropriate list, if it
hasn't already been forwarded?

On 30/09/16 23:51, Fred wrote:

Hi misc@

The following message was sent to bugs@ but probably belongs
here...

Libreboot is no longer a GNU project and they are keen to better
support OpenBSD and the *BSD's in general.

Cheers

Fred


 Forwarded Message  Subject: Booting BSD on a
Libreboot system - documentation needed Date: Fri, 30 Sep 2016
15:58:18 +0100 From: Leah Rowe  To:
b...@openbsd.org CC: mail...@lists.dragonflybsd.org,
freebsd-b...@freebsd.org, netbsd-b...@netbsd.org

Dear BSD community,

Libreboot is a free/opensource BIOS/UEFI
implementation/replacement. GNU/Linux is supported well, but people
have recently started figuring out how to boot BSD. More info about
libreboot at https://libreboot.org/

We wish to have more involvement from the BSD communities, and are
willing to accommodate them.

See: https://libreboot.org/faq/#bsd

We wish for official documentation. See:
https://libreboot.org/docs/gnulinux/

We want something like that for BSD, so it would become:
https:///libreboot.org/docs/bsd/

That FAQ page shows guides already. We just need proper docs in
libreboot.org/docs

The libreboot documentation is in the main libreboot repository.
You can find the instructions for cloning git and sending patches
at: https://libreboot.org/git/

Thanks!

-- Leah Rowe

Libreboot developer

Use free software. Free as in freedom.
https://en.wikipedia.org/wiki/Free_software

Use a free operating system, GNU/Linux.

Use a free BIOS. https://libreboot.org/

Support computer user freedom. https://peers.community/

Minifree Ltd, trading as Ministry of Freedom | Registered in
England, No. 9361826 | VAT No. GB202190462 Registered Office: 19
Hilton Road, Canvey Island, Essex SS8 9QA, UK | Web:
http://minifree.org/




- --
Leah Rowe

Libreboot developer

Use free software. Free as in freedom.
https://en.wikipedia.org/wiki/Free_software

Use a free operating system, GNU/Linux.

Use a free BIOS.
https://libreboot.org/

Support computer user freedom.
https://peers.community/

Minifree Ltd, trading as Ministry of Freedom | Registered in England,
No. 9361826 | VAT No. GB202190462
Registered Office: 19 Hilton Road, Canvey Island, Essex SS8 9QA, UK |
Web: http://minifree.org/
iQEcBAEBCAAGBQJX9EJ6AAoJEP9Ft0z50c+U28AH/RsWIASdrofzYWOq6InZFbXu
90aU76pRBXkQB4wpP4+HkKp40vtstInex65jMV5OChMx0/MQXn9wea2Bq58zDMkK
V3b40eyMzYhLeTMQF9EniPyRD71JfKGWhhaIic8xcwOq1SQoX55UtzQeLhS1B0tk
axoYBJ3PUM3ZW0lC5aHtAWYPeSAdkl/AAPsUFZUYNFb92+I7CuWCC5f01AfS00O2
OscRQ2TLMGfh5OgwBp1HO+7WL32CVo8MYDu9+MRFdPAV18Duh9Tz3R6h0aIEj6uB
iOy3RrZD6l1GjX+EF793dUAf9iCG4mj5aaR+tIM6UhZmL/ucPmC7yOVgTYu92Ic=
=MvPr
-END PGP SIGNATURE-




umb is cool

2016-10-04 Thread Scott Bonds

I've got a WWAN card that required a bunch of fiddling with pppd under 5.9 to 
get online. I upgraded to 6.0 and my pppd dialup script stopped working. I soon 
discovered I had a new NIC: umb0. A man page read and an ifconfig command 
later, I've got a working WWAN-based connection to the internet. Piece of cake.

I really like being able to connect with a simple ifconfig command instead of 
all that pppd config I had before. If you're in the market for a WWAN card for 
your OpenBSD box and you have a BIOS that doesn't get in the way of using the 
hardware of your choice, you might want to consider the list of devices on the 
umb man page.



Re: dmesg for Lenovo Thinkpad x200 w/Libreboot

2016-09-26 Thread Scott Bonds

I'm able to boot to OpenBSD on a CDROM (well, technically an Isostick)
and install from there. I haven't had any luck with booting an OpenBSD
install where I setup full disk encryption. First I tried a whole disk
MBR install, then I tried creating an EFI volume plus an encrypted
volume. The installs went fine, I just haven't figured out how to bend
Libreboot's Grub2 to my will. Whatever I try with chainloader, I always
get the same error message: "error: unrecognised payload type."

With whole disk I tried grub commands like:

grub> chainloader (ahci0,msdos1)+1

With my EFI setup I tried:

grub> chainloader (ahci0,openbsd1)/efi/boot/bootx64.efi

I'm really just taking mostly blind stabs in the dark, as the Grub2 docs
don't have much to say, as far as I've been able to find, on
chainloader. I've read the OpenBSD FAQ on booting amd64 but didn't find
anything that switched on a light in my head as yet. I'll keep reading
docs and poking around to see if I can get it to boot. It seems so
close, having installed 'successfully' and knowing that it runs ok on an
unencrypted volume.

Someone else posted an (unanswered) question about the error message I'm
running into, implying that chainloader command might be broken for
Libreboot.  So there's that.

On 09/26, Scott Bonds wrote:

I have a Lenovo ThinkPad x200 running OpenBSD 6.0 with an unencrypted
drive. I flashed it to use Libreboot and then booted it up by running
this on the GRUB2 command line:

# kopenbsd -r sd0a (ahci0,openbsd1)/bsd
# boot

I haven't tested it extensively, but at first blush things seem to be
working just fine. Wifi works, X works, apmd works, brightness keys
don't seem to work. I think I need to boot to linux to update the grub
config and add OpenBSD to the boot menu, I haven't figured out a way to
do that from OpenBSD.

I'm going to try swapping in an encrypted drive from another machine and
see if I can get that booting up. Maybe I need to chain the OpenBSD
bootloader instead of using kopenbsd, we'll see. Or perhaps I can get
the install process working of a USB drive. Anyway, I'll let y'all know
once I've tried a few more things, but I thought I'd share what I have
so far.

bcced dmesg@

Here's the dmesg and sensor output:

OpenBSD 6.0 (GENERIC.MP) #2319: Tue Jul 26 13:00:43 MDT 2016
  dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4004118528 (3818MB)
avail mem = 3879006208 (3699MB)
warning: no entropy supplied by boot loader
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xbfaa0020 (9 entries)
bios0: vendor coreboot version "CBET4000 a02e567-dirty" date 08/18/2016
bios0: LENOVO 745434U
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT MCFG TCPA APIC DMAR HPET
acpi0: wakeup devices HDEF(S4) USB1(S4) USB2(S4) USB3(S4) EHC1(S4) USB4(S4) 
USB5(S4) USB6(S4) EHC2(S4) SLT1(S4) SLT2(S4) SLT3(S4) SLT6(S4) LANC(S3) 
LANR(S3) SLPB(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU P8700 @ 2.53GHz, 1600.33 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU P8700 @ 2.53GHz, 1600.06 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus 5 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpicpu1 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "COMPATIBLE" serial 18729 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: LID_
"

dmesg for Lenovo Thinkpad x200 w/Libreboot

2016-09-26 Thread Scott Bonds

I have a Lenovo ThinkPad x200 running OpenBSD 6.0 with an unencrypted
drive. I flashed it to use Libreboot and then booted it up by running
this on the GRUB2 command line:

# kopenbsd -r sd0a (ahci0,openbsd1)/bsd
# boot

I haven't tested it extensively, but at first blush things seem to be
working just fine. Wifi works, X works, apmd works, brightness keys
don't seem to work. I think I need to boot to linux to update the grub
config and add OpenBSD to the boot menu, I haven't figured out a way to
do that from OpenBSD.

I'm going to try swapping in an encrypted drive from another machine and
see if I can get that booting up. Maybe I need to chain the OpenBSD
bootloader instead of using kopenbsd, we'll see. Or perhaps I can get
the install process working of a USB drive. Anyway, I'll let y'all know
once I've tried a few more things, but I thought I'd share what I have
so far.

bcced dmesg@

Here's the dmesg and sensor output:

OpenBSD 6.0 (GENERIC.MP) #2319: Tue Jul 26 13:00:43 MDT 2016
   dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4004118528 (3818MB)
avail mem = 3879006208 (3699MB)
warning: no entropy supplied by boot loader
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xbfaa0020 (9 entries)
bios0: vendor coreboot version "CBET4000 a02e567-dirty" date 08/18/2016
bios0: LENOVO 745434U
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT MCFG TCPA APIC DMAR HPET
acpi0: wakeup devices HDEF(S4) USB1(S4) USB2(S4) USB3(S4) EHC1(S4) USB4(S4) 
USB5(S4) USB6(S4) EHC2(S4) SLT1(S4) SLT2(S4) SLT3(S4) SLT6(S4) LANC(S3) 
LANR(S3) SLPB(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU P8700 @ 2.53GHz, 1600.33 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU P8700 @ 2.53GHz, 1600.06 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus 5 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpicpu1 at acpi0
C1: bogo buffer
C2: bogo buffer
C3: bogo buffer: C1(@1 halt!), PSS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpithinkpad0 at acpi0
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "COMPATIBLE" serial 18729 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: LID_
"PNP0303" at acpi0 not configured
"PNP0F13" at acpi0 not configured
"WACF004" at acpi0 not configured
acpidock0 at acpi0: DOCK not docked (0)
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: LCD0
cpu0: Enhanced SpeedStep 1600 MHz: speeds: 2534, 2533, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x07
inteldrm0 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x07
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xd000, size 0x1000
inteldrm0: msi
inteldrm0: 1280x800
error: [drm:pid0:intel_pipe_config_compare] *ERROR* mismatch in 
adjusted_mode.flags(DRM_MODE_FLAG_PHSYNC) (expected 0, found 1)
pipe state doesn't match!
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel GM45 Video" rev 0x07 at pci0 dev 2 function 1 not configured
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M" rev 0x03: msi, address 
00:1f:16:2c:e0:df
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 2 int 16
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 2 int 17
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 2 int 18
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 2 int 18
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 

Re: OpenBSD 6.0 released, September 1, 2016

2016-09-01 Thread Scott Bonds
Thank you! Congratulations on another great release. I can't wait to get 
this deployed on all my boxes. :) Much love to everyone that 
contributed--I'm consistently amazed by the level of awesome that is 
OpenBSD and how it just keeps getting better.


On 09/01, Theo de Raadt wrote:


September 1, 2016.

We are pleased to announce the official release of OpenBSD 6.0.
This is our 40th release on CD-ROM (and 41st via FTP/HTTP).  We remain
proud of OpenBSD's record of more than twenty years with only two remote
holes in the default install.

As in our previous releases, 6.0 provides significant improvements,
including new features, in nearly all areas of the system:

- New/extended platforms:
   o armv7:
  - EFI bootloader added, kernels are now loaded from FFS instead
of FAT or EXT filesystems, without U-Boot headers.
  - A single kernel and ramdisk are now used for all SoCs.
  - Hardware is dynamically enumerated via Flattened Device Tree
(FDT) instead of via static tables based on board id numbers.
  - Miniroot installer images include U-Boot 2016.07 with support
for EFI payloads.
   o vax:
  - Removed.

- Improved hardware support, including:
   o New bytgpio(4) driver for the Intel Bay Trail GPIO controller.
   o New chvgpio(4) driver for the Intel Cherry View GPIO controller.
   o New maxrtc(4) driver for the Maxim DS1307 real time clock.
   o New nvme(4) driver for the Non-Volatile Memory Express (NVMe) host
 controller interface.
   o New pcfrtc(4) driver for the NXP PCF8523 real time clock.
   o New umb(4) driver for the Mobile Broadband Interface Model (MBIM).
   o New ure(4) driver for RealTek RTL8152 based 10/100 USB Ethernet
 devices.
   o New utvfu(4) driver for audio/video capture devices based on the
 Fushicai USBTV007.
   o The iwm(4) driver now supports Intel Wireless 3165 and 8260
 devices, and works more reliably in RAMDISK kernels.
   o Support for I2C HID devices with GPIO signalled interrupts has
 been added to dwiic(4).
   o Support for larger bus widths, high speed modes, and DMA transfers
 has been added to sdmmc(4), rtsx(4), sdhc(4), and imxesdhc(4).
   o Support for EHCI and OHCI compliant USB controllers on Octeon II
 SoCs.
   o Many USB device drivers have been enabled on OpenBSD/octeon.
   o Improved support for hardware-reduced ACPI implementations.
   o Improved support for ACPI 5.0 implementations.
   o AES-NI crypto is now done without holding the kernel lock.
   o Improved AGP support on PowerPC G5 machines.
   o Added support for the SD card slot in Intel Bay Trail SoCs.
   o The ichiic(4) driver now ignores the SMBALERT# interrupt to
 prevent an interrupt storm with buggy BIOS implementations.
   o Device attachment problems with the axen(4) driver have been
 fixed.
   o The ral(4) driver is more stable under load with RT2860 devices.
   o Problems with dead keyboards after resume have been fixed in the
 pckbd(4) driver.
   o The rtsx(4) driver now supports RTS522A devices.
   o Initial support for MSI-X has been added.
   o Support MSI-X in the virtio(4) driver.
   o Added a workaround for hardware DMA overruns to the dc(4) driver.
   o The acpitz(4) driver now spins the fan down after cooling if ACPI
 uses hysteresis for active cooling.
   o The xhci(4) driver now performs handoff from an xHCI-capable BIOS
 correctly.
   o Support for multi-touch input has been added to the wsmouse(4)
 driver.
   o The uslcom(4) driver now supports the serial console of Aruba 7xxx
 wireless controllers.
   o The re(4) driver now works around broken LED configurations in
 APU1 EEPROMs.
   o The ehci(4) driver now works around problems with ATI USB
 controllers (e.g. SB700).
   o The xen(4) driver now supports domU configuration under Qubes OS.

- IEEE 802.11 wireless stack improvements:
   o The HT block ack receive buffer logic follows the algorithm given
 in the 802.11-2012 spec more closely.
   o The iwn(4) driver now keeps track of HT protection changes while
 associated to an 11n AP.
   o The wireless stack and several drivers make more aggressive use of
 RTS/CTS to avoid interference from legacy devices and hidden
 nodes.
   o The netstat(1) -W command now shows information about 802.11n
 events.
   o In hostap mode, do not reuse association IDs of nodes which are
 still cached. Fixes a problem where an access point using the
 ral(4) driver would get stuck at 1 Mbps because Tx rate accounting
 happened on the wrong node object.

- Generic network stack improvements:
   o The routing table is now based on ART offering a faster lookup.
   o The number of route lookup per packet has been reduced to 1 in the
 forwarding path.
   o The prio field on VLAN headers is now correctly set on each
 fragment of an IPv4 packet going out on a vlan(4) interface.
   o Enabled 

Re: multiple python version

2016-08-16 Thread Scott Bonds
I use pyenv to install multiple versions of python under a user account 
on my OpenBSD boxes.


https://github.com/yyuu/pyenv

On 08/16, Jay Patel wrote:

Oh.. okay.. That was my concern. Thanks.

On Tue, Aug 16, 2016 at 2:11 PM, Stuart Henderson 
wrote:


On 2016-08-16, Jay Patel  wrote:
> On Tue, Aug 16, 2016 at 12:28 PM, Stuart Henderson 
> wrote:
>
>> On 2016-08-16, Jay Patel  wrote:
>> > is there a way to get two python versions running on OpenBSD system?
and is
>> > it advisable to use it for production system or just follow packaged
python
>> > version for production?
>>
>> You can just "pkg_add python" and choose - things are setup so that
>> different branches (2.7, 3.4, 3.5) can coexist.
>
> I have requirement for my deployment to work with python 2.7.10 while
> pkg_add gives me 2.7.11. and for supervisor-3.2.0 from pkg_add requires
> python2.7.11 which contradicts for my deployment.

Ah, I don't think we ran into anybody wanting to do that yet.
You could do a local build and install it under a different prefix
(avoiding /usr/local), but this gets a lot more complicated, and
not really something I'd want to do on a production system.




Re: Some shell scripts I've wrote

2016-08-03 Thread Scott Bonds
I count myself among those who have taken a stab at automating wifi 
roaming in userland:


https://github.com/bonds/winot

To be clear, winot is far, far from production ready, its more of an 
excuse for me to play with Haskell at this point. But I've started 
adding to the Further Reading and Alternatives sections of the README 
when I see a thread on this topic, so maybe that could be useful to a 
wider audience.


On 08/03, Steven Dee wrote:

Cool. Maybe a good complement for .

On Wed, Aug 3, 2016 at 11:30 AM Walter Alejandro Iglesias <
roque...@gmail.com> wrote:


Sorry!

I have an entry in vimrc for my mail that replaces '>>' for '> >'.  That
screwed the code, it was a bad idea.  Here the corrected code:

=
#!/bin/sh
# ~/bin/wifi.sh - occasional wireless connection in OpenBSD

[ "`whoami`" != "root" ] && { echo "You must be root"; exit 1; }

# PUT YOUR NORMAL USER HERE
user=morlock

# IMPORTANT: if you don't use dhcp in your home LAN save a copy of your
# LAN version of /etc/resolv.conf and /etc/hosts to this directory.
backdir=/home/$user/.wifi

[ ! -d $backdir ] && mkdir $backdir
rec=$backdir/stored
[ ! -e $rec ] && {
touch $rec
chmod 600 $rec
chown $user:$user $rec
}
tmp=/tmp/wifi-`date +%H%M%S`

# FUNCTIONS
cancel()
{
ifconfig $int -inet -inet6 -nwid -bssid -wpakey -nwkey
ifconfig $int down
[ -f $tmp ] && rm $tmp
[ -f $stored_tmp ] && rm $stored_tmp
exit 1
}

get_password()
{
if grep -i $bssid $rec; then
echo -n "Use the above \"$nwid\" stored password? [Y/n] "
read answer
if [ "$answer" != "n" ]; then
password=`grep -i $bssid $rec | awk '{ print $2 }'`
else
printf "$nwid $enc $message: "
read password
fi
else
printf "$nwid $enc $message: "
read password
fi
}

# SELECT WIRELESS INTERFACE
interfaces="`ifconfig wlan | awk -F: '/^[^\t]/ { print $1 }' | xargs`"
if [ ! "$interfaces" ]; then
echo "No wireless interfaces found." 1>&2
exit 1
elif [ `echo "$interfaces" | wc -w | xargs` -gt 1 ]; then
echo $interfaces
int=none
until echo $interfaces | grep -q $int; do
echo -n "Interface? "
read int
done
else
int=$interfaces
fi

trap cancel INT
ifconfig $int up
ifconfig $int -inet -inet6 -nwid -bssid -wpakey -nwkey

# SCAN AND CHOOSE AN ACCESS POINT
echo 'Scanning on '$int'...'
ifconfig $int scan | awk -F'\t' '/\tnwid/ { print $3 }' | nl -s') ' > $tmp
if [ `awk 'END { print NR }' $tmp` -eq 0 ]; then
echo "No access points found."
cancel
elif [ `awk 'END { print NR }' $tmp` -gt 1 ]; then
sed 's/\(.*\) nwid \(.*\) chan .*/\1 \2/' $tmp
ap=0
until egrep -q "^ *$ap\) nwid" $tmp ; do
echo -n "number? "
read ap
done
else
ap=`awk -F\) '{ print $1 }' $tmp | sed 's/ *//'`
fi

# GET AP DATA
bssid=`egrep '^ +'$ap')' $tmp | egrep -o '(..:){5}..' | tr "[a-f]" "[A-F]"`
nwid=`grep -i $bssid $tmp | sed 's/.* nwid \(.*\) chan .*/\1/' | sed
's/"//g'`
enc=`grep -i $bssid $tmp | awk -F, '{ print $NF }'`

case $enc in
wep)
key=nwkey
message="key (for HEX prefix 0x)"
get_password
;;
wpa*)
key=wpakey
message="passphrase"
get_password
;;
*)
key='-wpakey -nwkey'
password=''
;;
esac

# SET UP INTERFACE
ifconfig $int nwid "$nwid" $key $password || cancel

# CONNECTION ATTEMPT
/home/$user/bin/dhcp-connect.sh $int || cancel

# STORE PASSWORD
[ "$password" != "" ] && {
sed -i "/$bssid/d" $rec
echo -e "$bssid\t$password" >> $rec
}

# End of wifi.sh


===
#!/bin/sh
# ~/bin/dhcp-connect.sh
# Connect using dhcp and set hostname (OpenBSD version)

[ "`whoami`" != "root" ] && { echo "You must be root"; exit 1; }

# PUT YOUR NORMAL USER HERE
user=morlock

# IMPORTANT: if you don't use dhcp in your home LAN save a copy of your
# LAN version of /etc/resolv.conf and /etc/hosts to this directory.
backdir=/home/$user/.wifi

int=$1
[ "$int" ] || {
echo "Usage: `basename $0` "
exit 1
}

clean_start()
{
for i in `ps xw | grep dhclient | grep $int | \
awk '{ print $1 }'`
do
[ $i ] && kill $i
done
}
cancel()
{
clean_start
[ -f $backdir/hosts ] && /home/$user/bin/reset-LAN.sh
exit 1
}
reset_LAN_at_shutdown()
{
[ ! -e /etc/rc.shutdown ] && {
echo "# /etc/rc.shutdown" > /etc/rc.shutdown
chmod 600 /etc/rc.shutdown
}
grep -q "# Reset LAN" /etc/rc.shutdown 2>/dev/null || {
echo 

Re: choosing OpenBSD for fileserver instead of FreeBSD + ZFS

2016-07-20 Thread Scott Bonds

Take a look at par2. https://en.wikipedia.org/wiki/Parchive

On 07/20, Miles Keaton wrote:

Got a fileserver with a few terabytes of important personal media, like all
old home movies, baby photos, etc.  Files that I want my family to have
access to when I die.

Really it's more of a file archive.  A backup.  Just rsync + ssh.  Serving
it isn't the point.  Just preserving it forever.

(It's all unencrypted.  It's not that kind of private.  Private and offline
from the outside world, but public within the family.)

For years it's been on a Synology, Linux ext4 filesystem.  Now I'm making a
new clone of it (new PC) to be in a different location.

I assumed I'd use FreeBSD + ZFS because of ZFS's checksum features.  But
really I love and prefer OpenBSD for everything else, and don't want any
other ZFS features : just that checksum.

So I figure if I use OpenBSD + softraid RAID 5 (across 4 disks) and then
write my own little shell script to track the MD5 (find . -type f -exec md5
{} \;) whenever I make changes, that should be enough to see if a file has
been changed due to disk corruption.

(Which makes me realize I don't know a damn thing about disk corruption,
only that it's happened a few times in the past.  The occasional JPG or MP3
from the late 90s that used to work but now doesn't, and who-knows-why.)

Before I embark on this direction for a fileserver, I thought I should
check with the smart people here on misc:

Any tips from anyone who's done something similar?

Or would anyone advise me against OpenBSD or this MD5 log approach for a
fileserver like this?

Thank you.




Re: [Q] Building a release, how do I create install60.fs and install60.iso

2016-06-17 Thread Scott Bonds
Just wanted to say good luck and I'm rooting for you! I've got a 
Macbook8,1 that would be better with OpenBSD running most days instead 
of OS X.  :)


On 06/16, Bryan C. Everly wrote:

Sorry if this is an obvious one but I've been all over the FAQ, read the
makefiles, etc. and cannot for the life of me figure out how those files
get created.  I have everything else (all of the *.tgz files, etc.) just
not these two.

I'm probably on a fool's errand but I'm trying to get this MacBook 9,1
working.  I have figured out that the PCI identifier for the NVMe
controller in this one is actually 0x2003 (seems like the older model was
0x2001 according to the mailing lists).

If I can get an installer image, I'm going to try risking my internal
drive's sanity and see if I can get it partitioned with the NVMe driver as
it is today.  I've been looking at the SPI driver code in the Linux kernel
and it seems comprehensible...

Thanks for any help folks can provide.

--

Thanks,
Bryan




Fwd: Intel Compute Stick BOXSTK1AW32SC

2016-04-26 Thread Scott Bonds
I thought I'd try installing OpenBSD on an Intel Compute Stick using
install.fs and the UEFI boot support. Worked like a charm. :) Dmesg
below.

I plan on building a wireless access point with it using a USB athn
adapter (since the built in iwm doesn't support AP mode). I might use
the Sticks to replace more of my high(er) energy usage servers, the
electricity bills add up!

- Forwarded message from Charlie Root  -

> From: Charlie Root 
> To: sc...@ggr.com
> Date: Wed, 27 Apr 2016 05:16:26 +1000 (ChST)
> Subject: Intel Compute Stick BOXSTK1AW32SC
> 
> OpenBSD 5.9 (GENERIC.MP) #1888: Fri Feb 26 01:20:19 MST 2016
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> RTC BIOS diagnostic error 3f
> real mem = 2057015296 (1961MB)
> avail mem = 1990533120 (1898MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.8 @ 0x7b392000 (51 entries)
> bios0: vendor Intel Corp. version "SCCHTAX5.86A.0014.2015.1119.1410" date 
> 11/19/2015
> bios0: Intel Corporation STK1AW32SC
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S5
> acpi0: tables DSDT FACP APIC FPDT FIDT MCFG UEFI HPET SSDT SSDT SSDT LPIT 
> BCFG PRAM BGRT CSRT MSDM WDAT
> acpi0: wakeup devices
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz, 1440.29 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
> cpu0: 1MB 64b/line 16-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 79MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.0.0.0.0.3.3, IBE
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz, 1439.96 MHz
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
> cpu1: 1MB 64b/line 16-way L2 cache
> cpu1: smt 0, core 1, package 0
> cpu2 at mainbus0: apid 4 (application processor)
> cpu2: Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz, 1439.96 MHz
> cpu2: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
> cpu2: 1MB 64b/line 16-way L2 cache
> cpu2: smt 0, core 2, package 0
> cpu3 at mainbus0: apid 6 (application processor)
> cpu3: Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz, 1439.96 MHz
> cpu3: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
> cpu3: 1MB 64b/line 16-way L2 cache
> cpu3: smt 0, core 3, package 0
> ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 115 pins
> acpimcfg0 at acpi0 addr 0xe000, bus 0-255
> acpihpet0 at acpi0: 14318179 Hz
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (RP01)
> acpiprt2 at acpi0: bus -1 (RP02)
> acpiprt3 at acpi0: bus -1 (RP03)
> acpiprt4 at acpi0: bus -1 (RP04)
> acpicpu0 at acpi0
> C2: state 6: substate 8 >= num 3
> C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
> acpicpu1 at acpi0
> C2: state 6: substate 8 >= num 3
> C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
> acpicpu2 at acpi0
> C2: state 6: substate 8 >= num 3
> C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
> acpicpu3 at acpi0
> C2: state 6: substate 8 >= num 3
> C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
> acpipwrres0 at acpi0: ID3C, resource for ISP3
> acpipwrres1 at acpi0: WWPR, resource for HS03, MDM1
> acpipwrres2 at acpi0: WWPR, resource for HS13, MDM1
> acpipwrres3 at acpi0: WWPR, resource for SSC1, MDM3
> acpipwrres4 at acpi0: WWPR, resource for SSCW, MDM3
> acpipwrres5 at acpi0: WWPR, resource for HSC1, MDM2
> acpipwrres6 at acpi0: WWPR, resource for HSC3, MDM4
> acpipwrres7 at acpi0: CLK3, resource for RTEK, RTK1
> acpipwrres8 at acpi0: CLK4
> acpipwrres9 at acpi0: CLK2, resource for NFC2
> acpipwrres10 at acpi0: CLK1
> acpipwrres11 at acpi0: CLK0
> acpipwrres12 at acpi0: CLK1
> acpipwrres13 at acpi0: USBC, resource for XHC1, OTG1
> acpipwrres14 at acpi0: P28X
> acpipwrres15 at acpi0: P18X
> 

how to break /etc/weekly and your locate.database

2016-02-03 Thread Scott Bonds
I thought I was being clever by doing all of:

* disabling root's password
* disabling SSH login by root
* setting root's shell to /sbin/nologin

su stopped working, but I don't use su, or so I thought, until I
noticed my locate.database was always 41B aka empty. Turns out
/etc/weekly *does* use su, specifically during the generation of
/var/db/locate.database which is handy if you want to use the locate
command at all. Changing root's shell back to /bin/ksh fixed the issue
and I can use locate again.

I could work around this specific (self-inflicted) problem by using a
different script for generating my locate.database and put it in
/etc/weekly.local, but I figure I should take the hint that su is
assumed to work, and if it doesn't, its possible other subtle
breakages in the system will happen.

Thought I'd share.



Re: Dell XPS 9343 and OpenBSD

2016-01-14 Thread Scott Bonds
Thanks for sharing Remi! I've been thinking about getting one of
those, I'm glad to hear it runs OpenBSD ok. Now if Dell would just add
an internal WWAN option. :)

On 01/14, Remi Locherer wrote:
> Hi,
> 
> I read tedu@'s post about OpenBSD on laptops and thought a little report
> about running -current on Dell XPS 13 might be interest.
> 
> http://www.tedunangst.com/flak/post/openbsd-laptops
> 
> I'm running -current on this and use it daily.
> 
> o Graphics:
>  Works ok with the modsetting driver (now default).
> 
> o Battery:
> I don't have exact measures. It runs about a day with one charge. I mainly
> use a bunch of xterms and browsers.
> 
> o WLAN
> The notebook shipped with a unsupported broadcom wlan adpater. I replaced
> it with an iwm0 card. The notebook can be opened with a torx screwdriver.
> 
> o LAN
> There is no built in Ethernet device. I use an USB3 to Gig. Ethernet
> adapter from Edimax (axen).
> 
> o Audio
> Only works with a patched kernel:
> http://marc.info/?l=openbsd-misc=144270531711263=2
> 
> o Touchpad
> Works more or less. Sometimes a click is not recognized or the pointer
> makes unexpected jumps and dmesg fills with:
> pms0: not in sync yet, discard input (state 0)
> It got a little bit better with BIOS updates. On CentOS 7 it's the same
> behaviour.
> 
> o Camera
> video(4) says: video: could not find a usable encoding
> 
> o Suspend, resume and hibernate
> Works reliable. Only when suspended by closing the lid it behaves strange:
> after opening the lid it resumes and then supends again. Then pressing the
> power button finaly resumes the device.
> 
> o EFI
> Booting with EFI works. Sometimes after efiboot loaded the kernel  it reboots.
> Then I either have to shutdown the notebook for some hours or boot into the
> BIOS or another OS. Then it boots again. I didn't figure out how to willingly
> reproduce this.
> 
> Remi
> 
> 
> OpenBSD 5.9-beta (GENERIC.MP) #3: Wed Jan 13 21:41:17 CET 2016
> r...@mistral.relo.ch:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 8473636864 (8081MB)
> avail mem = 8212652032 (7832MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xed7d0 (84 entries)
> bios0: vendor Dell Inc. version "A07" date 11/11/2015
> bios0: Dell Inc. XPS 13 9343
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP APIC FPDT FIDT MCFG HPET SSDT UEFI SSDT ASF! SSDT 
> SSDT SSDT SSDT PCCT SSDT SSDT SSDT SLIC MSDM DMAR CSRT BGRT
> acpi0: wakeup devices PEGP(S4) PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) 
> PXSX(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) 
> PXSX(S4) RP05(S4) [...]
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2494.64 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
> cpu0: 256KB 64b/line 8-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
> cpu0: apic clock running at 99MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2494.24 MHz
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
> cpu1: 256KB 64b/line 8-way L2 cache
> cpu1: smt 0, core 1, package 0
> cpu2 at mainbus0: apid 1 (application processor)
> cpu2: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2494.24 MHz
> cpu2: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,PT,SENSOR,ARAT
> cpu2: 256KB 64b/line 8-way L2 cache
> cpu2: smt 1, core 0, package 0
> cpu3 at mainbus0: apid 3 (application processor)
> cpu3: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2494.24 MHz
> cpu3: 
> 

adventures in wifi roaming

2015-12-29 Thread Scott Bonds
I am working on a script that keeps me connected to wifi all the time
and I thought it might be neat to have it notice when the signal is
weak and look for another station with a different BSSID but the same
SSID to connect to and connect to it with minimal interruption.
ifconfig let's me notice the weak signal easily enough, i.e.:

ifconfig iwm0 | grep bssid | sed -E "s/.*bssid.* (.*)%.*/\1/g" | tr -d '\n'

but I don't yet see a way to scan for other BSSIDs and their signal
strengths, at least, not without an interruption. Maybe I'll wait for
a low traffic point to do the scan.

I ran "ping 8.8.8.8" in one window and "ifconfig iwm0 scan" in
another, and I noticed dropped packets during the scan (boo!). I also
noticed that, after the scan, the BSSID changed to the one with the
strongest signal using the same SSID (yay!), but regardless of whether
a switch was made, it seemed like the media/mode was renegotiated,
starting with the slowest and ramping up to the fastest it could.

I'm running a snapshot from mid-November. I looked through the man
pages for ifconfig and for iwm and I didn't see anything that leads me
to expect dropped packets or switching BSSIDs during a scan. But in
the FreeBSD ifconfig man page it talks about a 'background scanning'
feature:

https://www.freebsd.org/cgi/man.cgi?ifconfig(8)

which leads me to think that the interruption is normal, but some
other OSes + certain wireless chips have a background scanning
feature.

Some other interesting, related man pages are: rssadapt, ieee80211. My
script is over here: https://github.com/bonds/winot It's not really in
a shape that others could use it easily, so, you know, keep that in
mind in case you decide to eyeball it, I include it here for academic
purposes, if you will. :)

I started this email thinking I had a question, but I was able to
answer all my questions, but I thought I'd share anyway in case
someone might find in interesting.



Re: impossibly slow installing 5.6-release on MacbookAir6,1

2014-12-04 Thread Scott Bonds
fixed as of the 2014-12-04 snapshot, thanks to Brad Smith

Excerpts from Scott Bonds's message of 2014-12-01 14:18:44 -0800:
 I am trying to install 5.6-release on a MacbookAir6,1. There are long (5
 to 10 minute) pauses that seem to happen whenever the OS accesses the
 built in hard drive. I tried the 20141201 snapshot as well and observed
 the same pauses. The pauses/slowness is so long that after 4 days of
 waiting, I wasn't through the step of the installer where the file
 systems are written out.
 
 I kept a manual log of my most recent attempt to install 5.6.release,
 including timestamps to help illustrate the long pauses:
 
 ??:?? follow jcs suggestions at https://gist.github.com/jcs/5573685 to
 create a partition using bootcamp then use bless to boot to usb isostick
 with install56.iso
 09:?? boot install56.iso using USB ISOstick
 09:17 scsibus2 at softraid0: 256 targets
 09:20 (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? s\n
 09:28 # fdisk -e sd0\n
 09:38 fdisk: 1
 ...
 09:41 fdisk: 1 setpid 3\nA6\nquit\n
 09:45 Writing MBR at offset 0.
 09:53 #
 ...
 09:55 # disklabel -E sd0\n
 10:01 Label editor (enter '?' for help at any prompt)
 10:01 
 ...
 10:11  a a\n\n\nRAID\nq\n\n
 10:20 #
 ...
 10:56 # bioctl -cC -l /dev/sd0a softraid0
 11:02 New passphrase: password\nRe-type passphrase:password\n
 11:07 sd2 at scsibus2 targ 1 lun 0: OPENBSD, SR CRYPTO, 005 SCSC2 0/direct 
 fixed
 11:07 sd2: 415800MB, 512 bytes/sector, 851559920 sectors
 11:08 softraid0: CRYPTO volume attached as sd2
 11:08 #
 ...
 11:14 Available disks are: sd0 sd1 sd2
 11:14 Which disk is the root disk? ('?' for details) [sd0] sd2\n
 11:14 Use DUIDs rather than device names in stab? [yes]\n
 11:24 Use (W)hole disk or (E)fit the MBR? [whole]\n
 11:24 Setting OpenBSD MBR partition to whole sd2...
 11:44 The auto-allocated layout for sd2 is:
 11:49 Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] 
 c\n
 11:55 Label editor (enter '?' for help at any prompt)
 11:55 
 ...
 12:08  q\n\n
 ...4 days later its still writing the new filesystems
 
 Here' is the dmesg:
 
 OpenBSD 5.6 (RAMDISK_CD) #303: Fri Aug  8 00:25:26 MDT 2014
 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
 RTC BIOS diagnostic error 
 ffclock_battery,ROM_cksum,config_unit,memory_size,fixed_disk,invalid_time
 real mem = 8511332352 (8117MB)
 avail mem = 8279367680 (7895MB)
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe (42 entries)
 bios0: vendor Apple Inc. version MBA61.88Z.0099.B16.1408291503 date 
 08/29/2014
 bios0: Apple Inc. MacBookAir6,1
 acpi0 at bios0: rev 2
 acpi0: sleep states S0 S3 S4 S5
 acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT 
 SSDT SSDT MCFG DMAR
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz, 1600.26 MHz
 cpu0: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM
 cpu0: 256KB 64b/line 8-way L2 cache
 cpu0: apic clock running at 100MHz
 cpu at mainbus0: not configured
 cpu at mainbus0: not configured
 cpu at mainbus0: not configured
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpiprt1 at acpi0: bus -1 (P0P2)
 acpiprt2 at acpi0: bus 1 (RP01)
 acpiprt3 at acpi0: bus 2 (RP02)
 acpiprt4 at acpi0: bus 3 (RP03)
 acpiprt5 at acpi0: bus 5 (RP05)
 acpiprt6 at acpi0: bus 4 (RP06)
 memory map conflict 0xe00f8000/0x1000
 memory map conflict 0xfed1c000/0x4000
 memory map conflict 0xffe1/0x3
 pci0 at mainbus0 bus 0
 pchb0 at pci0 dev 0 function 0 Intel Core 4G Host rev 0x09
 vga1 at pci0 dev 2 function 0 Intel HD Graphics 5000 rev 0x09
 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
 Intel Core 4G HD Audio rev 0x09 at pci0 dev 3 function 0 not configured
 Intel 8 Series xHCI rev 0x04 at pci0 dev 20 function 0 not configured
 Intel 8 Series MEI rev 0x04 at pci0 dev 22 function 0 not configured
 Intel 8 Series HD Audio rev 0x04 at pci0 dev 27 function 0 not configured
 ppb0 at pci0 dev 28 function 0 Intel 8 Series PCIE rev 0xe4
 pci1 at ppb0 bus 1
 ppb1 at pci0 dev 28 function 1 Intel 8 Series PCIE rev 0xe4: msi
 pci2 at ppb1 bus 2
 vendor Broadcom, unknown product 0x1570 (class multimedia subclass 
 miscellaneous, rev 0x00) at pci2 dev 0 function 0 not configured
 ppb2 at pci0 dev 28 function 2 Intel 8 Series PCIE rev 0xe4: msi
 pci3 at ppb2 bus 3
 vendor Broadcom, unknown product 0x43a0 (class network subclass 
 miscellaneous, rev 0x03) at pci3 dev 0 function 0 not configured
 ppb3 at pci0 dev 28 function 4 Intel 8 Series PCIE rev 0xe4: msi
 pci4 at ppb3 bus 5
 ppb4 at pci4 dev 0 function 0 vendor Intel, unknown 

Re: -current hangs during boot from xhci controller on MacbookAir6,1

2014-12-03 Thread Scott Bonds
 
 06=a000 07=
 isa0 at pcib0
 isadma0 at isa0
 com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo
 pcppi0 at isa0 port 0x61
 spkr0 at pcppi0
 uhub0: intr status=0
 nvram: invalid checksum
 uhub0: port 1 status=0x0501 change=0x0001
 uhub1 at uhub0 port 1 Intel Rate Matching Hub rev 2.00/0.04 addr 2
 uhub1: 8 ports with 8 removable, self powered, single transaction translator
 uhub1: port 1 status=0x0101 change=0x0001
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 umass0 at uhub1 port 1 configuration 1 interface 0 Corsair Voyager GT rev 
 2.00/11.00 addr 3
 umass0: using SCSI over Bulk-Only
 scsibus2 at umass0: 2 targets, initiator 0
 sd1 at scsibus2 targ 1 lun 0: Corsair, VoyagerGT, 1100 SCSI0 0/direct 
 removable serial.1b1c1a900309
 sd1: 7904MB, 512 bytes/sector, 16187392 sectors
 uhub1: port 2 status=0x0100 change=0x
 uhub1: port 3 status=0x0101 change=0x0001
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub2 at uhub1 port 3 Apple Inc. BRCM20702 Hub rev 2.00/1.00 addr 4
 uhub1: intr status=0
 uhub2: 3 ports with 0 removable, self powered
 uhub1: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub2: port 1 status=0x0101 change=0x0001
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhidev0 at uhub2 port 1 configuration 1uhub1: intr status=0
  interface 0 Apple Computer product 0x820a rev 2.00/1.00 addr 5
 uhidev0: iclass 3/1, 1 report id
 uhub2: intr status=0
 ukbd0 at uhidev0 reportid 1: 8 variable keys, 6 key codes
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 wskbd0 at ukbd0: console keyboard, using wsdisplay0
 uhub2: port 2 status=0x0101 change=0x0001
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhub1: intr status=0
 uhub2: intr status=0
 uhidev1 at uhub2 port 2 configuration 1 interface 0 Apple Computer product 
 0x820b rev 2.00/1.00 addr 6
 uhidev1: iclass 3/1, 2 report ids
 uhub1: intr status=0
 ums0 at uhidev1 reportid 2: 3 buttons
 wsmouse0 at ums0 mux 0
 uhub2: port 3 status=0x0101 change=0x0001
 uhub2: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 uhub1: intr status=0
 ugen0 at uhub2 port 3 Apple Inc. Bluetooth USB Host Controller rev 
 2.00/0.99 addr 7
 uhub1: port 4 status=0x0100 change=0x
 uhub1: port 5 status=0x0101 change=0x0001
 uhidev2 at uhub1 port 5 configuration 1 interface 0 Apple Inc. Apple 
 Internal Keyboard / Trackpad rev 2.00/1.71 addr 8
 uhidev2: iclass 3/0, 63 report ids
 uhid0 at uhidev2 reportid 63: input=64, output=0, feature=0
 uhidev3 at uhub1 port 5 configuration 1 interface 1 Apple Inc. Apple 
 Internal Keyboard / Trackpad rev 2.00/1.71 addr 8
 uhidev3: iclass 3/1, 63 report ids
 ukbd1 at uhidev3 reportid 1: 8 variable keys, 6 key codes, country code 33
 wskbd1 at ukbd1 mux 1
 wskbd1: connecting to wsdisplay0
 uhid1 at uhidev3 reportid 9: input=0, output=0, feature=3
 uhid2 at uhidev3 reportid 63: input=64, output=0, feature=0
 ubcmtp0 at uhub1 port 5 configuration 1 interface 2 Apple Inc. Apple 
 Internal Keyboard / Trackpad rev 2.00/1.71 addr 8
 wsmouse1 at ubcmtp0 mux 0
 uhub1: port 6 status=0x0100 change=0x
 uhub1: port 7 status=0x0100 change=0x
 uhub1: port 8 status=0x0100 change=0x
 uhub0: port 2 status=0x0500 change=0x
 vscsi0 at root
 scsibus3 at vscsi0: 256 targets
 softraid0 at root
 scsibus4 at softraid0: 256 targets
 root on sd1a (4c16713a536188bf.a) swap on sd1b dump on sd1b
 clock: unknown CMOS layout
 
 Excerpts from Martin Pieuchot's message of 2014-12-02 01:21:07 -0800:
  On 01/12/14(Mon) 15:41, Scott Bonds wrote:
   While investigating the slow hard drive on my MacbookAir6,1, I decided
   to take a working installation of -current (20141201 snapshot) on a USB
   drive and try booting it on the MBA6,1. I discovered that booting off of
   a usb drive (with a full install, i.e. bsd.mp NOT bsd.rd) hangs once the
   boot reaches this line:
   
   uhub0 at usb0 Intel xHCI root hub rev 3.00/1.00 addr 1
   
   This behavior manifests while using a 'normal' boot--I did not use the
   OSX bless utility to get the builtin USB controller into ehci mode
   instead of xhci mode. When I *do* do that (use bless to set the usb
   controller into ehci mode) the boot progresses to:
   
   scsibus4 at softraid0: 256 targets
   
   then pauses there for 5 minutes, then proceeds to boot just fine. When
   booting this way, I observe the same pauses/slowness when operating on
   the builtin hard drive as mentioned in the thread I started

Re: -current hangs during boot from xhci controller on MacbookAir6,1

2014-12-02 Thread Scott Bonds
 at ukbd0: console keyboard, using wsdisplay0
uhub2: port 2 status=0x0101 change=0x0001
uhub1: intr status=0
uhub2: intr status=0
uhub1: intr status=0
uhub2: intr status=0
uhub1: intr status=0
uhub2: intr status=0
uhub1: intr status=0
uhub2: intr status=0
uhub1: intr status=0
uhub2: intr status=0
uhidev1 at uhub2 port 2 configuration 1 interface 0 Apple Computer product 
0x820b rev 2.00/1.00 addr 6
uhidev1: iclass 3/1, 2 report ids
uhub1: intr status=0
ums0 at uhidev1 reportid 2: 3 buttons
wsmouse0 at ums0 mux 0
uhub2: port 3 status=0x0101 change=0x0001
uhub2: intr status=0
uhub1: intr status=0
uhub1: intr status=0
uhub1: intr status=0
uhub1: intr status=0
uhub1: intr status=0
ugen0 at uhub2 port 3 Apple Inc. Bluetooth USB Host Controller rev 2.00/0.99 
addr 7
uhub1: port 4 status=0x0100 change=0x
uhub1: port 5 status=0x0101 change=0x0001
uhidev2 at uhub1 port 5 configuration 1 interface 0 Apple Inc. Apple Internal 
Keyboard / Trackpad rev 2.00/1.71 addr 8
uhidev2: iclass 3/0, 63 report ids
uhid0 at uhidev2 reportid 63: input=64, output=0, feature=0
uhidev3 at uhub1 port 5 configuration 1 interface 1 Apple Inc. Apple Internal 
Keyboard / Trackpad rev 2.00/1.71 addr 8
uhidev3: iclass 3/1, 63 report ids
ukbd1 at uhidev3 reportid 1: 8 variable keys, 6 key codes, country code 33
wskbd1 at ukbd1 mux 1
wskbd1: connecting to wsdisplay0
uhid1 at uhidev3 reportid 9: input=0, output=0, feature=3
uhid2 at uhidev3 reportid 63: input=64, output=0, feature=0
ubcmtp0 at uhub1 port 5 configuration 1 interface 2 Apple Inc. Apple Internal 
Keyboard / Trackpad rev 2.00/1.71 addr 8
wsmouse1 at ubcmtp0 mux 0
uhub1: port 6 status=0x0100 change=0x
uhub1: port 7 status=0x0100 change=0x
uhub1: port 8 status=0x0100 change=0x
uhub0: port 2 status=0x0500 change=0x
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd1a (4c16713a536188bf.a) swap on sd1b dump on sd1b
clock: unknown CMOS layout

Excerpts from Martin Pieuchot's message of 2014-12-02 01:21:07 -0800:
 On 01/12/14(Mon) 15:41, Scott Bonds wrote:
  While investigating the slow hard drive on my MacbookAir6,1, I decided
  to take a working installation of -current (20141201 snapshot) on a USB
  drive and try booting it on the MBA6,1. I discovered that booting off of
  a usb drive (with a full install, i.e. bsd.mp NOT bsd.rd) hangs once the
  boot reaches this line:
  
  uhub0 at usb0 Intel xHCI root hub rev 3.00/1.00 addr 1
  
  This behavior manifests while using a 'normal' boot--I did not use the
  OSX bless utility to get the builtin USB controller into ehci mode
  instead of xhci mode. When I *do* do that (use bless to set the usb
  controller into ehci mode) the boot progresses to:
  
  scsibus4 at softraid0: 256 targets
  
  then pauses there for 5 minutes, then proceeds to boot just fine. When
  booting this way, I observe the same pauses/slowness when operating on
  the builtin hard drive as mentioned in the thread I started on that
  topic:
  
  http://marc.info/?l=openbsd-miscm=141747241629431w=2
  
  Anyway, I mention the xhci boot hang behaviour because I know xhci
  development is active, and I thought this result may be
  interesting/useful for that.
 
 Such long hang generally means that timeouts are occurring.  If you
 can compile a kernel with XHCI_DEBUG and UHUB_DEBUG defined and send
 me a dmesg, it will be much appreciated.
 
 Martin



impossibly slow installing 5.6-release on MacbookAir6,1

2014-12-01 Thread Scott Bonds
I am trying to install 5.6-release on a MacbookAir6,1. There are long (5
to 10 minute) pauses that seem to happen whenever the OS accesses the
built in hard drive. I tried the 20141201 snapshot as well and observed
the same pauses. The pauses/slowness is so long that after 4 days of
waiting, I wasn't through the step of the installer where the file
systems are written out.

I kept a manual log of my most recent attempt to install 5.6.release,
including timestamps to help illustrate the long pauses:

??:?? follow jcs suggestions at https://gist.github.com/jcs/5573685 to
create a partition using bootcamp then use bless to boot to usb isostick
with install56.iso
09:?? boot install56.iso using USB ISOstick
09:17 scsibus2 at softraid0: 256 targets
09:20 (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? s\n
09:28 # fdisk -e sd0\n
09:38 fdisk: 1
...
09:41 fdisk: 1 setpid 3\nA6\nquit\n
09:45 Writing MBR at offset 0.
09:53 #
...
09:55 # disklabel -E sd0\n
10:01 Label editor (enter '?' for help at any prompt)
10:01 
...
10:11  a a\n\n\nRAID\nq\n\n
10:20 #
...
10:56 # bioctl -cC -l /dev/sd0a softraid0
11:02 New passphrase: password\nRe-type passphrase:password\n
11:07 sd2 at scsibus2 targ 1 lun 0: OPENBSD, SR CRYPTO, 005 SCSC2 0/direct 
fixed
11:07 sd2: 415800MB, 512 bytes/sector, 851559920 sectors
11:08 softraid0: CRYPTO volume attached as sd2
11:08 #
...
11:14 Available disks are: sd0 sd1 sd2
11:14 Which disk is the root disk? ('?' for details) [sd0] sd2\n
11:14 Use DUIDs rather than device names in stab? [yes]\n
11:24 Use (W)hole disk or (E)fit the MBR? [whole]\n
11:24 Setting OpenBSD MBR partition to whole sd2...
11:44 The auto-allocated layout for sd2 is:
11:49 Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] c\n
11:55 Label editor (enter '?' for help at any prompt)
11:55 
...
12:08  q\n\n
...4 days later its still writing the new filesystems

Here' is the dmesg:

OpenBSD 5.6 (RAMDISK_CD) #303: Fri Aug  8 00:25:26 MDT 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
RTC BIOS diagnostic error 
ffclock_battery,ROM_cksum,config_unit,memory_size,fixed_disk,invalid_time
real mem = 8511332352 (8117MB)
avail mem = 8279367680 (7895MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe (42 entries)
bios0: vendor Apple Inc. version MBA61.88Z.0099.B16.1408291503 date 08/29/2014
bios0: Apple Inc. MacBookAir6,1
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT 
SSDT MCFG DMAR
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz, 1600.26 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 100MHz
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 5 (RP05)
acpiprt6 at acpi0: bus 4 (RP06)
memory map conflict 0xe00f8000/0x1000
memory map conflict 0xfed1c000/0x4000
memory map conflict 0xffe1/0x3
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel Core 4G Host rev 0x09
vga1 at pci0 dev 2 function 0 Intel HD Graphics 5000 rev 0x09
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
Intel Core 4G HD Audio rev 0x09 at pci0 dev 3 function 0 not configured
Intel 8 Series xHCI rev 0x04 at pci0 dev 20 function 0 not configured
Intel 8 Series MEI rev 0x04 at pci0 dev 22 function 0 not configured
Intel 8 Series HD Audio rev 0x04 at pci0 dev 27 function 0 not configured
ppb0 at pci0 dev 28 function 0 Intel 8 Series PCIE rev 0xe4
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 Intel 8 Series PCIE rev 0xe4: msi
pci2 at ppb1 bus 2
vendor Broadcom, unknown product 0x1570 (class multimedia subclass 
miscellaneous, rev 0x00) at pci2 dev 0 function 0 not configured
ppb2 at pci0 dev 28 function 2 Intel 8 Series PCIE rev 0xe4: msi
pci3 at ppb2 bus 3
vendor Broadcom, unknown product 0x43a0 (class network subclass 
miscellaneous, rev 0x03) at pci3 dev 0 function 0 not configured
ppb3 at pci0 dev 28 function 4 Intel 8 Series PCIE rev 0xe4: msi
pci4 at ppb3 bus 5
ppb4 at pci4 dev 0 function 0 vendor Intel, unknown product 0x1547 rev 0x03
pci5 at ppb4 bus 6
ppb5 at pci5 dev 0 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci6 at ppb5 bus 7
vendor Intel, unknown product 0x1547 (class system subclass miscellaneous, 
rev 0x03) at pci6 dev 

-current hangs during boot from xhci controller on MacbookAir6,1

2014-12-01 Thread Scott Bonds
While investigating the slow hard drive on my MacbookAir6,1, I decided
to take a working installation of -current (20141201 snapshot) on a USB
drive and try booting it on the MBA6,1. I discovered that booting off of
a usb drive (with a full install, i.e. bsd.mp NOT bsd.rd) hangs once the
boot reaches this line:

uhub0 at usb0 Intel xHCI root hub rev 3.00/1.00 addr 1

This behavior manifests while using a 'normal' boot--I did not use the
OSX bless utility to get the builtin USB controller into ehci mode
instead of xhci mode. When I *do* do that (use bless to set the usb
controller into ehci mode) the boot progresses to:

scsibus4 at softraid0: 256 targets

then pauses there for 5 minutes, then proceeds to boot just fine. When
booting this way, I observe the same pauses/slowness when operating on
the builtin hard drive as mentioned in the thread I started on that
topic:

http://marc.info/?l=openbsd-miscm=141747241629431w=2

Anyway, I mention the xhci boot hang behaviour because I know xhci
development is active, and I thought this result may be
interesting/useful for that.

Here is the dmesg from this laptop:

OpenBSD 5.6 (RAMDISK_CD) #303: Fri Aug  8 00:25:26 MDT 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
RTC BIOS diagnostic error 
ffclock_battery,ROM_cksum,config_unit,memory_size,fixed_disk,invalid_time
real mem = 8511332352 (8117MB)
avail mem = 8279367680 (7895MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe (42 entries)
bios0: vendor Apple Inc. version MBA61.88Z.0099.B16.1408291503 date 08/29/2014
bios0: Apple Inc. MacBookAir6,1
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT 
SSDT MCFG DMAR
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz, 1600.26 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 100MHz
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 5 (RP05)
acpiprt6 at acpi0: bus 4 (RP06)
memory map conflict 0xe00f8000/0x1000
memory map conflict 0xfed1c000/0x4000
memory map conflict 0xffe1/0x3
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel Core 4G Host rev 0x09
vga1 at pci0 dev 2 function 0 Intel HD Graphics 5000 rev 0x09
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
Intel Core 4G HD Audio rev 0x09 at pci0 dev 3 function 0 not configured
Intel 8 Series xHCI rev 0x04 at pci0 dev 20 function 0 not configured
Intel 8 Series MEI rev 0x04 at pci0 dev 22 function 0 not configured
Intel 8 Series HD Audio rev 0x04 at pci0 dev 27 function 0 not configured
ppb0 at pci0 dev 28 function 0 Intel 8 Series PCIE rev 0xe4
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 Intel 8 Series PCIE rev 0xe4: msi
pci2 at ppb1 bus 2
vendor Broadcom, unknown product 0x1570 (class multimedia subclass 
miscellaneous, rev 0x00) at pci2 dev 0 function 0 not configured
ppb2 at pci0 dev 28 function 2 Intel 8 Series PCIE rev 0xe4: msi
pci3 at ppb2 bus 3
vendor Broadcom, unknown product 0x43a0 (class network subclass 
miscellaneous, rev 0x03) at pci3 dev 0 function 0 not configured
ppb3 at pci0 dev 28 function 4 Intel 8 Series PCIE rev 0xe4: msi
pci4 at ppb3 bus 5
ppb4 at pci4 dev 0 function 0 vendor Intel, unknown product 0x1547 rev 0x03
pci5 at ppb4 bus 6
ppb5 at pci5 dev 0 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci6 at ppb5 bus 7
vendor Intel, unknown product 0x1547 (class system subclass miscellaneous, 
rev 0x03) at pci6 dev 0 function 0 not configured
ppb6 at pci5 dev 3 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci7 at ppb6 bus 8
ppb7 at pci5 dev 4 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci8 at ppb7 bus 57
ppb8 at pci5 dev 5 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci9 at ppb8 bus 106
ppb9 at pci5 dev 6 function 0 vendor Intel, unknown product 0x1547 rev 0x03: 
msi
pci10 at ppb9 bus 107
ppb10 at pci0 dev 28 function 5 Intel 8 Series PCIE rev 0xe4: msi
pci11 at ppb10 bus 4
ahci0 at pci11 dev 0 function 0 vendor Samsung, unknown product 0x1600 rev 
0x01: msi, AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: ATA, APPLE SSD SM0512, UXM2 SCSI3 0/direct 
fixed naa.5002538655584d30
sd0: 477102MB, 512 

Re: USB worked on 5.5, not on 5.6 on MacbookAir5,1

2014-11-23 Thread Scott Bonds
Earlier you asked for the usbdevs and lsusb outputs on the version of
the OS that was *not* recognizing the usb devices at all, that is to
say, 5.6-release. I got those today. Note that a urtwn is plugged into
the left USB port while I was running these commands. Here they are:

** 5.6-release usbdevs **

addr 1: EHCI root hub, Intel
 addr 2: Rate Matching Hub, Intel
  addr 3: FaceTime HD Camera (Built-in), Apple Inc.
addr 1: EHCI root hub, Intel
 addr 2: Rate Matching Hub, Intel
  addr 3: product 0x2512, Standard Microsystems
   addr 4: BRCM20702 Hub, Apple Inc.
addr 5: product 0x820a, Apple Computer
addr 6: product 0x820b, Apple Computer
addr 7: Bluetooth USB Host Controller, Apple Inc.
   addr 8: Apple Internal Keyboard / Trackpad, Apple Inc.

** 5.6-release usbdevs -dv **

Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x), 
Intel(0x8086), rev 1.00
  uhub0
 port 1 addr 2: high speed, self powered, config 1, Rate Matching Hub(0x0024), 
Intel(0x8087), rev 0.00
   uhub2
  port 1 addr 3: high speed, power 500 mA, config 1, FaceTime HD Camera 
(Built-in)(0x8510), Apple Inc.(0x05ac), rev 80.25, iSerialNumber 
CCGC6500NMDWC8C0
uvideo0
ugen0
  port 2 powered
  port 3 powered
  port 4 powered
  port 5 powered
  port 6 powered
 port 2 powered
Controller /dev/usb1:
addr 1: high speed, self powered, config 1, EHCI root hub(0x), 
Intel(0x8086), rev 1.00
  uhub1
 port 1 addr 2: high speed, self powered, config 1, Rate Matching Hub(0x0024), 
Intel(0x8087), rev 0.00
   uhub3
  port 1 powered
  port 2 powered
  port 3 powered
  port 4 powered
  port 5 powered
  port 6 powered
  port 7 powered
  port 8 addr 3: high speed, self powered, config 1, product 0x2512(0x2512), 
Standard Microsystems(0x0424), rev b.b3
uhub4
   port 1 addr 4: full speed, self powered, config 1, BRCM20702 Hub(0x4500), 
Apple Inc.(0x0a5c), rev 1.00
 uhub5
port 1 addr 5: full speed, self powered, config 1, product 0x820a(0x820a), 
Apple Computer(0x05ac), rev 1.00
  uhidev0
port 2 addr 6: full speed, self powered, config 1, product 0x820b(0x820b), 
Apple Computer(0x05ac), rev 1.00
  uhidev1
port 3 addr 7: full speed, self powered, config 1, Bluetooth USB Host 
Controller(0x821f), Apple Inc.(0x05ac), rev 1.47
  ugen1
   port 2 addr 8: full speed, power 40 mA, config 1, Apple Internal Keyboard / 
Trackpad(0x0249), Apple Inc.(0x05ac), rev 2.19
 uhidev2
 uhidev3
 ubcmtp0
 port 2 powered

** 5.6-release lsusb **

Bus 000 Device 001: ID 8086: Intel Corp. 
Bus 000 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 000 Device 003: ID 05ac:8510 Apple, Inc. FaceTime HD Camera (Built-in)
Bus 001 Device 001: ID 8086: Intel Corp. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 0424:2512 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of 
BCM2046 Bluetooth)
Bus 001 Device 005: ID 05ac:820a Apple, Inc. Bluetooth HID Keyboard
Bus 001 Device 006: ID 05ac:820b Apple, Inc. Bluetooth HID Mouse
Bus 001 Device 007: ID 05ac:821f Apple, Inc. Built-in Bluetooth 2.0+EDR HCI
Bus 001 Device 008: ID 05ac:0249 Apple, Inc. 

** 5.6-release lsusb -v **

Bus 000 Device 001: ID 8086: Intel Corp. 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass9 Hub
  bDeviceSubClass 0 Unused
  bDeviceProtocol 1 Single TT
  bMaxPacketSize064
  idVendor   0x8086 Intel Corp.
  idProduct  0x 
  bcdDevice1.00
  iManufacturer   1 Intel
  iProduct2 EHCI root hub
  iSerial 0 
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   25
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x40
  (Missing must-be-set bit!)
  Self Powered
MaxPower0mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 9 Hub
  bInterfaceSubClass  0 Unused
  bInterfaceProtocol  0 Full speed (or root) hub
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval  12
Hub Descriptor:
  bLength  11
  bDescriptorType  41
  nNbrPorts 2
  wHubCharacteristic 0x0002
No power switching (usb 

Re: USB worked on 5.5, not on 5.6 on MacbookAir5,1

2014-11-21 Thread Scott Bonds
Excerpts from Martin Pieuchot's message of 2014-11-20 02:30:44 -0800:

 I don't know how it works in Apple machines but other people reported
 such weird thing with machine having an xhci(4)/ehci(4) controller.
 Telling the BIOS to deactivate USB 3 support made their ports work
 again with ehci(4), do you have a way to do that on your MacbookAir5,1?

I tried the ways I've heard of for forcing my MacbookAir5,1 into EHCI
mode, but they did not work:

https://gist.github.com/jcs/5573685

I tried both variations of the OSX bless command that jcs suggests:

sudo bless --device /dev/disk1 --setBoot --legacy
sudo bless --device /dev/disk1 --setBoot --nextonly --legacy

Neither of them results in external USB ports that work. After running
bless, I booted (*without* holding down the alt key, so as to let the
bless command take effect) to 5.6-release-amd64 bsd.rd and plugged in a
USB device into an external port, but nothing shows up on the screen
indicating a device was just plugged in and the lights on the device
itself don't light up, in contrast to the behavior on 5.5-stable where
after plugging the same device into the same USB port, text appears on
the screen and the lights on the device itself light up.



Re: USB worked on 5.5, not on 5.6 on MacbookAir5,1

2014-11-19 Thread Scott Bonds
I'm sorry for creating some confusion. My original email was about the
MacbookAir5,1 external USB ports not working on 5.6-release, when they
worked fine under 5.5-stable, so the subject is descriptive, at least as
the discussion started.

Subsequently I emailed to say that I have also tried a snapshot and
found the USB ports work using the snapshot, but unreliably. *That* is
why I mentioned the 2014-11-14 snapshot--to explain which snapshot I was
encountering some problems. The problems with the snapshot are different
than the problems with 5.6--on 5.6 the USB ports don't seem to function
at all, whereas under the 2014-11-14 they work, but not reliably.

Excerpts from Theo de Raadt's message of 2014-11-19 14:38:31 -0800:
  Sorry about that Martin, I'll try to be more helpful by providing more
  details. The snapshot I tried and found to be unreliable was amd64
  bsd.mp 2014-11-14.
 
  ^^
 
 Which is not 5.6, as your subject says.
 
 It is -current, of a certain date.
 
 Please be more careful with the message.



Re: USB worked on 5.5, not on 5.6 on MacbookAir5,1

2014-11-18 Thread Scott Bonds
A few people suggest I try current. I tried it and the ports show up
again, this time as XHCI. They are unreliable, as others have noted:
http://marc.info/?l=openbsd-miscm=141614729913281w=2

I use this laptop as my main workstation, so I'm going to retreat back
to 5.5-stable for now, but I'll see if I can get a kernel built with the
XHCI debugging on so I can help gather info on the XHCI issues.

Excerpts from Scott Bonds's message of 2014-11-15 01:35:32 -0800:
 I've been running 5.5 on my MacbookAir5,1 for some time. I'm trying to
 upgrade to 5.6 but I'm not having much luck so far.
 
 A fresh install off a USB CD drive (ISOSTICK) proceeds until its time to
 copy the packages from the USB CD drive, but at that point no CD drive
 is visible.
 
 Next I tried installing by putting the machine into 'target disk mode'
 which allows me to connect it as a SATA drive to a virtual machine on
 another box. I'm able to install 5.6 that way, disconnect from the
 virtual machine, and boot up normally on the raw hardware. But when I
 plug in any USB device, be it a network adapter or storage device,
 neither are noticed by the OS at all--no message appears when they
 attached, nothing in dmesg, nothing new in the output from usbdevs. That
 said, the keyboard works, and it appears to be a USB device. Other
 devices like the EHCI root hubs, the Facetime HD Camera, and the
 Bluetooth USB Host Controller show up--its just the stuff plugged into
 either *external* USB port that aren't working. Which is a bummer,
 because I can't do much without a USB network adapter, since the
 internal wifi chipset is not supported.
 
 An old copy of the 5.5 dmesg is available here:
 
 http://marc.info/?l=openbsd-techm=138867402307945w=2
 
 I have the dmesg off of 5.6 as well...I plugged the machine back into
 the VM using target disk mode and copied it to a USB stick:
 
 OpenBSD 5.6 (GENERIC) #310: Fri Aug  8 00:14:24 MDT 2014
 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
 RTC BIOS diagnostic error 
 dfclock_battery,ROM_cksum,memory_size,fixed_disk,invalid_time
 real mem = 8475713536 (8083MB)
 avail mem = 8241348608 (7859MB)
 mpath0 at root
 scsibus0 at mpath0: 256 targets
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe (54 entries)
 bios0: vendor Apple Inc. version MBA51.88Z.00EF.B02.1211271028 date 
 11/27/2012
 bios0: Apple Inc. MacBookAir5,1
 acpi0 at bios0: rev 2
 acpi0: sleep states S0 S3 S4 S5
 acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT 
 SSDT SSDT SSDT SSDT SSDT DMAR MCFG
 acpi0: wakeup devices P0P2(S4) PEG2(S4) EC__(S4) HDEF(S4) RP02(S4) ARPT(S4) 
 RP05(S4) EHC1(S4) EHC2(S4) XHC1(S4) ADP1(S4) LID0(S4)
 acpitimer0 at acpi0: 3579545 Hz, 24 bits
 acpihpet0 at acpi0: 14318179 Hz
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1895.95 MHz
 cpu0: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
 cpu0: 256KB 64b/line 8-way L2 cache
 cpu0: smt 0, core 0, package 0
 mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
 cpu0: apic clock running at 99MHz
 cpu at mainbus0: not configured
 cpu at mainbus0: not configured
 cpu at mainbus0: not configured
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
 ioapic0: misconfigured as apic 0, remapped to apid 2
 acpiec0 at acpi0
 acpimcfg0 at acpi0 addr 0xe000, bus 0-153
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpiprt1 at acpi0: bus -1 (P0P2)
 acpiprt2 at acpi0: bus -1 (PEG2)
 acpiprt3 at acpi0: bus 2 (RP02)
 acpiprt4 at acpi0: bus 3 (RP05)
 acpicpu0 at acpi0: C3, C1, PSS
 acpibat0 at acpi0: BAT0 model 3545797981023400290 type 3545797981528607052 
 oem 3545797981528673619
 acpiac0 at acpi0: AC unit offline
 acpibtn0 at acpi0: LID0
 acpibtn1 at acpi0: PWRB
 acpibtn2 at acpi0: SLPB
 acpivideo0 at acpi0: IGPU
 acpivout0 at acpivideo0: DD02
 cpu0: Enhanced SpeedStep 1895 MHz: speeds: 2001, 2000, 1900, 1800, 1700, 
 1600, 1500, 1400, 1300, 1200, 1100, 1000, 900, 800 MHz
 memory map conflict 0xe00f8000/0x1000
 memory map conflict 0xfed1c000/0x4000
 memory map conflict 0xffe7/0x3
 pci0 at mainbus0 bus 0
 pchb0 at pci0 dev 0 function 0 Intel Core 3G Host rev 0x09
 vga1 at pci0 dev 2 function 0 Intel HD Graphics 4000 rev 0x09
 intagp at vga1 not configured
 inteldrm0 at vga1
 drm0 at inteldrm0
 drm: Memory usable by graphics device = 2048M
 inteldrm0: 1366x768
 wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
 wsdisplay0: screen 1-5 added (std, vt100 emulation)
 Intel 7 Series xHCI rev 0x04 at pci0 dev 20 function 0 not configured
 Intel 7 Series MEI rev 0x04 at pci0 dev 22 function 0 not configured
 ehci0 at pci0 dev 26 function 0 Intel 7 Series USB rev 

USB worked on 5.5, not on 5.6 on MacbookAir5,1

2014-11-15 Thread Scott Bonds
I've been running 5.5 on my MacbookAir5,1 for some time. I'm trying to
upgrade to 5.6 but I'm not having much luck so far.

A fresh install off a USB CD drive (ISOSTICK) proceeds until its time to
copy the packages from the USB CD drive, but at that point no CD drive
is visible.

Next I tried installing by putting the machine into 'target disk mode'
which allows me to connect it as a SATA drive to a virtual machine on
another box. I'm able to install 5.6 that way, disconnect from the
virtual machine, and boot up normally on the raw hardware. But when I
plug in any USB device, be it a network adapter or storage device,
neither are noticed by the OS at all--no message appears when they
attached, nothing in dmesg, nothing new in the output from usbdevs. That
said, the keyboard works, and it appears to be a USB device. Other
devices like the EHCI root hubs, the Facetime HD Camera, and the
Bluetooth USB Host Controller show up--its just the stuff plugged into
either *external* USB port that aren't working. Which is a bummer,
because I can't do much without a USB network adapter, since the
internal wifi chipset is not supported.

An old copy of the 5.5 dmesg is available here:

http://marc.info/?l=openbsd-techm=138867402307945w=2

I have the dmesg off of 5.6 as well...I plugged the machine back into
the VM using target disk mode and copied it to a USB stick:

OpenBSD 5.6 (GENERIC) #310: Fri Aug  8 00:14:24 MDT 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
RTC BIOS diagnostic error 
dfclock_battery,ROM_cksum,memory_size,fixed_disk,invalid_time
real mem = 8475713536 (8083MB)
avail mem = 8241348608 (7859MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe (54 entries)
bios0: vendor Apple Inc. version MBA51.88Z.00EF.B02.1211271028 date 11/27/2012
bios0: Apple Inc. MacBookAir5,1
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC SBST ECDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT 
SSDT SSDT SSDT SSDT DMAR MCFG
acpi0: wakeup devices P0P2(S4) PEG2(S4) EC__(S4) HDEF(S4) RP02(S4) ARPT(S4) 
RP05(S4) EHC1(S4) EHC2(S4) XHC1(S4) ADP1(S4) LID0(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1895.95 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpiec0 at acpi0
acpimcfg0 at acpi0 addr 0xe000, bus 0-153
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus -1 (PEG2)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP05)
acpicpu0 at acpi0: C3, C1, PSS
acpibat0 at acpi0: BAT0 model 3545797981023400290 type 3545797981528607052 
oem 3545797981528673619
acpiac0 at acpi0: AC unit offline
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpibtn2 at acpi0: SLPB
acpivideo0 at acpi0: IGPU
acpivout0 at acpivideo0: DD02
cpu0: Enhanced SpeedStep 1895 MHz: speeds: 2001, 2000, 1900, 1800, 1700, 1600, 
1500, 1400, 1300, 1200, 1100, 1000, 900, 800 MHz
memory map conflict 0xe00f8000/0x1000
memory map conflict 0xfed1c000/0x4000
memory map conflict 0xffe7/0x3
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel Core 3G Host rev 0x09
vga1 at pci0 dev 2 function 0 Intel HD Graphics 4000 rev 0x09
intagp at vga1 not configured
inteldrm0 at vga1
drm0 at inteldrm0
drm: Memory usable by graphics device = 2048M
inteldrm0: 1366x768
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
Intel 7 Series xHCI rev 0x04 at pci0 dev 20 function 0 not configured
Intel 7 Series MEI rev 0x04 at pci0 dev 22 function 0 not configured
ehci0 at pci0 dev 26 function 0 Intel 7 Series USB rev 0x04: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 Intel 7 Series HD Audio rev 0x04: msi
azalia0: codecs: Cirrus Logic CS4206, Intel/0x2806, using Cirrus Logic CS4206
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 Intel 7 Series PCIE rev 0xc4: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 Intel 7 Series PCIE rev 0xc4: msi
pci2 at ppb1 bus 2
Broadcom BCM43224 rev 0x01 at pci2 dev 0 function 0 not configured
ppb2 at pci0 dev 28 function 4 Intel 7 Series PCIE rev 

daily insecurity says my swap device changed

2014-09-11 Thread Scott Bonds
My daily insecurity email on one of my boxes says this:

Block device changes:
brw-r- 1 root operator 0, 1 Aug 16 17:44:40 2014 /dev/wd0b
brw-r- 1 root operator 0, 1 Sep 8  18:43:56 2014 /dev/wd0b

On all my other (openbsd) boxes, the swap partition has the same date as
all the other block devices. And all the other devices on *this* box
have the same timestamp of August 16. After this insecurity report, I
ran a script that eats up memory and started to use swap space and I
verified that at least in that case, the swap device timestamp didn't
change...so it would seem that using swap wouldn't lead to the timestamp
change in my daily insecurity report.

Does anyone know why the date would change on a swap device like this?



Re: daily insecurity says my swap device changed

2014-09-11 Thread Scott Bonds
On Thu, Sep 11, 2014 at 07:35:47PM +0200, Christer Solskogen wrote:
 On Thu, Sep 11, 2014 at 7:21 PM, Ingo Schwarze schwa...@usta.de wrote:
  Hi Scott,
 
  Scott Bonds wrote on Thu, Sep 11, 2014 at 09:38:10AM -0700:
 
  My daily insecurity email on one of my boxes says this:
 
  Block device changes:
  brw-r- 1 root operator 0, 1 Aug 16 17:44:40 2014 /dev/wd0b
  brw-r- 1 root operator 0, 1 Sep 8  18:43:56 2014 /dev/wd0b
 
  On all my other (openbsd) boxes, the swap partition has the same date as
  all the other block devices. And all the other devices on *this* box
  have the same timestamp of August 16. After this insecurity report, I
  ran a script that eats up memory and started to use swap space and I
  verified that at least in that case, the swap device timestamp didn't
  change...so it would seem that using swap wouldn't lead to the timestamp
  change in my daily insecurity report.
 
  Does anyone know why the date would change on a swap device like this?
 
  One obvious possibility would be that maybe somebody ran mknod(1)
  or touch(1) on the file /dev/wd0b.
 
 
 The script /dev/MAKEDEV was run, perhaps?

Understood. I'm the only user on this box and I did not run mknod,
touch, or MAKEDEV. I'm wondering whether something nefarious is going
on, or if there's some system process that's doing something normal.



Re: daily insecurity says my swap device changed

2014-09-11 Thread Scott Bonds
On Thu, Sep 11, 2014 at 10:13:14PM +0200, Christer Solskogen wrote:
 On Thu, Sep 11, 2014 at 9:23 PM, Scott Bonds sc...@ggr.com wrote:
 
  Understood. I'm the only user on this box and I did not run mknod,
  touch, or MAKEDEV. I'm wondering whether something nefarious is going
  on, or if there's some system process that's doing something normal.
 
 
 Not upgraded in the last few days either?

Correct, I did not upgrade the OS.



Re: daily insecurity says my swap device changed

2014-09-11 Thread Scott Bonds
On Thu, Sep 11, 2014 at 04:25:04PM -0400, System Administrator wrote:
 On 11 Sep 2014 at 12:23, Scott Bonds wrote:
 
  On Thu, Sep 11, 2014 at 07:35:47PM +0200, Christer Solskogen wrote:
   On Thu, Sep 11, 2014 at 7:21 PM, Ingo Schwarze schwa...@usta.de wrote:
Hi Scott,
   
Scott Bonds wrote on Thu, Sep 11, 2014 at 09:38:10AM -0700:
   
My daily insecurity email on one of my boxes says this:
   
Block device changes:
brw-r- 1 root operator 0, 1 Aug 16 17:44:40 2014 /dev/wd0b
brw-r- 1 root operator 0, 1 Sep 8  18:43:56 2014 /dev/wd0b
   
On all my other (openbsd) boxes, the swap partition has the same date 
as
all the other block devices. And all the other devices on *this* box
have the same timestamp of August 16. After this insecurity report, I
ran a script that eats up memory and started to use swap space and I
verified that at least in that case, the swap device timestamp didn't
change...so it would seem that using swap wouldn't lead to the 
timestamp
change in my daily insecurity report.
   
Does anyone know why the date would change on a swap device like this?
   
One obvious possibility would be that maybe somebody ran mknod(1)
or touch(1) on the file /dev/wd0b.
   
   
   The script /dev/MAKEDEV was run, perhaps?
  
  Understood. I'm the only user on this box and I did not run mknod,
  touch, or MAKEDEV. I'm wondering whether something nefarious is going
  on, or if there's some system process that's doing something normal.
  
  
 
 Does anyone know whether system crash dump (which goes to the swap 
 device) updates the timestampt? And did the system crash with a dump?

I think you've got it. There's a core dump in /var/crashes with the same
time stamp. Thanks!



Re: Recording from azalia does not work

2014-09-08 Thread Scott Bonds
On Tue, Jun 26, 2012 at 09:16:38AM +0200, Alexandre Ratchov wrote:
 On Mon, Jun 25, 2012 at 10:53:34AM +0200, Gregor Best wrote:
  I'm trying to get recording from the mic input of my laptop working, but 
  have
  not have success so far. I'm using a thinkpad laptop
  with an azalia device and a pretty run of the mill headset, attached to
  headphone out and microphone in. The headset itself works
  fine on other machines and the microphone input and headphone output of the
  laptop work fine hardware-wise (i.e. tested with another
  operating system). On OpenBSD however, the mic input remains silent. Files
  recorded with aucat -o foo.wav remain silent for the
  entire recording duration, as if the mic was somehow muted.

Same here. My azalia connected mic works under OSX but not under
OpenBSD. Did you ever figure out a solution?

  Below is the
  output of mixerctl: 
  outputs.spkr_source=dac-0:1
  outputs.spkr_mute=on
  outputs.spkr=125,125
  outputs.spkr_eapd=on
  outputs.hp_source=dac-0:1
  outputs.hp_mute=off
  outputs.hp=155,155
  outputs.hp_dir=output
  outputs.hp_boost=off
  outputs.mic_dir=input-vr80
  inputs.beep_mute=off
  inputs.beep=108
  inputs.mix_source=dac-0:1,mic,hp
  inputs.mix_dac-0:1=125,125
  inputs.mix_mic=215,215
  inputs.mix_hp=125,125
  record.adc-0:1_source=mic
  record.adc-0:1_mute=off
  record.adc-0:1=253,253
  outputs.hp_sense=plugged
  outputs.mic_sense=plugged
  outputs.spkr_muters=hp
  outputs.master=157,157
  outputs.master.mute=off
  outputs.master.slaves=spkr,hp
  record.volume=255,255
  record.volume.mute=off
  record.volume.slaves=adc-0:1

I have a similar problem. I've got a Macbook Air 5.1 running OpenBSD
5.5-stable. The microphone seems to be there, but I'm not able to get it
to record anything (aucat -o produces a silent file). The speakers and
headset work fine. Also, I noticed that Gnome 3 sound settings list no
input devices.

$ dmesg | grep azalia
azalia0 at pci0 dev 27 function 0 Intel 7 Series HD Audio rev 0x04: msi
azalia0: codecs: Cirrus Logic CS4206, Intel/0x2806, using Cirrus Logic CS4206
audio0 at azalia0

$ mixerctl -v
inputs.dac-0:1_mute=off  [ off on ]
inputs.dac-0:1=86,86 
inputs.dac-2:3_mute=on  [ off on ]
inputs.dac-2:3=62,62 
record.adc-0:1_source=mic  [ mic ]
record.adc-0:1_mute=off  [ off on ]
record.adc-0:1=124,124 
outputs.hp_source=dac-0:1  [ dac-0:1 ]
outputs.hp_boost=off  [ off on ]
outputs.spkr_source=dac-2:3  [ dac-2:3 ]
inputs.mic=85,85 
outputs.mic_dir=input-vr80  [ none input input-vr0 input-vr50 input-vr80 ]
outputs.hp_sense=plugged  [ unplugged plugged ]
outputs.spkr_muters=hp  { hp }
outputs.master=86,86 
outputs.master.mute=off  [ off on ]
outputs.master.slaves=dac-0:1,dac-2:3  { dac-0:1 dac-2:3 }
record.volume=124,124 
record.volume.mute=off  [ off on ]
record.volume.slaves=adc-0:1  { adc-0:1 mic }

 this seems correct at first glance; could you see whether the
 recorded file is full of silence (zeros) or noise (numbers close to
 zero)?
 
 aucat -o /tmp/foo
 
 and then:
 
 hexdump /tmp/foo |less
 
 noise would mean that there's a level knob to crank, while zeros
 would suggest that something in the recording chain is disabled.

Here's the first page of output:

000495246465b38000e415745566d662074
010002800010002bb80ee000002
02000040010
03030804ae161646174
0405b00000e
050
060
070
080
090
0a0
0b0
0c0
0d0
0e0
0f0
100
110
120
130
140
150
160

  As you can see, all recording 

Re: rc.local mystery executables

2014-08-29 Thread Scott Bonds
On Tue, Aug 19, 2014 at 03:24:08AM -0400, Todd Zimmermann wrote:

 Just off the top my head a few links:
 www.team-cymru.org
 https://www.dshield.org
 http://emergingthreats.net/
 https://www.grc.com/dns/dns.htm

 I stumbled upon malheur awhile back. No idea what to do with it, but
 it compiles easy on obsd. Since you found the malware files it might
 help.
 
 http://www.mlsec.org/malheur/

Thanks, I'll check these out.



Re: rc.local mystery executables

2014-08-18 Thread Scott Bonds
On Sat, Aug 16, 2014 at 02:34:21AM -0400, Todd Zimmermann wrote:

 Lots of good stuff in base and the ports collection. mtree can be
 extended to check file integrity for anything you've modified and
 other local stuff (something I need to do).

thanks, mtree is neat, glad to know about it
security(8) uses it too

and on that note, I realized I hadn't received my daily security(8)
email in a while, I broke my root=scott alias when fiddling with smtpd
configuration and forgot to fix it, otherwise I would have likely
noticed the breach sooner...live and learn

 OpenBSD has always rocked for providing very current versions of
 snort. barnyard2 compiles cleanly on obsd.

The funny thing is that I have a book on Snort on my reading list. Time
to read it. I'll checkout barnyard2 as well.

 IIRC swatch can email you on log events. i.e. I know I haven't logged
 onto the server for 2 weeks, why was there an unsuccessful (or yikes
 successful) su/sudo attempt at 0237 when I was sleeping.
 
 Got sagan-1.0.0RC4 set up earlier and was greeted with this alert:
 
 [**] [1001:1]  sagan_blacklist: Address found in blacklist [**]
 [Classification: Blacklist] [Priority: 1]
 2014-08-15 22:58:01 61.174.51.214:1514 - 127.0.0.1:1514 daemon warning
 Message:  Aug 15 22:57:55.617311 rule 7/(match) block in on rl0:
 61.174.51.214.6000  xxx.xxx.xxx.xxx.22: S 1496842240:1496842240(0)
 win 16384 [tos 0x20]
 
 And snort (timestamps are messed up):
 04/21-15:21:46.67  [**] [1:2100528:6] snort GPL SCAN loopback
 traffic [**] [Classification: Potentially Bad Traffic] [Priority: 2]
 {UDP} 127.0.0.1:53 - 172.xxx.xxx.xxx:31105
 12/30-19:03:17.65  [**] [1:2100528:6] snort GPL SCAN loopback
 traffic [**] [Classification: Potentially Bad Traffic] [Priority: 2]
 {UDP} 127.0.0.1:53 - 172.xxx.xxx.xxx:3117
 
 So you're not alone. Good Luck

Thank you. I'll checkout swatch and sagan too.

Also, another emailer suggested I submit the files to virustotal.com. I
did and all of them were recognized as malware, all but one had been
uploaded to them before:

https://www.virustotal.com/en/file/f9ff2f398e479a3e4dbb36c8b1a61e737ed18d6249bf0c2dc9abf4f0fe9ca665/analysis/
https://www.virustotal.com/en/file/53f0ba09b70923874ff84fb0061087a880c8583f4f9b5cee2deaa0d55a9ffdc9/analysis/
https://www.virustotal.com/en/file/50e83cea2ebcb0a8fc806a1ad19db3b052438ca585c4da6ab50048d0f640c27c/analysis/
https://www.virustotal.com/en/file/4c703e03afbda5411dda6e653b8c9bca48fd5b9187a730656b3a9da4b2a593ee/analysis/
https://www.virustotal.com/en/file/29f89dc1da6da3fa2fa951c3453d63ff82eab3159020012a90763df279a75e25/analysis/
https://www.virustotal.com/en/file/ab8c46065f2ae116e09d168d6cca940e8f472c80bb4b354c8e594081525da31a/analysis/
https://www.virustotal.com/en/file/2c22dfc1ea336737349bb51c60be268c42a1e965aaab292cb6ba9a4a4fa31171/analysis/

If anyone reading this knows where I can read up on (those specific)
exploits, please let me know, perhaps I can figure out where my
vulnerability is/was if I know more about how they work.



Re: rc.local mystery executables

2014-08-15 Thread Scott Bonds
Ok, thanks for confirming (and Chris and Adam). And while I have you 
here, thank you for all of your contributions to OpenBSD, its amazing to 
me the scope and quality of what y'all have built.

I thought I was being reasonably careful: ssh disabled for root, 
key-only login on my admin account, following stable, etc...then again, 
I'm running owncloud and a bunch of other (no doubt less secure) 
software. Perhaps I should separate the router and 'everything else' 
roles, so that the router only has builtin OpenBSD software on it, no 
packages. Then again, whatever the exploit, they could probably still 
use it on the newly separated 'everything else' box. Anyway, I clearly 
have a lot to learn about security.

On Thu, Aug 14, 2014 at 09:23:54PM -0400, Ted Unangst wrote:
 On Thu, Aug 14, 2014 at 17:54, Scott Bonds wrote:
 
  So...have I been p0wned or does anyone know what innocent thing might be
  happening here? Please CC sc...@ggr.com on any replies, as I'm not
  subscribed to updates from the list.
 
 Bad news: yeah. They appear to have screwed up their rootkit by
 installing the i386 edition, but those files should not be there. I'd
 reinstall after giving some consideration to how this may have
 happened (and changing all your passwords, rotating ssh keys, etc.).



Re: rc.local mystery executables

2014-08-15 Thread Scott Bonds
On Fri, Aug 15, 2014 at 11:42:32AM -0300, Giancarlo Razzolini wrote:
 Don't forget to check your own machine, not just your OpenBSD server.
 It's more often than not the point of origin of the attack. If your
 machine is compromised, reinstalling your server won't do anything,
 since they'll reinfect it again.

I'm running OpenBSD 5.5-stable on my laptop as well. My laptop isn't 
running any public services AFAIK...I've configured the ones I'm running 
on it (like unbound) to only respond to local requests. Then again, I 
haven't tested those ports from another machine to verify that I locked 
them down the way I think I have, and now that I think about it, that 
would be a good idea--I'll add that to my todo list.

If my laptop config IS properly locked down, it would need to be trojan 
horse or some kind of Firefox or email based vector, I suppose. Let's 
see... well, my laptop rc.local doesn't have any mystery files, at least.



Re: rc.local mystery executables

2014-08-15 Thread Scott Bonds
On Fri, Aug 15, 2014 at 10:50:55AM -0500, Adam Thompson wrote:
 While a long way from perfect, tools such as chkrootkit and rkhunter
 might shed some light on your situation.
 As Giancarlo said, check every machine that's closely interconnected, not
 just the one compromised server you've noticed.
 I haven't used them under OpenBSD, so not sure how effective they'll be
 (both projects claim to support OpenBSD), but they're probably more
 appropriate than clamscan(1) which looks for mostly MS Windows-based
 viruses, not rootkits.

Thank you for the suggestion. I just ran both chkrootkit and rkhunter.
chkrootkit didn't find any matches. rkhunter had a couple warnings but
to my eye they checkout out, i.e. warning that pkg_info is a perl
script.

That said, I'm going to make chkrootkit and rkhunter a regular part of
my maintenance regime, perhaps add them as daily cron jobs.



rc.local mystery executables

2014-08-14 Thread Scott Bonds
I run an OpenBSD 5.5-stable amd64 server at home. Email, web, etc. Today 
I was doing some maintenance and I found my way to /etc/rc.local. When I 
opened it I saw this:

$ cat rc.local
#   $OpenBSD: rc.local,v 1.44 2011/04/22 06:08:14 ajacoutot Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode.  For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.
cd /etc;./sfewfesfs
cd /etc;./gfhjrtfyhuf
cd /etc;./rewgtf3er4t
cd /etc;./sdmfdsfhjfe
cd /etc;./gfhddsfew
cd /etc;./ferwfrre
cd /etc;./dsfrefr

I don't remember adding those lines to my rc.local file.

$ cd /etc  ls -al ./sfewfesfs
-rwsrwsrwt  1 root  wheel  694680 Apr  4 07:47 /etc/sfewfesfs

$ file dsfrefr dsfrefr: ELF 32-bit LSB executable, Intel 80386, version 
1, statically linked, stripped

Seems odd to have a bunch of randomly named executibles running at boot. 
And that they are compiled for 386 (I'm running amd64), and that they have
suid set, and to root.

$ clamscan *
dsfrefr: OK
ferwfrre: OK
gfhddsfew: OK
gfhjrtfyhuf: OK
rc.local: OK
rewgtf3er4t: OK
sdmfdsfhjfe: OK
sfewfesfs: OK
Scanned directories: 0
Scanned files: 8
Infected files: 0
Data scanned: 3.21 MB
Data read: 3.20 MB (ratio 1.00:1)
Time: 10.842 sec (0 m 10 s)

Hmm, ok let's run one.

$ ./dsfrefr
./dsfrefr[1]: syntax error: `(' unexpected

That's all any of them say when run.

So...have I been p0wned or does anyone know what innocent thing might be 
happening here? Please CC sc...@ggr.com on any replies, as I'm not 
subscribed to updates from the list.