OpenBSD 5.4 Stable kernel fails to compile

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenBSD 5.4 Stable kernel fails to compile

Nishal Ranchhod
> Synopsis: OpenBSD 5.4 Stable kernel fails to compile
> Category:
> Environment:
        System      : OpenBSD 5.3
        Details     : OpenBSD 5.3-stable (macg4-20130531) #0: Fri May 31  
23:59:44 BST 2013
                         [hidden email]:/usr/src/sys/arch/macppc/compile/
macg4-20130531

        Architecture: OpenBSD.macppc
        Machine     : macppc

> Description:

The machine is an PowerMac G4 MDD single 1.250 Mhz CPU headless server  
running
OpenBSD-5.3-stable upgraded over ssh from a clean 5.2-stable  
installation using
official FAQ procedures.

While preparing to upgrade to OpenBSD-5.4-stable the kernel fails to  
compile.

The configuration is a copy of 5.4 GENERIC where the only modification  
made was
a custom boot, root and swap device.This is only necessary because  
this machine
mounts root on softraid and GENERIC fails to find the root device  
after booting
unless specified at compile time. The RAID device is made up of two  
disks:
wd0 and wd1 where each contains a small 'a' slice used to hold only  
the kernel.
After the kernel has booted from either disk, it sees the RAID slices,
assembles them into a RAID-1 discipline and roots at sd0a.

Compiling 5.4 using GENERIC completes without errors.

The disk layout is as follows:

Volume      Status               Size Device
softraid0 0 Online               466G sd0     RAID1
           0 Online               466G 0:0.0   noencl <wd0d>
                                                  'unknown serial'
           1 Online               466G 0:1.0   noencl <wd1d>
                                                  'unknown serial'

Partition map (with 512 byte blocks) on 'wd0'
  #:                type name         length   base      ( size )
  1: Apple_partition_map Apple            63 @ 1
  2:     Apple_Bootstrap bootstrap      1600 @ 64
  3:             OpenBSD OpenBSD   976771504 @ 1664      (465.8G)

Device block size=512, Number of Blocks=976773168 (465.8G)
DeviceType=0x0, DeviceId=0x0


Partition map (with 512 byte blocks) on 'wd1'
  #:                type name         length   base      ( size )
  1: Apple_partition_map Apple            63 @ 1
  2:     Apple_Bootstrap bootstrap      1600 @ 64
  3:             OpenBSD OpenBSD   976771504 @ 1664      (465.8G)

Device block size=512, Number of Blocks=976773168 (465.8G)
DeviceType=0x0, DeviceId=0x0


# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: ST3500630AS
duid: b63df990da46d5a3
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 969021
total sectors: 976773168 # total bytes: 476940.0M
boundstart: 1664
boundend: 976773168
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
   a:           128.1M             1664  4.2BSD   2048 16384    1
   c:        476940.0M                0  unused
   d:        476811.1M           264096    RAID


# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: ST3500630AS
duid: f467c45bf64deb40
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 969021
total sectors: 976773168 # total bytes: 476940.0M
boundstart: 1664
boundend: 976773168
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
   a:           128.1M             1664  4.2BSD   2048 16384    1
   c:        476940.0M                0  unused
   d:        476811.1M           264096    RAID

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: SR RAID 1
duid: 190d399eff0d9243
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 60784
total sectors: 976508544 # total bytes: 476810.8M
boundstart: 0
boundend: 976508544
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
   a:          1027.6M                0  4.2BSD   2048 16384    1 # /
   b:          2047.3M          2104512    swap                   # none
   c:        476810.8M                0  unused
   d:          2055.2M          6297504  4.2BSD   2048 16384    1 # /tmp
   e:          8189.4M         10506496  4.2BSD   2048 16384    1 # /var
   f:          8189.4M         27278368  4.2BSD   2048 16384    1 # /usr
   g:          1019.8M         44050208  4.2BSD   2048 16384    1 # /
