From f35d58a69c29b6a824074eb1c07e643dcc3772e5 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 18 May 2016 18:49:34 -0700 Subject: [PATCH 01/33] Spray and pray! Everything is eth0, right? - stub out syspath entries for network devices - assume that each platform boots with eth0 --- .../r0/src/lib/powerpc-accton-as4600-54t-r0.yml | 10 +++++----- .../r0/src/lib/powerpc-accton-as5610-52x-r0.yml | 10 +++++----- .../r0/src/lib/powerpc-accton-as5710-54x-r0.yml | 10 +++++----- .../r0b/src/lib/powerpc-accton-as5710-54x-r0b.yml | 10 +++++----- .../r0/src/lib/powerpc-accton-as6700-32x-r0.yml | 10 +++++----- .../r1/src/lib/powerpc-accton-as6700-32x-r1.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as5512-54x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as5712-54x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as5812-54t-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as5812-54x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as6712-32x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as6812-32x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as7512-32x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-as7712-32x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-accton-wedge-16x-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-cel-redstone-xp-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-kvm-x86-64-r0.yml | 10 +++++----- .../r0/src/lib/powerpc-quanta-lb9-r0.yml | 10 +++++----- .../r0/src/lib/powerpc-quanta-ly2-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-quanta-ly6-rangeley-r0.yml | 10 +++++----- .../r0/src/lib/x86-64-quanta-ly8-rangeley-r0.yml | 10 +++++----- 21 files changed, 105 insertions(+), 105 deletions(-) diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as4600-54t/platform-config/r0/src/lib/powerpc-accton-as4600-54t-r0.yml b/packages/platforms/accton/powerpc/powerpc-accton-as4600-54t/platform-config/r0/src/lib/powerpc-accton-as4600-54t-r0.yml index 1e8f0c60..eb3bdf19 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as4600-54t/platform-config/r0/src/lib/powerpc-accton-as4600-54t-r0.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as4600-54t/platform-config/r0/src/lib/powerpc-accton-as4600-54t-r0.yml @@ -39,8 +39,8 @@ powerpc-accton-as4600-54t-r0: =: 100% format: ext4 - network: - interfaces: - ma1: - name: ~ - syspath: soc.0/ff725000.ethernet + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: soc.0/ff725000.ethernet diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as5610-52x/platform-config/r0/src/lib/powerpc-accton-as5610-52x-r0.yml b/packages/platforms/accton/powerpc/powerpc-accton-as5610-52x/platform-config/r0/src/lib/powerpc-accton-as5610-52x-r0.yml index d81acd37..ca4037b2 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as5610-52x/platform-config/r0/src/lib/powerpc-accton-as5610-52x-r0.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as5610-52x/platform-config/r0/src/lib/powerpc-accton-as5610-52x-r0.yml @@ -40,8 +40,8 @@ powerpc-accton-as5610-52x-r0: =: 100% format: ext4 - network: - interfaces: - ma1: - name: ~ - syspath: soc.0/ff724000.ethernet + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: soc.0/ff724000.ethernet diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0/src/lib/powerpc-accton-as5710-54x-r0.yml b/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0/src/lib/powerpc-accton-as5710-54x-r0.yml index 3f610df6..f30782be 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0/src/lib/powerpc-accton-as5710-54x-r0.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0/src/lib/powerpc-accton-as5710-54x-r0.yml @@ -40,8 +40,8 @@ powerpc-accton-as5710-54x-r0: =: 100% format: ext4 - network: - interfaces: - ma1: - name: ~ - syspath: fsl,dpaa.16/ethernet.17 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: fsl,dpaa.16/ethernet.17 diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0b/src/lib/powerpc-accton-as5710-54x-r0b.yml b/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0b/src/lib/powerpc-accton-as5710-54x-r0b.yml index ca2a066c..f940bd38 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0b/src/lib/powerpc-accton-as5710-54x-r0b.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as5710-54x/platform-config/r0b/src/lib/powerpc-accton-as5710-54x-r0b.yml @@ -25,8 +25,8 @@ powerpc-accton-as5710-54x-r0b: device: /dev/sda nos_bootcmds: *usb_bootcmds - network: - interfaces: - ma1: - name: ~ - syspath: fsl,dpaa.16/ethernet.17 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: fsl,dpaa.16/ethernet.17 diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r0/src/lib/powerpc-accton-as6700-32x-r0.yml b/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r0/src/lib/powerpc-accton-as6700-32x-r0.yml index 570843ec..b7ee33b1 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r0/src/lib/powerpc-accton-as6700-32x-r0.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r0/src/lib/powerpc-accton-as6700-32x-r0.yml @@ -40,8 +40,8 @@ powerpc-accton-as6700-32x-r0: =: 100% format: ext4 - network: - interfaces: - ma1: - name: ~ - syspath: fsl,dpaa.16/ethernet.18 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: fsl,dpaa.16/ethernet.18 diff --git a/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r1/src/lib/powerpc-accton-as6700-32x-r1.yml b/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r1/src/lib/powerpc-accton-as6700-32x-r1.yml index f6d5c232..249fa0f5 100644 --- a/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r1/src/lib/powerpc-accton-as6700-32x-r1.yml +++ b/packages/platforms/accton/powerpc/powerpc-accton-as6700-32x/platform-config/r1/src/lib/powerpc-accton-as6700-32x-r1.yml @@ -40,8 +40,8 @@ powerpc-accton-as6700-32x-r1: =: 100% format: ext4 - network: - interfaces: - ma1: - name: ~ - syspath: fsl,dpaa.16/ethernet.18 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: fsl,dpaa.16/ethernet.18 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as5512-54x/platform-config/r0/src/lib/x86-64-accton-as5512-54x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as5512-54x/platform-config/r0/src/lib/x86-64-accton-as5512-54x-r0.yml index 0cdb6fca..2c31c65a 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as5512-54x/platform-config/r0/src/lib/x86-64-accton-as5512-54x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as5512-54x/platform-config/r0/src/lib/x86-64-accton-as5512-54x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as5512-54x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as5712-54x/platform-config/r0/src/lib/x86-64-accton-as5712-54x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as5712-54x/platform-config/r0/src/lib/x86-64-accton-as5712-54x-r0.yml index 29ce9bef..fa4eea34 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as5712-54x/platform-config/r0/src/lib/x86-64-accton-as5712-54x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as5712-54x/platform-config/r0/src/lib/x86-64-accton-as5712-54x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as5712-54x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54t/platform-config/r0/src/lib/x86-64-accton-as5812-54t-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54t/platform-config/r0/src/lib/x86-64-accton-as5812-54t-r0.yml index 4bfc8909..a88f81cf 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54t/platform-config/r0/src/lib/x86-64-accton-as5812-54t-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54t/platform-config/r0/src/lib/x86-64-accton-as5812-54t-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as5812-54t-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/lib/x86-64-accton-as5812-54x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/lib/x86-64-accton-as5812-54x-r0.yml index 7e4f4230..95817d8a 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/lib/x86-64-accton-as5812-54x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/lib/x86-64-accton-as5812-54x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as5812-54x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as6712-32x/platform-config/r0/src/lib/x86-64-accton-as6712-32x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as6712-32x/platform-config/r0/src/lib/x86-64-accton-as6712-32x-r0.yml index 7d358255..b3310b8d 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as6712-32x/platform-config/r0/src/lib/x86-64-accton-as6712-32x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as6712-32x/platform-config/r0/src/lib/x86-64-accton-as6712-32x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as6712-32x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as6812-32x/platform-config/r0/src/lib/x86-64-accton-as6812-32x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as6812-32x/platform-config/r0/src/lib/x86-64-accton-as6812-32x-r0.yml index 3eccc8bf..a7b75803 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as6812-32x/platform-config/r0/src/lib/x86-64-accton-as6812-32x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as6812-32x/platform-config/r0/src/lib/x86-64-accton-as6812-32x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as6812-32x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/lib/x86-64-accton-as7512-32x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/lib/x86-64-accton-as7512-32x-r0.yml index 319e4db2..4f4c51ce 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/lib/x86-64-accton-as7512-32x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/lib/x86-64-accton-as7512-32x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as5712-32x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/platform-config/r0/src/lib/x86-64-accton-as7712-32x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/platform-config/r0/src/lib/x86-64-accton-as7712-32x-r0.yml index 83e1d05d..1220adf4 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/platform-config/r0/src/lib/x86-64-accton-as7712-32x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/platform-config/r0/src/lib/x86-64-accton-as7712-32x-r0.yml @@ -24,8 +24,8 @@ x86-64-accton-as7712-32x-r0: nopat console=ttyS1,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/accton/x86-64/x86-64-accton-wedge-16x/platform-config/r0/src/lib/x86-64-accton-wedge-16x-r0.yml b/packages/platforms/accton/x86-64/x86-64-accton-wedge-16x/platform-config/r0/src/lib/x86-64-accton-wedge-16x-r0.yml index dc009fbb..1c42ce71 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-wedge-16x/platform-config/r0/src/lib/x86-64-accton-wedge-16x-r0.yml +++ b/packages/platforms/accton/x86-64/x86-64-accton-wedge-16x/platform-config/r0/src/lib/x86-64-accton-wedge-16x-r0.yml @@ -27,8 +27,8 @@ x86-64-accton-wedge-16x-r0: rd_NO_LUKS intel_iommu=off - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/platform-config/r0/src/lib/x86-64-cel-redstone-xp-r0.yml b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/platform-config/r0/src/lib/x86-64-cel-redstone-xp-r0.yml index b3efd7ec..76c1455d 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/platform-config/r0/src/lib/x86-64-cel-redstone-xp-r0.yml +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/platform-config/r0/src/lib/x86-64-cel-redstone-xp-r0.yml @@ -24,8 +24,8 @@ x86-64-cel-redstone-xp-r0: nopat console=ttyS0,115200n8 - network: - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/kvm/x86-64/x86-64-kvm-x86-64/platform-config/r0/src/lib/x86-64-kvm-x86-64-r0.yml b/packages/platforms/kvm/x86-64/x86-64-kvm-x86-64/platform-config/r0/src/lib/x86-64-kvm-x86-64-r0.yml index 9f7a641c..e20a30ab 100644 --- a/packages/platforms/kvm/x86-64/x86-64-kvm-x86-64/platform-config/r0/src/lib/x86-64-kvm-x86-64-r0.yml +++ b/packages/platforms/kvm/x86-64/x86-64-kvm-x86-64/platform-config/r0/src/lib/x86-64-kvm-x86-64-r0.yml @@ -24,8 +24,8 @@ x86-64-kvm-x86-64-r0: nopat console=ttyS0,115200n8 - network - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:03.0 + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:03.0 diff --git a/packages/platforms/quanta/powerpc/powerpc-quanta-lb9/platform-config/r0/src/lib/powerpc-quanta-lb9-r0.yml b/packages/platforms/quanta/powerpc/powerpc-quanta-lb9/platform-config/r0/src/lib/powerpc-quanta-lb9-r0.yml index 170b83a9..5e6528cd 100644 --- a/packages/platforms/quanta/powerpc/powerpc-quanta-lb9/platform-config/r0/src/lib/powerpc-quanta-lb9-r0.yml +++ b/packages/platforms/quanta/powerpc/powerpc-quanta-lb9/platform-config/r0/src/lib/powerpc-quanta-lb9-r0.yml @@ -26,8 +26,8 @@ powerpc-quanta-lb9-r0: env_size: 0x00002000 sector_size: 0x00020000 - network: - interfaces: - ma1: - name: ~ - syspath: e0000000.soc8541/e0024000.ethernet + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: e0000000.soc8541/e0024000.ethernet diff --git a/packages/platforms/quanta/powerpc/powerpc-quanta-ly2/platform-config/r0/src/lib/powerpc-quanta-ly2-r0.yml b/packages/platforms/quanta/powerpc/powerpc-quanta-ly2/platform-config/r0/src/lib/powerpc-quanta-ly2-r0.yml index 29626424..47231061 100644 --- a/packages/platforms/quanta/powerpc/powerpc-quanta-ly2/platform-config/r0/src/lib/powerpc-quanta-ly2-r0.yml +++ b/packages/platforms/quanta/powerpc/powerpc-quanta-ly2/platform-config/r0/src/lib/powerpc-quanta-ly2-r0.yml @@ -26,8 +26,8 @@ powerpc-quanta-ly2-r0: env_size: 0x00002000 sector_size: 0x00020000 - network - interfaces: - ma1: - name: ~ - syspath: soc.0/ffe24000.ethernet + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: soc.0/ffe24000.ethernet diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly6-rangeley-r0.yml b/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly6-rangeley-r0.yml index ecd6b139..0d6cc8f9 100644 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly6-rangeley-r0.yml +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly6-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly6-rangeley-r0.yml @@ -23,8 +23,8 @@ x86-64-quanta-ly6-rangeley-r0: args: >- console=ttyS1,115200n8 - network: - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly8-rangeley-r0.yml b/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly8-rangeley-r0.yml index 24bd1298..d6d78f2a 100644 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly8-rangeley-r0.yml +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly8-rangeley/platform-config/r0/src/lib/x86-64-quanta-ly8-rangeley-r0.yml @@ -23,8 +23,8 @@ x86-64-quanta-ly8-rangeley-r0: args: >- console=ttyS1,115200n8 - network: - interfaces: - ma1: - name: ~ - syspath: pci0000:00/0000:00:14.0 + ##network: + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 From 87ae54e79cf47fe56f14eca21de0c93b1bfe5d2a Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Thu, 19 May 2016 11:30:20 -0700 Subject: [PATCH 02/33] loader init files depend on onl-vendor-config-onl --- packages/base/all/initrds/loader-initrd-files/PKG.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/base/all/initrds/loader-initrd-files/PKG.yml b/packages/base/all/initrds/loader-initrd-files/PKG.yml index 3ae21ef7..56714efc 100644 --- a/packages/base/all/initrds/loader-initrd-files/PKG.yml +++ b/packages/base/all/initrds/loader-initrd-files/PKG.yml @@ -6,6 +6,7 @@ common: packages: - name: onl-loader-initrd-files + depends: [ onl-vendor-config-onl ] version: 1.0.0 summary: Open Network Linux System Loader Source Files From 37372b322ecc12f6424a72a8a72382ad507ddcff Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 01:39:34 +0000 Subject: [PATCH 03/33] Rename the legacy installer as such. If will be removed once the new installers are fully qualified on all platforms. --- Makefile | 6 +++--- builds/amd64/installer/legacy/builds/Makefile | 3 +-- builds/any/installer/legacy/APKG.yml | 14 ++------------ builds/any/installer/legacy/fit/builds/Makefile | 2 +- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 743df60f..96dab5a6 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ onl-amd64 onl-x86 x86 x86_64 amd64: packages_base_all $(MAKE) -C packages/base/amd64/faultd $(MAKE) -C builds/amd64/rootfs $(MAKE) -C builds/amd64/swi - $(MAKE) -C builds/amd64/installer/legacy + $(MAKE) -C builds/amd64/installer onl-ppc ppc: packages_base_all $(MAKE) -C packages/base/powerpc/kernels @@ -34,7 +34,7 @@ onl-ppc ppc: packages_base_all $(MAKE) -C packages/base/powerpc/fit $(MAKE) -C builds/powerpc/rootfs $(MAKE) -C builds/powerpc/swi - $(MAKE) -C builds/powerpc/installer/legacy + $(MAKE) -C builds/powerpc/installer ifdef ONL_DEBIAN_SUITE_jessie @@ -51,7 +51,7 @@ onl-arm arm: arm_toolchain_check packages_base_all $(MAKE) -C packages/base/armel/fit $(MAKE) -C builds/armel/rootfs $(MAKE) -C builds/armel/swi - $(MAKE) -C builds/armel/installer/legacy + $(MAKE) -C builds/armel/installer else onl-arm arm: diff --git a/builds/amd64/installer/legacy/builds/Makefile b/builds/amd64/installer/legacy/builds/Makefile index 158cbf6c..c32b3bce 100644 --- a/builds/amd64/installer/legacy/builds/Makefile +++ b/builds/amd64/installer/legacy/builds/Makefile @@ -14,7 +14,7 @@ MKSHAR_PERMS = autoperms.sh # Hardcoded to match ONL File naming conventions. include $(ONL)/make/version-onl.mk -INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_INSTALLER +INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_LEGACY_INSTALLER @@ -41,4 +41,3 @@ shar installer: installer clean: rm -f *.swi *.installer $(notdir $(KERNELS)) initrd-amd64 - diff --git a/builds/any/installer/legacy/APKG.yml b/builds/any/installer/legacy/APKG.yml index cad485cf..a53d0129 100644 --- a/builds/any/installer/legacy/APKG.yml +++ b/builds/any/installer/legacy/APKG.yml @@ -10,8 +10,8 @@ common: maintainer: support@bigswitch.com packages: - - name: onl-installer - summary: Open Network Linux $ARCH Installer + - name: onl-legacy-installer + summary: Open Network Linux $ARCH Legacy Installer files: builds/*INSTALLER : $$PKG_INSTALL/ @@ -23,13 +23,3 @@ packages: release: - builds/*INSTALLER : $ARCH/ - builds/*.md5sum : $ARCH/ - - - - - - - - - - diff --git a/builds/any/installer/legacy/fit/builds/Makefile b/builds/any/installer/legacy/fit/builds/Makefile index 38609d49..ce7e1c65 100644 --- a/builds/any/installer/legacy/fit/builds/Makefile +++ b/builds/any/installer/legacy/fit/builds/Makefile @@ -6,7 +6,7 @@ THISDIR := $(dir $(lastword $(MAKEFILE_LIST))) # Hardcoded to match ONL File naming conventions. include $(ONL)/make/version-onl.mk -INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_INSTALLER +INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_LEGACY_INSTALLER FIT_IMAGE_ALL := $(shell $(ONLPM) --find-file onl-loader-fit:$(ARCH) onl-loader-fit.itb) From 1e570f95d59f41a2f96916952b4f38492dade0c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 18:30:17 +0000 Subject: [PATCH 04/33] Fix connection configuration. --- .../any/rootfs/jessie/common/overlay/etc/snmp/snmpd.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/any/rootfs/jessie/common/overlay/etc/snmp/snmpd.conf b/builds/any/rootfs/jessie/common/overlay/etc/snmp/snmpd.conf index b885cb39..13eb88f7 100644 --- a/builds/any/rootfs/jessie/common/overlay/etc/snmp/snmpd.conf +++ b/builds/any/rootfs/jessie/common/overlay/etc/snmp/snmpd.conf @@ -12,7 +12,7 @@ # # Listen for connections from the local system only -agentAddress udp:127.0.0.1:161 +# agentAddress udp:127.0.0.1:161 # Listen for connections on all interfaces (both IPv4 *and* IPv6) agentAddress udp:161,udp6:[::1]:161 @@ -48,9 +48,9 @@ view systemonly included .1.3.6.1.4.1.42623 # Full access from the local host rocommunity public localhost # Default access to basic system info -rocommunity public default -V systemonly + rocommunity public default -V systemonly # rocommunity6 is for IPv6 -rocommunity6 public default -V systemonly + rocommunity6 public default -V systemonly # Full access from an example network # Adjust this network address to match your local @@ -139,7 +139,7 @@ load 12 10 5 # Event MIB - automatically generate alerts # # Remember to activate the 'createUser' lines above -iquerySecName internalUser +iquerySecName internalUser rouser internalUser # generate traps on UCD error conditions defaultMonitors yes From 0b7e38ec890ee6d3e1df3172342426ccdc700085 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 12:45:55 -0700 Subject: [PATCH 05/33] Latest --- packages/platforms-closed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/platforms-closed b/packages/platforms-closed index 3880b54f..1bea6253 160000 --- a/packages/platforms-closed +++ b/packages/platforms-closed @@ -1 +1 @@ -Subproject commit 3880b54fe9480edb6e8c2df7714d83e4e6aaf774 +Subproject commit 1bea6253f9814607df5c51a7cf5e1ee509331a37 From c568351d91c10e0c8fc1afcff74f9b8e3fb6f932 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 12:46:18 -0700 Subject: [PATCH 06/33] Remove comments. --- .../all/vendor-config-onl/src/python/onl/install/BaseInstall.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py index 08e41e76..274268f9 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py @@ -358,7 +358,6 @@ class Base: return 0 GRUB_TPL = """\ -#serial --port=0x3f8 --speed=115200 --word=8 --parity=no --stop=1 serial %(serial)s terminal_input serial terminal_output serial @@ -369,7 +368,6 @@ menuentry OpenNetworkLinux { echo 'Loading Open Network Linux ...' insmod gzio insmod part_msdos - #linux /kernel-3.9.6-x86-64-all nopat console=ttyS0,115200n8 onl_platform=x86-64-kvm-x86-64-r0 linux /%(kernel)s %(args)s onl_platform=%(platform)s initrd /%(initrd)s } From 711fbacd654d4b4c1171ebfaf230c6ee239198ed Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 12:46:58 -0700 Subject: [PATCH 07/33] Import from ONLP Repository. --- .../any/onlp/src/onlp/module/auto/onlp.yml | 2 + .../src/onlp/module/inc/onlp/platformi/sysi.h | 5 + .../any/onlp/src/onlp/module/inc/onlp/sfp.h | 2 + .../any/onlp/src/onlp/module/src/onlp_enums.c | 2 + .../any/onlp/src/onlp/module/src/onlp_main.c | 36 +- .../onlp/src/onlp/module/src/onlp_module.c | 24 + .../src/onlp/module/src/platform_manager.c | 1 + .../onlp_platform_defaults/module/src/sysi.c | 1 + .../onlp_platform_defaults.mk | 10 +- .../src/onlplib/module/inc/onlplib/thermal.h | 36 + .../any/onlp/src/onlplib/module/src/thermal.c | 51 + packages/base/any/onlp/src/onlplib/onlplib.mk | 10 +- .../base/any/onlp/src/sff/module/auto/sff.yml | 5 + .../any/onlp/src/sff/module/inc/sff/8436.h | 14 + .../any/onlp/src/sff/module/inc/sff/sff.h | 91 +- .../onlp/src/sff/module/inc/sff/sff_config.h | 10 + .../any/onlp/src/sff/module/inc/sff/sff_db.h | 60 + .../base/any/onlp/src/sff/module/src/sff.c | 450 ++--- .../any/onlp/src/sff/module/src/sff_config.c | 5 + .../base/any/onlp/src/sff/module/src/sff_db.c | 1468 +++++++++++++++++ .../any/onlp/src/sff/module/src/sff_enums.c | 2 + packages/base/any/onlp/src/sff/sff.mk | 10 +- packages/base/any/onlp/src/sff/utest/main.c | 1037 +----------- 23 files changed, 2050 insertions(+), 1282 deletions(-) create mode 100644 packages/base/any/onlp/src/onlplib/module/inc/onlplib/thermal.h create mode 100644 packages/base/any/onlp/src/onlplib/module/src/thermal.c create mode 100644 packages/base/any/onlp/src/sff/module/inc/sff/sff_db.h create mode 100644 packages/base/any/onlp/src/sff/module/src/sff_db.c diff --git a/packages/base/any/onlp/src/onlp/module/auto/onlp.yml b/packages/base/any/onlp/src/onlp/module/auto/onlp.yml index 47adc6e6..972d47eb 100644 --- a/packages/base/any/onlp/src/onlp/module/auto/onlp.yml +++ b/packages/base/any/onlp/src/onlp/module/auto/onlp.yml @@ -111,6 +111,7 @@ sfp_control: &sfp_control - RX_LOS - TX_FAULT - TX_DISABLE +- TX_DISABLE_CHANNEL - LP_MODE - POWER_OVERRIDE @@ -253,6 +254,7 @@ definitions: - RX_LOS - TX_FAULT - TX_DISABLE + - TX_DISABLE_CHANNEL - LP_MODE - POWER_OVERRIDE onlp_sfp_control_flag: diff --git a/packages/base/any/onlp/src/onlp/module/inc/onlp/platformi/sysi.h b/packages/base/any/onlp/src/onlp/module/inc/onlp/platformi/sysi.h index d4bde216..bc05146a 100644 --- a/packages/base/any/onlp/src/onlp/module/inc/onlp/platformi/sysi.h +++ b/packages/base/any/onlp/src/onlp/module/inc/onlp/platformi/sysi.h @@ -130,6 +130,11 @@ int onlp_sysi_oids_get(onlp_oid_t* table, int max); int onlp_sysi_ioctl(int code, va_list vargs); +/** + * @brief Platform management initialization. + */ +int onlp_sysi_platform_manage_init(void); + /** * @brief Perform necessary platform fan management. * @note This function should automatically adjust the FAN speeds diff --git a/packages/base/any/onlp/src/onlp/module/inc/onlp/sfp.h b/packages/base/any/onlp/src/onlp/module/inc/onlp/sfp.h index 6208e3ee..173a38ae 100644 --- a/packages/base/any/onlp/src/onlp/module/inc/onlp/sfp.h +++ b/packages/base/any/onlp/src/onlp/module/inc/onlp/sfp.h @@ -39,6 +39,7 @@ typedef enum onlp_sfp_control_e { ONLP_SFP_CONTROL_RX_LOS, ONLP_SFP_CONTROL_TX_FAULT, ONLP_SFP_CONTROL_TX_DISABLE, + ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL, ONLP_SFP_CONTROL_LP_MODE, ONLP_SFP_CONTROL_POWER_OVERRIDE, ONLP_SFP_CONTROL_LAST = ONLP_SFP_CONTROL_POWER_OVERRIDE, @@ -238,6 +239,7 @@ int onlp_sfp_control_flags_get(int port, uint32_t* flags); "RX_LOS", \ "TX_FAULT", \ "TX_DISABLE", \ + "TX_DISABLE_CHANNEL", \ "LP_MODE", \ "POWER_OVERRIDE", \ } diff --git a/packages/base/any/onlp/src/onlp/module/src/onlp_enums.c b/packages/base/any/onlp/src/onlp/module/src/onlp_enums.c index 0c5a185f..f5c9a74d 100644 --- a/packages/base/any/onlp/src/onlp/module/src/onlp_enums.c +++ b/packages/base/any/onlp/src/onlp/module/src/onlp_enums.c @@ -728,6 +728,7 @@ aim_map_si_t onlp_sfp_control_map[] = { "RX_LOS", ONLP_SFP_CONTROL_RX_LOS }, { "TX_FAULT", ONLP_SFP_CONTROL_TX_FAULT }, { "TX_DISABLE", ONLP_SFP_CONTROL_TX_DISABLE }, + { "TX_DISABLE_CHANNEL", ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL }, { "LP_MODE", ONLP_SFP_CONTROL_LP_MODE }, { "POWER_OVERRIDE", ONLP_SFP_CONTROL_POWER_OVERRIDE }, { NULL, 0 } @@ -740,6 +741,7 @@ aim_map_si_t onlp_sfp_control_desc_map[] = { "None", ONLP_SFP_CONTROL_RX_LOS }, { "None", ONLP_SFP_CONTROL_TX_FAULT }, { "None", ONLP_SFP_CONTROL_TX_DISABLE }, + { "None", ONLP_SFP_CONTROL_TX_DISABLE_CHANNEL }, { "None", ONLP_SFP_CONTROL_LP_MODE }, { "None", ONLP_SFP_CONTROL_POWER_OVERRIDE }, { NULL, 0 } diff --git a/packages/base/any/onlp/src/onlp/module/src/onlp_main.c b/packages/base/any/onlp/src/onlp/module/src/onlp_main.c index f20b1f0b..5afbb143 100644 --- a/packages/base/any/onlp/src/onlp/module/src/onlp_main.c +++ b/packages/base/any/onlp/src/onlp/module/src/onlp_main.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,7 @@ static void platform_manager_daemon__(const char* pidfile, char** argv); * This should be moved to common. */ static void -show_inventory__(aim_pvs_t* pvs) +show_inventory__(aim_pvs_t* pvs, int database) { int port; onlp_sfp_bitmap_t bitmap; @@ -50,8 +51,10 @@ show_inventory__(aim_pvs_t* pvs) aim_printf(pvs, "No SFPs on this platform.\n"); } else { + if(!database) { aim_printf(pvs, "Port Type Media Status Len Vendor Model S/N \n"); aim_printf(pvs, "---- -------------- ------ ------ ----- ---------------- ---------------- ----------------\n"); + } AIM_BITMAP_ITER(&bitmap, port) { int rv; @@ -60,7 +63,9 @@ show_inventory__(aim_pvs_t* pvs) rv = onlp_sfp_is_present(port); if(rv == 0) { + if(!database) { aim_printf(pvs, "%4d NONE\n", port); + } continue; } @@ -76,17 +81,21 @@ show_inventory__(aim_pvs_t* pvs) continue; } - sff_info_t sff; + sff_eeprom_t sff; char status_str[32] = {0}; - sff_info_init(&sff, data); + sff_eeprom_parse(&sff, data); - if(!sff.supported) { + if(!sff.identified) { /* Present but unidentified. */ aim_printf(pvs, "%13d UNK\n", port); continue; } + if(database) { + sff_db_entry_struct(&sff, &aim_pvs_stdout); + continue; + } uint32_t status = 0; char* cp = status_str; @@ -105,13 +114,13 @@ show_inventory__(aim_pvs_t* pvs) } aim_printf(pvs, "%4d %-14s %-6s %-6.6s %-5.5s %-16.16s %-16.16s %16.16s\n", port, - sff.module_type_name, - sff.media_type_name, + sff.info.module_type_name, + sff.info.media_type_name, status_str, - sff.length_desc, - sff.vendor, - sff.model, - sff.serial); + sff.info.length_desc, + sff.info.vendor, + sff.info.model, + sff.info.serial); } } } @@ -170,6 +179,7 @@ onlpdump_main(int argc, char* argv[]) int S = 0; int l = 0; int M = 0; + int b = 0; char* pidfile = NULL; const char* O = NULL; const char* t = NULL; @@ -182,7 +192,7 @@ onlpdump_main(int argc, char* argv[]) return onlp_sys_debug(&aim_pvs_stdout, argc-2, argv+2); } - while( (c = getopt(argc, argv, "srehdojmyM:ipxlSt:O:")) != -1) { + while( (c = getopt(argc, argv, "srehdojmyM:ipxlSt:O:b")) != -1) { switch(c) { case 's': show=1; break; @@ -201,6 +211,7 @@ onlpdump_main(int argc, char* argv[]) case 'O': O = optarg; break; case 'S': S=1; break; case 'l': l=1; break; + case 'b': b=1; break; case 'y': show=1; showflags |= ONLP_OID_SHOW_F_YAML; break; default: help=1; rv = 1; break; } @@ -223,6 +234,7 @@ onlpdump_main(int argc, char* argv[]) printf(" -t Decode TlvInfo data.\n"); printf(" -O Dump OID.\n"); printf(" -S Decode SFP Inventory\n"); + printf(" -b Decode SFP Inventory into SFF database entries.\n"); printf(" -l API Lock test.\n"); return rv; } @@ -262,7 +274,7 @@ onlpdump_main(int argc, char* argv[]) } if(S) { - show_inventory__(&aim_pvs_stdout); + show_inventory__(&aim_pvs_stdout, b); return 0; } diff --git a/packages/base/any/onlp/src/onlp/module/src/onlp_module.c b/packages/base/any/onlp/src/onlp/module/src/onlp_module.c index 4d050bd2..541d3c6e 100644 --- a/packages/base/any/onlp/src/onlp/module/src/onlp_module.c +++ b/packages/base/any/onlp/src/onlp/module/src/onlp_module.c @@ -27,12 +27,36 @@ #include "onlp_log.h" #include +#include + +static int +onlp_aim_ts__onlp_oid(aim_datatype_context_t* dtc, aim_va_list_t* vargs, + const char** rv) +{ + onlp_oid_t oid = va_arg(vargs->val, onlp_oid_t); + int id = ONLP_OID_ID_GET(oid); + + switch(ONLP_OID_TYPE_GET(oid)) + { +#define ONLP_OID_TYPE_ENTRY(_name, _value) \ + case ONLP_OID_TYPE_##_name: \ + *rv = aim_fstrdup("%s:%d", #_name, id); \ + break; +#include + } + + return AIM_DATATYPE_OK; +} static int datatypes_init__(void) { #define ONLP_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); #include + aim_datatype_register(0, "onlp_oid", + "ONLP OID", + NULL, + onlp_aim_ts__onlp_oid, NULL); /* diff --git a/packages/base/any/onlp/src/onlp/module/src/platform_manager.c b/packages/base/any/onlp/src/onlp/module/src/platform_manager.c index dfcba142..75054d6f 100644 --- a/packages/base/any/onlp/src/onlp/module/src/platform_manager.c +++ b/packages/base/any/onlp/src/onlp/module/src/platform_manager.c @@ -134,6 +134,7 @@ onlp_sys_platform_manage_init(void) int i; uint64_t now = os_time_monotonic(); + onlp_sysi_platform_manage_init(); control__.tw = timer_wheel_create(4, 512, now); for(i = 0; i < AIM_ARRAYSIZE(management_entries); i++) { diff --git a/packages/base/any/onlp/src/onlp_platform_defaults/module/src/sysi.c b/packages/base/any/onlp/src/onlp_platform_defaults/module/src/sysi.c index 76b66ab7..c5146f21 100644 --- a/packages/base/any/onlp/src/onlp_platform_defaults/module/src/sysi.c +++ b/packages/base/any/onlp/src/onlp_platform_defaults/module/src/sysi.c @@ -65,6 +65,7 @@ __ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_oids_get(onlp_oid_t* table, int max)); __ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_platform_info_get(onlp_platform_info_t* pi)); __ONLP_DEFAULTI_VIMPLEMENTATION(onlp_sysi_platform_info_free(onlp_platform_info_t* pi)); __ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_ioctl(int id, va_list vargs)); +__ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_platform_manage_init(void)); __ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_platform_manage_fans(void)); __ONLP_DEFAULTI_IMPLEMENTATION(onlp_sysi_platform_manage_leds(void)); diff --git a/packages/base/any/onlp/src/onlp_platform_defaults/onlp_platform_defaults.mk b/packages/base/any/onlp/src/onlp_platform_defaults/onlp_platform_defaults.mk index 301c4fe0..fa66350e 100644 --- a/packages/base/any/onlp/src/onlp_platform_defaults/onlp_platform_defaults.mk +++ b/packages/base/any/onlp/src/onlp_platform_defaults/onlp_platform_defaults.mk @@ -3,12 +3,12 @@ # # Inclusive Makefile for the onlp_platform_defaults module. # -# Autogenerated 2016-03-23 18:28:25.688419 +# Autogenerated 2016-05-17 17:43:05.660985 # ############################################################################### onlp_platform_defaults_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -include $(onlp_platform_defaults_BASEDIR)/module/make.mk -include $(onlp_platform_defaults_BASEDIR)/module/auto/make.mk -include $(onlp_platform_defaults_BASEDIR)/module/src/make.mk -include $(onlp_platform_defaults_BASEDIR)/utest/_make.mk +include $(onlp_platform_defaults_BASEDIR)module/make.mk +include $(onlp_platform_defaults_BASEDIR)module/auto/make.mk +include $(onlp_platform_defaults_BASEDIR)module/src/make.mk +include $(onlp_platform_defaults_BASEDIR)utest/_make.mk diff --git a/packages/base/any/onlp/src/onlplib/module/inc/onlplib/thermal.h b/packages/base/any/onlp/src/onlplib/module/inc/onlplib/thermal.h new file mode 100644 index 00000000..025e90a4 --- /dev/null +++ b/packages/base/any/onlp/src/onlplib/module/inc/onlplib/thermal.h @@ -0,0 +1,36 @@ +/************************************************************** + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************** + * + * Common thermal support routines. + * + ************************************************************/ +#ifndef __ONLPLIB_THERMAL_H__ +#define __ONLPLIB_THERMAL_H__ +#include +#include +/** + * @brief Read the mcelsius value from the given file. + * @param fname Filename + * @param info Thermal info structure. + */ +int onlplib_thermal_read_file(const char* fname, onlp_thermal_info_t* info); + +#endif /* __ONLPLIB_THERMAL_H__ */ diff --git a/packages/base/any/onlp/src/onlplib/module/src/thermal.c b/packages/base/any/onlp/src/onlplib/module/src/thermal.c new file mode 100644 index 00000000..32d1c931 --- /dev/null +++ b/packages/base/any/onlp/src/onlplib/module/src/thermal.c @@ -0,0 +1,51 @@ +/************************************************************** + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************** + * + * Common thermal support routines. + * + ************************************************************/ +#include +#include +#include + +int +onlplib_thermal_read_file(const char* fname, onlp_thermal_info_t* info) +{ + int ret; + int rv = onlp_file_read_int(&info->mcelsius, fname); + + if(rv == ONLP_STATUS_E_MISSING) { + /* Absent */ + info->status = 0; + ret = 0; + } + else if(rv >= 0) { + /* Present */ + info->status |= 1; + ret = 0; + } + else { + /** Other error. */ + ret = ONLP_STATUS_E_INTERNAL; + } + return ret; +} + diff --git a/packages/base/any/onlp/src/onlplib/onlplib.mk b/packages/base/any/onlp/src/onlplib/onlplib.mk index 889b3b94..c33c4de3 100644 --- a/packages/base/any/onlp/src/onlplib/onlplib.mk +++ b/packages/base/any/onlp/src/onlplib/onlplib.mk @@ -3,12 +3,12 @@ # # Inclusive Makefile for the onlplib module. # -# Autogenerated 2016-03-23 18:28:25.806397 +# Autogenerated 2016-05-17 17:43:05.779760 # ############################################################################### onlplib_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -include $(onlplib_BASEDIR)/module/make.mk -include $(onlplib_BASEDIR)/module/auto/make.mk -include $(onlplib_BASEDIR)/module/src/make.mk -include $(onlplib_BASEDIR)/utest/_make.mk +include $(onlplib_BASEDIR)module/make.mk +include $(onlplib_BASEDIR)module/auto/make.mk +include $(onlplib_BASEDIR)module/src/make.mk +include $(onlplib_BASEDIR)utest/_make.mk diff --git a/packages/base/any/onlp/src/sff/module/auto/sff.yml b/packages/base/any/onlp/src/sff/module/auto/sff.yml index dd31d020..3ccd142c 100644 --- a/packages/base/any/onlp/src/sff/module/auto/sff.yml +++ b/packages/base/any/onlp/src/sff/module/auto/sff.yml @@ -32,6 +32,9 @@ cdefs: &cdefs - SFF_CONFIG_INCLUDE_EXT_CC_CHECK: doc: "Include extended checksum verification." default: 0 +- SFF_CONFIG_INCLUDE_DATABASE: + doc: "Include eeprom database." + default: 1 sff_media_types: &sff_media_types - COPPER: @@ -56,6 +59,8 @@ sff_module_types: &sff_module_types desc: "40GBASE-SR4" - 40G_BASE_LR4: desc: "40GBASE-LR4" +- 40G_BASE_LM4: + desc: "40GBASE-LM4" - 40G_BASE_ACTIVE: desc: "40GBASE-ACTIVE" - 40G_BASE_CR: diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/8436.h b/packages/base/any/onlp/src/sff/module/inc/sff/8436.h index 3bedc8f8..d2c0e35f 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/8436.h +++ b/packages/base/any/onlp/src/sff/module/inc/sff/8436.h @@ -224,6 +224,8 @@ #define SFF8436_DOM_GET_RXPWR_TYPE(idprom) \ (idprom[220] & SFF8436_RX_PWR_TYPE_MASK) +/* SFF8436 registers */ +#define SFF8436_CONTROL_TX_DISABLE 86 /* alternate ways to identify pre-standard 40G cables */ static inline int _sff8436_qsfp_40g_pre(const uint8_t* idprom) @@ -255,6 +257,18 @@ _sff8436_qsfp_40g_pre(const uint8_t* idprom) return 0; } +static inline int +_sff8436_qsfp_40g_lm4(const uint8_t* idprom) +{ + if(!SFF8436_MODULE_QSFP_PLUS_V2(idprom)) { + return 0; + } + /* Restrict to Finisar FTL4C3QE1C at this point. */ + if(strncmp("FTL4C3QE1C ", (char*)idprom+168, 16)) { + return 0; + } + return SFF8436_MEDIA_NONE(idprom); +} static inline int _sff8436_bitrate(const uint8_t *idprom) diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/sff.h b/packages/base/any/onlp/src/sff/module/inc/sff/sff.h index cd110cdb..20e3b3f4 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/sff.h +++ b/packages/base/any/onlp/src/sff/module/inc/sff/sff.h @@ -1,21 +1,21 @@ /************************************************************ * - * - * Copyright 2014, 2015 Big Switch Networks, Inc. - * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.eclipse.org/legal/epl-v10.html - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the * License. - * + * * ************************************************************ * @@ -103,6 +103,7 @@ typedef enum sff_module_type_e { SFF_MODULE_TYPE_40G_BASE_CR4, SFF_MODULE_TYPE_40G_BASE_SR4, SFF_MODULE_TYPE_40G_BASE_LR4, + SFF_MODULE_TYPE_40G_BASE_LM4, SFF_MODULE_TYPE_40G_BASE_ACTIVE, SFF_MODULE_TYPE_40G_BASE_CR, SFF_MODULE_TYPE_40G_BASE_SR2, @@ -137,6 +138,7 @@ typedef enum sff_module_type_e { "40G_BASE_CR4", \ "40G_BASE_SR4", \ "40G_BASE_LR4", \ + "40G_BASE_LM4", \ "40G_BASE_ACTIVE", \ "40G_BASE_CR", \ "40G_BASE_SR2", \ @@ -228,7 +230,7 @@ sff_module_type_t sff_module_type_get(const uint8_t* idprom); * @brief Determine the SFF Media type (from the idprom data)./ * @param idprom The SFF idprom. */ -sff_media_type_t sff_media_type_get(const uint8_t* idprom); +sff_media_type_t sff_media_type_get(sff_module_type_t mt); /** @@ -238,45 +240,35 @@ sff_media_type_t sff_media_type_get(const uint8_t* idprom); * @returns 0 on successful parse. * @returns < 0 on error. */ -int sff_module_caps_get(const uint8_t* idprom, uint32_t* caps); +int sff_module_caps_get(sff_module_type_t mt, uint32_t* caps); -/** - * Display a summary of the given SFF module. - * @param idprom The idprom data - * @param pvs The output pvs. - */ - -void sff_module_show(const uint8_t* idprom, aim_pvs_t* pvs); - - - -/** - * SFF Module Information Structure - */ typedef struct sff_info_s { - /** Raw eeprom data */ - uint8_t eeprom[256]; /** Vendor Name */ char vendor[17]; + /** Model Number */ char model[17]; + /** Serial Number */ char serial[17]; /** SFP Type */ sff_sfp_type_t sfp_type; + /** SFP Type Name */ const char* sfp_type_name; /** Module Type */ sff_module_type_t module_type; + /** Module Type Name */ const char* module_type_name; /** Media Type */ sff_media_type_t media_type; + /** Media Type Name */ const char* media_type_name; @@ -286,15 +278,26 @@ typedef struct sff_info_s { /** Cable length, if available */ int length; char length_desc[16]; +} sff_info_t; - /** computed checksums for idprom contents */ +/** + * SFF Module Information Structure + */ +typedef struct sff_eeprom_s { + /** Raw eeprom data */ + uint8_t eeprom[256]; + + /** computed checksums for eeprom contents */ uint8_t cc_base; uint8_t cc_ext; - /** whether this SFP is supported */ - int supported; + /** Whether this EEPROM was successfully parsed and identified. */ + int identified; -} sff_info_t; + /** Parsed SFF Information */ + sff_info_t info; + +} sff_eeprom_t; /** @@ -305,14 +308,28 @@ typedef struct sff_info_s { * @note if eeprom is NULL it is assumed the rv->eeprom buffer * has already been initialized. */ -int sff_info_init(sff_info_t* rv, uint8_t* eeprom); +int sff_eeprom_parse(sff_eeprom_t* rv, uint8_t* eeprom); /** * @brief Initialize an SFF module information structure from a file. * @param rv [out] Receives thh data. * @param fname The filename. */ -int sff_info_init_file(sff_info_t* rv, const char* fname); +int sff_eeprom_parse_file(sff_eeprom_t* rv, const char* fname); + +/** + * @brief Clear an sff_eeprom_t structure. + * @param eeprom The eeprom structure. + */ +void sff_eeprom_invalidate(sff_eeprom_t *info); + +/** + * @brief Determine if this is a valid SFP + * (whether or not we can parse it) + * @param info The info structure. + * @param verbose Whether to report errors on invalid contents. + */ +int sff_eeprom_validate(sff_eeprom_t *info, int verbose); /** * @brief Show an sff info structure. @@ -322,18 +339,12 @@ int sff_info_init_file(sff_info_t* rv, const char* fname); void sff_info_show(sff_info_t* info, aim_pvs_t* pvs); /** - * @brief Invalidate an idprom data structure, - * such that any resulting sff_info_init will fail. - * @param eeprom The idprom buffer (256 bytes). + * @brief Populate an SFF info structure from a module type. */ -void sff_info_invalidate(sff_info_t *info); +int sff_info_from_module_type(sff_info_t* info, + sff_sfp_type_t st, + sff_module_type_t mt); + -/** - * @brief Determine if this is a valid SFP - * (whether or not we can parse it) - * @param info The info structure. - * @param verbose Whether to report errors on invalid contents. - */ -int sff_info_valid(sff_info_t *info, int verbose); #endif /* __SFF_SFF_H__ */ diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/sff_config.h b/packages/base/any/onlp/src/sff/module/inc/sff/sff_config.h index 966d24c4..c3e5d6de 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/sff_config.h +++ b/packages/base/any/onlp/src/sff/module/inc/sff/sff_config.h @@ -109,6 +109,16 @@ #define SFF_CONFIG_INCLUDE_EXT_CC_CHECK 0 #endif +/** + * SFF_CONFIG_INCLUDE_DATABASE + * + * Include eeprom database. */ + + +#ifndef SFF_CONFIG_INCLUDE_DATABASE +#define SFF_CONFIG_INCLUDE_DATABASE 1 +#endif + /** diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/sff_db.h b/packages/base/any/onlp/src/sff/module/inc/sff/sff_db.h new file mode 100644 index 00000000..2242cd57 --- /dev/null +++ b/packages/base/any/onlp/src/sff/module/inc/sff/sff_db.h @@ -0,0 +1,60 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#ifndef __SFF_DB_H__ +#define __SFF_DB_H__ + +#include +#include +#include + +typedef struct { + sff_eeprom_t se; +} sff_db_entry_t; + +/** + * @brief Get the database entry table. + * @param entries Receives the table pointer. + * @param count Receives the size of the table. + */ +int sff_db_get(sff_db_entry_t** entries, int* count); + +/** + * @brief Return any entry with the given module type. + * @param se Receives the information struct. + * @param type The type to retreive. + */ +int sff_db_get_type(sff_eeprom_t* se, sff_module_type_t type); + + +/** + * @brief Output the given SFF information to a database entry. + * @param info The source information. + * @param pvs The output pvs.; + * @note This is used mainly for generating new entries for the SFF db from a running system. + */ +int sff_db_entry_struct(sff_eeprom_t* se, aim_pvs_t* pvs); + +#endif /* __SFF_DB_H__ */ + diff --git a/packages/base/any/onlp/src/sff/module/src/sff.c b/packages/base/any/onlp/src/sff/module/src/sff.c index 20650c0e..74cad3e5 100644 --- a/packages/base/any/onlp/src/sff/module/src/sff.c +++ b/packages/base/any/onlp/src/sff/module/src/sff.c @@ -1,21 +1,21 @@ /************************************************************ * - * - * Copyright 2014, 2015 Big Switch Networks, Inc. - * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.eclipse.org/legal/epl-v10.html - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the * License. - * + * * ************************************************************ * @@ -30,16 +30,16 @@ #include sff_sfp_type_t -sff_sfp_type_get(const uint8_t* idprom) +sff_sfp_type_get(const uint8_t* eeprom) { - if(idprom) { - if(SFF8472_MODULE_SFP(idprom)) { + if(eeprom) { + if(SFF8472_MODULE_SFP(eeprom)) { return SFF_SFP_TYPE_SFP; } - if(SFF8436_MODULE_QSFP_PLUS_V2(idprom)) { + if(SFF8436_MODULE_QSFP_PLUS_V2(eeprom)) { return SFF_SFP_TYPE_QSFP_PLUS; } - if(SFF8636_MODULE_QSFP28(idprom)) { + if(SFF8636_MODULE_QSFP28(eeprom)) { return SFF_SFP_TYPE_QSFP28; } } @@ -47,92 +47,97 @@ sff_sfp_type_get(const uint8_t* idprom) } sff_module_type_t -sff_module_type_get(const uint8_t* idprom) +sff_module_type_get(const uint8_t* eeprom) { - if (SFF8636_MODULE_QSFP28(idprom) - && SFF8636_MEDIA_EXTENDED(idprom) - && SFF8636_MEDIA_100GE_AOC(idprom)) + if (SFF8636_MODULE_QSFP28(eeprom) + && SFF8636_MEDIA_EXTENDED(eeprom) + && SFF8636_MEDIA_100GE_AOC(eeprom)) return SFF_MODULE_TYPE_100G_AOC; - if (SFF8636_MODULE_QSFP28(idprom) - && SFF8636_MEDIA_EXTENDED(idprom) - && SFF8636_MEDIA_100GE_SR4(idprom)) + if (SFF8636_MODULE_QSFP28(eeprom) + && SFF8636_MEDIA_EXTENDED(eeprom) + && SFF8636_MEDIA_100GE_SR4(eeprom)) return SFF_MODULE_TYPE_100G_BASE_SR4; - if (SFF8636_MODULE_QSFP28(idprom) - && SFF8636_MEDIA_EXTENDED(idprom) - && SFF8636_MEDIA_100GE_LR4(idprom)) + if (SFF8636_MODULE_QSFP28(eeprom) + && SFF8636_MEDIA_EXTENDED(eeprom) + && SFF8636_MEDIA_100GE_LR4(eeprom)) return SFF_MODULE_TYPE_100G_BASE_LR4; - if (SFF8636_MODULE_QSFP28(idprom) - && SFF8636_MEDIA_EXTENDED(idprom) - && SFF8636_MEDIA_100GE_CR4(idprom)) + if (SFF8636_MODULE_QSFP28(eeprom) + && SFF8636_MEDIA_EXTENDED(eeprom) + && SFF8636_MEDIA_100GE_CR4(eeprom)) return SFF_MODULE_TYPE_100G_BASE_CR4; - if (SFF8636_MODULE_QSFP28(idprom) - && SFF8636_MEDIA_EXTENDED(idprom) - && SFF8636_MEDIA_100GE_CWDM4(idprom)) + if (SFF8636_MODULE_QSFP28(eeprom) + && SFF8636_MEDIA_EXTENDED(eeprom) + && SFF8636_MEDIA_100GE_CWDM4(eeprom)) return SFF_MODULE_TYPE_100G_CWDM4; - - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && SFF8436_MEDIA_40GE_CR4(idprom)) + + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && SFF8436_MEDIA_40GE_CR4(eeprom)) return SFF_MODULE_TYPE_40G_BASE_CR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && SFF8436_MEDIA_40GE_SR4(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && SFF8436_MEDIA_40GE_SR4(eeprom)) return SFF_MODULE_TYPE_40G_BASE_SR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && _sff8436_qsfp_40g_sr4_aoc_pre(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_sr4_aoc_pre(eeprom)) return SFF_MODULE_TYPE_40G_BASE_SR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && SFF8436_MEDIA_40GE_LR4(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && SFF8436_MEDIA_40GE_LR4(eeprom)) return SFF_MODULE_TYPE_40G_BASE_LR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && SFF8436_MEDIA_40GE_ACTIVE(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && SFF8436_MEDIA_40GE_ACTIVE(eeprom)) return SFF_MODULE_TYPE_40G_BASE_ACTIVE; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && _sff8436_qsfp_40g_aoc_breakout(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_aoc_breakout(eeprom)) return SFF_MODULE_TYPE_40G_BASE_SR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && SFF8436_MEDIA_40GE_CR(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && SFF8436_MEDIA_40GE_CR(eeprom)) return SFF_MODULE_TYPE_40G_BASE_CR; /* pre-standard finisar optics */ - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && _sff8436_qsfp_40g_pre(idprom) - && (SFF8436_TECH_FC_FIBER_LONG(idprom) - || SFF8436_MEDIA_FC_FIBER_SM(idprom))) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_pre(eeprom) + && (SFF8436_TECH_FC_FIBER_LONG(eeprom) + || SFF8436_MEDIA_FC_FIBER_SM(eeprom))) return SFF_MODULE_TYPE_40G_BASE_LR4; - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && _sff8436_qsfp_40g_pre(idprom) - && (SFF8436_TECH_FC_FIBER_SHORT(idprom) - || SFF8436_MEDIA_FC_FIBER_MM(idprom))) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_pre(eeprom) + && (SFF8436_TECH_FC_FIBER_SHORT(eeprom) + || SFF8436_MEDIA_FC_FIBER_MM(eeprom))) return SFF_MODULE_TYPE_40G_BASE_SR4; /* pre-standard QSFP-BiDi optics */ - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) - && _sff8436_qsfp_40g_sr2_bidi_pre(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_sr2_bidi_pre(eeprom)) return SFF_MODULE_TYPE_40G_BASE_SR2; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_XGE_SR(idprom) - && !_sff8472_media_gbe_sx_fc_hack(idprom)) + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_lm4(eeprom)) { + return SFF_MODULE_TYPE_40G_BASE_LM4; + } + + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_XGE_SR(eeprom) + && !_sff8472_media_gbe_sx_fc_hack(eeprom)) return SFF_MODULE_TYPE_10G_BASE_SR; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_XGE_LR(idprom) - && !_sff8472_media_gbe_lx_fc_hack(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_XGE_LR(eeprom) + && !_sff8472_media_gbe_lx_fc_hack(eeprom)) return SFF_MODULE_TYPE_10G_BASE_LR; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_XGE_LRM(idprom) - && !_sff8472_media_gbe_lx_fc_hack(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_XGE_LRM(eeprom) + && !_sff8472_media_gbe_lx_fc_hack(eeprom)) return SFF_MODULE_TYPE_10G_BASE_LRM; /* @@ -141,71 +146,69 @@ sff_module_type_get(const uint8_t* idprom) * See also _sff8472_media_cr_passive, which encodes some * additional workarounds for these cables. */ - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_XGE_ER(idprom) - && !_sff8472_inf_1x_cu_active(idprom) - && !_sff8472_inf_1x_cu_passive(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_XGE_ER(eeprom) + && !_sff8472_inf_1x_cu_active(eeprom) + && !_sff8472_inf_1x_cu_passive(eeprom)) return SFF_MODULE_TYPE_10G_BASE_ER; /* XXX roth - not sure on this one */ - if (SFF8472_MODULE_SFP(idprom) - && _sff8472_media_cr_passive(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && _sff8472_media_cr_passive(eeprom)) return SFF_MODULE_TYPE_10G_BASE_CR; - if (SFF8472_MODULE_SFP(idprom) - && _sff8472_media_cr_active(idprom)) { - if (_sff8472_sfp_10g_aoc(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && _sff8472_media_cr_active(eeprom)) { + if (_sff8472_sfp_10g_aoc(eeprom)) return SFF_MODULE_TYPE_10G_BASE_SR; else return SFF_MODULE_TYPE_10G_BASE_CR; } - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_GBE_SX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_GBE_SX(eeprom)) return SFF_MODULE_TYPE_1G_BASE_SX; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_GBE_LX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_GBE_LX(eeprom)) return SFF_MODULE_TYPE_1G_BASE_LX; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_GBE_CX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_GBE_CX(eeprom)) return SFF_MODULE_TYPE_1G_BASE_CX; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_GBE_T(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_GBE_T(eeprom)) return SFF_MODULE_TYPE_1G_BASE_T; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_GBE_LX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_GBE_LX(eeprom)) return SFF_MODULE_TYPE_1G_BASE_LX; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_CBE_LX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_CBE_LX(eeprom)) return SFF_MODULE_TYPE_100_BASE_LX; - if (SFF8472_MODULE_SFP(idprom) - && SFF8472_MEDIA_CBE_FX(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && SFF8472_MEDIA_CBE_FX(eeprom)) return SFF_MODULE_TYPE_100_BASE_FX; /* non-standard (e.g. Finisar) ZR media */ - if (SFF8472_MODULE_SFP(idprom) - && _sff8472_media_zr(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && _sff8472_media_zr(eeprom)) return SFF_MODULE_TYPE_10G_BASE_ZR; /* non-standard (e.g. Finisar) SRL media */ - if (SFF8472_MODULE_SFP(idprom) - && _sff8472_media_srlite(idprom)) + if (SFF8472_MODULE_SFP(eeprom) + && _sff8472_media_srlite(eeprom)) return SFF_MODULE_TYPE_10G_BASE_SRL; return SFF_MODULE_TYPE_INVALID; } sff_media_type_t -sff_media_type_get(const uint8_t* idprom) +sff_media_type_get(sff_module_type_t mt) { - sff_module_type_t mt = sff_module_type_get(idprom); - switch(mt) { case SFF_MODULE_TYPE_100G_BASE_CR4: @@ -222,6 +225,7 @@ sff_media_type_get(const uint8_t* idprom) case SFF_MODULE_TYPE_100G_CWDM4: case SFF_MODULE_TYPE_40G_BASE_SR4: case SFF_MODULE_TYPE_40G_BASE_LR4: + case SFF_MODULE_TYPE_40G_BASE_LM4: case SFF_MODULE_TYPE_40G_BASE_ACTIVE: case SFF_MODULE_TYPE_40G_BASE_SR2: case SFF_MODULE_TYPE_10G_BASE_SR: @@ -247,14 +251,11 @@ sff_media_type_get(const uint8_t* idprom) } int -sff_module_caps_get(const uint8_t* idprom, uint32_t *caps) +sff_module_caps_get(sff_module_type_t mt, uint32_t *caps) { - if (idprom == NULL) - return -1; if (caps == NULL) return -1; - sff_module_type_t mt = sff_module_type_get(idprom); *caps = 0; switch(mt) @@ -270,6 +271,7 @@ sff_module_caps_get(const uint8_t* idprom, uint32_t *caps) case SFF_MODULE_TYPE_40G_BASE_CR4: case SFF_MODULE_TYPE_40G_BASE_SR4: case SFF_MODULE_TYPE_40G_BASE_LR4: + case SFF_MODULE_TYPE_40G_BASE_LM4: case SFF_MODULE_TYPE_40G_BASE_ACTIVE: case SFF_MODULE_TYPE_40G_BASE_CR: case SFF_MODULE_TYPE_40G_BASE_SR2: @@ -305,24 +307,6 @@ sff_module_caps_get(const uint8_t* idprom, uint32_t *caps) } } -void -sff_module_show(const uint8_t* idprom, aim_pvs_t* pvs) -{ - - if (SFF8436_MODULE_QSFP_PLUS_V2(idprom) || - SFF8636_MODULE_QSFP28(idprom)) { - aim_printf(pvs, - "%-12.12s %-16.16s %-16.16s %-16.16s\n", - sff_module_type_desc(sff_module_type_get(idprom)), - idprom+148, idprom+168, idprom+196); - } else { - aim_printf(pvs, - "%-12.12s %-16.16s %-16.16s %-16.16s\n", - sff_module_type_desc(sff_module_type_get(idprom)), - idprom+20, idprom+40, idprom+68); - } -} - static void make_printable__(char* string) { @@ -342,154 +326,176 @@ make_printable__(char* string) * @note if eeprom is NULL it is assumed the rv->eeprom buffer * has already been initialized. */ + int -sff_info_init(sff_info_t* rv, uint8_t* eeprom) +sff_eeprom_parse(sff_eeprom_t* se, uint8_t* eeprom) { - if(rv == NULL) { + if(se == NULL) { return -1; } - rv->supported = 0; + se->identified = 0; if(eeprom) { - SFF_MEMCPY(rv->eeprom, eeprom, 256); + SFF_MEMCPY(se->eeprom, eeprom, 256); } - if (SFF8472_MODULE_SFP(rv->eeprom)) { + if (SFF8472_MODULE_SFP(se->eeprom)) { /* See SFF-8472 pp22, pp28 */ int i; - for (i = 0, rv->cc_base = 0; i < 63; ++i) - rv->cc_base = (rv->cc_base + rv->eeprom[i]) & 0xFF; - for (i = 64, rv->cc_ext = 0; i < 95; ++i) - rv->cc_ext = (rv->cc_ext + rv->eeprom[i]) & 0xFF; - } else if (SFF8436_MODULE_QSFP_PLUS_V2(rv->eeprom) || - SFF8636_MODULE_QSFP28(rv->eeprom)) { + for (i = 0, se->cc_base = 0; i < 63; ++i) + se->cc_base = (se->cc_base + se->eeprom[i]) & 0xFF; + for (i = 64, se->cc_ext = 0; i < 95; ++i) + se->cc_ext = (se->cc_ext + se->eeprom[i]) & 0xFF; + } else if (SFF8436_MODULE_QSFP_PLUS_V2(se->eeprom) || + SFF8636_MODULE_QSFP28(se->eeprom)) { /* See SFF-8436 pp72, pp73 */ int i; - for (i = 128, rv->cc_base = 0; i < 191; ++i) - rv->cc_base = (rv->cc_base + rv->eeprom[i]) & 0xFF; - for (i = 192, rv->cc_ext = 0; i < 223; ++i) - rv->cc_ext = (rv->cc_ext + rv->eeprom[i]) & 0xFF; + for (i = 128, se->cc_base = 0; i < 191; ++i) + se->cc_base = (se->cc_base + se->eeprom[i]) & 0xFF; + for (i = 192, se->cc_ext = 0; i < 223; ++i) + se->cc_ext = (se->cc_ext + se->eeprom[i]) & 0xFF; } - if (!sff_info_valid(rv, 1)) return -1; - - rv->sfp_type = sff_sfp_type_get(rv->eeprom); - if(rv->sfp_type == SFF_SFP_TYPE_INVALID) { - AIM_LOG_ERROR("sff_info_init() failed: invalid sfp type"); + if (!sff_eeprom_validate(se, 1)) { return -1; } - rv->sfp_type_name = sff_sfp_type_desc(rv->sfp_type); + + se->info.sfp_type = sff_sfp_type_get(se->eeprom); + if(se->info.sfp_type == SFF_SFP_TYPE_INVALID) { + AIM_LOG_ERROR("sff_eeprom_parse() failed: invalid sfp type"); + return -1; + } + se->info.sfp_type_name = sff_sfp_type_desc(se->info.sfp_type); const uint8_t *vendor, *model, *serial; - switch(rv->sfp_type) + switch(se->info.sfp_type) { case SFF_SFP_TYPE_QSFP_PLUS: case SFF_SFP_TYPE_QSFP28: - vendor=rv->eeprom+148; - model=rv->eeprom+168; - serial=rv->eeprom+196; + vendor=se->eeprom+148; + model=se->eeprom+168; + serial=se->eeprom+196; break; case SFF_SFP_TYPE_SFP: default: - vendor=rv->eeprom+20; - model=rv->eeprom+40; - serial=rv->eeprom+68; + vendor=se->eeprom+20; + model=se->eeprom+40; + serial=se->eeprom+68; break; } /* handle NULL fields, they should actually be space-padded */ const char *empty = " "; if (*vendor) { - aim_strlcpy(rv->vendor, (char*)vendor, sizeof(rv->vendor)); - make_printable__(rv->vendor); + aim_strlcpy(se->info.vendor, (char*)vendor, sizeof(se->info.vendor)); + make_printable__(se->info.vendor); } else { - aim_strlcpy(rv->vendor, empty, 17); + aim_strlcpy(se->info.vendor, empty, 17); } if (*model) { - aim_strlcpy(rv->model, (char*)model, sizeof(rv->model)); - make_printable__(rv->model); + aim_strlcpy(se->info.model, (char*)model, sizeof(se->info.model)); + make_printable__(se->info.model); } else { - aim_strlcpy(rv->model, empty, 17); + aim_strlcpy(se->info.model, empty, 17); } if (*serial) { - aim_strlcpy(rv->serial, (char*)serial, sizeof(rv->serial)); - make_printable__(rv->serial); + aim_strlcpy(se->info.serial, (char*)serial, sizeof(se->info.serial)); + make_printable__(se->info.serial); } else { - aim_strlcpy(rv->serial, empty, 17); + aim_strlcpy(se->info.serial, empty, 17); } - rv->module_type = sff_module_type_get(rv->eeprom); - if(rv->module_type == SFF_MODULE_TYPE_INVALID) { + se->info.module_type = sff_module_type_get(se->eeprom); + if(se->info.module_type == SFF_MODULE_TYPE_INVALID) { AIM_LOG_ERROR("sff_info_init() failed: invalid module type"); return -1; } - rv->module_type_name = sff_module_type_desc(rv->module_type); - rv->media_type = sff_media_type_get(rv->eeprom); - rv->media_type_name = sff_media_type_desc(rv->media_type); - - if (sff_module_caps_get(rv->eeprom, &rv->caps) < 0) { - AIM_LOG_ERROR("sff_info_init() failed: invalid module caps"); + if(sff_info_from_module_type(&se->info, se->info.sfp_type, + se->info.module_type) < 0) { return -1; } int aoc_length; - switch (rv->media_type) { - case SFF_MEDIA_TYPE_COPPER: - switch (rv->sfp_type) { - case SFF_SFP_TYPE_QSFP_PLUS: - case SFF_SFP_TYPE_QSFP28: - rv->length = rv->eeprom[146]; + switch (se->info.media_type) + { + case SFF_MEDIA_TYPE_COPPER: + switch (se->info.sfp_type) + { + case SFF_SFP_TYPE_QSFP_PLUS: + case SFF_SFP_TYPE_QSFP28: + se->info.length = se->eeprom[146]; + break; + case SFF_SFP_TYPE_SFP: + se->info.length = se->eeprom[18]; + break; + default: + se->info.length = -1; + break; + } break; - case SFF_SFP_TYPE_SFP: - rv->length = rv->eeprom[18]; - break; - default: - rv->length = -1; - break; - } - break; - case SFF_MEDIA_TYPE_FIBER: - switch (rv->sfp_type) { - case SFF_SFP_TYPE_QSFP28: - aoc_length = _sff8636_qsfp28_100g_aoc_length(rv->eeprom); - rv->length = aoc_length; - break; - case SFF_SFP_TYPE_QSFP_PLUS: - case SFF_SFP_TYPE_SFP: - aoc_length = _sff8436_qsfp_40g_aoc_length(rv->eeprom); - if (aoc_length < 0) - aoc_length = _sff8472_sfp_10g_aoc_length(rv->eeprom); - if (aoc_length > 0) - rv->length = aoc_length; - else - rv->length = -1; - break; - default: - rv->length = -1; - break; - } - break; - default: - rv->length = -1; - } - if(rv->length == -1) { - rv->length_desc[0] = 0; + case SFF_MEDIA_TYPE_FIBER: + switch (se->info.sfp_type) + { + case SFF_SFP_TYPE_QSFP28: + aoc_length = _sff8636_qsfp28_100g_aoc_length(se->eeprom); + se->info.length = aoc_length; + break; + case SFF_SFP_TYPE_QSFP_PLUS: + case SFF_SFP_TYPE_SFP: + aoc_length = _sff8436_qsfp_40g_aoc_length(se->eeprom); + if (aoc_length < 0) + aoc_length = _sff8472_sfp_10g_aoc_length(se->eeprom); + if (aoc_length > 0) + se->info.length = aoc_length; + else + se->info.length = -1; + break; + default: + se->info.length = -1; + break; + } + break; + default: + se->info.length = -1; + } + + if(se->info.length == -1) { + se->info.length_desc[0] = 0; } else { - SFF_SNPRINTF(rv->length_desc, sizeof(rv->length_desc), "%dm", rv->length); + SFF_SNPRINTF(se->info.length_desc, sizeof(se->info.length_desc), "%dm", se->info.length); } - rv->supported = 1; + se->identified = 1; return 0; } +int +sff_info_from_module_type(sff_info_t* info, sff_sfp_type_t st, sff_module_type_t mt) +{ + info->sfp_type = st; + info->sfp_type_name = sff_sfp_type_desc(st); + + info->module_type = mt; + info->module_type_name = sff_module_type_desc(mt); + + info->media_type = sff_media_type_get(mt); + info->media_type_name = sff_media_type_desc(info->media_type); + + if (sff_module_caps_get(info->module_type, &info->caps) < 0) { + AIM_LOG_ERROR("sff_info_init() failed: invalid module caps"); + return -1; + } + return 0; +} + void sff_info_show(sff_info_t* info, aim_pvs_t* pvs) { @@ -499,20 +505,20 @@ sff_info_show(sff_info_t* info, aim_pvs_t* pvs) } int -sff_info_init_file(sff_info_t* info, const char* fname) +sff_eeprom_parse_file(sff_eeprom_t* se, const char* fname) { int rv; FILE* fp; - SFF_MEMSET(info, 0, sizeof(*info)); + SFF_MEMSET(se, 0, sizeof(*se)); if( (fp = fopen(fname, "r")) == NULL) { AIM_LOG_ERROR("Failed to open eeprom file %s: %{errno}"); return -1; } - if( (rv = fread(info->eeprom, 1, 256, fp)) > 0) { - if( (rv=sff_info_init(info, NULL)) < 0) { + if( (rv = fread(se->eeprom, 1, 256, fp)) > 0) { + if( (rv=sff_eeprom_parse(se, NULL)) < 0) { AIM_LOG_ERROR("sff_init() failed on data from file %s: %d\n", fname, rv); rv = -1; } @@ -526,53 +532,53 @@ sff_info_init_file(sff_info_t* info, const char* fname) } void -sff_info_invalidate(sff_info_t *info) +sff_eeprom_invalidate(sff_eeprom_t *se) { - memset(info->eeprom, 0xFF, 256); - info->cc_base = 0xFF; - info->cc_ext = 0xFF; - info->supported = 0; + memset(se->eeprom, 0xFF, 256); + se->cc_base = 0xFF; + se->cc_ext = 0xFF; + se->identified = 0; } int -sff_info_valid(sff_info_t *info, int verbose) +sff_eeprom_validate(sff_eeprom_t *se, int verbose) { - if (SFF8436_MODULE_QSFP_PLUS_V2(info->eeprom) || - SFF8636_MODULE_QSFP28(info->eeprom)) { + if (SFF8436_MODULE_QSFP_PLUS_V2(se->eeprom) || + SFF8636_MODULE_QSFP28(se->eeprom)) { - if (info->cc_base != info->eeprom[191]) { + if (se->cc_base != se->eeprom[191]) { if (verbose) { - AIM_LOG_ERROR("sff_info_valid() failed: invalid base QSFP checksum (0x%x should be 0x%x)", - info->eeprom[191], info->cc_base); + AIM_LOG_ERROR("sff_eeprom_validate() failed: invalid base QSFP checksum (0x%x should be 0x%x)", + se->eeprom[191], se->cc_base); } return 0; } #if SFF_CONFIG_INCLUDE_EXT_CC_CHECK == 1 - if (info->cc_ext != info->eeprom[223]) { + if (se->cc_ext != se->eeprom[223]) { if (verbose) { AIM_LOG_ERROR("sff_info_valid() failed: invalid extended QSFP checksum (0x%x should be 0x%x)", - info->eeprom[223], info->cc_ext); + se->eeprom[223], se->cc_ext); } return 0; } #endif - } else if (SFF8472_MODULE_SFP(info->eeprom)) { + } else if (SFF8472_MODULE_SFP(se->eeprom)) { - if (info->cc_base != info->eeprom[63]) { + if (se->cc_base != se->eeprom[63]) { if (verbose) { AIM_LOG_ERROR("sff_info_valid() failed: invalid base SFP checksum (0x%x should be 0x%x)", - info->eeprom[63], info->cc_base); + se->eeprom[63], se->cc_base); } return 0; } #if SFF_CONFIG_INCLUDE_EXT_CC_CHECK == 1 - if (info->cc_ext != info->eeprom[95]) { + if (se->cc_ext != se->eeprom[95]) { if (verbose) { AIM_LOG_ERROR("sff_info_valid() failed: invalid extended SFP checksum (0x%x should be 0x%x)", - info->eeprom[95], info->cc_ext); + se->eeprom[95], se->cc_ext); } return 0; } diff --git a/packages/base/any/onlp/src/sff/module/src/sff_config.c b/packages/base/any/onlp/src/sff/module/src/sff_config.c index 1e448f3b..400b7a72 100644 --- a/packages/base/any/onlp/src/sff/module/src/sff_config.c +++ b/packages/base/any/onlp/src/sff/module/src/sff_config.c @@ -54,6 +54,11 @@ sff_config_settings_t sff_config_settings[] = { __sff_config_STRINGIFY_NAME(SFF_CONFIG_INCLUDE_EXT_CC_CHECK), __sff_config_STRINGIFY_VALUE(SFF_CONFIG_INCLUDE_EXT_CC_CHECK) }, #else { SFF_CONFIG_INCLUDE_EXT_CC_CHECK(__sff_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef SFF_CONFIG_INCLUDE_DATABASE + { __sff_config_STRINGIFY_NAME(SFF_CONFIG_INCLUDE_DATABASE), __sff_config_STRINGIFY_VALUE(SFF_CONFIG_INCLUDE_DATABASE) }, +#else +{ SFF_CONFIG_INCLUDE_DATABASE(__sff_config_STRINGIFY_NAME), "__undefined__" }, #endif { NULL, NULL } }; diff --git a/packages/base/any/onlp/src/sff/module/src/sff_db.c b/packages/base/any/onlp/src/sff/module/src/sff_db.c new file mode 100644 index 00000000..c6c0ae1e --- /dev/null +++ b/packages/base/any/onlp/src/sff/module/src/sff_db.c @@ -0,0 +1,1468 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#define SFF_1G_BASE_SX_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_SX, "1GBASE-SX", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G + + +#define SFF_1G_BASE_LX_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_1G_BASE_LX, "1GBASE-LR", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_1G + + +#define SFF_10G_BASE_CR_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_10G_BASE_CR, "10GBASE-CR", SFF_MEDIA_TYPE_COPPER, "Copper", SFF_MODULE_CAPS_F_10G + + +#define SFF_10G_BASE_ZR_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_10G_BASE_ZR, "10GBASE-ZR", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_10G + + +#define SFF_10G_BASE_SR_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_10G_BASE_SR, "10GBASE-SR", SFF_MEDIA_TYPE_FIBER, "Fiber",SFF_MODULE_CAPS_F_10G + + +#define SFF_10G_BASE_SRL_PROPERTIES \ + SFF_SFP_TYPE_SFP, "SFP", SFF_MODULE_TYPE_10G_BASE_SRL, "1GBASE-SRL", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_10G + + +#define SFF_40G_BASE_SR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP_PLUS, "QSFP+", SFF_MODULE_TYPE_40G_BASE_SR4, "40GBASE-SR4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_40G + +#define SFF_40G_BASE_LR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP_PLUS, "QSFP+", SFF_MODULE_TYPE_40G_BASE_LR4, "40GBASE-LR4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_40G + +#define SFF_40G_BASE_LM4_PROPERTIES \ + SFF_SFP_TYPE_QSFP_PLUS, "QSFP+", SFF_MODULE_TYPE_40G_BASE_LM4, "40GBASE-LM4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_40G + + +#define SFF_40G_BASE_CR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP_PLUS, "QSFP+", SFF_MODULE_TYPE_40G_BASE_CR4, "40GBASE-CR4", SFF_MEDIA_TYPE_COPPER, "Copper", SFF_MODULE_CAPS_F_40G + + +#define SFF_40G_BASE_SR2_PROPERTIES \ + SFF_SFP_TYPE_QSFP_PLUS, "QSFP+", SFF_MODULE_TYPE_40G_BASE_SR2, "40GBASE-SR2", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_40G + +#define SFF_100G_AOC_PROPERTIES \ + SFF_SFP_TYPE_QSFP28, "QSFP28", SFF_MODULE_TYPE_100G_AOC, "100G-AOC", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_100G + +#define SFF_100G_BASE_LR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP28, "QSFP28", SFF_MODULE_TYPE_100G_BASE_LR4, "100GBASE-LR4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_100G + +#define SFF_100G_BASE_SR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP28, "QSFP28", SFF_MODULE_TYPE_100G_BASE_SR4, "100GBASE-SR4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_100G + +#define SFF_100G_BASE_CR4_PROPERTIES \ + SFF_SFP_TYPE_QSFP28, "QSFP28", SFF_MODULE_TYPE_100G_BASE_CR4, "100GBASE-CR4", SFF_MEDIA_TYPE_COPPER, "Copper", SFF_MODULE_CAPS_F_100G + +#define SFF_100G_CWDM4_PROPERTIES \ + SFF_SFP_TYPE_QSFP28, "QSFP28", SFF_MODULE_TYPE_100G_CWDM4, "100G-CWDM4", SFF_MEDIA_TYPE_FIBER, "Fiber", SFF_MODULE_CAPS_F_100G + +static sff_db_entry_t sff_database__[] = + { + +#if SFF_CONFIG_INCLUDE_DATABASE == 1 + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x01, 0x20, 0x40, 0x0c, 0x05, 0x01, 0x15, 0x00, 0x00, 0x00, + 0x1e, 0x0f, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x52, 0x4a, 0x38, 0x35, 0x31, 0x39, + 0x50, 0x31, 0x42, 0x4e, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0x66, + 0x00, 0x12, 0x00, 0x00, 0x50, 0x38, 0x4a, 0x32, 0x5a, 0x4e, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x30, 0x35, 0x31, 0x30, 0x33, 0x31, 0x20, 0x20, 0x58, 0x90, 0x01, 0x74, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "FINISAR CORP. ", + "FTRJ8519P1BNL ", + "P8J2ZNC ", + SFF_1G_BASE_SX_PROPERTIES, + -1, + } + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x41, 0x50, 0x48, 0x35, 0x37, 0x31, 0x35, 0x34, 0x30, 0x30, 0x30, + 0x37, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xfa, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x50, 0x46, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x37, 0x30, 0x31, + 0x34, 0x37, 0x20, 0x20, 0x31, 0x30, 0x30, 0x33, 0x30, 0x32, 0x20, 0x20, 0x00, 0x00, 0x00, 0xa9, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "Amphenol ", + "571540007 ", + "APF10080070147 ", + SFF_10G_BASE_CR_PROPERTIES, + 0x1 + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x4d, 0x4f, 0x4c, 0x45, 0x58, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x09, 0x3a, 0x37, 0x34, 0x37, 0x35, 0x32, 0x2d, 0x39, 0x35, + 0x31, 0x39, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x20, 0x20, 0x01, 0x00, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x4d, 0x4f, 0x43, 0x31, 0x35, 0x34, 0x37, 0x30, 0x30, 0x30, 0x48, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x31, 0x31, 0x31, 0x32, 0x31, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8f, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0xf9, 0x8e, 0x5a, + 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x34, 0x4a, 0x41, 0x42, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, + 0x30, 0x2d, 0x30, 0x33, 0x56, 0x30, 0x33, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xcc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x31, 0x4d, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb3, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "CISCO-MOLEX ", + "74752-9519 ", + "MOC1547000H ", + SFF_10G_BASE_CR_PROPERTIES, + 0x1, + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x43, 0x39, 0x39, 0x39, 0x39, 0x2d, 0x31, 0x4d, + 0x2d, 0x50, 0x2d, 0x4c, 0x43, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xa1, + 0x00, 0x00, 0x00, 0x00, 0x31, 0x33, 0x30, 0x35, 0x33, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x34, 0x31, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x1d, + 0x00, 0x00, 0x11, 0xb6, 0x7f, 0x7f, 0x08, 0x96, 0xee, 0x8e, 0x60, 0x37, 0xb4, 0xc8, 0x8b, 0x88, + 0x66, 0x9c, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xdd, 0x56, 0xe8, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + " ", + "C9999-1M-P-LC ", + "1305300041 ", + SFF_10G_BASE_CR_PROPERTIES, + 0x0, + } + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x4d, 0x4f, 0x4c, 0x45, 0x58, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x09, 0x3a, 0x37, 0x34, 0x37, 0x35, 0x32, 0x2d, 0x39, 0x35, + 0x32, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x20, 0x20, 0x01, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x00, 0x4d, 0x4f, 0x43, 0x31, 0x36, 0x30, 0x33, 0x30, 0x42, 0x48, 0x34, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x31, 0x31, 0x39, 0x20, 0x20, 0x00, 0x00, 0x00, 0xa5, + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x04, 0x3b, 0x5b, + 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x36, 0x4a, 0x41, 0x42, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, + 0x31, 0x2d, 0x30, 0x33, 0x56, 0x30, 0x33, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x33, 0x4d, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "CISCO-MOLEX ", + "74752-9520 ", + "MOC16030BH4 ", + SFF_10G_BASE_CR_PROPERTIES, + 0x3 + }, + }, + }, + + { + { + .eeprom = { + 0x00, 0x80, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x01, 0x0d, 0x33, 0x0c, 0xcb, 0x0c, 0xcb, 0x0d, 0x33, 0x1b, 0xd5, 0x1b, 0x54, 0x18, 0xcd, 0x1c, + 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x4f, 0x45, 0x4d, 0x20, 0x20, + 0x0d, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, + 0x0a, 0x03, 0x00, 0x00, 0x4f, 0x45, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x00, 0x1e, 0x00, 0x51, 0x53, 0x46, 0x50, 0x2d, 0x34, 0x30, 0x47, + 0x2d, 0x53, 0x52, 0x34, 0x20, 0x20, 0x20, 0x20, 0x31, 0x41, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x0c, + 0x00, 0x00, 0x00, 0xde, 0x41, 0x43, 0x52, 0x34, 0x30, 0x47, 0x30, 0x30, 0x34, 0x31, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x38, 0x32, 0x37, 0x31, 0x39, 0x08, 0x00, 0x00, 0x8a, + 0x00, 0x00, 0x11, 0x9d, 0xf1, 0x68, 0x34, 0xac, 0xb2, 0x3d, 0xc6, 0x19, 0x53, 0x0b, 0xbf, 0xf0, + 0x2e, 0xe1, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0xfe, 0x58, 0x27, + }, + .info = { + "OEM ", + "QSFP-40G-SR4 ", + "ACR40G0041 ", + SFF_40G_BASE_SR4_PROPERTIES, + -1, + }, + }, + }, + + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xa0, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x78, 0xa7, 0x14, 0x36, 0x30, 0x33, 0x30, 0x32, 0x30, 0x30, 0x30, + 0x33, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x20, 0x07, 0x0b, 0x00, 0x00, 0x46, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x50, 0x46, 0x31, 0x33, 0x30, 0x32, 0x30, 0x30, 0x33, 0x35, 0x41, + 0x52, 0x56, 0x20, 0x20, 0x31, 0x33, 0x30, 0x31, 0x31, 0x35, 0x20, 0x20, 0x00, 0x00, 0x00, 0xf9, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "Amphenol ", + "603020003 ", + "APF13020035ARV ", + SFF_40G_BASE_CR4_PROPERTIES, + 0x3 + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x46, 0x69, 0x62, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x40, 0x20, 0x31, 0x30, 0x47, 0x53, 0x46, 0x50, 0x2d, 0x50, + 0x43, 0x2d, 0x33, 0x30, 0x2d, 0x31, 0x20, 0x20, 0x41, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x00, 0x46, 0x53, 0x34, 0x30, 0x32, 0x31, 0x32, 0x44, 0x30, 0x31, 0x37, 0x36, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x30, 0x32, 0x31, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8f, + 0x00, 0x00, 0x11, 0x4b, 0xd4, 0xe4, 0xc5, 0x99, 0xd1, 0xfb, 0xdb, 0x5e, 0xa2, 0xc4, 0x62, 0x0c, + 0xf2, 0x5b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0xfa, 0x99, + 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x34, 0x4a, 0x41, 0x41, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, + 0x30, 0x2d, 0x30, 0x32, 0x56, 0x30, 0x32, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xc9, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x31, 0x4d, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb3, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { +"FiberStore ", + "10GSFP-PC-30-1 ", + "FS40212D0176 ", + SFF_10G_BASE_CR_PROPERTIES, + 0x1, + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x06, 0x67, 0x00, 0x50, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x58, 0x31, 0x38, 0x37, 0x31, + 0x4d, 0x33, 0x42, 0x43, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x06, 0x0e, 0x00, 0x33, + 0x06, 0x1a, 0x00, 0x00, 0x55, 0x50, 0x47, 0x30, 0x31, 0x57, 0x4a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x34, 0x32, 0x39, 0x20, 0x20, 0x68, 0xf0, 0x05, 0xfe, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FTLX1871M3BCL ", + "UPG01WJ ", + SFF_10G_BASE_ZR_PROPERTIES, + -1, + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, + 0x03, 0x01, 0x00, 0x0a, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x58, 0x38, 0x35, 0x37, 0x30, + 0x44, 0x33, 0x42, 0x43, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0x1c, + 0x00, 0x1a, 0x00, 0x00, 0x50, 0x50, 0x34, 0x34, 0x51, 0x56, 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x32, 0x31, 0x37, 0x20, 0x20, 0x68, 0xf0, 0x03, 0xe3, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FTLX8570D3BCL ", + "PP44QV1 ", + SFF_10G_BASE_SRL_PROPERTIES, + -1, + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x02, 0x12, 0x10, 0x01, 0x05, 0x01, 0x15, 0x00, 0x0a, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x52, 0x4a, 0x31, 0x33, 0x31, 0x39, + 0x50, 0x31, 0x42, 0x54, 0x4c, 0x2d, 0x4d, 0x44, 0x41, 0x20, 0x20, 0x20, 0x05, 0x1e, 0x00, 0x88, + 0x00, 0x1a, 0x00, 0x00, 0x50, 0x44, 0x42, 0x31, 0x56, 0x51, 0x55, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x30, 0x33, 0x31, 0x37, 0x20, 0x20, 0x68, 0xb0, 0x01, 0xc9, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { +"FINISAR CORP. ", + "FTRJ1319P1BTL-MD", + "PDB1VQU ", + SFF_1G_BASE_LX_PROPERTIES, + -1, + }, + }, + }, + + { + { + .eeprom = { + 0x03, 0x04, 0x21, 0x81, 0x00, 0x00, 0x04, 0x41, 0x04, 0x80, 0xd5, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x54, 0x79, 0x63, 0x6f, 0x20, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x6f, + 0x6e, 0x69, 0x63, 0x73, 0x00, 0x00, 0x40, 0x20, 0x32, 0x31, 0x30, 0x30, 0x38, 0x37, 0x30, 0x2d, + 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8a, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x39, 0x33, 0x35, 0x45, 0x30, 0x34, 0x38, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x35, 0x30, 0x39, 0x30, 0x30, 0x00, 0x00, 0x00, 0x41, + 0x37, 0x34, 0x30, 0x2d, 0x30, 0x33, 0x30, 0x30, 0x37, 0x36, 0x20, 0x52, 0x45, 0x56, 0x20, 0x30, + 0x31, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "Tyco Electronics", + "2100870-1 ", + "0935E048 ", + SFF_10G_BASE_CR_PROPERTIES, + 1, + }, + }, + }, + + { + { + .eeprom = { + /* 0 */ 0x0d, 0x00, 0x02, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 16 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 32 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 48 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 64 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 80 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 128 */ 0x0d, 0xdc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xce, 0x00, 0x00, 0x32, + /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x41, 0x56, 0x41, 0x47, 0x4f, 0x20, + /* 160 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x17, 0x6a, 0x41, 0x46, 0x42, 0x52, 0x2d, 0x37, 0x39, 0x45, + /* 176 */ 0x42, 0x50, 0x5a, 0x2d, 0x43, 0x53, 0x31, 0x20, 0x30, 0x31, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x47, + /* 192 */ 0x00, 0x00, 0x0f, 0xde, 0x41, 0x56, 0x4d, 0x31, 0x38, 0x30, 0x39, 0x53, 0x30, 0x54, 0x47, 0x20, + /* 208 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x30, 0x32, 0x32, 0x35, 0x20, 0x20, 0x08, 0x00, 0xf5, 0xcc, + /* 224 */ 0xf5, 0x00, 0x06, 0xd2, 0x04, 0x9c, 0x47, 0x09, 0xc5, 0xaf, 0xcf, 0xb7, 0x65, 0xd9, 0x72, 0x03, + /* 240 */ 0xea, 0x59, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x45, 0xbd, 0x94, + }, + .info = { +"CISCO-AVAGO ", + "AFBR-79EBPZ-CS1 ", + "AVM1809S0TG ", + SFF_40G_BASE_SR2_PROPERTIES, + -1, + }, + }, + }, + /* Cisco/Finisar 40G QSFP (QuadWire? AOC? Pigtail?) */ + { + { + .eeprom = { + /* 0x0000 */ 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xde, 0x00, 0x00, 0x7f, 0x4d, 0x00, 0x00, 0x00, 0x00, + /* 0x0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + /* 0x0080 */ 0x0d, 0x10, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x00, 0x32, + /* 0x0090 */ 0x1e, 0x00, 0x0a, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + /* 0x00a0 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x34, 0x31, 0x30, 0x51, + /* 0x00b0 */ 0x45, 0x32, 0x43, 0x31, 0x30, 0x2d, 0x43, 0x31, 0x41, 0x20, 0x42, 0x68, 0x07, 0xd0, 0x46, 0xaf, + /* 0x00c0 */ 0x00, 0x01, 0x04, 0xd8, 0x46, 0x49, 0x53, 0x31, 0x37, 0x33, 0x31, 0x30, 0x30, 0x35, 0x33, 0x2d, + /* 0x00d0 */ 0x41, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x37, 0x33, 0x31, 0x20, 0x20, 0x0a, 0x00, 0xf6, 0x90, + /* 0x00e0 */ 0x00, 0x00, 0x02, 0x43, 0x59, 0xd3, 0x68, 0x03, 0x46, 0x83, 0x87, 0x75, 0x1f, 0xee, 0x94, 0x62, + /* 0x00f0 */ 0xb8, 0x98, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5e, 0x75, 0x43, + }, + .info = { + "CISCO ", + "FCBN410QE2C10-C1", + "FIS17310053-A ", + SFF_40G_BASE_SR4_PROPERTIES, + -1, + }, + }, + }, + /* + * Dell/Amphenol 3M copper + * Identifies as intra-enclosure and inter-enclosure + */ + { + { + .eeprom = { + /* 0000 */ 0x03, 0x04, 0x21, 0x01, 0x00, 0x00, 0x00, 0x41, 0x84, 0x80, 0x55, 0x00, 0x67, 0x00, 0x00, 0x00, + /* 0010 */ 0x00, 0x00, 0x03, 0x00, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, + /* 0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x78, 0xa7, 0x14, 0x36, 0x31, 0x36, 0x37, 0x34, 0x30, 0x30, 0x30, + /* 0030 */ 0x33, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xe3, + /* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x43, 0x4e, 0x30, 0x35, 0x33, 0x48, 0x56, 0x4e, 0x34, 0x34, 0x4c, 0x38, + /* 0050 */ 0x37, 0x59, 0x59, 0x20, 0x31, 0x34, 0x30, 0x34, 0x32, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x78, + /* 0060 */ 0x0f, 0x10, 0x00, 0xa3, 0x71, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "Amphenol ", + "616740003 ", + "CN053HVN44L87YY ", + SFF_10G_BASE_CR_PROPERTIES, + 3, + }, + }, + }, + /* + * Dell/Amphenol 3M copper + * Identifies as intra-enclosure and inter-enclosure + */ + { + { + .eeprom = { + /* 0x0000 */ 0x03, 0x04, 0x21, 0x02, 0x00, 0x00, 0x04, 0x41, 0x84, 0x80, 0xd5, 0x00, 0x67, 0x00, 0x00, 0x00, + /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x33, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + /* 0x0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x31, 0x34, 0x31, 0x30, 0x2d, 0x50, 0x31, 0x37, + /* 0x0030 */ 0x2d, 0x30, 0x30, 0x2d, 0x33, 0x2e, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1c, + /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x30, 0x32, 0x32, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0080 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0090 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M ", + "1410-P17-00-3.00", + /* XXX roth -- NULL serial number ??!??111! */ + " ", + SFF_10G_BASE_CR_PROPERTIES, + 3, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x03, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x14, 0x21, 0x00, 0x00, 0x83, 0x2c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0a, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, + 0x0c, 0x04, 0x00, 0x00, 0x00, 0x40, 0x40, 0x06, 0x00, 0x05, + 0x64, 0x00, 0x00, 0x32, 0x1e, 0x00, 0x00, 0x00, 0x45, 0x64, + 0x67, 0x65, 0x2d, 0x63, 0x6f, 0x72, 0x45, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x04, 0x70, 0x72, 0xcf, 0x4d, 0x30, + 0x4f, 0x45, 0x43, 0x36, 0x34, 0x30, 0x31, 0x54, 0x30, 0x30, + 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x68, 0x07, 0xd0, + 0x46, 0xb0, 0x00, 0x00, 0x00, 0x12, 0x31, 0x45, 0x37, 0x51, + 0x54, 0x30, 0x30, 0x30, 0x33, 0x30, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x31, 0x34, 0x30, 0x37, 0x32, 0x38, 0x20, 0x20, + 0x08, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "Edge-corE ", + "M0OEC6401T00Z ", + "1E7QT00030 ", + SFF_40G_BASE_SR4_PROPERTIES, + -1, + }, + } + }, + { + { + .eeprom = { + 0x0d, 0x03, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0e, 0x30, 0x00, 0x00, 0x82, 0xa2, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, + 0x0c, 0x04, 0x00, 0x00, 0x00, 0x40, 0x40, 0x06, 0x00, 0x05, + 0x64, 0x00, 0x00, 0x32, 0x1e, 0x00, 0x00, 0x00, 0x45, 0x64, + 0x67, 0x65, 0x2d, 0x63, 0x6f, 0x72, 0x45, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x04, 0x70, 0x72, 0xcf, 0x4d, 0x30, + 0x4f, 0x45, 0x43, 0x36, 0x34, 0x30, 0x31, 0x54, 0x30, 0x30, + 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x68, 0x07, 0xd0, + 0x46, 0xb0, 0x00, 0x00, 0x00, 0x12, 0x31, 0x45, 0x37, 0x51, + 0x54, 0x30, 0x30, 0x30, 0x32, 0x38, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x31, 0x34, 0x30, 0x37, 0x32, 0x38, 0x20, 0x20, + 0x08, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }, + .info = { + "Edge-corE ", + "M0OEC6401T00Z ", + "1E7QT00028 ", + SFF_40G_BASE_SR4_PROPERTIES, + -1, + }, + } + }, + { + { + .eeprom = { + 0x0d, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x9f, 0x00, 0x00, 0x80, 0x29, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0xd5, 0x44, 0x3a, 0x48, 0xb1, + 0x4d, 0x30, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x8c, + 0x23, 0x04, 0x00, 0x00, 0x01, 0x40, 0x40, 0x02, 0x00, 0x05, + 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x46, 0x4f, + 0x52, 0x4d, 0x45, 0x52, 0x49, 0x43, 0x41, 0x4f, 0x45, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x04, 0x00, 0x00, 0x00, 0x54, 0x51, + 0x53, 0x2d, 0x51, 0x31, 0x4c, 0x48, 0x38, 0x2d, 0x58, 0x43, + 0x41, 0x31, 0x30, 0x20, 0x00, 0x00, 0x42, 0x68, 0x07, 0xd0, + 0x46, 0x4a, 0x00, 0x00, 0x05, 0x31, 0x39, 0x31, 0x33, 0x33, + 0x32, 0x4c, 0x30, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x31, 0x33, 0x30, 0x38, 0x30, 0x36, 0x20, 0x20, + 0x08, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, + 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xf7, + 0xf7, 0xf7, 0xf7, 0xf7, 0xfe, 0xfe, + }, + .info = { + "FORMERICAOE ", + "TQS-Q1LH8-XCA10 ", + "91332L0001 ", + SFF_40G_BASE_SR4_PROPERTIES, + 10, + }, + }, + }, + + { + { + .eeprom = { + /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, + /* + * ^^^^ copper pigtail + * + * ^^^^ no 10G or IB codes + * + * ^^^^ ^^^^ no SONET (fiber) + * + * identifies as 1000BASE-CX ^^^^ + * + * no FC length code ^^^^ + * + * identifies as SFP+ passive ^^^^ + * + * no FC media, copper or otherwise ^^^^ + * + * no FC speed ^^^^ + * + * nominal bitrate 0x67 --> 10.3GB ^^^^ + */ + /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x49, 0x42, 0x4d, 0x2d, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, + /* + * ^^^^ copper cable length (3m) + */ + /* 0x0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x17, 0xef, 0x39, 0x30, 0x59, 0x39, 0x34, 0x32, 0x38, 0x2d, + /* 0x0030 */ 0x4e, 0x32, 0x38, 0x35, 0x30, 0x30, 0x41, 0x20, 0x46, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x7a, + /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x59, 0x33, 0x35, 0x30, 0x56, 0x54, 0x32, 0x42, 0x52, 0x31, 0x46, 0x47, + /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x31, 0x31, 0x32, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x0d, + /* 0x0060 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { +"IBM-Amphenol ", + "90Y9428-N28500A ", + "Y350VT2BR1FG ", + SFF_10G_BASE_CR_PROPERTIES, + 3, + }, + }, + }, + { + /* Verify string normalization for unprintable characters in the vendor, model, or serial number fields. */ + { + { + /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, + /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x49, 0x42, 0x4d, 0x2d, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, + /* 0x0020 */ 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x17, 0xef, 0x39, 0x30, 0x59, 0x39, 0x34, 0x32, 0x38, 0xFd, + /* 0x0030 */ 0x4e, 0x32, 0x38, 0x35, 0x30, 0x30, 0x41, 0x20, 0x46, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x8a, + /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x59, 0x33, 0xF5, 0xF0, 0x56, 0x54, 0x32, 0x42, 0x52, 0x31, 0x46, 0x47, + /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x31, 0x31, 0x32, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8d, + /* 0x0060 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* 0x00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "IBM-Amphenol????", + "90Y9428?N28500A ", + "Y3??VT2BR1FG ", + SFF_10G_BASE_CR_PROPERTIES, + 3, + }, + }, + }, + { + /* + * Finisar 40G AOC breakout cable + */ + { + { + /* 0x0000 */ 0x0d, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x9f, 0x00, 0x00, 0x80, 0xc2, 0x00, 0x00, 0x00, 0x00, + /* 0x0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + + /* 0x0080 */ 0x0d, 0x10, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x00, 0x00, + /* + * ^^^^ QSFP+ + * + * ^^^^ no separable connector (active?) + * + * ^^^^^ no media compliance (*NOT* 40G active) + * + * ^^^^ no SONET compliance + * + * ^^^^ no SAS compliance + * + * ^^^^ no GbE compliance + * + * ^^^^ ^^^^ no FC compliance + * + * ^^^^ no FC media + * + * ^^^^ no FC speed + * + * ^^^^ 64b66b + * + * ^^^^ nominal BR >= 10G + * no SM or OM3 length ^^^^ ^^^^ + */ + /* 0x0090 */ 0x00, 0x00, 0x03, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + /* + * ^^^^ ^^^^ no OM1 or OM2 length + * + * ^^^^ 3M cable (copper or active) + */ + /* 0x00a0 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x35, 0x31, 0x30, 0x51, + /* 0x00b0 */ 0x45, 0x32, 0x43, 0x30, 0x33, 0x20, 0x20, 0x20, 0x41, 0x20, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x29, + /* + * ^^^^ ^^^^ 850nm + */ + /* 0x00c0 */ 0x00, 0x01, 0x04, 0xd8, 0x44, 0x53, 0x4b, 0x30, 0x34, 0x56, 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, + /* 0x00d0 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x31, 0x31, 0x30, 0x34, 0x20, 0x20, 0x08, 0x00, 0xf6, 0x54, + /* 0x00e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP ", + "FCBN510QE2C03 ", + "DSK04VR ", + SFF_40G_BASE_SR4_PROPERTIES, + 3, + }, + }, + }, + { + /* + * Finisar 40G AOC breakout cable, 10G end + */ + { + { + /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, + /* + * ^^^^ SFP+ + * + * ^^^^ copper pigtail (ugh) + * + * ^^^^ no 10G or IF compliance + * + * ^^^^ no SONET compliance + * + * ^^^^ no OC length spec + * + * ^^^^ no ethernet compliance + * + * ^^^^ no FC length or tech + * + * ^^^^ active cable, no FC tech + * + * ^^^^ no FC media + * + * ^^^^ no FC speed + * + * ^^^^ 64/66 encoding + * + * nominal BR >= 10G ^^^^ + * + * no SM length ^^^^ ^^^^ + */ + /* 0x0010 */ 0x00, 0x00, 0x01, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + /* + * ^^^^ ^^^^ no MM length + * + * ^^^^ active/copper length 1m + * + * ^^^^ no OM3 length + * + */ + /* 0x0020 */ 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x35, 0x31, 0x30, 0x51, + /* 0x0030 */ 0x45, 0x32, 0x43, 0x30, 0x31, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x0c, 0x00, 0x00, 0xa9, + /* + * compliant with FC or SFF limiting ^^^^ ^^^^ + */ + /* 0x0040 */ 0x00, 0x12, 0x00, 0x00, 0x44, 0x53, 0x4a, 0x30, 0x35, 0x39, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, + /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x31, 0x30, 0x33, 0x30, 0x20, 0x20, 0x00, 0x00, 0x05, 0x72, + /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0080 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x0090 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00e0 */ 0x00, 0x7f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FCBN510QE2C01 ", + "DSJ059S ", + SFF_10G_BASE_SR_PROPERTIES, + 1, + }, + }, + }, + + + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x45, 0x42, 0x30, 0x38, 0x35, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x31, 0x31, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10EB085 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x4f, 0x00, 0x00, 0x7f, 0x3d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1b, 0x19, 0x1c, 0x87, 0x1a, 0x7c, 0x1b, 0xdd, 0x0e, 0xed, 0x0e, 0xd1, 0x0e, 0xcc, + 0x0f, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0xcc, 0x23, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x20, 0x20, 0x20, 0x20, 0x1f, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x34, 0x32, 0x35, 0x51, + 0x42, 0x31, 0x43, 0x30, 0x33, 0x20, 0x20, 0x20, 0x41, 0x31, 0x00, 0x00, 0x00, 0x00, 0x46, 0xb1, + 0x01, 0x07, 0xff, 0xde, 0x44, 0x55, 0x48, 0x30, 0x30, 0x32, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x30, 0x32, 0x31, 0x20, 0x20, 0x08, 0x00, 0x67, 0x94, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP ", + "FCBN425QB1C03 ", + "DUH002C ", + SFF_100G_AOC_PROPERTIES, + 3, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x4f, 0x00, 0x00, 0x81, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xd7, 0x06, 0x55, 0x06, 0x41, 0x07, 0xab, 0x4b, 0x1d, 0x45, 0x55, 0x48, 0x45, + 0x44, 0x4a, 0x1f, 0x02, 0x2f, 0x75, 0x32, 0x82, 0x37, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x0d, 0xc0, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x0a, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x34, 0x43, 0x31, 0x51, 0x45, + 0x31, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x31, 0x65, 0xa4, 0x05, 0x14, 0x46, 0xa1, + 0x00, 0x01, 0x0c, 0xd8, 0x55, 0x51, 0x4b, 0x30, 0x4e, 0x4c, 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x31, 0x31, 0x32, 0x30, 0x20, 0x20, 0x08, 0x00, 0x00, 0x61, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FTL4C1QE1C ", + "UQK0NL1 ", + SFF_40G_BASE_LR4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xd3, 0x00, 0x00, 0x80, 0x56, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x23, 0x03, 0xbc, 0x03, 0x20, 0x06, 0x49, 0x4d, 0x76, 0x4f, 0x6a, 0x54, 0x33, + 0x44, 0xc5, 0x3c, 0xd8, 0x38, 0xc4, 0x3b, 0xe6, 0x36, 0x89, 0x80, 0x51, 0x81, 0x48, 0x7e, 0xe2, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0xc0, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x0a, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x4a, 0x44, 0x53, 0x55, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x01, 0x9c, 0x4a, 0x51, 0x50, 0x2d, 0x30, 0x34, 0x4c, 0x57, + 0x42, 0x41, 0x32, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x31, 0x66, 0x6c, 0x05, 0x14, 0x46, 0xe5, + 0x00, 0x00, 0x0c, 0x98, 0x46, 0x45, 0x33, 0x34, 0x31, 0x30, 0x38, 0x38, 0x43, 0x30, 0x32, 0x34, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x30, 0x38, 0x32, 0x32, 0x20, 0x20, 0x08, 0x00, 0x00, 0x39, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "JDSU ", + "JQP-04LWBA2 ", + "FE341088C024 ", + SFF_40G_BASE_LR4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x42, 0x39, 0x32, 0x30, 0x32, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x39, 0x31, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x3a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10B9202 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xa4, 0x00, 0x00, 0x81, 0x43, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x96, 0x1d, 0xe5, 0x28, 0xfc, 0x1e, 0x76, 0x30, 0x05, 0x2e, 0x97, 0x30, 0xaf, + 0x41, 0x07, 0x1f, 0x47, 0x1f, 0x70, 0x20, 0x0c, 0x1d, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0xcc, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x4c, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x55, 0x4d, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x01, 0x9c, 0x4c, 0x51, 0x32, 0x31, 0x30, 0x43, 0x52, 0x2d, + 0x43, 0x41, 0x41, 0x31, 0x20, 0x20, 0x20, 0x20, 0x30, 0x31, 0x66, 0x6c, 0x05, 0x14, 0x00, 0x96, + 0x06, 0x0f, 0xff, 0xfa, 0x46, 0x46, 0x34, 0x32, 0x35, 0x30, 0x35, 0x30, 0x30, 0x30, 0x31, 0x39, + 0x2d, 0x51, 0x20, 0x20, 0x31, 0x35, 0x31, 0x32, 0x30, 0x32, 0x20, 0x20, 0x0c, 0x18, 0x67, 0x48, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "LUMENTUM ", + "LQ210CR-CAA1 ", + "FF4250500019-Q ", + SFF_100G_CWDM4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x45, 0x42, 0x30, 0x34, 0x39, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x31, 0x31, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10EB049 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x17, 0x00, 0x00, 0x7f, 0x46, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0xa9, 0x1c, 0x81, 0x1c, 0x4a, 0x1d, 0xf0, 0x0f, 0xfb, 0x0f, 0x8e, 0x0f, 0x90, + 0x0f, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0xcc, 0x23, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x20, 0x20, 0x20, 0x20, 0x1f, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x34, 0x32, 0x35, 0x51, + 0x42, 0x31, 0x43, 0x31, 0x30, 0x20, 0x20, 0x20, 0x41, 0x31, 0x00, 0x00, 0x00, 0x00, 0x46, 0xb6, + 0x01, 0x07, 0xff, 0xde, 0x44, 0x55, 0x48, 0x30, 0x30, 0x37, 0x34, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x30, 0x32, 0x34, 0x20, 0x20, 0x08, 0x00, 0x67, 0x8d, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP ", + "FCBN425QB1C10 ", + "DUH0074 ", + SFF_100G_AOC_PROPERTIES, + 10, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x45, 0x42, 0x30, 0x34, 0x36, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x31, 0x31, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0x41, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10EB046 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x2d, 0x00, 0x00, 0x7f, 0x58, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x12, 0xf8, 0x12, 0x17, 0x17, 0x09, 0x0f, 0x2e, 0x8c, 0x56, 0x79, 0x8a, 0x7e, 0x21, + 0x84, 0xb5, 0x1f, 0x8d, 0x21, 0x25, 0x20, 0xa1, 0x23, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, + 0x11, 0xcd, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x64, 0x44, 0x45, 0x4c, 0x4c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x1f, 0x22, 0x33, 0x4d, 0x46, 0x58, 0x47, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x30, 0x66, 0x58, 0x01, 0x90, 0x46, 0x7a, + 0x03, 0x0f, 0xff, 0xda, 0x43, 0x4e, 0x30, 0x33, 0x4d, 0x46, 0x58, 0x47, 0x35, 0x36, 0x49, 0x30, + 0x30, 0x30, 0x31, 0x20, 0x31, 0x35, 0x30, 0x36, 0x31, 0x38, 0x20, 0x20, 0x0c, 0x10, 0x67, 0x9e, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xdf, 0x10, 0x01, 0x21, 0x41, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "DELL ", + "3MFXG ", + "CN03MFXG56I0001 ", + SFF_100G_BASE_LR4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x45, 0x42, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x31, 0x31, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10EB001 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x33, 0x4d, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x07, 0x08, 0x00, 0x21, 0x39, 0x51, 0x41, 0x30, 0x2d, 0x31, 0x31, 0x31, + 0x2d, 0x31, 0x32, 0x2d, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x31, 0x03, 0x05, 0x06, 0x0c, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x31, 0x30, 0x42, 0x39, 0x37, 0x36, 0x35, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x39, 0x31, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "3M Company ", + "9QA0-111-12-1.00", + "V10B9765 ", + SFF_40G_BASE_CR4_PROPERTIES, + 1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x89, 0x00, 0x00, 0x80, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x2c, 0x7a, 0x2c, 0x51, 0x23, 0x1a, 0x25, 0x43, 0x0d, 0xb3, 0x0d, 0x77, 0x0d, 0xc7, + 0x0d, 0x7f, 0x1a, 0xed, 0x1b, 0x3e, 0x1c, 0xa4, 0x1c, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x56, 0x41, 0x47, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x17, 0x6a, 0x41, 0x46, 0x42, 0x52, 0x2d, 0x37, 0x39, 0x45, + 0x51, 0x44, 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x31, 0x42, 0x68, 0x07, 0xd0, 0x46, 0xbe, + 0x00, 0x00, 0x0f, 0xde, 0x51, 0x44, 0x34, 0x39, 0x30, 0x37, 0x32, 0x38, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x31, 0x32, 0x30, 0x35, 0x20, 0x20, 0x08, 0x00, 0x00, 0x34, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "AVAGO ", + "AFBR-79EQDZ ", + "QD490728 ", + SFF_40G_BASE_SR4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x23, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xa0, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x1f, 0x78, 0xa7, 0x14, 0x4e, 0x44, 0x41, 0x41, 0x46, 0x46, 0x2d, 0x43, + 0x31, 0x30, 0x33, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x20, 0x07, 0x0b, 0x0d, 0x13, 0x55, 0x15, + 0x0b, 0x00, 0x00, 0x00, 0x41, 0x50, 0x46, 0x31, 0x35, 0x35, 0x30, 0x31, 0x30, 0x33, 0x34, 0x37, + 0x35, 0x46, 0x20, 0x20, 0x31, 0x35, 0x31, 0x32, 0x30, 0x38, 0x20, 0x20, 0x00, 0x00, 0x67, 0x3f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }, + .info = { + "Amphenol ", + "NDAAFF-C103 ", + "APF1550103475F ", + SFF_100G_BASE_CR4_PROPERTIES, + 3, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x68, 0x00, 0x00, 0x7f, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x34, 0x0f, 0x1c, 0xf3, 0x34, 0x57, 0x33, 0xcf, 0x0d, 0xd3, 0x0d, 0xf9, 0x0e, 0x03, + 0x0d, 0xdf, 0x26, 0xe6, 0x2d, 0xd3, 0x2d, 0xd8, 0x30, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0xcc, 0x0c, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x00, 0x00, 0x23, + 0x00, 0x00, 0x32, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x43, 0x39, 0x35, 0x35, 0x31, + 0x52, 0x45, 0x50, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x41, 0x30, 0x42, 0x68, 0x07, 0xd0, 0x00, 0x3c, + 0x02, 0x07, 0xff, 0xde, 0x58, 0x55, 0x39, 0x30, 0x54, 0x52, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x31, 0x30, 0x30, 0x36, 0x20, 0x20, 0x0c, 0x10, 0x67, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP ", + "FTLC9551REPM ", + "XU90TRP ", + SFF_100G_BASE_SR4_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x11, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x66, 0x00, 0x00, 0x7f, 0x45, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x21, 0x1b, 0x1f, 0x2d, 0x1f, 0xe5, 0x1f, 0xdb, 0x0f, 0x25, 0x0f, 0x19, 0x0f, 0x09, + 0x0e, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0xcc, 0x23, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x05, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x20, 0x20, 0x20, 0x20, 0x1f, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x34, 0x32, 0x35, 0x51, + 0x42, 0x31, 0x43, 0x30, 0x35, 0x20, 0x20, 0x20, 0x41, 0x31, 0x00, 0x00, 0x00, 0x00, 0x46, 0xb5, + 0x01, 0x07, 0xff, 0xde, 0x44, 0x55, 0x38, 0x30, 0x30, 0x33, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x30, 0x38, 0x32, 0x31, 0x20, 0x20, 0x08, 0x00, 0x67, 0x8e, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP ", + "FCBN425QB1C05 ", + "DU8003E ", + SFF_100G_AOC_PROPERTIES, + 5, + }, + }, + }, + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x10, 0x00, 0x00, 0x00, 0x20, 0x40, 0x0c, 0x80, 0x06, 0x67, 0x00, 0x00, 0x00, + 0x08, 0x03, 0x00, 0x1e, 0x4a, 0x44, 0x53, 0x55, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x01, 0x9c, 0x50, 0x4c, 0x52, 0x58, 0x50, 0x4c, 0x53, 0x43, + 0x53, 0x34, 0x33, 0x32, 0x32, 0x4e, 0x20, 0x20, 0x32, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0xfe, + 0x00, 0x1a, 0x00, 0x00, 0x43, 0x42, 0x34, 0x35, 0x55, 0x46, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x31, 0x31, 0x30, 0x33, 0x31, 0x20, 0x20, 0x68, 0xf0, 0x03, 0xd6, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "JDSU ", + "PLRXPLSCS4322N ", + "CB45UF001 ", + SFF_10G_BASE_SR_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x03, 0x04, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, + 0x08, 0x03, 0x00, 0x1e, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x58, 0x38, 0x35, 0x37, 0x31, + 0x44, 0x33, 0x42, 0x43, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0x48, + 0x00, 0x1a, 0x00, 0x00, 0x4d, 0x54, 0x38, 0x31, 0x54, 0x45, 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x35, 0x30, 0x33, 0x30, 0x34, 0x20, 0x20, 0x68, 0xf0, 0x03, 0xfd, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FTLX8571D3BCL ", + "MT81TEX ", + SFF_10G_BASE_SR_PROPERTIES, + -1, + }, + }, + }, + { + { + .eeprom = { + 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x78, 0x00, 0x00, 0x7f, 0x19, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x89, 0x0d, 0x70, 0xb6, 0x51, 0x1b, 0x7e, 0x8a, 0x51, 0x40, 0x44, 0x62, 0x4f, 0x4f, + 0x4a, 0xe3, 0x46, 0x41, 0x45, 0xc9, 0x49, 0x6e, 0x49, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x0d, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x01, 0x46, + 0x00, 0x00, 0x00, 0x40, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, + 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x34, 0x43, 0x33, 0x51, 0x45, + 0x31, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x31, 0x65, 0xa4, 0x05, 0x14, 0x46, 0xde, + 0x00, 0x01, 0x0c, 0xd8, 0x55, 0x54, 0x4e, 0x30, 0x51, 0x38, 0x34, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x31, 0x36, 0x30, 0x33, 0x31, 0x30, 0x20, 0x20, 0x08, 0x00, 0x00, 0x5c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .info = { + "FINISAR CORP. ", + "FTL4C3QE1C ", + "UTN0Q84 ", + SFF_40G_BASE_LM4_PROPERTIES, + -1, + }, + }, + }, + +#endif /** SFF_CONFIG_INCLUDE_DATABASE */ + }; + +int +sff_db_get(sff_db_entry_t** entries, int* count) +{ + *entries = sff_database__; + *count = AIM_ARRAYSIZE(sff_database__); + return *count; +} + +int +sff_db_get_type(sff_eeprom_t* se, sff_module_type_t type) +{ + int i; + sff_db_entry_t* entry; + for(i = 0; i < AIM_ARRAYSIZE(sff_database__); i++) { + entry = sff_database__ + i; + if(se->info.module_type == type) { + memcpy(se, &entry->se, sizeof(*se)); + return 1; + } + } + return 0; +} + +int +sff_db_entry_struct(sff_eeprom_t* se, aim_pvs_t* pvs) +{ + int i, j; + aim_printf(pvs, " {\n"); + aim_printf(pvs, " {\n"); + aim_printf(pvs, " .eeprom = {\n"); + for(i = 0; i < 16; i++) { + aim_printf(pvs, " "); + for(j = 0; j < 16; j++) { + aim_printf(pvs, "0x%.2x, ", se->eeprom[i*16+j]); + } + aim_printf(pvs, "\n"); + } + aim_printf(pvs, " },\n"); + aim_printf(pvs, " .info = {\n"); + aim_printf(pvs, " \"%s\",\n", se->info.vendor); + aim_printf(pvs, " \"%s\",\n", se->info.model); + aim_printf(pvs, " \"%s\",\n", se->info.serial); + aim_printf(pvs, " SFF_%s_PROPERTIES,\n", + sff_module_type_name(se->info.module_type)); + aim_printf(pvs, " %d,\n", se->info.length); + aim_printf(pvs, " },\n"); + aim_printf(pvs, " },\n"); + aim_printf(pvs, " },\n"); + return 0;} diff --git a/packages/base/any/onlp/src/sff/module/src/sff_enums.c b/packages/base/any/onlp/src/sff/module/src/sff_enums.c index d3a4ed30..d748d162 100644 --- a/packages/base/any/onlp/src/sff/module/src/sff_enums.c +++ b/packages/base/any/onlp/src/sff/module/src/sff_enums.c @@ -137,6 +137,7 @@ aim_map_si_t sff_module_type_map[] = { "40G_BASE_CR4", SFF_MODULE_TYPE_40G_BASE_CR4 }, { "40G_BASE_SR4", SFF_MODULE_TYPE_40G_BASE_SR4 }, { "40G_BASE_LR4", SFF_MODULE_TYPE_40G_BASE_LR4 }, + { "40G_BASE_LM4", SFF_MODULE_TYPE_40G_BASE_LM4 }, { "40G_BASE_ACTIVE", SFF_MODULE_TYPE_40G_BASE_ACTIVE }, { "40G_BASE_CR", SFF_MODULE_TYPE_40G_BASE_CR }, { "40G_BASE_SR2", SFF_MODULE_TYPE_40G_BASE_SR2 }, @@ -168,6 +169,7 @@ aim_map_si_t sff_module_type_desc_map[] = { "40GBASE-CR4", SFF_MODULE_TYPE_40G_BASE_CR4 }, { "40GBASE-SR4", SFF_MODULE_TYPE_40G_BASE_SR4 }, { "40GBASE-LR4", SFF_MODULE_TYPE_40G_BASE_LR4 }, + { "40GBASE-LM4", SFF_MODULE_TYPE_40G_BASE_LM4 }, { "40GBASE-ACTIVE", SFF_MODULE_TYPE_40G_BASE_ACTIVE }, { "40GBASE-CR", SFF_MODULE_TYPE_40G_BASE_CR }, { "40GBASE-SR2", SFF_MODULE_TYPE_40G_BASE_SR2 }, diff --git a/packages/base/any/onlp/src/sff/sff.mk b/packages/base/any/onlp/src/sff/sff.mk index 9770d2c8..cfe22be5 100644 --- a/packages/base/any/onlp/src/sff/sff.mk +++ b/packages/base/any/onlp/src/sff/sff.mk @@ -3,12 +3,12 @@ # # Inclusive Makefile for the sff module. # -# Autogenerated 2016-03-23 18:28:25.869697 +# Autogenerated 2016-05-17 17:43:05.843123 # ############################################################################### sff_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -include $(sff_BASEDIR)/module/make.mk -include $(sff_BASEDIR)/module/auto/make.mk -include $(sff_BASEDIR)/module/src/make.mk -include $(sff_BASEDIR)/utest/_make.mk +include $(sff_BASEDIR)module/make.mk +include $(sff_BASEDIR)module/auto/make.mk +include $(sff_BASEDIR)module/src/make.mk +include $(sff_BASEDIR)utest/_make.mk diff --git a/packages/base/any/onlp/src/sff/utest/main.c b/packages/base/any/onlp/src/sff/utest/main.c index 8152fa9b..acf6593d 100644 --- a/packages/base/any/onlp/src/sff/utest/main.c +++ b/packages/base/any/onlp/src/sff/utest/main.c @@ -10,1044 +10,95 @@ #include #include #include - -typedef struct { - sff_info_t info; -} eeprom_verify_t; - - -static eeprom_verify_t data[] = - { - { - { - { - 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x01, 0x20, 0x40, 0x0c, 0x05, 0x01, 0x15, 0x00, 0x00, 0x00, - 0x1e, 0x0f, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x52, 0x4a, 0x38, 0x35, 0x31, 0x39, - 0x50, 0x31, 0x42, 0x4e, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0x66, - 0x00, 0x12, 0x00, 0x00, 0x50, 0x38, 0x4a, 0x32, 0x5a, 0x4e, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x30, 0x35, 0x31, 0x30, 0x33, 0x31, 0x20, 0x20, 0x58, 0x90, 0x01, 0x74, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "FINISAR CORP. ", - "FTRJ8519P1BNL ", - "P8J2ZNC ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_1G_BASE_SX, - "1GBASE-SX", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_1G, - -1, - }, - }, - /* Amphenol 10GBASE-CR */ - { - /* sff info */ - { - /* eeprom */ - { - 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x41, 0x50, 0x48, 0x35, 0x37, 0x31, 0x35, 0x34, 0x30, 0x30, 0x30, - 0x37, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xfa, - 0x00, 0x00, 0x00, 0x00, 0x41, 0x50, 0x46, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x37, 0x30, 0x31, - 0x34, 0x37, 0x20, 0x20, 0x31, 0x30, 0x30, 0x33, 0x30, 0x32, 0x20, 0x20, 0x00, 0x00, 0x00, 0xa9, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - - "Amphenol ", - "571540007 ", - "APF10080070147 ", - - /* sfp_type */ - SFF_SFP_TYPE_SFP, - "SFP", - - /* module_type */ - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - - /* media_type */ - SFF_MEDIA_TYPE_COPPER, - "Copper", - - /* caps */ - SFF_MODULE_CAPS_F_10G, - - /* Length */ - 0x1 - }, - }, - /* CISCO-MOLEX */ - { - /* sff_info */ - { - /* eeprom */ - { - 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x4d, 0x4f, 0x4c, 0x45, 0x58, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x09, 0x3a, 0x37, 0x34, 0x37, 0x35, 0x32, 0x2d, 0x39, 0x35, - 0x31, 0x39, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x20, 0x20, 0x01, 0x00, 0x00, 0x11, - 0x00, 0x00, 0x00, 0x00, 0x4d, 0x4f, 0x43, 0x31, 0x35, 0x34, 0x37, 0x30, 0x30, 0x30, 0x48, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x31, 0x31, 0x31, 0x32, 0x31, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8f, - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0xf9, 0x8e, 0x5a, - 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x34, 0x4a, 0x41, 0x42, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, - 0x30, 0x2d, 0x30, 0x33, 0x56, 0x30, 0x33, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xcc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x31, 0x4d, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "CISCO-MOLEX ", - "74752-9519 ", - "MOC1547000H ", - - /* sfp_type */ - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 0x1, - }, - }, - /* Unknown */ - { - /* sff_info */ - { - /* eeprom */ - { - 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x43, 0x39, 0x39, 0x39, 0x39, 0x2d, 0x31, 0x4d, - 0x2d, 0x50, 0x2d, 0x4c, 0x43, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xa1, - 0x00, 0x00, 0x00, 0x00, 0x31, 0x33, 0x30, 0x35, 0x33, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x34, 0x31, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x1d, - 0x00, 0x00, 0x11, 0xb6, 0x7f, 0x7f, 0x08, 0x96, 0xee, 0x8e, 0x60, 0x37, 0xb4, 0xc8, 0x8b, 0x88, - 0x66, 0x9c, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xdd, 0x56, 0xe8, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - " ", - "C9999-1M-P-LC ", - "1305300041 ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 0x0, - }, - }, - /* CISCO-MOLEX */ - { - { - { - 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x4d, 0x4f, 0x4c, 0x45, 0x58, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x09, 0x3a, 0x37, 0x34, 0x37, 0x35, 0x32, 0x2d, 0x39, 0x35, - 0x32, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x20, 0x20, 0x01, 0x00, 0x00, 0x0b, - 0x00, 0x00, 0x00, 0x00, 0x4d, 0x4f, 0x43, 0x31, 0x36, 0x30, 0x33, 0x30, 0x42, 0x48, 0x34, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x31, 0x31, 0x39, 0x20, 0x20, 0x00, 0x00, 0x00, 0xa5, - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x04, 0x3b, 0x5b, - 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x36, 0x4a, 0x41, 0x42, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, - 0x31, 0x2d, 0x30, 0x33, 0x56, 0x30, 0x33, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xcf, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x33, 0x4d, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "CISCO-MOLEX ", - "74752-9520 ", - "MOC16030BH4 ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 0x3 - }, - }, - /* OEM */ - { - { - { - 0x00, 0x80, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x0d, 0x33, 0x0c, 0xcb, 0x0c, 0xcb, 0x0d, 0x33, 0x1b, 0xd5, 0x1b, 0x54, 0x18, 0xcd, 0x1c, - 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x4f, 0x45, 0x4d, 0x20, 0x20, - 0x0d, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, - 0x0a, 0x03, 0x00, 0x00, 0x4f, 0x45, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x07, 0x00, 0x1e, 0x00, 0x51, 0x53, 0x46, 0x50, 0x2d, 0x34, 0x30, 0x47, - 0x2d, 0x53, 0x52, 0x34, 0x20, 0x20, 0x20, 0x20, 0x31, 0x41, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x0c, - 0x00, 0x00, 0x00, 0xde, 0x41, 0x43, 0x52, 0x34, 0x30, 0x47, 0x30, 0x30, 0x34, 0x31, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x30, 0x38, 0x32, 0x37, 0x31, 0x39, 0x08, 0x00, 0x00, 0x8a, - 0x00, 0x00, 0x11, 0x9d, 0xf1, 0x68, 0x34, 0xac, 0xb2, 0x3d, 0xc6, 0x19, 0x53, 0x0b, 0xbf, 0xf0, - 0x2e, 0xe1, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0xfe, 0x58, 0x27, - }, - "OEM ", - "QSFP-40G-SR4 ", - "ACR40G0041 ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE-SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - -1, - }, - }, - { - { - { - 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0d, 0x00, 0x23, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0xa0, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x78, 0xa7, 0x14, 0x36, 0x30, 0x33, 0x30, 0x32, 0x30, 0x30, 0x30, - 0x33, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x20, 0x07, 0x0b, 0x00, 0x00, 0x46, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x41, 0x50, 0x46, 0x31, 0x33, 0x30, 0x32, 0x30, 0x30, 0x33, 0x35, 0x41, - 0x52, 0x56, 0x20, 0x20, 0x31, 0x33, 0x30, 0x31, 0x31, 0x35, 0x20, 0x20, 0x00, 0x00, 0x00, 0xf9, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "Amphenol ", - "603020003 ", - "APF13020035ARV ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_CR4, - "40GBASE-CR4", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_40G, - 0x3 - }, - }, - /* Fiberstore */ - { - { - { - 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x46, 0x69, 0x62, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x40, 0x20, 0x31, 0x30, 0x47, 0x53, 0x46, 0x50, 0x2d, 0x50, - 0x43, 0x2d, 0x33, 0x30, 0x2d, 0x31, 0x20, 0x20, 0x41, 0x30, 0x20, 0x20, 0x00, 0x00, 0x00, 0xd9, - 0x00, 0x00, 0x00, 0x00, 0x46, 0x53, 0x34, 0x30, 0x32, 0x31, 0x32, 0x44, 0x30, 0x31, 0x37, 0x36, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x30, 0x32, 0x31, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8f, - 0x00, 0x00, 0x11, 0x4b, 0xd4, 0xe4, 0xc5, 0x99, 0xd1, 0xfb, 0xdb, 0x5e, 0xa2, 0xc4, 0x62, 0x0c, - 0xf2, 0x5b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0xfa, 0x99, - 0x43, 0x4f, 0x50, 0x51, 0x41, 0x41, 0x34, 0x4a, 0x41, 0x41, 0x33, 0x37, 0x2d, 0x30, 0x39, 0x36, - 0x30, 0x2d, 0x30, 0x32, 0x56, 0x30, 0x32, 0x20, 0x01, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0xc9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x46, 0x50, 0x2d, 0x48, 0x31, 0x30, 0x47, 0x42, 0x2d, 0x43, 0x55, 0x31, 0x4d, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "FiberStore ", - "10GSFP-PC-30-1 ", - "FS40212D0176 ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 0x1, - }, - }, - /* - * Finisar FTLX1871M3BCL, see PAN-1005 - * http://www.finisar.com/products/optical-modules/sfp-plus/FTLX1871M3BCL - * http://www.quagwire.com/ftlx1871m3bcl/ - * XXX roth -- from my reading, this is a 10GBASE-ZR module - */ - { - { - { - 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x06, 0x67, 0x00, 0x50, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x58, 0x31, 0x38, 0x37, 0x31, - 0x4d, 0x33, 0x42, 0x43, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x06, 0x0e, 0x00, 0x33, - 0x06, 0x1a, 0x00, 0x00, 0x55, 0x50, 0x47, 0x30, 0x31, 0x57, 0x4a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x34, 0x32, 0x39, 0x20, 0x20, 0x68, 0xf0, 0x05, 0xfe, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "FINISAR CORP. ", - "FTLX1871M3BCL ", - "UPG01WJ ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_ZR, - "1GBASE-ZR", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_10G, - -1, - }, - }, - /* - * Finisar FTLX8570D3BCL, see PAN-1006 - * http://www.finisar.com/products/optical-modules/sfp-plus/FTLX1671D3BCL - * http://www.quagwire.com/ftlx8570d3bcl/ - * XXX roth -- from my reading, this is a 10GBASE-SR-lite - */ - { - { - { - 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, - 0x03, 0x01, 0x00, 0x0a, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x4c, 0x58, 0x38, 0x35, 0x37, 0x30, - 0x44, 0x33, 0x42, 0x43, 0x4c, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x03, 0x52, 0x00, 0x1c, - 0x00, 0x1a, 0x00, 0x00, 0x50, 0x50, 0x34, 0x34, 0x51, 0x56, 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x32, 0x31, 0x37, 0x20, 0x20, 0x68, 0xf0, 0x03, 0xe3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "FINISAR CORP. ", - "FTLX8570D3BCL ", - "PP44QV1 ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_SRL, - "1GBASE-SRL", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_10G, - -1, - }, - }, - /* - * Finisar FTRJ1319P1BTL-MD, see PAN-1011 - * http://www.technodirect.com/finisarsfp2125gb1310nm10kmlongwavetransceiverftrj1319p1btl-md.aspx - * XXX roth -- from my reading, this is a 1GBASE-LX optic - * (10km) but it supports 2G FC. - */ - { - { - { - 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x02, 0x12, 0x10, 0x01, 0x05, 0x01, 0x15, 0x00, 0x0a, 0x64, - 0x00, 0x00, 0x00, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x54, 0x52, 0x4a, 0x31, 0x33, 0x31, 0x39, - 0x50, 0x31, 0x42, 0x54, 0x4c, 0x2d, 0x4d, 0x44, 0x41, 0x20, 0x20, 0x20, 0x05, 0x1e, 0x00, 0x88, - 0x00, 0x1a, 0x00, 0x00, 0x50, 0x44, 0x42, 0x31, 0x56, 0x51, 0x55, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x30, 0x38, 0x30, 0x33, 0x31, 0x37, 0x20, 0x20, 0x68, 0xb0, 0x01, 0xc9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "FINISAR CORP. ", - "FTRJ1319P1BTL-MD", - "PDB1VQU ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_1G_BASE_LX, - "1GBASE-LR", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_1G, - -1, - }, - }, - /* - * Juniper/Tyco 10G CR, see PAN-934 - * - */ - { - { - { - 0x03, 0x04, 0x21, 0x81, 0x00, 0x00, 0x04, 0x41, 0x04, 0x80, 0xd5, 0x00, 0x67, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x54, 0x79, 0x63, 0x6f, 0x20, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x6f, - 0x6e, 0x69, 0x63, 0x73, 0x00, 0x00, 0x40, 0x20, 0x32, 0x31, 0x30, 0x30, 0x38, 0x37, 0x30, 0x2d, - 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8a, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x39, 0x33, 0x35, 0x45, 0x30, 0x34, 0x38, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x35, 0x30, 0x39, 0x30, 0x30, 0x00, 0x00, 0x00, 0x41, - 0x37, 0x34, 0x30, 0x2d, 0x30, 0x33, 0x30, 0x30, 0x37, 0x36, 0x20, 0x52, 0x45, 0x56, 0x20, 0x30, - 0x31, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "Tyco Electronics", - "2100870-1 ", - "0935E048 ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 1, - }, - }, - /* - * QSFP+ 40G-bidi - */ - { - { - { - /* 0 */ 0x0d, 0x00, 0x02, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 16 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 32 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 48 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 64 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 80 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 128 */ 0x0d, 0xdc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xce, 0x00, 0x00, 0x32, - /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x2d, 0x41, 0x56, 0x41, 0x47, 0x4f, 0x20, - /* 160 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x17, 0x6a, 0x41, 0x46, 0x42, 0x52, 0x2d, 0x37, 0x39, 0x45, - /* 176 */ 0x42, 0x50, 0x5a, 0x2d, 0x43, 0x53, 0x31, 0x20, 0x30, 0x31, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x47, - /* 192 */ 0x00, 0x00, 0x0f, 0xde, 0x41, 0x56, 0x4d, 0x31, 0x38, 0x30, 0x39, 0x53, 0x30, 0x54, 0x47, 0x20, - /* 208 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x30, 0x32, 0x32, 0x35, 0x20, 0x20, 0x08, 0x00, 0xf5, 0xcc, - /* 224 */ 0xf5, 0x00, 0x06, 0xd2, 0x04, 0x9c, 0x47, 0x09, 0xc5, 0xaf, 0xcf, 0xb7, 0x65, 0xd9, 0x72, 0x03, - /* 240 */ 0xea, 0x59, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x45, 0xbd, 0x94, - }, - "CISCO-AVAGO ", - "AFBR-79EBPZ-CS1 ", - "AVM1809S0TG ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR2, - "40GBASE-SR2", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - -1, - }, - }, - /* Cisco/Finisar 40G QSFP (QuadWire? AOC? Pigtail?) */ - { - { - { - /* 0x0000 */ 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xde, 0x00, 0x00, 0x7f, 0x4d, 0x00, 0x00, 0x00, 0x00, - /* 0x0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, - /* 0x0080 */ 0x0d, 0x10, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x00, 0x32, - /* 0x0090 */ 0x1e, 0x00, 0x0a, 0x00, 0x43, 0x49, 0x53, 0x43, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - /* 0x00a0 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x34, 0x31, 0x30, 0x51, - /* 0x00b0 */ 0x45, 0x32, 0x43, 0x31, 0x30, 0x2d, 0x43, 0x31, 0x41, 0x20, 0x42, 0x68, 0x07, 0xd0, 0x46, 0xaf, - /* 0x00c0 */ 0x00, 0x01, 0x04, 0xd8, 0x46, 0x49, 0x53, 0x31, 0x37, 0x33, 0x31, 0x30, 0x30, 0x35, 0x33, 0x2d, - /* 0x00d0 */ 0x41, 0x20, 0x20, 0x20, 0x31, 0x33, 0x30, 0x37, 0x33, 0x31, 0x20, 0x20, 0x0a, 0x00, 0xf6, 0x90, - /* 0x00e0 */ 0x00, 0x00, 0x02, 0x43, 0x59, 0xd3, 0x68, 0x03, 0x46, 0x83, 0x87, 0x75, 0x1f, 0xee, 0x94, 0x62, - /* 0x00f0 */ 0xb8, 0x98, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5e, 0x75, 0x43, - }, - "CISCO ", - "FCBN410QE2C10-C1", - "FIS17310053-A ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - /* XXX roth -- FIXME */ - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE-SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - -1, - }, - }, - /* - * Dell/Amphenol 3M copper - * Identifies as intra-enclosure and inter-enclosure - */ - { - { - { - /* 0000 */ 0x03, 0x04, 0x21, 0x01, 0x00, 0x00, 0x00, 0x41, 0x84, 0x80, 0x55, 0x00, 0x67, 0x00, 0x00, 0x00, - /* 0010 */ 0x00, 0x00, 0x03, 0x00, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, 0x20, 0x20, 0x20, 0x20, - /* 0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x78, 0xa7, 0x14, 0x36, 0x31, 0x36, 0x37, 0x34, 0x30, 0x30, 0x30, - /* 0030 */ 0x33, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0xe3, - /* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x43, 0x4e, 0x30, 0x35, 0x33, 0x48, 0x56, 0x4e, 0x34, 0x34, 0x4c, 0x38, - /* 0050 */ 0x37, 0x59, 0x59, 0x20, 0x31, 0x34, 0x30, 0x34, 0x32, 0x33, 0x20, 0x20, 0x00, 0x00, 0x00, 0x78, - /* 0060 */ 0x0f, 0x10, 0x00, 0xa3, 0x71, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "Amphenol ", - "616740003 ", - "CN053HVN44L87YY ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 3, - }, - }, - /* - * Dell/Amphenol 3M copper - * Identifies as intra-enclosure and inter-enclosure - */ - { - { - { - /* 0x0000 */ 0x03, 0x04, 0x21, 0x02, 0x00, 0x00, 0x04, 0x41, 0x84, 0x80, 0xd5, 0x00, 0x67, 0x00, 0x00, 0x00, - /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x33, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - /* 0x0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x31, 0x34, 0x31, 0x30, 0x2d, 0x50, 0x31, 0x37, - /* 0x0030 */ 0x2d, 0x30, 0x30, 0x2d, 0x33, 0x2e, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1c, - /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x30, 0x32, 0x32, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, - /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0080 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0090 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "3M ", - "1410-P17-00-3.00", - /* XXX roth -- NULL serial number ??!??111! */ - " ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 3, - }, - }, - { - { - { - 0x0d, 0x03, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x14, 0x21, 0x00, 0x00, 0x83, 0x2c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, - 0x0c, 0x04, 0x00, 0x00, 0x00, 0x40, 0x40, 0x06, 0x00, 0x05, - 0x64, 0x00, 0x00, 0x32, 0x1e, 0x00, 0x00, 0x00, 0x45, 0x64, - 0x67, 0x65, 0x2d, 0x63, 0x6f, 0x72, 0x45, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x04, 0x70, 0x72, 0xcf, 0x4d, 0x30, - 0x4f, 0x45, 0x43, 0x36, 0x34, 0x30, 0x31, 0x54, 0x30, 0x30, - 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x68, 0x07, 0xd0, - 0x46, 0xb0, 0x00, 0x00, 0x00, 0x12, 0x31, 0x45, 0x37, 0x51, - 0x54, 0x30, 0x30, 0x30, 0x33, 0x30, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x31, 0x34, 0x30, 0x37, 0x32, 0x38, 0x20, 0x20, - 0x08, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "Edge-corE ", - "M0OEC6401T00Z ", - "1E7QT00030 ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE_SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - -1, - } - }, - { - { - { - 0x0d, 0x03, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x30, 0x00, 0x00, 0x82, 0xa2, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, - 0x0c, 0x04, 0x00, 0x00, 0x00, 0x40, 0x40, 0x06, 0x00, 0x05, - 0x64, 0x00, 0x00, 0x32, 0x1e, 0x00, 0x00, 0x00, 0x45, 0x64, - 0x67, 0x65, 0x2d, 0x63, 0x6f, 0x72, 0x45, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x04, 0x70, 0x72, 0xcf, 0x4d, 0x30, - 0x4f, 0x45, 0x43, 0x36, 0x34, 0x30, 0x31, 0x54, 0x30, 0x30, - 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x68, 0x07, 0xd0, - 0x46, 0xb0, 0x00, 0x00, 0x00, 0x12, 0x31, 0x45, 0x37, 0x51, - 0x54, 0x30, 0x30, 0x30, 0x32, 0x38, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x31, 0x34, 0x30, 0x37, 0x32, 0x38, 0x20, 0x20, - 0x08, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - "Edge-corE ", - "M0OEC6401T00Z ", - "1E7QT00028 ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE_SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - -1, - } - }, - { - { - { - 0x0d, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x9f, 0x00, 0x00, 0x80, 0x29, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x44, 0xd5, 0x44, 0x3a, 0x48, 0xb1, - 0x4d, 0x30, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x8c, - 0x23, 0x04, 0x00, 0x00, 0x01, 0x40, 0x40, 0x02, 0x00, 0x05, - 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x46, 0x4f, - 0x52, 0x4d, 0x45, 0x52, 0x49, 0x43, 0x41, 0x4f, 0x45, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x04, 0x00, 0x00, 0x00, 0x54, 0x51, - 0x53, 0x2d, 0x51, 0x31, 0x4c, 0x48, 0x38, 0x2d, 0x58, 0x43, - 0x41, 0x31, 0x30, 0x20, 0x00, 0x00, 0x42, 0x68, 0x07, 0xd0, - 0x46, 0x4a, 0x00, 0x00, 0x05, 0x31, 0x39, 0x31, 0x33, 0x33, - 0x32, 0x4c, 0x30, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x31, 0x33, 0x30, 0x38, 0x30, 0x36, 0x20, 0x20, - 0x08, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, - 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf7, 0xf7, 0xf7, - 0xf7, 0xf7, 0xf7, 0xf7, 0xfe, 0xfe, - }, - "FORMERICAOE ", - "TQS-Q1LH8-XCA10 ", - "91332L0001 ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE_SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - 10, - }, - }, - { - /* - * PAN-1233 -- 10G IBM-Amphenol cable - */ - { - { - /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, - /* - * ^^^^ copper pigtail - * - * ^^^^ no 10G or IB codes - * - * ^^^^ ^^^^ no SONET (fiber) - * - * identifies as 1000BASE-CX ^^^^ - * - * no FC length code ^^^^ - * - * identifies as SFP+ passive ^^^^ - * - * no FC media, copper or otherwise ^^^^ - * - * no FC speed ^^^^ - * - * nominal bitrate 0x67 --> 10.3GB ^^^^ - */ - /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x49, 0x42, 0x4d, 0x2d, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, - /* - * ^^^^ copper cable length (3m) - */ - /* 0x0020 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x17, 0xef, 0x39, 0x30, 0x59, 0x39, 0x34, 0x32, 0x38, 0x2d, - /* 0x0030 */ 0x4e, 0x32, 0x38, 0x35, 0x30, 0x30, 0x41, 0x20, 0x46, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x7a, - /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x59, 0x33, 0x35, 0x30, 0x56, 0x54, 0x32, 0x42, 0x52, 0x31, 0x46, 0x47, - /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x31, 0x31, 0x32, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x0d, - /* 0x0060 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "IBM-Amphenol ", - "90Y9428-N28500A ", - "Y350VT2BR1FG ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 3, - }, - }, - { - /* Verify string normalization for unprintable characters in the vendor, model, or serial number fields. */ - { - { - /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, - /* 0x0010 */ 0x00, 0x00, 0x03, 0x00, 0x49, 0x42, 0x4d, 0x2d, 0x41, 0x6d, 0x70, 0x68, 0x65, 0x6e, 0x6f, 0x6c, - /* 0x0020 */ 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x17, 0xef, 0x39, 0x30, 0x59, 0x39, 0x34, 0x32, 0x38, 0xFd, - /* 0x0030 */ 0x4e, 0x32, 0x38, 0x35, 0x30, 0x30, 0x41, 0x20, 0x46, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x8a, - /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x59, 0x33, 0xF5, 0xF0, 0x56, 0x54, 0x32, 0x42, 0x52, 0x31, 0x46, 0x47, - /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x31, 0x31, 0x32, 0x37, 0x20, 0x20, 0x00, 0x00, 0x00, 0x8d, - /* 0x0060 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0070 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0080 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x0090 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00a0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00b0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00c0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00d0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00e0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* 0x00f0 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - "IBM-Amphenol????", - "90Y9428?N28500A ", - "Y3??VT2BR1FG ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_CR, - "10GBASE-CR", - SFF_MEDIA_TYPE_COPPER, - "Copper", - SFF_MODULE_CAPS_F_10G, - 3, - }, - }, - { - /* - * Finisar 40G AOC breakout cable - */ - { - { - /* 0x0000 */ 0x0d, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x9f, 0x00, 0x00, 0x80, 0xc2, 0x00, 0x00, 0x00, 0x00, - /* 0x0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0050 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, - - /* 0x0080 */ 0x0d, 0x10, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x67, 0x00, 0x00, 0x00, - /* - * ^^^^ QSFP+ - * - * ^^^^ no separable connector (active?) - * - * ^^^^^ no media compliance (*NOT* 40G active) - * - * ^^^^ no SONET compliance - * - * ^^^^ no SAS compliance - * - * ^^^^ no GbE compliance - * - * ^^^^ ^^^^ no FC compliance - * - * ^^^^ no FC media - * - * ^^^^ no FC speed - * - * ^^^^ 64b66b - * - * ^^^^ nominal BR >= 10G - * no SM or OM3 length ^^^^ ^^^^ - */ - /* 0x0090 */ 0x00, 0x00, 0x03, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - /* - * ^^^^ ^^^^ no OM1 or OM2 length - * - * ^^^^ 3M cable (copper or active) - */ - /* 0x00a0 */ 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x35, 0x31, 0x30, 0x51, - /* 0x00b0 */ 0x45, 0x32, 0x43, 0x30, 0x33, 0x20, 0x20, 0x20, 0x41, 0x20, 0x42, 0x68, 0x07, 0xd0, 0x46, 0x29, - /* - * ^^^^ ^^^^ 850nm - */ - /* 0x00c0 */ 0x00, 0x01, 0x04, 0xd8, 0x44, 0x53, 0x4b, 0x30, 0x34, 0x56, 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, - /* 0x00d0 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x31, 0x31, 0x30, 0x34, 0x20, 0x20, 0x08, 0x00, 0xf6, 0x54, - /* 0x00e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - "FINISAR CORP ", - "FCBN510QE2C03 ", - "DSK04VR ", - SFF_SFP_TYPE_QSFP_PLUS, - "QSFP+", - SFF_MODULE_TYPE_40G_BASE_SR4, - "40GBASE-SR4", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_40G, - 3, - }, - }, - { - /* - * Finisar 40G AOC breakout cable, 10G end - */ - { - { - /* 0x0000 */ 0x03, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x06, 0x67, 0x00, 0x00, 0x00, - /* - * ^^^^ SFP+ - * - * ^^^^ copper pigtail (ugh) - * - * ^^^^ no 10G or IF compliance - * - * ^^^^ no SONET compliance - * - * ^^^^ no OC length spec - * - * ^^^^ no ethernet compliance - * - * ^^^^ no FC length or tech - * - * ^^^^ active cable, no FC tech - * - * ^^^^ no FC media - * - * ^^^^ no FC speed - * - * ^^^^ 64/66 encoding - * - * nominal BR >= 10G ^^^^ - * - * no SM length ^^^^ ^^^^ - */ - /* 0x0010 */ 0x00, 0x00, 0x01, 0x00, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x41, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x50, - /* - * ^^^^ ^^^^ no MM length - * - * ^^^^ active/copper length 1m - * - * ^^^^ no OM3 length - * - */ - /* 0x0020 */ 0x2e, 0x20, 0x20, 0x20, 0x00, 0x00, 0x90, 0x65, 0x46, 0x43, 0x42, 0x4e, 0x35, 0x31, 0x30, 0x51, - /* 0x0030 */ 0x45, 0x32, 0x43, 0x30, 0x31, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x20, 0x0c, 0x00, 0x00, 0xa9, - /* - * compliant with FC or SFF limiting ^^^^ ^^^^ - */ - /* 0x0040 */ 0x00, 0x12, 0x00, 0x00, 0x44, 0x53, 0x4a, 0x30, 0x35, 0x39, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - /* 0x0050 */ 0x20, 0x20, 0x20, 0x20, 0x31, 0x34, 0x31, 0x30, 0x33, 0x30, 0x20, 0x20, 0x00, 0x00, 0x05, 0x72, - /* 0x0060 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0080 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x0090 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00e0 */ 0x00, 0x7f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* 0x00f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, - }, - "FINISAR CORP. ", - "FCBN510QE2C01 ", - "DSJ059S ", - SFF_SFP_TYPE_SFP, - "SFP", - SFF_MODULE_TYPE_10G_BASE_SR, - "10GBASE-SR", - SFF_MEDIA_TYPE_FIBER, - "Fiber", - SFF_MODULE_CAPS_F_10G, - 1, - }, - }, - }; - +#include int aim_main(int argc, char* argv[]) { int i; - int first = 0; - int last = AIM_ARRAYSIZE(data)-1; - if(argv[1]) { - first = last = atoi(argv[1]); - } + sff_db_entry_t* entries; + sff_db_entry_t* p; + int count; - for(i = first; i <= last; i++) { + sff_db_get(&entries, &count); + + for(i = 0, p=entries; i < count; i++, p++) { int rv; - sff_info_t info; - eeprom_verify_t* p = data+i; + sff_eeprom_t se; aim_printf(&aim_pvs_stdout, "Verifying entry %d: %s:%s:%s...\n", i, - p->info.vendor, - p->info.model, - p->info.serial); + p->se.info.vendor, + p->se.info.model, + p->se.info.serial); - if( (rv=sff_info_init(&info, p->info.eeprom)) < 0) { - AIM_DIE("index=%d sff_info_init=%d\n", i, rv); + if( (rv=sff_eeprom_parse(&se, p->se.eeprom)) < 0) { + AIM_DIE("index=%d sff_eeprom_parse=%d\n", i, rv); } - if (!info.supported) { - AIM_DIE("index=%d supported=0\n", i); + if (!se.identified) { + AIM_DIE("index=%d identified=0\n", i); } - - if(strcmp(info.vendor, p->info.vendor)) { + if(strcmp(se.info.vendor, p->se.info.vendor)) { AIM_DIE("index=%d vendor expected '%s' got '%s'", - i, p->info.vendor, info.vendor); + i, p->se.info.vendor, se.info.vendor); } - if(strcmp(info.model, p->info.model)) { + if(strcmp(se.info.model, p->se.info.model)) { AIM_DIE("index=%d model expected '%s' got '%s'", - i, p->info.model, info.model); + i, p->se.info.model, se.info.model); } - if(strcmp(info.serial, p->info.serial)) { + if(strcmp(se.info.serial, p->se.info.serial)) { AIM_DIE("index=%d serial expected '%s' got '%s'", - i, p->info.serial, info.serial); + i, p->se.info.serial, se.info.serial); } - if(info.sfp_type != p->info.sfp_type) { + if(se.info.sfp_type != p->se.info.sfp_type) { AIM_DIE("index=%d sfp_type expected '%{sff_sfp_type}' got '%{sff_sfp_type}'", - i, p->info.sfp_type, info.sfp_type); + i, p->se.info.sfp_type, se.info.sfp_type); } - if(strcmp(info.sfp_type_name, p->info.sfp_type_name)) { + if(strcmp(se.info.sfp_type_name, p->se.info.sfp_type_name)) { AIM_DIE("index=%d type_name expected '%s' got '%s'", - i, p->info.sfp_type, info.sfp_type); + i, p->se.info.sfp_type, se.info.sfp_type); } - if(info.module_type != p->info.module_type) { + if(se.info.module_type != p->se.info.module_type) { AIM_DIE("index=%d module_type expected '%{sff_module_type}' got '%{sff_module_type}'", - i, p->info.module_type, info.module_type); + i, p->se.info.module_type, se.info.module_type); } - if(info.media_type != p->info.media_type) { + if(se.info.media_type != p->se.info.media_type) { AIM_DIE("index=%d media_type expected '%{sff_media_type}' got '%{sff_media_type}'\n", - i, p->info.media_type, info.media_type); + i, p->se.info.media_type, se.info.media_type); } - if(strcmp(info.media_type_name, p->info.media_type_name)) { + if(strcmp(se.info.media_type_name, p->se.info.media_type_name)) { AIM_DIE("index=%d media_type_name expected '%s' got '%s'", - i, p->info.media_type_name, info.media_type_name); + i, p->se.info.media_type_name, se.info.media_type_name); } - - if (info.caps != p->info.caps) { + if (se.info.caps != p->se.info.caps) { AIM_DIE("index=%d caps expected '%{sff_module_caps}' got '%{sff_module_caps}'", - i, p->info.caps, info.caps); + i, p->se.info.caps, se.info.caps); } - if(info.length != p->info.length) { + if(se.info.length != p->se.info.length) { AIM_DIE("index=%d length expected %d got %d", - i, p->info.length, info.length); + i, p->se.info.length, se.info.length); } - - if(info.length == -1 && info.length_desc[0]) { + if(se.info.length == -1 && se.info.length_desc[0]) { AIM_DIE("index=%d length_desc expected '%s' got '%s'", - i, '\0', info.length_desc); + i, '\0', se.info.length_desc); } - else if(info.length != -1) { + else if(se.info.length != -1) { char tmp[32]; - snprintf(tmp, sizeof(tmp), "%dm", info.length); - if(strcmp(tmp, info.length_desc)) { + snprintf(tmp, sizeof(tmp), "%dm", se.info.length); + if(strcmp(tmp, se.info.length_desc)) { AIM_DIE("index=%d length_desc expected '%s' got '%s'", - i, tmp, info.length_desc); + i, tmp, se.info.length_desc); } } aim_printf(&aim_pvs_stdout, "Verifying entry %d: %s:%s:%s...PASSED\n", i, - p->info.vendor, - p->info.model, - p->info.serial); + p->se.info.vendor, + p->se.info.model, + p->se.info.serial); } return 0; From f0fb870dc86168cd6a3faca95fdc88518b31e58b Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 17 May 2016 12:47:28 -0700 Subject: [PATCH 08/33] Init at INFO. --- tools/onlpm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/onlpm.py b/tools/onlpm.py index a3ff9a0c..d45b2e29 100755 --- a/tools/onlpm.py +++ b/tools/onlpm.py @@ -24,7 +24,7 @@ import lsb_release g_dist_codename = lsb_release.get_distro_information().get('CODENAME') -logger = onlu.init_logging('onlpm') +logger = onlu.init_logging('onlpm', logging.INFO) class OnlPackageError(Exception): """General Package Error Exception From 660fb3a7467d8c8558f337ba8e05770bf9c94dc5 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 18 May 2016 18:08:53 +0000 Subject: [PATCH 09/33] Use ONLPM_OPTION_REPO as the base local repository. --- builds/any/rootfs/jessie/standard/standard.yml | 4 ++-- builds/any/rootfs/wheezy/standard/standard.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/any/rootfs/jessie/standard/standard.yml b/builds/any/rootfs/jessie/standard/standard.yml index 4586c93f..7266fa7d 100644 --- a/builds/any/rootfs/jessie/standard/standard.yml +++ b/builds/any/rootfs/jessie/standard/standard.yml @@ -43,11 +43,11 @@ Multistrap: omitdebsrc: true Local-All: - source: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/binary-all + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all omitdebsrc: true Local-Arch: - source: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/binary-${ARCH} + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-${ARCH} omitdebsrc: true Configure: diff --git a/builds/any/rootfs/wheezy/standard/standard.yml b/builds/any/rootfs/wheezy/standard/standard.yml index 2ec2902d..f7f04c32 100644 --- a/builds/any/rootfs/wheezy/standard/standard.yml +++ b/builds/any/rootfs/wheezy/standard/standard.yml @@ -43,11 +43,11 @@ Multistrap: omitdebsrc: true Local-All: - source: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/binary-all + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all omitdebsrc: true Local-Arch: - source: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/binary-${ARCH} + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-${ARCH} omitdebsrc: true Configure: From 912602b697f0115b5110bad217395d424e27c42b Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:23:36 -0700 Subject: [PATCH 10/33] Set hostDir to None to skip cleanup --- .../vendor-config-onl/src/python/onl/install/InstallUtils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py index f2e2232f..830e042e 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py @@ -260,7 +260,9 @@ class MountContext(SubprocessMixin): cmd = ('umount', self.hostDir,) self.check_call(cmd, vmode=self.V1) - self.rmdir(self.hostDir) + if self.hostDir is not None: + self.rmdir(self.hostDir) + return False class BlkidEntry: From aacb668932e7d9f6f7307983218c0f5e0ca6aac9 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:24:38 -0700 Subject: [PATCH 11/33] Don't remount the filesystem if it is the root filesystem --- .../src/python/onl/mounts/__init__.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py b/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py index e5d8c9d0..68eda495 100755 --- a/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py @@ -28,12 +28,17 @@ class OnlMountManager(object): with open("/proc/mounts") as f: return directory in f.read() + def checkroot(self, dev): + pat = "%s / " % dev + with open("/proc/mounts") as f: + return pat in f.read() + def mount(self, device, directory, mode='r', timeout=5): self.logger.debug("Mounting %s -> %s %s" % (device, directory, mode)) try: subprocess.check_call("mount -%s %s %s" % (mode, device, directory), shell=True) - except subrocess.CalledProcessError, e: - self.logger("Mount failed: '%s'" % e.output) + except subprocess.CalledProcessError, e: + self.logger.error("Mount failed: '%s'" % e.output) return False # If requested, wait for the mount to complete. @@ -81,10 +86,14 @@ class OnlMountManager(object): self.logger.debug("%s @ %s" % (k, v['device'])) + isRoot = self.checkroot(v['device']) + # if this device is current the root device, + # ignore any umount/mount/fsck shenanigans + # # If its currently mounted we should unmount first. # - if self.checkmount(v['device']): + if not isRoot and self.checkmount(v['device']): self.logger.info("%s is currently mounted." % (k)) try: out = subprocess.check_output("umount %s" % v['device'], shell=True) @@ -100,7 +109,7 @@ class OnlMountManager(object): self.logger.debug("Overriding fsck settings for %s with %s" % (k, fsck)) v['fsck'] = fsck - if v.get('fsck', False): + if not isRoot and v.get('fsck', False): try: self.logger.info("Running fsck on %s [ %s ]..." % (k, v['device'])) cmd = "fsck.ext4 -p %s" % (v['device']) @@ -119,7 +128,7 @@ class OnlMountManager(object): v['mount'] = 'w' mount = v.get('mount', None) - if mount: + if not isRoot and mount: if mount in ['r', 'w']: self.mount(v['device'], v['dir'], mode=mount, timeout=v.get('timeout', 5)) else: From d72cfb61a0fdf1d4ea676937ab3d06440d5364d8 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:25:16 -0700 Subject: [PATCH 12/33] Added HostInfo parser to help with IPv6 addresses and authentiation creds --- .../src/python/onl/network/__init__.py | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/network/__init__.py b/packages/base/all/vendor-config-onl/src/python/onl/network/__init__.py index 9a2cd3e0..ebbcc196 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/network/__init__.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/network/__init__.py @@ -1,3 +1,82 @@ """__init__.py """ + +import subprocess + +class HostInfo: + + def __init__(self, host, + user=None, password=None, + port=None, + scope=None): + self.user = user + self.password = password + self.port = port + + if scope is None and host.startswith('fe80:'): + cmd = ('ip', '-6', '-oneline', 'route', 'show',) + for line in subprocess.check_output(cmd).splitlines(False): + words = line.split() + if words[0].startswith('fe80:'): + scope = words[2] + break + + if scope is not None: + self.host = host + '%' + scope + else: + self.host = host + + # try to canonicalize the scope + # add scope to host + # set bhost to bracketed host + + if ':' in host: + self.bhost = '[' + self.host + ']' + else: + self.bhost = self.host + + @classmethod + def fromString(cls, hinfo): + + buf = hinfo + l, sep, r = buf.partition('@') + if sep: + uinfo, buf = l, r + l, sep, r = uinfo.partition(':') + if sep: + u, p = l, r + else: + u, p = uinfo, None + else: + u = p = None + + if not buf.startswith('['): + s = None + l, sep, r = buf.partition(':') + if sep: + h, p = l, int(r) + else: + h, p = buf, None + else: + l, sep, r = buf.partition(']') + if not sep: + raise ValueError("invalid host specifier %s" % hinfo) + h = l[1:] + if r and r.startswith(':'): + p = int(r[1:]) + elif not r: + p = None + else: + raise ValueError("invalid host specifier %s" % hinfo) + i = h.find('%25') + if i > -1: + h, s = h[:i], h[i+3:] + else: + l, sep, r = h.partition('%') + if sep: + h, s = l, r + else: + s = None + + return cls(h, port=p, user=u, password=p, scope=s) From f9b67ae99cfc9b01ac51c99e23c17d2cb8a7b80b Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:26:40 -0700 Subject: [PATCH 13/33] Added 'installed' bootmode with inspiration from @sonoble - refactor to leverage /bootmodes/swi - splice in some of the /etc muckery from /bin/boot - added consistency checks - put some temp files on the flash --- .../src/bootmodes/installed | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100755 packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed diff --git a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed new file mode 100755 index 00000000..543a1e0d --- /dev/null +++ b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed @@ -0,0 +1,123 @@ +############################################################ +# +# Bootmode: installed +# +# Boot the installed rootfs from the INSTALLED BOOTPARAM value. +# +############################################################ +. /lib/msgs +. /etc/onl/BOOTPARAMS + +# make sure /mnt/onl/data exists +if [ ! -d /mnt/onl/data ]; then + msg_error "Missing /mnt/onl/data, disk boot cannot continue" + exit 200 +fi + +# make sure it's mounted as per mtab.yml +d1=$(stat -f -c '%d' /mnt/onl) +d2=$(stat -f -c '%d' /mnt/onl/data) +if [ "$d1" -eq "$d2" ]; then + msg_error "Unmounted /mnt/onl/data, disk boot cannot continue" + exit 200 +fi + +do_unpack= +swiget_workdir= +swi_workdir= + +do_cleanup() { + cd / + rm -fr $swiget_workdir $swi_workdir +} + +trap "do_cleanup" 0 1 + +case "$SWI" in + ""|dir:*|nfs://*/) + msg_info "*** missing SWI file, will attempt to boot existing image" + + if [ ! -f /mnt/onl/data/.swi ]; then + msg_error "Un-populated /mnt/onl/data, cannot continue" + exit 200 + fi + + ;; + *) + # resolve this SWI as a file and unpack it + swiget_workdir=${TMPDIR-"/tmp"} + swiget_workdir=$(mktemp -d $swiget_workdir/bootmodes-XXXXXX) + TMPDIR=$swiget_workdir swipath=$(swiget $SWI) + + # do some sort of test to see if it's populated + if [ ! -f /mnt/onl/data/.swi ]; then + msg_info "Un-populated /mnt/onl/data, will (re-)image" + do_unpack=1 + else + msg_info "Found valid (current) image at /mnt/onl/data" + fi + ;; +esac + +if [ "$do_unpack" ]; then + + rm -fr /mnt/onl/data/* /mnt/onl/data/.??* + mkdir /mnt/onl/data/lost+found + + swi_workdir=$(mktemp -d /mnt/onl/data/tmp-XXXXXX) + + msg_info "extracting SWI $swipath --> $swi_workdir" + unzip $swipath -d $swi_workdir + set dummy $swi_workdir/*.sqsh + if [ ! -f "$2" ]; then + msg_error "*** missing squashfs file" + exit 1 + fi + if [ $# -gt 2 ]; then + msg_error "*** too many squashfs files" + exit 1 + fi + + msg_info "extracting rootfs $2 --> /mnt/onl/data" + unsquashfs -f -d /mnt/onl/data "$2" + echo "unsquashfs status $?" + + if [ ! -f /mnt/onl/data/lib/vendor-config/onl/install/lib.sh ]; then + msg_error "*** invalid squashfs contents" + exit 1 + fi + + # Install any SWI data packages. + if [ -s $swi_workdir/swi-data.tar.gz ]; then + msg_info "installing SWI data into /boot..." + tar -C /mnt/onl/data/boot -xzf $swi_workdir/swi-data.tar.gz + fi + + # If there is a SWI version file put it in /etc/onl/swi_version + if [ -f $swi_workdir/version ]; then + cp $swi_workdir/version /mnt/onl/data/etc/onl/swi_version + fi + + msg_info "stamping filesystem with SWI" + case "$SWI" in + *::latest) + swistamp=${SWI%:latest}${swipath##*/} + ;; + *) + swistamp=$SWI + ;; + esac + echo "$swistamp" > /mnt/onl/data/.swi +fi + +trap - 0 1 +do_cleanup + +sed -i -e '/^SWI=/d' /etc/onl/BOOTPARAMS +echo "SWI=dir:data:/" >> /etc/onl/BOOTPARAMS +. /bootmodes/swi + +# Local variables: +# mode: sh +# sh-basic-offset: 4 +# End: From 6a17f712342b181e79b2e6ad06c72f6f657d1c27 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:31:27 -0700 Subject: [PATCH 14/33] Factor out the SWI retrieval and directory mounting --- .../loader-initrd-files/src/bin/swiget | 244 ++++++++++++++++++ .../loader-initrd-files/src/bin/swimount | 184 +++++++++++++ 2 files changed, 428 insertions(+) create mode 100755 packages/base/all/initrds/loader-initrd-files/src/bin/swiget create mode 100755 packages/base/all/initrds/loader-initrd-files/src/bin/swimount diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiget b/packages/base/all/initrds/loader-initrd-files/src/bin/swiget new file mode 100755 index 00000000..0e0a23f3 --- /dev/null +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiget @@ -0,0 +1,244 @@ +#!/usr/bin/python + +"""swiget + +Retrieve/resolve a SWI file to the local filesystem path. +""" + +import sys, os +import time +import urllib +import subprocess +import shutil +import logging +import tempfile + +import onl.install.InstallUtils +MountContext = onl.install.InstallUtils.MountContext +BlkidParser = onl.install.InstallUtils.BlkidParser +ProcMountsParser = onl.install.InstallUtils.ProcMountsParser + +import onl.mounts +OnlMountManager = onl.mounts.OnlMountManager + +import onl.network +HostInfo = onl.network.HostInfo + +class Runner(onl.install.InstallUtils.SubprocessMixin): + + def __init__(self, log): + self.log = log + + self.nextUpdate = None + + def reporthook(self, blocks, bsz, sz): + if time.time() < self.nextUpdate: return + self.nextUpdate = time.time() + 0.25 + if sz: + pct = blocks * bsz * 100 / sz + sys.stderr.write("downloaded %d%% ...\r" % pct) + else: + icon = "|/-\\"[blocks % 4] + sys.stderr.write("downloading ... %s\r" % icon) + + def get(self, SWI): + + # XXX lots of fixups required here for proper IPv6 support + if SWI.startswith('http://') or SWI.startswith('ftp://'): + self.log.info("retrieving %s via HTTP/FTP", SWI) + dst = tempfile.mktemp(prefix="swiget-", suffix=".swi") + if os.isatty(sys.stdout.fileno()): + dst, headers = urllib.urlretrieve(SWI, dst, self.reporthook) + else: + dst, headers = urllib.urlretrieve(SWI, dst) + sys.stderr.write("\n") + return dst + + if SWI.startswith('scp://') or SWI.startswith('ssh://'): + buf = SWI[6:] + h, sep, r = buf.partition('/') + if not sep: + self.log.error("invalid SWI %s", SWI) + return None + hinfo = HostInfo.fromString(h) + rcmd = "cat /%s" % r + cmd = ['dbclient', '-y', hinfo.host, rcmd,] + if hinfo.port is not None: + cmd[2:2] = ['-p', str(hinfo.port),] + if hinfo.user is not None: + cmd[2:2] = ['-l', hinfo.user,] + env = {} + env.update(os.environ) + if hinfo.password is not None: + env['DROPBEAR_PASSWORD'] = hinfo.password + dst = tempfile.mktemp(prefix="swiget-", suffix=".swi") + with open(dst, "w") as fd: + self.check_call(cmd, stdout=fd, env=env) + return dst + + if SWI.startswith('tftp://'): + buf = SWI[7:] + h, sep, r = buf.partition('/') + if not sep: + self.log.error("invalid SWI %s", SWI) + return None + hinfo = HostInfo.fromString(h) + port = hinfo.port or 69 + dst = tempfile.mktemp(prefix="swiget-", suffix=".swi") + cmd = ('tftp', '-g', '-r', r, '-l', dst, hinfo.host, str(hinfo.port),) + self.check_call(cmd) + return dst + + if SWI.startswith('nfs://'): + buf = SWI[6:] + h, sep, r = buf.partition('/') + if not sep: + self.log.error("invalid SWI %s", SWI) + return None + hinfo = HostInfo.fromString(h) + + if '/' in r: + root, base = os.path.split(r) + else: + root, base = '/', r + src = "%s:/%s" % (hinfo.bhost, root,) + mpt = self.mkdtemp(prefix="swiget-nfs-", suffix=".d") + cmd = ['mount', '-t', 'nfs', src, mpt,] + if hinfo.port is not None: + cmd[3:3] = ['-o', "ro,nolock,port=%s" % hinfo.port,] + else: + cmd[3:3] = ['-o', 'ro,nolock',] + self.check_call(cmd) + + dst = tempfile.mktemp(prefix="swiget-", suffix=".swi") + try: + src = "%s/%s" % (mpt, base,) + self.copy2(src, dst) + except: + if os.path.exists(dst): + self.unlink(dst) + raise + finally: + self.check_call(('umount', mpt,)) + self.rmdir(mpt) + + return dst + + blkid = BlkidParser(log=self.log) + + if ':' in SWI: + devspec, sep, r = SWI.partition(':') + + p = "/dev/%s" % devspec + if os.path.exists(p): + return self.blockdevCopy(p, r) + + try: + part = blkid[devspec] + except IndexError: + part = None + if part is not None: + return self.blockdevCopy(part.device, r) + + mm = OnlMountManager("/etc/mtab.yml", self.log) + label = mpt = None + for k, v in mm.mdata['mounts'].items(): + if v['dir'].endswith('/' + devspec): + label = k + mpt = v['dir'] + break + if label is not None: + try: + part = blkid[label] + except IndexError: + part = None + if part is not None: + return self.blockdevCopy(part.device, r, dir=mpt) + + self.log.error("cannot find device specifier for %s", SWI) + return None + + # local file + if SWI.startswith('/') and os.path.exists(SWI): + return SWI + + # possibly unmounted dirctory + if SWI.startswith('/') and not os.path.exists(SWI): + mm = OnlMountManager("/etc/mtab.yml", self.log) + label = mpt = path = None + for k, v in mm.mdata['mounts'].items(): + if SWI.startswith(v['dir'] + '/'): + label = k + mpt = v['dir'] + path = SWI[len(mpt)+1:] + break + if label is not None: + try: + part = blkid[label] + except IndexError: + part = None + if part is not None: + return self.blockdevCopy(part.device, path, dir=mpt) + + self.log.error("invalid SWI %s", SWI) + return None + + def blockdevCopy(self, dev, src, dir=None): + + def latest(d): + l = [x for x in os.listdir(d) if x.endswith('.swi')] + l = [os.path.join(d, x) for x in l] + l.sort(key=os.path.getmtime) + return l[-1] + + pm = ProcMountsParser() + parts = [x for x in pm.mounts if x.device == dev] + if parts: + if src == ':latest': + dst = latest(parts[0].dir) + self.log.info("found 'latest' swi %s", dst) + else: + dst = os.path.join(parts[0].dir, src) + if not os.path.exists(dst): + self.log.error("missing SWI: %s", dst) + return None + return dst + + with MountContext(device=dev, log=self.log) as ctx: + if src == ':latest': + dst = latest(ctx.dir) + self.log.info("found 'latest' swi %s", dst) + else: + dst = os.path.join(ctx.dir, src) + if not os.path.exists(dst): + self.log.error("missing SWI: %s:%s", dev, src) + return None + + # move to its proper location as per mtab + # XXX perms may not be right here + if dir is not None: + self.check_call(('mount', '--move', ctx.dir, dir,)) + ctx.mounted = False + return os.path.join(dir, src) + + ctx.mounted = False + ctx.hostDir = None + return dst + + @classmethod + def main(cls): + SWI = sys.argv[1] + logging.basicConfig() + logger = logging.getLogger("swiget") + logger.setLevel(logging.DEBUG) + r = cls(logger) + dst = r.get(SWI) + if dst is None: + sys.exit(1) + sys.stdout.write(dst + "\n") + sys.exit(0) + +main = Runner.main + +if __name__ == "__main__": + main() diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swimount b/packages/base/all/initrds/loader-initrd-files/src/bin/swimount new file mode 100755 index 00000000..b7ea1879 --- /dev/null +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swimount @@ -0,0 +1,184 @@ +#!/usr/bin/python + +"""swimount + +Mount a directory specified in $SWI. +""" + +import os, sys +import shutil +import logging + +import onl.install.InstallUtils +BlkidParser = onl.install.InstallUtils.BlkidParser + +import onl.mounts +MountContext = onl.install.InstallUtils.MountContext +OnlMountManager = onl.mounts.OnlMountManager +ProcMountsParser = onl.install.InstallUtils.ProcMountsParser + +import onl.network +HostInfo = onl.network.HostInfo + +class Runner(onl.install.InstallUtils.SubprocessMixin): + + def __init__(self, log): + self.log = log + + self.blkid = BlkidParser(log=self.log) + + def mount(self, SWI): + + if SWI.startswith('nfs://'): + buf = SWI[6:] + buf = buf.rstrip('/') + h, sep, r = buf.partition('/') + if not sep: + self.log.error("invalid SWI %s", SWI) + return None + hinfo = HostInfo.fromString(h) + + if not r: + r = '/' + else: + r = '/' + r + src = "%s:%s" % (hinfo.bhost, r,) + mpt = self.mkdtemp(prefix="swimount-nfs-", suffix=".d") + cmd = ['mount', '-t', 'nfs', src, mpt,] + if hinfo.port is not None: + cmd[3:3] = ['-o', "nolock,port=%s" % hinfo.port,] + else: + cmd[3:3] = ['-o', 'nolock',] + self.check_call(cmd) + + return mpt + + # local path specifier + if not SWI.startswith('dir:'): + self.log.error("invalid SWI %s", SWI) + return None + SWI = SWI[4:] + + if ':' in SWI: + devspec, sep, r = SWI.partition(':') + return self.devspecMount(devspec, r) + + if not SWI.startswith('/'): + return self.devspecMount(SWI, '/') + + if not os.path.isdir(SWI): + self.log.error("invalid SWI %s (not a directory)", SWI) + return None + + # local directory, but actually mounted + if os.stat('/').st_dev != os.stat(SWI).st_dev: + return SWI + + # possibly unmounted dirctory + mm = OnlMountManager("/etc/mtab.yml", self.log) + label = mpt = path = None + for k, v in mm.mdata['mounts'].items(): + if SWI == v['dir']: + label = k + mpt = v['dir'] + path = '/' + break + if SWI.startswith(v['dir'] + '/'): + label = k + mpt = v['dir'] + path = SWI[len(mpt)+1:] + break + if label is not None: + try: + part = self.blkid[label] + except IndexError: + part = None + if part is not None: + return self.blockdevMount(part.device, path, dir=mpt) + + self.log.error("invalid SWI %s", SWI) + return None + + def devspecMount(self, devspec, path): + """Find using a device specifier.""" + + p = "/dev/%s" % devspec + if os.path.exists(p): + return self.blockdevMount(p, r) + + try: + part = self.blkid[devspec] + except IndexError: + part = None + if part is not None: + return self.blockdevMount(part.device, r) + + mm = OnlMountManager("/etc/mtab.yml", self.log) + label = mpt = None + for k, v in mm.mdata['mounts'].items(): + if v['dir'].endswith('/' + devspec): + label = k + mpt = v['dir'] + break + if label is not None: + try: + part = self.blkid[label] + except IndexError: + part = None + if part is not None: + return self.blockdevMount(part.device, path, dir=mpt) + + self.log.error("cannot find device specifier for %s", SWI) + return None + + def blockdevMount(self, dev, src, dir=None): + + pm = ProcMountsParser() + parts = [x for x in pm.mounts if x.device == dev] + if parts: + dst = parts[0].dir + if src and src != '/': dst = os.path.join(dst, src) + if not os.path.exists(dst): + self.log.error("missing SWI: %s", dst) + return None + self.check_call(('mount', '-o', 'rw,remount', dst,)) + return dst + + with MountContext(device=dev, log=self.log) as ctx: + dst = ctx.dir + if src and src != '/': dst = os.path.join(dst, src) + if not os.path.exists(dst): + self.log.error("missing SWI: %s:%s", dev, src) + return None + + # move to its proper location as per mtab + # XXX perms may not be right here + if dir is not None: + self.check_call(('mount', '-o', 'rw,remount', ctx.dir,)) + self.check_call(('mount', '--move', ctx.dir, dir,)) + ctx.mounted = False + dst = dir + if src and src != '/': dst = os.path.join(dst, src) + return dst + + ctx.mounted = False + ctx.hostDir = None + return dst + + @classmethod + def main(cls): + SWI = sys.argv[1] + logging.basicConfig() + logger = logging.getLogger("swimount") + logger.setLevel(logging.DEBUG) + r = cls(logger) + dst = r.mount(SWI) + if dst is None: + sys.exit(1) + sys.stdout.write(dst + "\n") + sys.exit(0) + +main = Runner.main + +if __name__ == "__main__": + main() From 168495e04be029b50ce9741c14995cabd77387a4 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:33:06 -0700 Subject: [PATCH 15/33] Move 'latest' SWI calculation into swiget --- .../all/initrds/loader-initrd-files/src/bootmodes/swi | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/swi b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/swi index 7d6a3fd7..a4c8c446 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/swi +++ b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/swi @@ -14,16 +14,6 @@ if [ ! "${SWI}" ]; then exit 200 fi -if [ "${SWI}" = "images::latest" ]; then - # Boot the latest (by mtime) SWI in the images partition. - SWI=`ls /mnt/onl/images/*.swi -t | head -n1` - if [ -z "${SWI}" ]; then - msg_error "No SWI available in /mnt/onl/images. SWI booting cannot continue." - exit 200 - fi -fi - - # # The SWI setting can be a list of URLs # From dbb298931460e7713d1fd940704934ca8a8c312d Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Mon, 23 May 2016 17:35:19 -0700 Subject: [PATCH 16/33] Refactor to use swiget and swimount - working (almost) support for persistent installs --- .../initrds/loader-initrd-files/src/bin/boot | 108 ++++++++---------- .../initrds/loader-initrd-files/src/lib/boot1 | 26 +++-- 2 files changed, 62 insertions(+), 72 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/boot b/packages/base/all/initrds/loader-initrd-files/src/bin/boot index 63ca5ec7..f377bc0d 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/boot +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/boot @@ -28,11 +28,15 @@ set -e unset testonly help cache +CR=" +" + while [ "$1" ]; do case "$1" in -h|--help) help=1 ;; -t|--testonly) testonly=1 ;; --cache) shift; cache="$1" ;; + --rootfs) shift; rootfs="$1" ;; *) break ;; esac shift @@ -48,19 +52,30 @@ Usage: $0 [-h|--help] [-t|--testonly] [--rootfs ROOTFS] --cache LOCATION [SWI] Loads and boots a software image (SWI). The load method depends on the format of the SWI argument: - DEV:PATH - /mnt/onl/DEV/PATH - Loads a SWI file from local storage device DEV (e.g. flash). - http://[USER:PASSWORD@]SERVER[:PORT]/PATH - ftp://[USER:PASSWORD@]SERVER[:PORT]/PATH - ssh|scp://USER:PASSWORD[:PORT]@SERVER/PATH - tftp://SERVER[:PORT]/PATH + DEV:SWI-PATH + Mount /dev/DEV to find a SWI + LABEL-ISH:SWI-PATH + Mount a filesysem labeled LABEL to find a SWI + /mnt/DEV/SWI-PATH + /mnt/onl/LABEL-ISH/SWI-PATH + Loads a SWI file from local storage device (e.g. flash). + http://[USER:PASSWORD@]SERVER[:PORT]/SWI-PATH + ftp://[USER:PASSWORD@]SERVER[:PORT]/SWI-PATH + ssh|scp://USER:PASSWORD[:PORT]@SERVER/SWI-PATH + tftp://SERVER[:PORT]/SWI-PATH Downloads a SWI file via HTTP, FTP, SSH or TFTP. - nfs://SERVER[:PORT]/PATH - If PATH is a file, mounts the parent directory via NFS and loads the - SWI file. If PATH is a directory, mounts the directory and loads - the SWI without unpacking (PATH must end with / and the directory - must contain an unpacked SWI). + nfs://SERVER[:PORT]/SWI-PATH + Mounts the parent directory via NFS and loads the SWI file. + nfs://SERVER[:PORT]/[ROOTFS-PATH/] + Mounts the parent directory via NFS and uses ROOTFS-PATH + as the unpacked SWI contents (path must end with '/') + dir:DEV[:/ROOTFS-PATH] + Mounts /dev/DEV to find a root filesystem + dir:LABEL-ISH[:/ROOTFS-PATH] + Mounts a fileystem labeled LABEL to find a root filesystem + dir:/mnt/DEV[/ROOTFS-PATH] + dir:/mnt/onl/LABEL-ISH[/ROOTFS-PATH] + Mounts a directory on a local storage device to find a root filesystem EOF exit 1 @@ -70,60 +85,20 @@ shift [ ! "${testonly}" ] || set -x -unset swipath host port dir file dev user password +unset swipath host bhost port dir file dev user password scope case "${SWI}" in - http:*|ftp:*) - echo "Downloading ${SWI}" - wget -O /tmp/swi0 "${SWI}" - mv /tmp/swi0 /tmp/swi - swipath=/tmp/swi - ;; - scp:*|ssh:*) - echo "Downloading ${SWI}" - eval $(echo "${SWI}" | sed -n 's#\(scp\|ssh\)://\([^:]*\):\([^@]*\)@\([^/:]*\)\(:\([0-9]\+\)\)\?/\(.*\)#user="\2" password="\3" host="\4" port="\6" file="\7"#p') - [ "${port}" ] || port=22 - DROPBEAR_PASSWORD="${password}" dbclient -y -p ${port} -l "${user}" "${host}" "cat /${file}" >/tmp/swi0 - mv /tmp/swi0 /tmp/swi - swipath=/tmp/swi - ;; - tftp:*) - echo "Downloading ${SWI}" - eval $(echo "${SWI}" | sed -n 's#tftp://\([^/:]*\|\[[^]/]*\]\)\(:\([0-9]\+\)\)\?/\(.*\)#host="\1" port="\3" file="\4"#p') - tftp -g -r "${file}" -l /tmp/swi0 "${host}" ${port} - mv /tmp/swi0 /tmp/swi - swipath=/tmp/swi - ;; - nfs:*) - eval $(echo "${SWI}" | sed -n 's#nfs://\([^/:]*\|\[[^]/]*\]\)\(:\([0-9]\+\)\)\?\(.*\)/\(.*\)#host="\1" port="\3" dir="\4" file="\5"#p') - [ "${dir}" ] || dir=/ - [ "${port}" ] || port=0 - echo "Mounting nfs://${host}:${port}${dir}" - umount -l /tmp/nfs 2>/dev/null || : - mkdir -p /tmp/nfs - mount -t nfs -o "nolock,port=${port}" "${host}:${dir}" /tmp/nfs - if [ "${file}" ]; then - swipath="/tmp/nfs/${file}" - [ ! -d ${swipath} ] || { echo "${SWI} must be a SWI file (use ${SWI}/ for a SWI directory)"; exit 1; } - else - swipath=/tmp/nfs + nfs://*/|dir:*) + swipath=$(swimount $SWI) + if [ "$rootfs" ]; then [ -d "${swipath}/${rootfs}" ] || { echo "${SWI}${rootfs} must be an unpacked rootfs"; exit 1; } - mount -t nfs -o "nolock,port=${port}" "${host}:${dir}/${rootfs}" "${swipath}/${rootfs}" fi ;; + http:*|ftp:*|scp://*|ssh://*|tftp://*|nfs://*) + echo "Downloading ${SWI}" + swipath=$(swiget $SWI) + ;; *) - # Parse dev:file or dev:/file or /mnt/onl/dev/file - parselocal='s#\(\([^:/]*\):/\?\|/mnt/onl/\([^/]*\)/\)\?\(.*\)#dev="\2\3" file="\4"#p' - eval $(echo "${SWI}" | sed -n "${parselocal}") - if [ "${dev}" ] ; then - # Wait for /mnt/dev to show up - : - else - # Assume file is relative, parse absolutified file - eval $(realpath "${file}" | sed -n "${parselocal}") - SWI="${dev}:${file}" - fi - swipath="/mnt/onl/${dev}/${file}" - [ -f "${swipath}" ] || { echo "${SWI} not found or not a file"; exit 1; } + swipath=$(swiget $SWI) ;; esac @@ -143,7 +118,18 @@ if [ -n "$cache" ]; then python /bin/swicache.py "${swipath}" "${cache}" fi +if [ "$testonly" ]; then + echo "swipath=$swipath rootfs=$rootfs" + echo "Stop here" + exit 0 +fi + . /lib/boot1 echo "Boot failed" exit 1 + +# Local variables: +# mode: sh +# sh-basic-offset: 4 +# End: diff --git a/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 b/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 index dcb3814c..908a48b6 100644 --- a/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 +++ b/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 @@ -88,20 +88,23 @@ if [ -f /etc/fw_env.config ]; then cat /etc/fw_env.config >/newroot/etc/fw_env.config fi -unzip -oq "${swipath}" swi-data.tar.gz -d /tmp +if [ -f "$swipath" ]; then -# Install any SWI data packages. -if [ -s /tmp/swi-data.tar.gz ]; then - echo "Installing SWI data into /boot..." - tar -C /newroot/boot -xzf /tmp/swi-data.tar.gz -fi - -# If there is a SWI version file put it in /etc/onl/swi_version -unzip -oq "${swipath}" version -d /tmp -if [ -f /tmp/version ]; then - cp /tmp/version /newroot/etc/onl/swi_version + # Install any SWI data packages. + unzip -oq "${swipath}" swi-data.tar.gz -d /tmp + if [ -s /tmp/swi-data.tar.gz ]; then + echo "Installing SWI data into /boot..." + tar -C /newroot/boot -xzf /tmp/swi-data.tar.gz fi + # If there is a SWI version file put it in /etc/onl/swi_version + unzip -oq "${swipath}" version -d /tmp + if [ -f /tmp/version ]; then + cp /tmp/version /newroot/etc/onl/swi_version + fi + +fi + # # The file /lib/boot-custom can be provided by customized builds to # add functionality before the root is switched. @@ -115,5 +118,6 @@ kill -QUIT 1 # exec /bin/switchroot as PID 1 sleep 30 # Local variables: +# mode: sh # sh-basic-offset: 4 # End: From 8041b7bf7c520a5219e64e2688fdc220220646ea Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 18 May 2016 18:47:58 -0700 Subject: [PATCH 17/33] Deprecate initnetdev - moved to onl-vendor-config-onl - onl-loader-initscripts is now deprecated --- builds/any/rootfs/jessie/common/common-packages.yml | 1 - builds/any/rootfs/wheezy/common/common-packages.yml | 1 - packages/base/all/initrds/loader-initrd-files/PKG.yml | 11 ----------- 3 files changed, 13 deletions(-) diff --git a/builds/any/rootfs/jessie/common/common-packages.yml b/builds/any/rootfs/jessie/common/common-packages.yml index ef765ea3..d41477b4 100644 --- a/builds/any/rootfs/jessie/common/common-packages.yml +++ b/builds/any/rootfs/jessie/common/common-packages.yml @@ -66,7 +66,6 @@ - realpath - iptables - onl-faultd -- onl-loader-initscripts - onlp-snmpd - oom-shim - python-parted diff --git a/builds/any/rootfs/wheezy/common/common-packages.yml b/builds/any/rootfs/wheezy/common/common-packages.yml index 40a6bf5d..eb365075 100644 --- a/builds/any/rootfs/wheezy/common/common-packages.yml +++ b/builds/any/rootfs/wheezy/common/common-packages.yml @@ -65,7 +65,6 @@ - realpath - iptables - onl-faultd -- onl-loader-initscripts - onlp-snmpd - oom-shim - python-parted diff --git a/packages/base/all/initrds/loader-initrd-files/PKG.yml b/packages/base/all/initrds/loader-initrd-files/PKG.yml index 56714efc..79489347 100644 --- a/packages/base/all/initrds/loader-initrd-files/PKG.yml +++ b/packages/base/all/initrds/loader-initrd-files/PKG.yml @@ -23,15 +23,4 @@ packages: changelog: Change changes changes., - - name: onl-loader-initscripts - version: 1.0.0 - summary: Open Network Linux System Loader Common Initscripts - - files: - src/bin/initnetdev : /sbin/ - - changelog: Change changes changes., - - - From c2e6da45a4afaf1870ebb2fe8197319450a79d4f Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Thu, 26 May 2016 14:03:50 -0700 Subject: [PATCH 18/33] Factored out swi unpack/mount/overlay stuffs --- .../loader-initrd-files/src/bin/swiprep | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100755 packages/base/all/initrds/loader-initrd-files/src/bin/swiprep diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep new file mode 100755 index 00000000..00c40770 --- /dev/null +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep @@ -0,0 +1,203 @@ +#!/bin/sh +# +###################################################################### +# +# swiprep +# +# unpack a SWI to a directory in preparation for boot +# +###################################################################### + +swipath= +destdir= +swiref= +mode_install= +mode_overlay= +flag_unmount= + +while test $# -gt 0; do + case "$1" in + --install) + mode_install=1 + mode_overlay= + shift + continue + ;; + --overlay) + mode_install= + mode_overlay=1 + shift + continue + ;; + --swiref) + shift + swiref=$1 + shift + continue + ;; + --unmount) + shift + flag_unmount=1 + continue + ;; + -*) + echo "*** invalid option $1" 1>&2 + exit 1 + ;; + esac + + if test "$swipath"; then + : + else + swipath=$1 + shift + continue + fi + if test "$destdir"; then + : + else + destdir=$1 + shift + continue + fi + break + +done + +if test "$swipath"; then + : +else + echo "*** missing swipath" 1>&2 + exit 1 +fi +if test "$destdir"; then + : +else + echo "*** missing destdir" 1>&2 + exit 1 +fi +case "${mode_install}:${mode_overlay}" in + :) + echo "*** missing --install or --overlay" 1>&2 + exit 1 + ;; +esac +if test $# -gt 0; then + echo "*** extra arguments" 1>&2 + exit 1 +fi + +mkdir -p "$destdir" + +rm -fr "$destdir"/* "$destdir"/.??* +if grep -q " $destdir " /proc/mounts; then + mkdir "$destdir/lost+found" +fi + +if test "$flag_unmount"; then + umount -l "$destdir" 2>/dev/null || : + if test "$mode_overlay"; then + mkdir -p "${destdir}.lower" "${destdir}.upper" + umount -l "${destdir}.lower" 2>/dev/null || : + umount -l "${destdir}.upper" 2>/dev/null || : + fi +fi + +if test "$mode_install"; then + workdir=$(mktemp -d "$destdir"/swiprep-XXXXXX) +else + workdir=$(mktemp -t -d swiprep-XXXXXX) +fi + +echo "extracting SWI $swipath --> $workdir" + +do_cleanup() { + cd / + rm -fr $workdir +} + +trap "do_cleanup" 0 1 + +ARCH_LIST= +case $(uname -m) in + ppc) + ARCH_LIST="ppc powerpc" + ;; + x86_64) + ARCH_LIST="x86_64 amd64" + ;; + armv7l) + ARCH_LIST="armel" + ;; + *) + q;; +esac + +for arch in $ARCH_LIST; do + unzip -pq "$swipath" "rootfs-${arch}.sqsh" > "$workdir/rootfs.sqsh" + if test -s "$workdir/rootfs.sqsh"; then break; fi +done +if test ! -s "$workdir/rootfs.sqsh"; then + echo "*** cannot find a valid rootfs" 1>&2 + exit 1 +fi + +if test "$mode_install"; then + echo "extracting rootfs $workdir/rootfs.sqsh --> $destdir" + unsquashfs -f -d "$destdir" "$workdir/rootfs.sqsh" + if test ! -f "$destdir/lib/vendor-config/onl/install/lib.sh"; then + echo "*** invalid squashfs contents" 1>&2 + exit 1 + fi +fi +if test "$mode_overlay"; then + # keep the squashfs file around + mv $workdir/rootfs.sqsh /tmp/.rootfs + if grep -q overlayfs /proc/filesystems; then + mount -t squashfs -o loop /tmp/.rootfs "${destdir}.lower" + mount -t tmpfs -o size=15%,mode=0755 none "${destdir}.upper" + mount -t overlayfs -o "lowerdir=${destdir}.lower,upperdir=${destdir}.upper" none "$destdir" + elif grep -q overlay /proc/filesystems; then + mount -t squashfs -o loop /tmp/.rootfs "${destdir}.lower" + mount -t tmpfs -o size=15%,mode=0755 none "${destdir}.upper" + mkdir "${destdir}.upper/upper" + mkdir "${destdir}.upper/work" + mount -t overlay "-olowerdir=${destdir}.lower,upperdir=${destdir}.upper/upper,workdir=${destdir}.upper/work" overlay "$destdir" + else + echo "OverlayFS not found in kernel" + fi +fi +rm -f $workdir/rootfs.sqsh + +# Install any SWI data packages. +unzip -oq "$swipath" swi-data.tar.gz > "$workdir/swi-data.tar.gz" +if test -s "$workdir/swi-data.tar.gz"; then + echo "installing SWI data into /boot..." + tar -C "$destdir/boot" -xzf "$workdir/swi-data.tar.gz" +fi + +mkdir -p "$destdir/etc/onl" + +cp -R /etc/onl/* "$destdir/etc/onl/." +if [ -f /etc/fw_env.config ]; then + cat /etc/fw_env.config > "$destdir/etc/fw_env.config" +fi + +# If there is a SWI version file put it in /etc/onl/swi_version +unzip -oq "$swipath" version > "$workdir/version" +if test -f "$workdir/version"; then + cp "$workdir/version" "$destdir/etc/onl/swi_version" +fi + +if test "$swiref"; then + echo "$swiref" > "$destdir/.swi" +else + echo "$swipath" > "$destdir/.swi" +fi + +exit 0 + +# Local variables: +# mode: sh +# sh-indentation: 2 +# End: From e17ea293e2d1dc80e3bdfd2a236122fad9f76cdd Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Thu, 26 May 2016 14:06:00 -0700 Subject: [PATCH 19/33] Refactor boot, boot1, implement directory-based installs --- .../initrds/loader-initrd-files/src/bin/boot | 32 ++++- .../src/bootmodes/installed | 64 ++------- .../initrds/loader-initrd-files/src/lib/boot1 | 123 ------------------ packages/base/all/vendor-config-onl/PKG.yml | 11 +- 4 files changed, 55 insertions(+), 175 deletions(-) delete mode 100644 packages/base/all/initrds/loader-initrd-files/src/lib/boot1 diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/boot b/packages/base/all/initrds/loader-initrd-files/src/bin/boot index f377bc0d..a532d5a3 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/boot +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/boot @@ -88,6 +88,7 @@ shift unset swipath host bhost port dir file dev user password scope case "${SWI}" in nfs://*/|dir:*) + echo "Mounting ${SWI}" swipath=$(swimount $SWI) if [ "$rootfs" ]; then [ -d "${swipath}/${rootfs}" ] || { echo "${SWI}${rootfs} must be an unpacked rootfs"; exit 1; } @@ -98,9 +99,18 @@ case "${SWI}" in swipath=$(swiget $SWI) ;; *) + echo "Locating ${SWI}" swipath=$(swiget $SWI) ;; esac +case "$SWI" in + *::latest) + swistamp=${SWI%:latest}${swipath##*/} + ;; + *) + swistamp=$SWI + ;; +esac echo "SWI=${SWI}" >/etc/onl/boot-config echo "CONSOLESPEED=$(stty speed)" >>/etc/onl/boot-config @@ -124,7 +134,27 @@ if [ "$testonly" ]; then exit 0 fi -. /lib/boot1 +if [ -d "${swipath}" ]; then + # rootfs is a directory + mkdir -p /newroot + umount -l /newroot 2>/dev/null || : + mount --bind "${swipath}/${rootfs}" /newroot +else + echo "$swistamp" > /etc/onl/SWI + swiprep --overlay "${swipath}${rootfs}" --unmount --swiref "$swistamp" /newroot +fi + +# +# The file /lib/boot-custom can be provided by customized builds to +# add functionality before the root is switched. +# +if [ -f /lib/boot-custom ]; then + . /lib/boot-custom +fi + +echo "Switching rootfs" # limit 16 chars since serial buffer is not flushed +kill -QUIT 1 # exec /bin/switchroot as PID 1 +sleep 30 echo "Boot failed" exit 1 diff --git a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed index 543a1e0d..00fe97d7 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed +++ b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed @@ -59,62 +59,26 @@ case "$SWI" in ;; esac +case "$SWI" in + *::latest) + swistamp=${SWI%:latest}${swipath##*/} + ;; + *) + swistamp=$SWI + ;; +esac + +echo "$swistamp" > /etc/onl/SWI +sed -i -e '/^SWI=/d' /etc/onl/BOOTPARAMS +echo "SWI=dir:data:/" >> /etc/onl/BOOTPARAMS + if [ "$do_unpack" ]; then - - rm -fr /mnt/onl/data/* /mnt/onl/data/.??* - mkdir /mnt/onl/data/lost+found - - swi_workdir=$(mktemp -d /mnt/onl/data/tmp-XXXXXX) - - msg_info "extracting SWI $swipath --> $swi_workdir" - unzip $swipath -d $swi_workdir - set dummy $swi_workdir/*.sqsh - if [ ! -f "$2" ]; then - msg_error "*** missing squashfs file" - exit 1 - fi - if [ $# -gt 2 ]; then - msg_error "*** too many squashfs files" - exit 1 - fi - - msg_info "extracting rootfs $2 --> /mnt/onl/data" - unsquashfs -f -d /mnt/onl/data "$2" - echo "unsquashfs status $?" - - if [ ! -f /mnt/onl/data/lib/vendor-config/onl/install/lib.sh ]; then - msg_error "*** invalid squashfs contents" - exit 1 - fi - - # Install any SWI data packages. - if [ -s $swi_workdir/swi-data.tar.gz ]; then - msg_info "installing SWI data into /boot..." - tar -C /mnt/onl/data/boot -xzf $swi_workdir/swi-data.tar.gz - fi - - # If there is a SWI version file put it in /etc/onl/swi_version - if [ -f $swi_workdir/version ]; then - cp $swi_workdir/version /mnt/onl/data/etc/onl/swi_version - fi - - msg_info "stamping filesystem with SWI" - case "$SWI" in - *::latest) - swistamp=${SWI%:latest}${swipath##*/} - ;; - *) - swistamp=$SWI - ;; - esac - echo "$swistamp" > /mnt/onl/data/.swi + swiprep --install "$swipath" --swiref "$swistamp" /mnt/onl/data fi trap - 0 1 do_cleanup -sed -i -e '/^SWI=/d' /etc/onl/BOOTPARAMS -echo "SWI=dir:data:/" >> /etc/onl/BOOTPARAMS . /bootmodes/swi # Local variables: diff --git a/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 b/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 deleted file mode 100644 index 908a48b6..00000000 --- a/packages/base/all/initrds/loader-initrd-files/src/lib/boot1 +++ /dev/null @@ -1,123 +0,0 @@ -# -*- sh -*- -############################################################ -# -# -# Copyright 2013, 2014 BigSwitch Networks, Inc. -# -# Licensed under the Eclipse Public License, Version 1.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.eclipse.org/legal/epl-v10.html -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the License for the specific -# language governing permissions and limitations under the -# License. -# -# -############################################################ -# -# boot1 -# -# Copies/mounts rootfs from swi and switches root -# -###################################################################### - -mkdir -p /newroot -umount -l /newroot 2>/dev/null || : - -if [ -d "${swipath}" ]; then - # rootfs is a directory - mount --bind "${swipath}/${rootfs}" /newroot -else - # rootfs is a squashfs - echo "Booting: ${swipath}" - mkdir -p /newroot.lower /newroot.upper - umount -l /newroot.lower 2>/dev/null || : - umount -l /newroot.upper 2>/dev/null || : - rm -f /tmp/rootfs - uarch=`uname -m` - - ARCH_LIST= - case $uarch in - ppc) - ARCH_LIST="ppc powerpc" - ;; - x86_64) - ARCH_LIST="x86_64 amd64" - ;; - armv7l) - ARCH_LIST="armel" - ;; - *) - ;; - esac - - for arch in $ARCH_LIST; do - unzip -pq "${swipath}" "rootfs-$arch.sqsh" >/tmp/rootfs - [ ! -s /tmp/rootfs ] || break - done - - if [ ! -s /tmp/rootfs ]; then - echo "${swipath} does not contain a rootfs image for the current architecture ($uarch). Booting cannot continue." - exit 1 - fi - - if grep -q overlayfs /proc/filesystems; then - mount -t squashfs -o loop /tmp/rootfs /newroot.lower - mount -t tmpfs -o size=15%,mode=0755 none /newroot.upper - mount -t overlayfs -o lowerdir=/newroot.lower,upperdir=/newroot.upper none /newroot - elif grep -q overlay /proc/filesystems; then - mount -t squashfs -o loop /tmp/rootfs /newroot.lower - mount -t tmpfs -o size=15%,mode=0755 none /newroot.upper - mkdir /newroot.upper/upper - mkdir /newroot.upper/work - mount -t overlay -olowerdir=/newroot.lower,upperdir=/newroot.upper/upper,workdir=/newroot.upper/work overlay /newroot - else - echo "OverlayFS not found in kernel" - fi -fi - -mkdir -p /newroot/etc/onl -cp -R /etc/onl/* /newroot/etc/onl - -if [ -f /etc/fw_env.config ]; then - cat /etc/fw_env.config >/newroot/etc/fw_env.config -fi - -if [ -f "$swipath" ]; then - - # Install any SWI data packages. - unzip -oq "${swipath}" swi-data.tar.gz -d /tmp - if [ -s /tmp/swi-data.tar.gz ]; then - echo "Installing SWI data into /boot..." - tar -C /newroot/boot -xzf /tmp/swi-data.tar.gz - fi - - # If there is a SWI version file put it in /etc/onl/swi_version - unzip -oq "${swipath}" version -d /tmp - if [ -f /tmp/version ]; then - cp /tmp/version /newroot/etc/onl/swi_version - fi - -fi - -# -# The file /lib/boot-custom can be provided by customized builds to -# add functionality before the root is switched. -# -if [ -f /lib/boot-custom ]; then - . /lib/boot-custom -fi - -echo "Switching rootfs" # limit 16 chars since serial buffer is not flushed -kill -QUIT 1 # exec /bin/switchroot as PID 1 -sleep 30 - -# Local variables: -# mode: sh -# sh-basic-offset: 4 -# End: diff --git a/packages/base/all/vendor-config-onl/PKG.yml b/packages/base/all/vendor-config-onl/PKG.yml index 32109df3..a1fecbf9 100644 --- a/packages/base/all/vendor-config-onl/PKG.yml +++ b/packages/base/all/vendor-config-onl/PKG.yml @@ -10,7 +10,16 @@ packages: files: src/python/onl : $PY_INSTALL/onl src/boot.d : /etc/boot.d - src/bin : /usr/bin + src/bin/initubootenv: /sbin/initubootenv + src/bin/initmounts: /sbin/initmounts + src/bin/initnetdev: /sbin/initnetdev + src/bin/pki : /sbin/pki + src/bin/loader-shell: /usr/bin/loader-shell + src/bin/onie-shell: /usr/bin/onie-shell + src/bin/onl-platform-show: /usr/bin/onl-platform-show + src/bin/onl-install: /usr/bin/onl-install + src/bin/onl-recover: /usr/bin/onl-recover + src/bin/pyfit: /usr/bin/pyfit src/lib : /lib/vendor-config/onl changelog: Changes From 14870ac7b77143b4c57b83b698c7cdcb2821fecb Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Thu, 26 May 2016 14:07:33 -0700 Subject: [PATCH 20/33] Build directory-based installers - move default installer to 'swi' directory - add BOOTMODE salt to deb and installer name --- builds/amd64/installer/PKG.yml | 1 - builds/amd64/installer/installed/Makefile | 1 + builds/amd64/installer/installed/PKG.yml | 2 ++ builds/amd64/installer/{ => installed}/builds/.gitignore | 0 builds/amd64/installer/installed/builds/Makefile | 3 +++ builds/amd64/installer/installed/builds/boot-config | 4 ++++ builds/amd64/installer/swi/Makefile | 1 + builds/amd64/installer/swi/PKG.yml | 1 + .../installer => amd64/installer/swi}/builds/.gitignore | 0 builds/amd64/installer/{ => swi}/builds/Makefile | 1 + builds/amd64/installer/{ => swi}/builds/boot-config | 0 builds/any/installer/APKG.yml | 2 +- builds/any/installer/grub/builds/Makefile | 6 +++++- builds/any/installer/uboot/builds/Makefile | 6 +++++- builds/armel/installer/PKG.yml | 1 - builds/armel/installer/installed/Makefile | 1 + builds/armel/installer/installed/PKG.yml | 1 + .../installer/installed}/builds/.gitignore | 0 builds/armel/installer/installed/builds/Makefile | 3 +++ builds/armel/installer/installed/builds/boot-config | 4 ++++ builds/armel/installer/swi/Makefile | 1 + builds/armel/installer/swi/PKG.yml | 1 + builds/armel/installer/swi/builds/.gitignore | 1 + builds/armel/installer/{ => swi}/builds/Makefile | 1 + builds/armel/installer/{ => swi}/builds/boot-config | 0 builds/powerpc/installer/PKG.yml | 1 - builds/powerpc/installer/installed/Makefile | 1 + builds/powerpc/installer/installed/PKG.yml | 1 + builds/powerpc/installer/installed/builds/.gitignore | 1 + builds/powerpc/installer/installed/builds/Makefile | 3 +++ builds/powerpc/installer/installed/builds/boot-config | 4 ++++ builds/powerpc/installer/swi/Makefile | 1 + builds/powerpc/installer/swi/PKG.yml | 2 ++ builds/powerpc/installer/swi/builds/.gitignore | 1 + builds/powerpc/installer/{ => swi}/builds/Makefile | 1 + builds/powerpc/installer/{ => swi}/builds/boot-config | 0 36 files changed, 52 insertions(+), 6 deletions(-) delete mode 100644 builds/amd64/installer/PKG.yml create mode 100644 builds/amd64/installer/installed/Makefile create mode 100644 builds/amd64/installer/installed/PKG.yml rename builds/amd64/installer/{ => installed}/builds/.gitignore (100%) create mode 100644 builds/amd64/installer/installed/builds/Makefile create mode 100644 builds/amd64/installer/installed/builds/boot-config create mode 100644 builds/amd64/installer/swi/Makefile create mode 100644 builds/amd64/installer/swi/PKG.yml rename builds/{armel/installer => amd64/installer/swi}/builds/.gitignore (100%) rename builds/amd64/installer/{ => swi}/builds/Makefile (87%) rename builds/amd64/installer/{ => swi}/builds/boot-config (100%) delete mode 100644 builds/armel/installer/PKG.yml create mode 100644 builds/armel/installer/installed/Makefile create mode 100644 builds/armel/installer/installed/PKG.yml rename builds/{powerpc/installer => armel/installer/installed}/builds/.gitignore (100%) create mode 100644 builds/armel/installer/installed/builds/Makefile create mode 100644 builds/armel/installer/installed/builds/boot-config create mode 100644 builds/armel/installer/swi/Makefile create mode 100644 builds/armel/installer/swi/PKG.yml create mode 100644 builds/armel/installer/swi/builds/.gitignore rename builds/armel/installer/{ => swi}/builds/Makefile (87%) rename builds/armel/installer/{ => swi}/builds/boot-config (100%) delete mode 100644 builds/powerpc/installer/PKG.yml create mode 100644 builds/powerpc/installer/installed/Makefile create mode 100644 builds/powerpc/installer/installed/PKG.yml create mode 100644 builds/powerpc/installer/installed/builds/.gitignore create mode 100644 builds/powerpc/installer/installed/builds/Makefile create mode 100644 builds/powerpc/installer/installed/builds/boot-config create mode 100644 builds/powerpc/installer/swi/Makefile create mode 100644 builds/powerpc/installer/swi/PKG.yml create mode 100644 builds/powerpc/installer/swi/builds/.gitignore rename builds/powerpc/installer/{ => swi}/builds/Makefile (88%) rename builds/powerpc/installer/{ => swi}/builds/boot-config (100%) diff --git a/builds/amd64/installer/PKG.yml b/builds/amd64/installer/PKG.yml deleted file mode 100644 index 7f363cd8..00000000 --- a/builds/amd64/installer/PKG.yml +++ /dev/null @@ -1 +0,0 @@ -!include $ONL/builds/any/installer/APKG.yml ARCH=amd64 diff --git a/builds/amd64/installer/installed/Makefile b/builds/amd64/installer/installed/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/amd64/installer/installed/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/amd64/installer/installed/PKG.yml b/builds/amd64/installer/installed/PKG.yml new file mode 100644 index 00000000..ac1ff1a6 --- /dev/null +++ b/builds/amd64/installer/installed/PKG.yml @@ -0,0 +1,2 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=amd64 BOOTMODE=INSTALLED + diff --git a/builds/amd64/installer/builds/.gitignore b/builds/amd64/installer/installed/builds/.gitignore similarity index 100% rename from builds/amd64/installer/builds/.gitignore rename to builds/amd64/installer/installed/builds/.gitignore diff --git a/builds/amd64/installer/installed/builds/Makefile b/builds/amd64/installer/installed/builds/Makefile new file mode 100644 index 00000000..bcff0452 --- /dev/null +++ b/builds/amd64/installer/installed/builds/Makefile @@ -0,0 +1,3 @@ +BOOTMODE=INSTALLED +include $(ONL)/make/config.amd64.mk +include $(ONL)/builds/any/installer/grub/builds/Makefile diff --git a/builds/amd64/installer/installed/builds/boot-config b/builds/amd64/installer/installed/builds/boot-config new file mode 100644 index 00000000..99685e0d --- /dev/null +++ b/builds/amd64/installer/installed/builds/boot-config @@ -0,0 +1,4 @@ +NETDEV=ma1 +NETAUTO=dhcp +BOOTMODE=INSTALLED +SWI=images::latest diff --git a/builds/amd64/installer/swi/Makefile b/builds/amd64/installer/swi/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/amd64/installer/swi/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/amd64/installer/swi/PKG.yml b/builds/amd64/installer/swi/PKG.yml new file mode 100644 index 00000000..8b4940f7 --- /dev/null +++ b/builds/amd64/installer/swi/PKG.yml @@ -0,0 +1 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=amd64 BOOTMODE=swi diff --git a/builds/armel/installer/builds/.gitignore b/builds/amd64/installer/swi/builds/.gitignore similarity index 100% rename from builds/armel/installer/builds/.gitignore rename to builds/amd64/installer/swi/builds/.gitignore diff --git a/builds/amd64/installer/builds/Makefile b/builds/amd64/installer/swi/builds/Makefile similarity index 87% rename from builds/amd64/installer/builds/Makefile rename to builds/amd64/installer/swi/builds/Makefile index 1f5d777c..ac17b603 100644 --- a/builds/amd64/installer/builds/Makefile +++ b/builds/amd64/installer/swi/builds/Makefile @@ -1,2 +1,3 @@ +BOOTMODE=SWI include $(ONL)/make/config.amd64.mk include $(ONL)/builds/any/installer/grub/builds/Makefile diff --git a/builds/amd64/installer/builds/boot-config b/builds/amd64/installer/swi/builds/boot-config similarity index 100% rename from builds/amd64/installer/builds/boot-config rename to builds/amd64/installer/swi/builds/boot-config diff --git a/builds/any/installer/APKG.yml b/builds/any/installer/APKG.yml index 62ad5191..0eaa849c 100644 --- a/builds/any/installer/APKG.yml +++ b/builds/any/installer/APKG.yml @@ -10,7 +10,7 @@ common: maintainer: support@bigswitch.com packages: - - name: onl-installer + - name: onl-installer-$BOOTMODE summary: Open Network Linux $ARCH Installer files: diff --git a/builds/any/installer/grub/builds/Makefile b/builds/any/installer/grub/builds/Makefile index 99be574f..660be639 100644 --- a/builds/any/installer/grub/builds/Makefile +++ b/builds/any/installer/grub/builds/Makefile @@ -2,6 +2,10 @@ ifndef ARCH $(error $$ARCH not set) endif +ifndef BOOTMODE +$(error $$BOOTMODE not set) +endif + ONLPLATFORM = python $(ONL)/tools/onlplatform.py PLATFORMS := $(shell $(ONLPM) --platform-manifest onl-loader-initrd:$(ARCH)) @@ -11,7 +15,7 @@ MKSHAR_PERMS = autoperms.sh # Hardcoded to match ONL File naming conventions. include $(ONL)/make/version-onl.mk -INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_INSTALLER +INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_$(BOOTMODE)_INSTALLER ifeq ($(ARCH), amd64) INSTALLER_ARCH = x86_64 diff --git a/builds/any/installer/uboot/builds/Makefile b/builds/any/installer/uboot/builds/Makefile index ea5ad357..e7db90ab 100644 --- a/builds/any/installer/uboot/builds/Makefile +++ b/builds/any/installer/uboot/builds/Makefile @@ -2,6 +2,10 @@ ifndef ARCH $(error $$ARCH not set) endif +ifndef BOOTMODE +$(error $$BOOTMODE not set) +endif + ONLPLATFORM = python $(ONL)/tools/onlplatform.py PLATFORMS := $(shell $(ONLPM) --platform-manifest onl-loader-initrd:$(ARCH)) @@ -15,7 +19,7 @@ PYFIT_ENVIRONMENT = PYTHONPATH=$(VONLDIR)/src/python # Hardcoded to match ONL File naming conventions. include $(ONL)/make/version-onl.mk -INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_INSTALLER +INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_$(BOOTMODE)_INSTALLER # default fit image can be used as the canonical location for the initrd FIT_IMAGE_ALL := $(shell $(ONLPM) --find-file onl-loader-fit:$(ARCH) onl-loader-fit.itb) diff --git a/builds/armel/installer/PKG.yml b/builds/armel/installer/PKG.yml deleted file mode 100644 index 2dba5e13..00000000 --- a/builds/armel/installer/PKG.yml +++ /dev/null @@ -1 +0,0 @@ -!include $ONL/builds/any/installer/APKG.yml ARCH=armel diff --git a/builds/armel/installer/installed/Makefile b/builds/armel/installer/installed/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/armel/installer/installed/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/armel/installer/installed/PKG.yml b/builds/armel/installer/installed/PKG.yml new file mode 100644 index 00000000..b92a4496 --- /dev/null +++ b/builds/armel/installer/installed/PKG.yml @@ -0,0 +1 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=armel BOOTMODE=installed diff --git a/builds/powerpc/installer/builds/.gitignore b/builds/armel/installer/installed/builds/.gitignore similarity index 100% rename from builds/powerpc/installer/builds/.gitignore rename to builds/armel/installer/installed/builds/.gitignore diff --git a/builds/armel/installer/installed/builds/Makefile b/builds/armel/installer/installed/builds/Makefile new file mode 100644 index 00000000..2e55e0c0 --- /dev/null +++ b/builds/armel/installer/installed/builds/Makefile @@ -0,0 +1,3 @@ +BOOTMODE=INSTALLED +include $(ONL)/make/config.armel.mk +include $(ONL)/builds/any/installer/uboot/builds/Makefile diff --git a/builds/armel/installer/installed/builds/boot-config b/builds/armel/installer/installed/builds/boot-config new file mode 100644 index 00000000..99685e0d --- /dev/null +++ b/builds/armel/installer/installed/builds/boot-config @@ -0,0 +1,4 @@ +NETDEV=ma1 +NETAUTO=dhcp +BOOTMODE=INSTALLED +SWI=images::latest diff --git a/builds/armel/installer/swi/Makefile b/builds/armel/installer/swi/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/armel/installer/swi/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/armel/installer/swi/PKG.yml b/builds/armel/installer/swi/PKG.yml new file mode 100644 index 00000000..51d53064 --- /dev/null +++ b/builds/armel/installer/swi/PKG.yml @@ -0,0 +1 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=armel BOOTMODE=swi diff --git a/builds/armel/installer/swi/builds/.gitignore b/builds/armel/installer/swi/builds/.gitignore new file mode 100644 index 00000000..fbd18542 --- /dev/null +++ b/builds/armel/installer/swi/builds/.gitignore @@ -0,0 +1 @@ +*INSTALLER diff --git a/builds/armel/installer/builds/Makefile b/builds/armel/installer/swi/builds/Makefile similarity index 87% rename from builds/armel/installer/builds/Makefile rename to builds/armel/installer/swi/builds/Makefile index f1443e22..84e3c64d 100644 --- a/builds/armel/installer/builds/Makefile +++ b/builds/armel/installer/swi/builds/Makefile @@ -1,2 +1,3 @@ +BOOTMODE=SWI include $(ONL)/make/config.armel.mk include $(ONL)/builds/any/installer/uboot/builds/Makefile diff --git a/builds/armel/installer/builds/boot-config b/builds/armel/installer/swi/builds/boot-config similarity index 100% rename from builds/armel/installer/builds/boot-config rename to builds/armel/installer/swi/builds/boot-config diff --git a/builds/powerpc/installer/PKG.yml b/builds/powerpc/installer/PKG.yml deleted file mode 100644 index 2bb3e575..00000000 --- a/builds/powerpc/installer/PKG.yml +++ /dev/null @@ -1 +0,0 @@ -!include $ONL/builds/any/installer/APKG.yml ARCH=powerpc diff --git a/builds/powerpc/installer/installed/Makefile b/builds/powerpc/installer/installed/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/powerpc/installer/installed/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/powerpc/installer/installed/PKG.yml b/builds/powerpc/installer/installed/PKG.yml new file mode 100644 index 00000000..25b0b747 --- /dev/null +++ b/builds/powerpc/installer/installed/PKG.yml @@ -0,0 +1 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=powerpc BOOTMODE=INSTALLED diff --git a/builds/powerpc/installer/installed/builds/.gitignore b/builds/powerpc/installer/installed/builds/.gitignore new file mode 100644 index 00000000..fbd18542 --- /dev/null +++ b/builds/powerpc/installer/installed/builds/.gitignore @@ -0,0 +1 @@ +*INSTALLER diff --git a/builds/powerpc/installer/installed/builds/Makefile b/builds/powerpc/installer/installed/builds/Makefile new file mode 100644 index 00000000..844194c7 --- /dev/null +++ b/builds/powerpc/installer/installed/builds/Makefile @@ -0,0 +1,3 @@ +BOOTMODE=INSTALLED +include $(ONL)/make/config.powerpc.mk +include $(ONL)/builds/any/installer/uboot/builds/Makefile diff --git a/builds/powerpc/installer/installed/builds/boot-config b/builds/powerpc/installer/installed/builds/boot-config new file mode 100644 index 00000000..99685e0d --- /dev/null +++ b/builds/powerpc/installer/installed/builds/boot-config @@ -0,0 +1,4 @@ +NETDEV=ma1 +NETAUTO=dhcp +BOOTMODE=INSTALLED +SWI=images::latest diff --git a/builds/powerpc/installer/swi/Makefile b/builds/powerpc/installer/swi/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/builds/powerpc/installer/swi/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/builds/powerpc/installer/swi/PKG.yml b/builds/powerpc/installer/swi/PKG.yml new file mode 100644 index 00000000..e38c1eb8 --- /dev/null +++ b/builds/powerpc/installer/swi/PKG.yml @@ -0,0 +1,2 @@ +!include $ONL/builds/any/installer/APKG.yml ARCH=powerpc BOOTMODE=swi + diff --git a/builds/powerpc/installer/swi/builds/.gitignore b/builds/powerpc/installer/swi/builds/.gitignore new file mode 100644 index 00000000..fbd18542 --- /dev/null +++ b/builds/powerpc/installer/swi/builds/.gitignore @@ -0,0 +1 @@ +*INSTALLER diff --git a/builds/powerpc/installer/builds/Makefile b/builds/powerpc/installer/swi/builds/Makefile similarity index 88% rename from builds/powerpc/installer/builds/Makefile rename to builds/powerpc/installer/swi/builds/Makefile index 414f0bbb..4dba3a3e 100644 --- a/builds/powerpc/installer/builds/Makefile +++ b/builds/powerpc/installer/swi/builds/Makefile @@ -1,2 +1,3 @@ +BOOTMODE=SWI include $(ONL)/make/config.powerpc.mk include $(ONL)/builds/any/installer/uboot/builds/Makefile diff --git a/builds/powerpc/installer/builds/boot-config b/builds/powerpc/installer/swi/builds/boot-config similarity index 100% rename from builds/powerpc/installer/builds/boot-config rename to builds/powerpc/installer/swi/builds/boot-config From 9194aff9da7d96a6fac7e392e884da711ab9d4a1 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 27 May 2016 11:36:44 -0700 Subject: [PATCH 21/33] Don't install an empty version file --- packages/base/all/initrds/loader-initrd-files/src/bin/swiprep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep index 00c40770..1e78e828 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep @@ -185,7 +185,7 @@ fi # If there is a SWI version file put it in /etc/onl/swi_version unzip -oq "$swipath" version > "$workdir/version" -if test -f "$workdir/version"; then +if test -s "$workdir/version"; then cp "$workdir/version" "$destdir/etc/onl/swi_version" fi From c7ae9a68c3e484e3cebe18375b84afb7652c0aba Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 27 May 2016 12:41:17 -0700 Subject: [PATCH 22/33] Use time module to compute timestamps --- tools/make-versions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/make-versions.py b/tools/make-versions.py index 2813c44e..5bc2625d 100755 --- a/tools/make-versions.py +++ b/tools/make-versions.py @@ -7,6 +7,7 @@ import subprocess import json import pprint import yaml +import time class OnlVersionsGenerator(object): def __init__(self, ops): @@ -20,8 +21,12 @@ class OnlVersionsGenerator(object): raise ValueError("The import file %s does not contain a class named %s" % (ops.import_file, ops.class_name)) self.ops = ops - self.build_sha1 = subprocess.check_output("git rev-list HEAD -1", shell=True).strip() - self.build_timestamp =subprocess.check_output("date +%Y-%m-%d.%H:%M", shell=True).strip() + + cmd = ('git', 'rev-list', 'HEAD', '-1',) + self.build_sha1 = subprocess.check_output(cmd).strip() + + fmt = "%Y-%m-%d.%H:%M" + self.build_timestamp = time.strftime(fmt, time.localtime()) def generate_all(self): for product in self.implementation.PRODUCTS: From b21007c70ab6ca50ccd5ef81374a1ad4cd55227e Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 27 May 2016 13:02:53 -0700 Subject: [PATCH 23/33] Install manifest.json if available - Hurr, fix unzip arguments - put manifest and/or version at root level too --- .../all/initrds/loader-initrd-files/src/bin/swiprep | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep index 1e78e828..449d333f 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep @@ -170,7 +170,7 @@ fi rm -f $workdir/rootfs.sqsh # Install any SWI data packages. -unzip -oq "$swipath" swi-data.tar.gz > "$workdir/swi-data.tar.gz" +unzip -pq "$swipath" swi-data.tar.gz > "$workdir/swi-data.tar.gz" if test -s "$workdir/swi-data.tar.gz"; then echo "installing SWI data into /boot..." tar -C "$destdir/boot" -xzf "$workdir/swi-data.tar.gz" @@ -183,10 +183,16 @@ if [ -f /etc/fw_env.config ]; then cat /etc/fw_env.config > "$destdir/etc/fw_env.config" fi -# If there is a SWI version file put it in /etc/onl/swi_version -unzip -oq "$swipath" version > "$workdir/version" +# If there are SWI version file(s) put them in /etc/onl +unzip -pq "$swipath" version > "$workdir/version" if test -s "$workdir/version"; then cp "$workdir/version" "$destdir/etc/onl/swi_version" + cp "$workdir/version" "$destdir/.swi_version" +fi +unzip -pq "$swipath" manifest.json > "$workdir/manifest.json" +if test -s "$workdir/manifest.json"; then + cp "$workdir/manifest.json" "$destdir/etc/onl/swi_manifest.json" + cp "$workdir/manifest.json" "$destdir/.swi_manifest.json" fi if test "$swiref"; then From 35db5ffb43fbb5a9c783a5607b5d60eccd436caf Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 27 May 2016 13:06:14 -0700 Subject: [PATCH 24/33] Better implementation of 'latest' - swi file timestamp is unreliable if clock is not set correctly - extract build timestamp from manifest if available - extract timestamp-ish string from 'version' file or from swi filename --- .../loader-initrd-files/src/bin/swiget | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiget b/packages/base/all/initrds/loader-initrd-files/src/bin/swiget index 0e0a23f3..34615678 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/swiget +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiget @@ -12,6 +12,9 @@ import subprocess import shutil import logging import tempfile +import re +import json +import zipfile import onl.install.InstallUtils MountContext = onl.install.InstallUtils.MountContext @@ -24,6 +27,98 @@ OnlMountManager = onl.mounts.OnlMountManager import onl.network HostInfo = onl.network.HostInfo +SWI_TIMESTAMP_FMT = "%Y-%m-%d.%H:%M" + +SWI_TIMESTAMP_RE = re.compile(r""" + [0-9][0-9][0-9][0-9] [-] [0-9][0-9] [-] [0-9][0-9] + [.] + [0-9][0-9] [:] [0-9][0-9] +""", re.VERBOSE) + +SWI_FNAME_TIMESTAMP_FMT = "%Y-%m-%d.%H%M" + +SWI_FNAME_TIMESTAMP_RE = re.compile(r""" + [0-9][0-9][0-9][0-9] [-] [0-9][0-9] [-] [0-9][0-9] + [.] + [0-9][0-9] [0-9][0-9] +""", re.VERBOSE) + +def versionSortKey(vstr): + + m = SWI_TIMESTAMP_RE.search(vstr) + if m is not None: + try: + return time.mktime(time.strptime(m.group(0), SWI_TIMESTAMP_FMT)) + except ValueError: + pass + + m = SWI_FNAME_TIMESTAMP_RE.search(vstr) + if m is not None: + try: + return time.mktime(time.strptime(m.group(0), SWI_FNAME_TIMESTAMP_FMT)) + except ValueError: + pass + + return None + +def manifestSortKey(mdata): + + mdata = mdata.get('version', {}) + + vstr = mdata.get('BUILD_TIMESTAMP', None) + if vstr is not None: + try: + return time.mktime(time.strptime(vstr, SWI_TIMESTAMP_FMT)) + except ValueError: + pass + + vstr = mdata.get('FNAME_BUILD_TIMESTAMP', None) + if vstr is not None: + try: + return time.mktime(time.strptime(vstr, SWI_FNAME_TIMESTAMP_FMT)) + except ValueError: + pass + + return None + +def swiSortKey(swiPath): + + try: + zf = zipfile.ZipFile(swiPath, "r") + except zipfile.BadZipFile: + return os.path.getmtime(swiPath) + + try: + fd = zf.open("manifest.json", "r") + except KeyError: + fd = None + if fd is not None: + data = json.load(fd) + fd.close() + else: + data = {} + ts = manifestSortKey(data) + if ts is not None: return ts + + try: + fd = zf.open("version", "r") + except KeyError: + fd = None + if fd is not None: + vstr = fd.read() + fd.close() + else: + vstr = "" + ts = versionSortKey(vstr) + if ts is not None: return ts + + ts = versionSortKey(swiPath) + if ts is not None: return ts + # maybe the timestamp is embedded into the filename + + # else, use the filesytem mtime, which is less reliable + return os.path.getmtime(swiPath) + class Runner(onl.install.InstallUtils.SubprocessMixin): def __init__(self, log): @@ -188,7 +283,7 @@ class Runner(onl.install.InstallUtils.SubprocessMixin): def latest(d): l = [x for x in os.listdir(d) if x.endswith('.swi')] l = [os.path.join(d, x) for x in l] - l.sort(key=os.path.getmtime) + l.sort(key=swiSortKey) return l[-1] pm = ProcMountsParser() From 2a6cbbacf7c903ffae142478e41b10755d2b873d Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 27 May 2016 13:11:48 -0700 Subject: [PATCH 25/33] fpm/deb do not like uppercase letters in package names. ORLY? --- builds/amd64/installer/installed/PKG.yml | 2 +- builds/powerpc/installer/installed/PKG.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builds/amd64/installer/installed/PKG.yml b/builds/amd64/installer/installed/PKG.yml index ac1ff1a6..4b375b2f 100644 --- a/builds/amd64/installer/installed/PKG.yml +++ b/builds/amd64/installer/installed/PKG.yml @@ -1,2 +1,2 @@ -!include $ONL/builds/any/installer/APKG.yml ARCH=amd64 BOOTMODE=INSTALLED +!include $ONL/builds/any/installer/APKG.yml ARCH=amd64 BOOTMODE=installed diff --git a/builds/powerpc/installer/installed/PKG.yml b/builds/powerpc/installer/installed/PKG.yml index 25b0b747..2447d684 100644 --- a/builds/powerpc/installer/installed/PKG.yml +++ b/builds/powerpc/installer/installed/PKG.yml @@ -1 +1 @@ -!include $ONL/builds/any/installer/APKG.yml ARCH=powerpc BOOTMODE=INSTALLED +!include $ONL/builds/any/installer/APKG.yml ARCH=powerpc BOOTMODE=installed From 85c3880610ba55b0949b043d15e0dc7bbdf03e26 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Tue, 31 May 2016 12:57:28 -0700 Subject: [PATCH 26/33] Fixed path for version files --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 96dab5a6..1141235e 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ docker-debug: docker_check versions: - $(ONL)/tools/make-versions.py --import-file=$(ONL)/tools/onlvi --class-name=OnlVersionImplementation --output-dir $(ONL)/make --force + $(ONL)/tools/make-versions.py --import-file=$(ONL)/tools/onlvi --class-name=OnlVersionImplementation --output-dir $(ONL)/make/versions --force relclean: @find $(ONL)/RELEASE -name "ONL-*" -delete From dbc63575e75fcb0ff3739c641ed9810fa9dfd1fa Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 1 Jun 2016 18:48:35 -0700 Subject: [PATCH 27/33] Update swiprep version locations, add --record option --- .../loader-initrd-files/src/bin/swiprep | 114 +++++++++++------- 1 file changed, 73 insertions(+), 41 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep index 449d333f..0753957c 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/swiprep @@ -13,6 +13,7 @@ destdir= swiref= mode_install= mode_overlay= +mode_record= flag_unmount= while test $# -gt 0; do @@ -29,10 +30,9 @@ while test $# -gt 0; do shift continue ;; - --swiref) - shift - swiref=$1 + --record) shift + mode_record=1 continue ;; --unmount) @@ -40,6 +40,12 @@ while test $# -gt 0; do flag_unmount=1 continue ;; + --swiref) + shift + swiref=$1 + shift + continue + ;; -*) echo "*** invalid option $1" 1>&2 exit 1 @@ -76,9 +82,9 @@ else echo "*** missing destdir" 1>&2 exit 1 fi -case "${mode_install}:${mode_overlay}" in - :) - echo "*** missing --install or --overlay" 1>&2 +case "${mode_install}:${mode_overlay}:${mode_record}" in + ::) + echo "*** missing --install or --overlay or --record" 1>&2 exit 1 ;; esac @@ -87,11 +93,12 @@ if test $# -gt 0; then exit 1 fi -mkdir -p "$destdir" - -rm -fr "$destdir"/* "$destdir"/.??* -if grep -q " $destdir " /proc/mounts; then - mkdir "$destdir/lost+found" +if test "${mode_install}${mode_overlay}"; then + mkdir -p "$destdir" + rm -fr "$destdir"/* "$destdir"/.??* + if grep -q " $destdir " /proc/mounts; then + mkdir "$destdir/lost+found" + fi fi if test "$flag_unmount"; then @@ -109,7 +116,11 @@ else workdir=$(mktemp -t -d swiprep-XXXXXX) fi -echo "extracting SWI $swipath --> $workdir" +if test "$mode_record"; then + echo "recording SWI $swipath --> $workdir" +else + echo "extracting SWI $swipath --> $workdir" +fi do_cleanup() { cd / @@ -133,13 +144,15 @@ case $(uname -m) in q;; esac -for arch in $ARCH_LIST; do - unzip -pq "$swipath" "rootfs-${arch}.sqsh" > "$workdir/rootfs.sqsh" - if test -s "$workdir/rootfs.sqsh"; then break; fi -done -if test ! -s "$workdir/rootfs.sqsh"; then - echo "*** cannot find a valid rootfs" 1>&2 - exit 1 +if test "${mode_install}${mode_overlay}"; then + for arch in $ARCH_LIST; do + unzip -pq "$swipath" "rootfs-${arch}.sqsh" > "$workdir/rootfs.sqsh" + if test -s "$workdir/rootfs.sqsh"; then break; fi + done + if test ! -s "$workdir/rootfs.sqsh"; then + echo "*** cannot find a valid rootfs" 1>&2 + exit 1 + fi fi if test "$mode_install"; then @@ -169,36 +182,55 @@ if test "$mode_overlay"; then fi rm -f $workdir/rootfs.sqsh -# Install any SWI data packages. -unzip -pq "$swipath" swi-data.tar.gz > "$workdir/swi-data.tar.gz" -if test -s "$workdir/swi-data.tar.gz"; then - echo "installing SWI data into /boot..." - tar -C "$destdir/boot" -xzf "$workdir/swi-data.tar.gz" +if test "${mode_install}${mode_overlay}"; then + + # Install any SWI data packages. + unzip -pq "$swipath" swi-data.tar.gz > "$workdir/swi-data.tar.gz" + if test -s "$workdir/swi-data.tar.gz"; then + echo "installing SWI data into /boot..." + tar -C "$destdir/boot" -xzf "$workdir/swi-data.tar.gz" + fi + + mkdir -p "$destdir/etc/onl" + + cp -R /etc/onl/* "$destdir/etc/onl/." + if [ -f /etc/fw_env.config ]; then + cat /etc/fw_env.config > "$destdir/etc/fw_env.config" + fi + fi -mkdir -p "$destdir/etc/onl" - -cp -R /etc/onl/* "$destdir/etc/onl/." -if [ -f /etc/fw_env.config ]; then - cat /etc/fw_env.config > "$destdir/etc/fw_env.config" -fi +if test "$mode_record"; then + vdestdir="$destdir/etc/onl/upgrade/swi" +else + vdestdir="$destdir/etc/onl/rootfs" +fi # If there are SWI version file(s) put them in /etc/onl -unzip -pq "$swipath" version > "$workdir/version" -if test -s "$workdir/version"; then - cp "$workdir/version" "$destdir/etc/onl/swi_version" - cp "$workdir/version" "$destdir/.swi_version" +if test ! -f "$vdestdir/version"; then + unzip -pq "$swipath" version > "$workdir/version" + if test -s "$workdir/version"; then + mkdir -p "$vdestdir" + cp "$workdir/version" "$vdestdir/version" + fi fi -unzip -pq "$swipath" manifest.json > "$workdir/manifest.json" -if test -s "$workdir/manifest.json"; then - cp "$workdir/manifest.json" "$destdir/etc/onl/swi_manifest.json" - cp "$workdir/manifest.json" "$destdir/.swi_manifest.json" +if test ! -f "$vdestdir/manifest.json"; then + unzip -pq "$swipath" manifest.json > "$workdir/manifest.json" + if test -s "$workdir/manifest.json"; then + mkdir -p "$vdestdir" + cp "$workdir/manifest.json" "$vdestdir/manifest.json" + fi fi -if test "$swiref"; then - echo "$swiref" > "$destdir/.swi" +if test -z "$swiref"; then + swiref=$swipath +fi + +if test "$mode_record"; then + mkdir -p "$destdir/etc/onl/upgrade/swi" + echo "$swiref" > "$destdir/etc/onl/upgrade/swi/SWI" else - echo "$swipath" > "$destdir/.swi" + echo "$swiref" > "$destdir/etc/onl/SWI" fi exit 0 From 6bd030c898dc105aa82ac98640b21a3c65110db0 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 1 Jun 2016 18:48:52 -0700 Subject: [PATCH 28/33] Record SWI data before booting --- packages/base/all/initrds/loader-initrd-files/src/bin/boot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/boot b/packages/base/all/initrds/loader-initrd-files/src/bin/boot index a532d5a3..a8cfd7af 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/boot +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/boot @@ -140,8 +140,8 @@ if [ -d "${swipath}" ]; then umount -l /newroot 2>/dev/null || : mount --bind "${swipath}/${rootfs}" /newroot else - echo "$swistamp" > /etc/onl/SWI swiprep --overlay "${swipath}${rootfs}" --unmount --swiref "$swistamp" /newroot + swiprep --record "${swipath}${rootfs}" --swiref "$swistamp" /newroot fi # From 05561cd4824f4b9ab7978e84ed6cdcd748ff21e7 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 1 Jun 2016 18:49:20 -0700 Subject: [PATCH 29/33] Record SWI data before switchroot - also update version location(s) --- .../all/initrds/loader-initrd-files/src/bootmodes/installed | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed index 00fe97d7..00aa3a41 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed +++ b/packages/base/all/initrds/loader-initrd-files/src/bootmodes/installed @@ -37,7 +37,7 @@ case "$SWI" in ""|dir:*|nfs://*/) msg_info "*** missing SWI file, will attempt to boot existing image" - if [ ! -f /mnt/onl/data/.swi ]; then + if [ ! -s /mnt/onl/data/etc/onl/SWI ]; then msg_error "Un-populated /mnt/onl/data, cannot continue" exit 200 fi @@ -50,7 +50,7 @@ case "$SWI" in TMPDIR=$swiget_workdir swipath=$(swiget $SWI) # do some sort of test to see if it's populated - if [ ! -f /mnt/onl/data/.swi ]; then + if [ ! -s /mnt/onl/data/etc/onl/SWI ]; then msg_info "Un-populated /mnt/onl/data, will (re-)image" do_unpack=1 else @@ -68,13 +68,13 @@ case "$SWI" in ;; esac -echo "$swistamp" > /etc/onl/SWI sed -i -e '/^SWI=/d' /etc/onl/BOOTPARAMS echo "SWI=dir:data:/" >> /etc/onl/BOOTPARAMS if [ "$do_unpack" ]; then swiprep --install "$swipath" --swiref "$swistamp" /mnt/onl/data fi +swiprep --record "$swipath" --swiref "$swistamp" /mnt/onl/data trap - 0 1 do_cleanup From 94ac25053bf49bc7d9261c8ae08e92bd7863e2ff Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Wed, 1 Jun 2016 18:49:33 -0700 Subject: [PATCH 30/33] Added stub SWI upgrade script --- .../src/boot.d/63.upgrade-swi | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 packages/base/all/vendor-config-onl/src/boot.d/63.upgrade-swi diff --git a/packages/base/all/vendor-config-onl/src/boot.d/63.upgrade-swi b/packages/base/all/vendor-config-onl/src/boot.d/63.upgrade-swi new file mode 100755 index 00000000..660159b2 --- /dev/null +++ b/packages/base/all/vendor-config-onl/src/boot.d/63.upgrade-swi @@ -0,0 +1,71 @@ +#!/usr/bin/python + +"""63.upgrade-swi + +SWI upgrade hook + +This is currently a place-holder, we don't actually have a mechanism +to upgrade the SWI, only a means to detect if a SWI upgrade is indicated. + +""" + +import os +import re +from onl.upgrade import ubase + +class Swi_Upgrade(ubase.BaseUpgrade): + name="swi" + Name="SWI" + title="SWI Upgrade Check" + atype="A SWI" + + current_version_key="Current SWI Version" + next_version_key="Next SWI Version" + + def init_versions(self): + """Scrape out the SWI versions. + + Use recorded version manifest, or a bare version file. + XXX probably can also scrape it from the SWI filename, + but FNAME variants are not 1:1 translatible. + """ + + self.current_version = self.next_version = None + + data = self.load_json("/etc/onl/rootfs/manifest.json", default={}).get('version', {}) + vstr = data.get('RELEASE_ID', None) + if self.next_version is None and vstr is not None: + self.next_version = vstr + + if self.next_version is None and os.path.exists("/etc/onl/rootfs/version"): + with open("/etc/onl/rootfs/version") as fd: + self.next_version = fd.read().strip() + + data = self.load_json("/etc/onl/upgrade/swi/manifest.json", default={}).get('version', {}) + vstr = data.get('RELEASE_ID', None) + if self.current_version is None and vstr is not None: + self.current_version = vstr + + if self.current_version is None and os.path.exists("/etc/onl/upgrade/swi/version"): + with open("/etc/onl/upgrade/swi/version") as fd: + self.next_version = fd.read().strip() + + def summarize(self): + self.logger.info("Current SWI Version: %s" % self.current_version) + self.logger.info(" Next SWI Version: %s" % self.next_version) + self.logger.info("") + + def upgrade_notes(self): + return """ + * A single reboot will be required to complete this upgrade. +""" + + def do_upgrade(self, forced=False): + """Execute the upgradee. + + SWI upgrade depends on a new SWI being available (DUH). + """ + self.logger.info("THIS STEP INTENTIONALLY LEFT BLANK") + +if __name__ == '__main__': + Swi_Upgrade().main() From ac6f24629196921561080a9ce1bd9b054e1104dc Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 22 Jul 2016 13:27:58 -0700 Subject: [PATCH 31/33] Remount onie-boot if necessary --- builds/any/installer/installer.sh.in | 24 ++++++++-- .../vendor-config-onl/src/lib/install/lib.sh | 47 +++++++++++++++++++ 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/builds/any/installer/installer.sh.in b/builds/any/installer/installer.sh.in index e2dbd86e..fc2a95fa 100644 --- a/builds/any/installer/installer.sh.in +++ b/builds/any/installer/installer.sh.in @@ -399,10 +399,26 @@ installer_mkchroot "${rootdir}" mkdir -p "${rootdir}/mnt/installer" mount -o ro,bind "${installer_dir}" "${rootdir}/mnt/installer" -# make the onie boot files available to the chroot -mkdir -p "${rootdir}/mnt/onie-boot" -if test -d "/mnt/onie-boot"; then - mount -o ro,bind "/mnt/onie-boot" "${rootdir}/mnt/onie-boot" +# make sure onie-boot is mounted +if test -d /mnt/onie-boot; then + if grep -q " /mnt/onie-boot " /proc/mounts; then + : + else + ONIE_BOOT_DEVICE= + visit_blkid blkid_find_onie + if test -b "$ONIE_BOOT_DEVICE"; then + installer_say "Mounting ONIE-BOOT ($ONIE_BOOT_DEVICE) as /mnt/onie-boot" + mount -o defaults,rw $ONIE_BOOT_DEVICE /mnt/onie-boot + else + installer_say "*** missing ONIE-BOOT device" + fi + fi + + if grep -q " /mnt/onie-boot " /proc/mounts; then + # make the onie boot files available to the chroot + mkdir -p "${rootdir}/mnt/onie-boot" + mount -o ro,bind "/mnt/onie-boot" "${rootdir}/mnt/onie-boot" + fi fi # generate config for installer environment diff --git a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh index 78a5033b..cce68557 100644 --- a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh +++ b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh @@ -123,6 +123,53 @@ installer_mkchroot() { fi } +visit_blkid() +{ + local fn rest + fn=$1; shift + rest="$@" + + local ifs + ifs=IFS; IFS=$CR + for line in $(blkid); do + IFS=$ifs + + local dev + dev=${line%%:*} + line=${line#*:} + + local TYPE LABEL PARTLABEL UUID PARTUUID + while test "$line"; do + local key + key=${line%%=*} + line=${line#*=} + case "$line" in + '"'*) + line=${line#\"} + val=${line%%\"*} + line=${line#*\"} + line=${line## } + ;; + *) + val=${line%% *} + line=${line#* } + ;; + esac + eval "$key=\"$val\"" + done + + local sts + eval $fn \"$dev\" \"$LABEL\" \"$UUID\" \"$PARTLABEL\" \"$PARTUUID\" $rest + sts=$? + if test $sts -eq 2; then break; fi + if test $sts -ne 0; then return $sts; fi + + done + IFS=$ifs + + return 0 +} + # Local variables # mode: sh # sh-basic-offset: 2 From b1b0b218fdcacdb5bba0cbc21f831b3b2cce9421 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 22 Jul 2016 13:33:00 -0700 Subject: [PATCH 32/33] Updates for large disks - report logical and physical sector sizes - be less strict about sector sizes - align partitions on physical sector size --- .../src/python/onl/install/BaseInstall.py | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py index f18cd649..44fc575a 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py @@ -225,9 +225,28 @@ class Base: devices = {} def _u2s(sz, u): + """Convert to units of logical sectors.""" bsz = sz * u - bsz = bsz + self.partedDevice.physicalSectorSize - 1 - return bsz / self.partedDevice.physicalSectorSize + bsz = bsz + self.partedDevice.sectorSize - 1 + return bsz / self.partedDevice.sectorSize + + def _align(spos): + """Align this sector number.""" + sz = self.partedDevice.sectorSize + psz = self.partedDevice.physicalSectorSize + + if type(psz) != int: return spos + if psz <= sz: return spos + if (psz % sz) != 0: return spos + if psz > 1048576: return spos + + stride = psz / sz + off = spos % stride + off = stride - off + off = off % stride + + spos += off + return spos UNITS = { 'GiB' : 1024 * 1024 * 1024, @@ -260,7 +279,7 @@ class Base: part, sz) return 1 - start = nextBlock + start = _align(nextBlock) end = start + cnt - 1 if end <= self.partedDevice.getLength(): self.log.info("Allocating %d sectors for %s", @@ -526,15 +545,17 @@ class GrubInstaller(SubprocessMixin, Base): self.log.info("disk is %s", self.partedDevice.path) + self.log.info("found %s partitions (bsz %s, lbsz %s)", + self.partedDisk.type, + self.partedDevice.sectorSize, + self.partedDevice.physicalSectorSize) if self.partedDisk.type != 'gpt': self.log.error("not a GPT partition table") return 1 if self.partedDevice.sectorSize != 512: - self.log.error("invalid logical block size") - return 1 + self.log.warn("invalid logical block size, expected 512") if self.partedDevice.physicalSectorSize != 512: - self.log.error("invalid physical block size") - return 1 + self.log.warn("invalid physical block size, expected 512") self.log.info("found a disk with %d blocks", self.partedDevice.getLength()) @@ -745,15 +766,17 @@ class UbootInstaller(SubprocessMixin, Base): self.log.info("Installing to %s", self.device) + self.log.info("found %s partitions (bsz %s, lbsz %s)", + self.partedDisk.type, + self.partedDevice.sectorSize, + self.partedDevice.physicalSectorSize) if self.partedDisk.type != 'msdos': self.log.error("not an MSDOS partition table") return 1 if self.partedDevice.sectorSize != 512: - self.log.error("invalid logical block size") - return 1 + self.log.warn("invalid logical block size, expected 512") if self.partedDevice.physicalSectorSize != 512: - self.log.error("invalid physical block size") - return 1 + self.log.warn("invalid physical block size, expected 512") self.log.info("found a disk with %d blocks", self.partedDevice.getLength()) From 551eb28d3353a590112eb635e8805fa573c2e4de Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Fri, 22 Jul 2016 13:39:13 -0700 Subject: [PATCH 33/33] Re-introduce code that identifies already-mounted rootfs --- .../src/python/onl/mounts/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py b/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py index ee72b0f6..8a71d02b 100755 --- a/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/mounts/__init__.py @@ -41,18 +41,19 @@ class MountManager(object): def mount(self, device, directory, mode='r', timeout=5): mountargs = [ str(mode) ] - current = self.is_mounted(device, directory) - if current: + currentItems = [x for x in self.mounts.iteritems() if x[1]['dev'] == device] + if currentItems: + currentDirectory, current = currentItems[0] if current['mode'] == mode: # Already mounted as requested. self.logger.debug("%s already mounted @ %s with mode %s. Doing nothing." % (device, directory, mode)) return True - elif device == current['dir']: + elif directory != currentDirectory: # Already mounted, at a different location (e.g. '/'), but not in the requested mode. self.logger.debug("%s mounted @ %s (%s) with mode %s. It will be remounted %s.", - device, directory, current['dir'], current['mode'], mode) + device, directory, currentDirectory, current['mode'], mode) mountargs.append('remount') - directory = current['dir'] + directory = currentDirectory else: # Already mounted, but not in the requested mode. self.logger.debug("%s mounted @ %s with mode %s. It will be remounted %s." % (device, directory, current['mode'], mode))