usr/X11R6
   h:          8189.4M         46138656  4.2BSD   2048 16384    1 # /
usr/local
   i:          4094.7M         62910528  4.2BSD   2048 16384    1 # /
usr/src
   j:          4094.7M         71296448  4.2BSD   2048 16384    1 # /
usr/obj
   k:        437903.4M         79682432  4.2BSD   4096 32768    1 # /
home


> How-To-Repeat:

On a running OpenBSD 5.3-stable macppc extract the 5.4 src and sys  
trees to /usr/src:

$ tar -C /usr/src -xzphf src.tar.gz
$ tar -C /usr/src -xzphf sys.tar.gz

Take a copy of GENERIC, edit the boot device and compile the kernel:

$ cd /usr/src/sys/arch/mappc/conf
$ cp GENERIC macg4-$(date "+Y%m%d")
$ vi macg4-$(date "+Y%m%d")

$ diff -wu GENERIC macg4-20131109
--- GENERIC     Sun Jul  7 17:20:58 2013
+++ macg4-20131109      Sat Nov  9 14:40:05 2013
@@ -31,7 +31,7 @@

  option         USER_PCICONF    # user-space PCI configuration

-config         bsd     swap generic
+config      bsd root on sd0a swap on sd0b dumps on sd0b

  mainbus0       at root
  cpu*           at mainbus0


$ config macg4-$(date "+Y%m%d")
$ cd ../compile/macg4-$(date "+Y%m%d")
$ make clean
$ make
[lots of output from compiler]
cc1: warnings being treated as errors
swapbsd.c:9: warning: excess elements in struct initializer
swapbsd.c:9: warning: (near initialization for 'swdevt[0]')
swapbsd.c:10: warning: excess elements in struct initializer
swapbsd.c:10: warning: (near initialization for 'swdevt[1]')
*** Error 1 in /usr/src/sys/arch/macppc/compile/macg4-20131109  
(Makefile:609
'swapbsd.o')

$ cat swapbsd.c
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/systm.h>

dev_t   rootdev = makedev(2, 0);        /* sd0a */
dev_t   dumpdev = makedev(2, 1);        /* sd0b */

struct  swdevt swdevt[] = {
         { makedev(2, 1),        0,      0 },    /* sd0b */
         { NODEV, 0, 0 }
};

int (*mountroot)(void) = dk_mountroot;

> Fix:
       
Not known

dmesg:
OpenBSD 5.3-stable (macg4-20130531) #0: Fri May 31 23:59:44 BST 2013
    [hidden email]:/usr/src/sys/arch/macppc/compile/
macg4-20130531
real mem = 1879048192 (1792MB)
avail mem = 1815363584 (1731MB)
mainbus0 at root: model PowerMac3,6
cpu0 at mainbus0: 7455 (Revision 0x303): 1249 MHz: 256KB L2 cache, 1MB  
L3 cache
mem0 at mainbus0
spdmem0 at mem0: 512MB DDR SDRAM non-parity PC2700CL2.5
spdmem1 at mem0: 512MB DDR SDRAM non-parity PC2700CL2.5
spdmem2 at mem0: 512MB DDR SDRAM non-parity PC2700CL2.5
spdmem3 at mem0: 256MB DDR SDRAM non-parity PC3200CL3.0
memc0 at mainbus0: uni-n rev 0x24
kiic0 at memc0 offset 0xf8001000
iic0 at kiic0
admtmp0 at iic0 addr 0x2c: unable to read fan setting
"cy2213" at iic0 addr 0x65 not configured
lmtemp0 at iic0 addr 0x49: ds1775, fails to respond
mpcpcibr0 at mainbus0 pci: uni-north
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 "Apple UniNorth AGP" rev 0x00
appleagp0 at pchb0
agp0 at appleagp0: aperture at 0x0, size 0x10000000
vgafb0 at pci0 dev 16 function 0 "ATI Radeon 9000" rev 0x01, mmio
wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
mpcpcibr1 at mainbus0 pci: uni-north
pci1 at mpcpcibr1 bus 0
pchb1 at pci1 dev 11 function 0 "Apple UniNorth PCI" rev 0x00
pciide0 at pci1 dev 20 function 0 "CMD Technology SiI3512 SATA" rev  
0x01: DMA
pciide0: using irq 54 for native-PCI interrupt
pciide0: port 0: device present, speed: 1.5Gb/s
wd0 at pciide0 channel 0 drive 0: <ST3500630AS>
wd0: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
wd0(pciide0:0:0): using BIOS timings, Ultra-DMA mode 6
pciide0: port 1: device present, speed: 1.5Gb/s
wd1 at pciide0 channel 1 drive 0: <ST3500630AS>
wd1: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
wd1(pciide0:1:0): using BIOS timings, Ultra-DMA mode 6
pciide1 at pci1 dev 21 function 0 "CMD Technology SiI3512 SATA" rev  
0x01: DMA
pciide1: using irq 58 for native-PCI interrupt
pciide1: port 0: device present, speed: 1.5Gb/s
wd2 at pciide1 channel 0 drive 0: <WDC WD5000KS-00MNB0>
wd2: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
wd2(pciide1:0:0): using BIOS timings, Ultra-DMA mode 6
pciide1: port 1: device present, speed: 1.5Gb/s
wd3 at pciide1 channel 1 drive 0: <WDC WD5000AAKS-00C8A0>
wd3: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
wd3(pciide1:1:0): using BIOS timings, Ultra-DMA mode 6
macobio0 at pci1 dev 23 function 0 "Apple Keylargo" rev 0x03
openpic0 at macobio0 offset 0x40000: version 0x4614 feature 3f0302 LE
macgpio0 at macobio0 offset 0x50
macgpio1 at macgpio0 offset 0x9 irq 47
"programmer-switch" at macgpio0 offset 0x11 not configured
"gpio5" at macgpio0 offset 0x6f not configured
"extint-gpio15" at macgpio0 offset 0x67 not configured
"gpio6" at macgpio0 offset 0x70 not configured
"extint-gpio16" at macgpio0 offset 0x68 not configured
"extint-gpio14" at macgpio0 offset 0x66 not configured
"gpio12" at macgpio0 offset 0x76 not configured
"gpio11" at macgpio0 offset 0x75 not configured
"escc-legacy" at macobio0 offset 0x12000 not configured
zsc0 at macobio0 offset 0x13000: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
snapper0 at macobio0 offset 0x10000: irq 30,1,2
"timer" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000 irq 25: via-pmu, 0 targets
apm0 at adb0: battery flags 0x9, 0% charged
piic0 at adb0
iic1 at piic0
"cy28506" at iic1 addr 0xea not configured
"pck2059" at iic1 addr 0xe4 not configured
kiic1 at macobio0 offset 0x18000
iic2 at kiic1
wdc0 at macobio0 offset 0x1f000 irq 19: DMA
wdc1 at macobio0 offset 0x20000 irq 20: DMA
atapiscsi0 at wdc1 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <HL-DT-ST, RW/DVD GCC-4480B, 1.03> ATAPI  
5/cdrom removable
cd0(wdc1:0:0): using BIOS timings, DMA mode 2
wi0 at macobio0 offset 0x30000 irq 57:
wi0: Firmware 8.70 variant 1, address 00:30:65:0d:a9:8b
audio0 at snapper0
ohci0 at pci1 dev 24 function 0 "Apple USB" rev 0x00: irq 27, version  
1.0
ohci1 at pci1 dev 25 function 0 "Apple USB" rev 0x00: irq 28, version  
1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Apple OHCI root hub" rev 1.00/1.00 addr 1
usb1 at ohci1: USB revision 1.0
uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1
mpcpcibr2 at mainbus0 pci: uni-north
pci2 at mpcpcibr2 bus 0
pchb2 at pci2 dev 11 function 0 "Apple UniNorth PCI" rev 0x00
kauaiata0 at pci2 dev 13 function 0 "Apple Uni-N ATA" rev 0x00
wdc2 at kauaiata0 irq 39: DMA
"Apple UniNorth Firewire" rev 0x01 at pci2 dev 14 function 0 not  
configured
gem0 at pci2 dev 15 function 0 "Apple Uni-N2 GMAC" rev 0x00: irq 41,  
address 00:0a:95:ce:41:92
brgphy0 at gem0 phy 0: BCM5421 10/100/1000baseT PHY, rev. 1
uhidev0 at uhub0 port 1 configuration 1 interface 0 "CHICONY HP Basic  
USB Keyboard" rev 1.10/3.00 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0: console keyboard, using wsdisplay0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
sd0 at scsibus2 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct  
fixed
sd0: 476810MB, 512 bytes/sector, 976508544 sectors
softraid0: sd1 was not shutdown properly
sd1 at scsibus2 targ 2 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct  
fixed
sd1: 476810MB, 512 bytes/sector, 976508544 sectors
bootpath: /pci@f2000000/Generic-3512-ER4@14/@0:/bsd
string [/Generic-3512-ER4@14/@0:/bsd] not found
Warning: bootpath unrecognized: /pci@f2000000/Generic-3512-ER4@14/@0:/
bsd
root on sd0a swap on sd0b dump on sd0b

usbdevs:
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000),  
Apple(0x106b), rev 1.00
port 1 addr 2: low speed, power 100 mA, config 1, HP Basic USB  
Keyboard(0x0024), CHICONY(0x03f0), rev 3.00
port 2 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000),  
Apple(0x106b), rev 1.00
port 1 powered
port 2 powered

pcidump:
Domain /dev/pci0:
0:11:0: Apple UniNorth AGP
        0x0000: Vendor ID: 106b Product ID: 0034
        0x0004: Command: 0016 Status ID: 22b0
        0x0008: Class: 06 Subclass: 00 Interface: 00 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 08
        0x0010: BAR empty (00000000)
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
        0x0080: Capability 0x02: AGP
        0x0000: 0034106b 22b00016 06000000 00001008
        0x0010: 00000000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000080 00000000 00000000
        0x0040: 00000840 00000000 02000002 00000000
        0x0050: 001000c0 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00100002 07000217 00000000 00a1b040
        0x0090: 00000000 00000100 00000001 00000400
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:16:0: ATI Radeon 9000
        0x0000: Vendor ID: 1002 Product ID: 4966
        0x0004: Command: 0086 Status ID: 02b0
        0x0008: Class: 03 Subclass: 00 Interface: 00 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: ff Cache Line Size: 08
        0x0010: BAR mem prefetchable 32bit addr: 0x98000000/0x08000000
        0x0014: BAR io addr: 0x00000400/0x0100
        0x0018: BAR mem 32bit addr: 0x90000000/0x00010000
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 1002 Product ID: 4966
        0x0030: Expansion ROM Base Address: 90020000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 30 Min Gnt: 08 Max Lat: 00
        0x0058: Capability 0x02: AGP
        0x0050: Capability 0x01: Power Management
        0x0000: 49661002 02b00086 03000001 0000ff08
        0x0010: 98000008 00000401 90000000 00000000
        0x0020: 00000000 00000000 00000000 49661002
        0x0030: 90020000 00000058 00000000 00080130
        0x0040: 00000000 00000000 00000000 49661002
        0x0050: 06020001 00000000 00205002 2f000217
        0x0060: 00000200 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
Domain /dev/pci1:
0:11:0: Apple UniNorth PCI
        0x0000: Vendor ID: 106b Product ID: 0035
        0x0004: Command: 0016 Status ID: 22a0
        0x0008: Class: 06 Subclass: 00 Interface: 00 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 08
        0x0010: BAR empty (00000000)
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
        0x0000: 0035106b 22a00016 06000000 00001008
        0x0010: 00000000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 00000000
        0x0040: 00000840 00000000 01000008 00000000
        0x0050: 001000c1 00000000 00000000 00000000
        0x0060: fffffff3 ffffffff ffffffff ffffffff
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:20:0: CMD Technology SiI3512 SATA
        0x0000: Vendor ID: 1095 Product ID: 3512
        0x0004: Command: 0007 Status ID: 02b0
        0x0008: Class: 01 Subclass: 80 Interface: 00 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 01
        0x0010: BAR io addr: 0x00000490/0x0008
        0x0014: BAR io addr: 0x00000480/0x0004
        0x0018: BAR io addr: 0x00000470/0x0008
        0x001c: BAR io addr: 0x00000460/0x0004
        0x0020: BAR io addr: 0x00000450/0x0010
        0x0024: BAR mem 32bit addr: 0x80081000/0x00000200
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 1095 Product ID: 3512
        0x0030: Expansion ROM Base Address: 80180001
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 36 Min Gnt: 00 Max Lat: 00
        0x0060: Capability 0x01: Power Management
        0x0000: 35121095 02b00007 01800001 00001001
        0x0010: 00000491 00000481 00000471 00000461
        0x0020: 00000451 80081000 00000000 35121095
        0x0030: 80180001 00000060 00000000 00000136
        0x0040: 00000002 0082a887 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 06220001 64004000 00000000 00000000
        0x0070: 00200008 00a60000 00200008 00a70000
        0x0080: 00000002 00000002 00000000 5dff5cff
        0x0090: 08000000 00400000 18000000 00000000
        0x00a0: 65150101 62dd62dd 43924392 40094009
        0x00b0: 65150101 62dd62dd 43924392 40094009
        0x00c0: 000000f4 00000002 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:21:0: CMD Technology SiI3512 SATA
        0x0000: Vendor ID: 1095 Product ID: 3512
        0x0004: Command: 0005 Status ID: 02b0
        0x0008: Class: 01 Subclass: 80 Interface: 00 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 01
        0x0010: BAR io addr: 0x00000440/0x0008
        0x0014: BAR io addr: 0x00000430/0x0004
        0x0018: BAR io addr: 0x00000420/0x0008
        0x001c: BAR io addr: 0x00000410/0x0004
        0x0020: BAR io addr: 0x00000400/0x0010
        0x0024: BAR mem 32bit addr: 0x80080000/0x00000200
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 1095 Product ID: 3512
        0x0030: Expansion ROM Base Address: 80100000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 3a Min Gnt: 00 Max Lat: 00
        0x0060: Capability 0x01: Power Management
        0x0000: 35121095 02b00005 01800001 00001001
        0x0010: 00000441 00000431 00000421 00000411
        0x0020: 00000401 80080000 00000000 35121095
        0x0030: 80100000 00000060 00000000 0000013a
        0x0040: 00000002 0014c007 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 06220001 64004000 00000000 00000000
        0x0070: 00200000 00a80000 00200000 00a90000
        0x0080: 00000002 00000002 00000000 b6edfd8d
        0x0090: 08000000 00400000 18000000 00000000
        0x00a0: 65150101 62dd62dd 43924392 40094009
        0x00b0: 65150101 62dd62dd 43924392 40094009
        0x00c0: 000000f4 00000002 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:23:0: Apple Keylargo
        0x0000: Vendor ID: 106b Product ID: 0022
        0x0004: Command: 0006 Status ID: 0200
        0x0008: Class: ff Subclass: 00 Interface: 00 Revision: 03
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 08
        0x0010: BAR mem 32bit addr: 0x80000000/0x00080000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
        0x0000: 0022106b 02000006 ff000003 00001008
        0x0010: 80000000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 00000000
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:24:0: Apple USB
        0x0000: Vendor ID: 106b Product ID: 0019
        0x0004: Command: 0006 Status ID: 0200
        0x0008: Class: 0c Subclass: 03 Interface: 10 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 00
        0x0010: BAR mem 32bit addr: 0x80083000/0x00001000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 1b Min Gnt: 03 Max Lat: 56
        0x0000: 0019106b 02000006 0c031000 00001000
        0x0010: 80083000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 5603011b
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:25:0: Apple USB
        0x0000: Vendor ID: 106b Product ID: 0019
        0x0004: Command: 0006 Status ID: 0200
        0x0008: Class: 0c Subclass: 03 Interface: 10 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 00
        0x0010: BAR mem 32bit addr: 0x80082000/0x00001000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 1c Min Gnt: 03 Max Lat: 56
        0x0000: 0019106b 02000006 0c031000 00001000
        0x0010: 80082000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 5603011c
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
Domain /dev/pci2:
0:11:0: Apple UniNorth PCI
        0x0000: Vendor ID: 106b Product ID: 0036
        0x0004: Command: 0016 Status ID: 22a0
        0x0008: Class: 06 Subclass: 00 Interface: 00 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 10 Cache Line Size: 08
        0x0010: BAR empty (00000000)
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
        0x0000: 0036106b 22a00016 06000000 00001008
        0x0010: 00000000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 00000000
        0x0040: 00000840 00000000 00000020 00000000
        0x0050: 0011e0c2 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:13:0: Apple Uni-N ATA
        0x0000: Vendor ID: 106b Product ID: 0033
        0x0004: Command: 0006 Status ID: 8200
        0x0008: Class: ff Subclass: 00 Interface: 00 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 20 Cache Line Size: 08
        0x0010: BAR mem 32bit addr: 0xf5004000/0x00004000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
        0x0000: 0033106b 82000006 ff000000 00002008
        0x0010: f5004000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: 00000000 00000000 00000000 00000000
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:14:0: Apple UniNorth Firewire
        0x0000: Vendor ID: 106b Product ID: 0031
        0x0004: Command: 0006 Status ID: 0290
        0x0008: Class: 0c Subclass: 00 Interface: 10 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 40 Cache Line Size: 08
        0x0010: BAR mem 32bit addr: 0xf5000000/0x00001000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 106b Product ID: 5811
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 28 Min Gnt: 0c Max Lat: 18
        0x0044: Capability 0x01: Power Management
        0x0000: 0031106b 02900006 0c001001 00004008
        0x0010: f5000000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 5811106b
        0x0030: 00000000 00000044 00000000 180c0128
        0x0040: 00000000 7e020001 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 000a95ff fece4192 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
0:15:0: Apple Uni-N2 GMAC
        0x0000: Vendor ID: 106b Product ID: 0032
        0x0004: Command: 0006 Status ID: 84a0
        0x0008: Class: 02 Subclass: 00 Interface: 00 Revision: 00
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 20 Cache Line Size: 20
        0x0010: BAR mem 32bit addr: 0xf5200000/0x00200000
        0x0014: BAR empty (00000000)
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 0000 Product ID: 0000
        0x0030: Expansion ROM Base Address: f5100000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 29 Min Gnt: 40 Max Lat: 40
        0x0000: 0032106b 84a00006 02000000 00002020
        0x0010: f5200000 00000000 00000000 00000000
        0x0020: 00000000 00000000 00000000 00000000
        0x0030: f5100000 00000000 00000000 40400129
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 00000000 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000

acpidump:

Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD 5.4 Stable kernel fails to compile

Florian Obser-2
On Sat, Nov 09, 2013 at 03:56:25PM +0000, Nishal Ranchhod wrote:
> >Synopsis: OpenBSD 5.4 Stable kernel fails to compile
> >Category:
> >Environment:
> System      : OpenBSD 5.3
[...]
> While preparing to upgrade to OpenBSD-5.4-stable the kernel fails to
> compile.

You are not supposed to do that.

You are at Goal Binary upgrade to then ...
Old -stable -stable Newest release Fetch & build -stable
( http://www.openbsd.org/faq/faq5.html#BldBinary )

I understand you cannot do that on this particular machine, maybe you
have another macppc which will boot GENERIC and you can use that as a
build machine? Alternatively see below.

[...]

> $ config macg4-$(date "+Y%m%d")
> $ cd ../compile/macg4-$(date "+Y%m%d")
> $ make clean
> $ make
> [lots of output from compiler]
> cc1: warnings being treated as errors
> swapbsd.c:9: warning: excess elements in struct initializer
> swapbsd.c:9: warning: (near initialization for 'swdevt[0]')
> swapbsd.c:10: warning: excess elements in struct initializer
> swapbsd.c:10: warning: (near initialization for 'swdevt[1]')
> *** Error 1 in /usr/src/sys/arch/macppc/compile/macg4-20131109
> (Makefile:609
> 'swapbsd.o')

You need a newer config(8), see this old entry from current.html:

http://www.openbsd.org/cgi-bin/cvsweb/www/faq/current.html.diff?r1=1.378;r2=1.379

I'm optimistic that you can take the 5.4 sources of config(8), build
them on 5.3 and use the resulting binary to build your frankensteined
kernel. Or you can try to edit the generated swapbsd.c and remove the
last ", 0" in the swdevt lines (IIRC)

>
> $ cat swapbsd.c
> #include <sys/param.h>
> #include <sys/conf.h>
> #include <sys/systm.h>
>
> dev_t   rootdev = makedev(2, 0);        /* sd0a */
> dev_t   dumpdev = makedev(2, 1);        /* sd0b */
>
> struct  swdevt swdevt[] = {
>         { makedev(2, 1),        0,      0 },    /* sd0b */
                                   ^^^^^^^^ here  
>         { NODEV, 0, 0 }
                    ^^^ and here
> };
>
> int (*mountroot)(void) = dk_mountroot;
>

--
I'm not entirely sure you are real.

Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD 5.4 Stable kernel fails to compile

Nishal Ranchhod
> I understand you cannot do that on this particular machine, maybe you
> have another macppc which will boot GENERIC and you can use that as a
> build machine? Alternatively see below.

I'm afraid I don't have this option, sadly.

> I'm optimistic that you can take the 5.4 sources of config(8), build
> them on 5.3 and use the resulting binary to build your frankensteined
> kernel. Or you can try to edit the generated swapbsd.c and remove the
> last ", 0" in the swdevt lines (IIRC)

Thank you Florian, that was spot on! The new "config" binary produces  
a valid swapbsd.c

If I had followed "-current" rather than "-stable" I assume I would  
have an updated "config" binary to start with and would not have run  
into this issue. I will consider that option going forward.

For the sake of helping others, here's the steps taken to resolve:
I built a new config userland binary from the 5.4 tree.

$ mv /usr/sbin/config /usr/sbin/config.old
$ cd /usr/src/usr.sbin/config
$ make
$ make install

Then ran it against my kernel config:

$ cd /usr/src/sys/arch/macppc/conf
$ config macg4-20131109

swapbsd.c has the correct number of elements now:

$ cd ../compile/macg4-20131109
$ cat swapbsd.c

#include <sys/param.h>
#include <sys/conf.h>
#include <sys/systm.h>

dev_t   rootdev = makedev(2, 0);        /* sd0a */
dev_t   dumpdev = makedev(2, 1);        /* sd0b */

struct  swdevt swdevt[] = {
         { makedev(2, 1),        0 },    /* sd0b */
         { NODEV, 0 }
};

int (*mountroot)(void) = dk_mountroot;


The kernel builds:

text    data    bss     dec     hex
5951529 90128   469616  6511273 635aa9


Nishal