text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="7.7.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="inch" altunit="inch"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="no" active="no"/>
<layer number="2" name="Route2" color="1" fill="3" visible="no" active="no"/>
<layer number="3" name="Route3" color="4" fill="3" visible="no" active="no"/>
<layer number="14" name="Route14" color="1" fill="6" visible="no" active="no"/>
<layer number="15" name="Route15" color="4" fill="6" visible="no" active="no"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="no" active="no"/>
<layer number="17" name="Pads" color="2" fill="1" visible="no" active="no"/>
<layer number="18" name="Vias" color="2" fill="1" visible="no" active="no"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="no" active="no"/>
<layer number="20" name="Dimension" color="15" fill="1" visible="no" active="no"/>
<layer number="21" name="tPlace" color="7" fill="1" visible="no" active="no"/>
<layer number="22" name="bPlace" color="7" fill="1" visible="no" active="no"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="no" active="no"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="no" active="no"/>
<layer number="25" name="tNames" color="7" fill="1" visible="no" active="no"/>
<layer number="26" name="bNames" color="7" fill="1" visible="no" active="no"/>
<layer number="27" name="tValues" color="7" fill="1" visible="no" active="no"/>
<layer number="28" name="bValues" color="7" fill="1" visible="no" active="no"/>
<layer number="29" name="tStop" color="7" fill="3" visible="no" active="no"/>
<layer number="30" name="bStop" color="7" fill="6" visible="no" active="no"/>
<layer number="31" name="tCream" color="7" fill="4" visible="no" active="no"/>
<layer number="32" name="bCream" color="7" fill="5" visible="no" active="no"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="no" active="no"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="no" active="no"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="no" active="no"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="no" active="no"/>
<layer number="37" name="tTest" color="7" fill="1" visible="no" active="no"/>
<layer number="38" name="bTest" color="7" fill="1" visible="no" active="no"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="no" active="no"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="no" active="no"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="no" active="no"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="no" active="no"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="no" active="no"/>
<layer number="44" name="Drills" color="7" fill="1" visible="no" active="no"/>
<layer number="45" name="Holes" color="7" fill="1" visible="no" active="no"/>
<layer number="46" name="Milling" color="3" fill="1" visible="no" active="no"/>
<layer number="47" name="Measures" color="7" fill="1" visible="no" active="no"/>
<layer number="48" name="Document" color="7" fill="1" visible="no" active="no"/>
<layer number="49" name="Reference" color="7" fill="1" visible="no" active="no"/>
<layer number="51" name="tDocu" color="6" fill="1" visible="no" active="no"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="no" active="no"/>
<layer number="90" name="Modules" color="5" fill="1" visible="yes" active="yes"/>
<layer number="91" name="Nets" color="2" fill="1" visible="yes" active="yes"/>
<layer number="92" name="Busses" color="1" fill="1" visible="yes" active="yes"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="yes"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="yes" active="yes"/>
<layer number="95" name="Names" color="7" fill="1" visible="yes" active="yes"/>
<layer number="96" name="Values" color="7" fill="1" visible="yes" active="yes"/>
<layer number="97" name="Info" color="7" fill="1" visible="yes" active="yes"/>
<layer number="98" name="Guide" color="6" fill="1" visible="yes" active="yes"/>
</layers>
<schematic xreflabel="%F%N/%S.%C%R" xrefpart="/%S.%C%R">
<libraries>
<library name="con-pulse">
<description>Pulse Engineering, Inc.

www.pulseeng.com
<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="J1">
<description>PULSEJACK (TM) 1x1 Tab-UP RJ45

10/100 Base-TX RJ45 1x1 Tab-UP with LEDs 8-pin (J1 series) and 6-pin (JP series) integrated magnetics connector,

designed to support applications, such as ADSL modems, LAN-on-Motherboard, and Hub and Switches.

Source: www.pulseeng.com .. PulseJack-J402.pdf</description>
<wire x1="-8.405" y1="-17.05" x2="8.405" y2="-17.05" width="0.2032" layer="21"/>
<wire x1="8.405" y1="-17.05" x2="8.405" y2="8.15" width="0.2032" layer="51"/>
<wire x1="-8.405" y1="8.15" x2="-8.405" y2="-17.05" width="0.2032" layer="51"/>
<wire x1="-8.405" y1="8.15" x2="8.405" y2="8.15" width="0.2032" layer="21"/>
<wire x1="-8.3851" y1="-16.9799" x2="-8.8044" y2="-16.316" width="0.2032" layer="21"/>
<wire x1="-8.8044" y1="-16.316" x2="-10.2718" y2="-10.3067" width="0.2032" layer="21" curve="-37.105316"/>
<wire x1="-10.2718" y1="-10.3067" x2="-10.5862" y2="-9.2586" width="0.2032" layer="21" curve="43.052296"/>
<wire x1="-10.5862" y1="-9.2586" x2="-10.4814" y2="-9.1538" width="0.2032" layer="21" curve="-166.504203"/>
<wire x1="-10.4814" y1="-9.1538" x2="-10.3766" y2="-9.2935" width="0.2032" layer="21"/>
<wire x1="-10.3766" y1="-9.2935" x2="-10.132" y2="-9.9923" width="0.2032" layer="21" curve="-35.168494"/>
<wire x1="-10.132" y1="-9.9923" x2="-10.132" y2="-10.726" width="0.2032" layer="21" curve="-3.414373"/>
<wire x1="-10.132" y1="-10.726" x2="-8.455" y2="-16.5606" width="0.2032" layer="21" curve="35.485558"/>
<wire x1="8.3851" y1="-16.9799" x2="8.8044" y2="-16.316" width="0.2032" layer="21"/>
<wire x1="8.8044" y1="-16.316" x2="10.2718" y2="-10.3067" width="0.2032" layer="21" curve="37.105316"/>
<wire x1="10.2718" y1="-10.3067" x2="10.5862" y2="-9.2586" width="0.2032" layer="21" curve="-43.052296"/>
<wire x1="10.5862" y1="-9.2586" x2="10.4814" y2="-9.1538" width="0.2032" layer="21" curve="166.504203"/>
<wire x1="10.4814" y1="-9.1538" x2="10.3766" y2="-9.2935" width="0.2032" layer="21"/>
<wire x1="10.3766" y1="-9.2935" x2="10.132" y2="-9.9923" width="0.2032" layer="21" curve="35.168494"/>
<wire x1="10.132" y1="-9.9923" x2="10.132" y2="-10.726" width="0.2032" layer="21" curve="3.414373"/>
<wire x1="10.132" y1="-10.726" x2="8.455" y2="-16.5606" width="0.2032" layer="21" curve="-35.485558"/>
<wire x1="-8.405" y1="8.15" x2="-8.405" y2="-1.27" width="0.2032" layer="21"/>
<wire x1="-8.405" y1="-5.08" x2="-8.405" y2="-17.05" width="0.2032" layer="21"/>
<wire x1="8.405" y1="-17.05" x2="8.405" y2="-5.08" width="0.2032" layer="21"/>
<wire x1="8.405" y1="-1.27" x2="8.405" y2="8.15" width="0.2032" layer="21"/>
<wire x1="-6.8922" y1="-16.9332" x2="-6.5774" y2="-8.8515" width="0.2032" layer="21"/>
<wire x1="-6.5774" y1="-8.8515" x2="-6.2975" y2="-8.5716" width="0.2032" layer="21" curve="-85.555511"/>
<wire x1="-6.3675" y1="-16.9332" x2="-6.1575" y2="-9.8661" width="0.2032" layer="21"/>
<wire x1="-6.1575" y1="-9.8661" x2="-4.6531" y2="-9.8661" width="0.2032" layer="21" curve="-176.58855"/>
<wire x1="-4.6531" y1="-9.8661" x2="-4.4082" y2="-16.9682" width="0.2032" layer="21"/>
<wire x1="-3.8834" y1="-16.9332" x2="-4.1982" y2="-8.8515" width="0.2032" layer="21"/>
<wire x1="-4.1982" y1="-8.8515" x2="-4.4781" y2="-8.5716" width="0.2032" layer="21" curve="85.555511"/>
<wire x1="-6.2975" y1="-8.5716" x2="-4.4781" y2="-8.5716" width="0.2032" layer="21"/>
<wire x1="6.8922" y1="-16.9332" x2="6.5774" y2="-8.8515" width="0.2032" layer="21"/>
<wire x1="6.5774" y1="-8.8515" x2="6.2975" y2="-8.5716" width="0.2032" layer="21" curve="85.555511"/>
<wire x1="6.3675" y1="-16.9332" x2="6.1575" y2="-9.8661" width="0.2032" layer="21"/>
<wire x1="6.1575" y1="-9.8661" x2="4.6531" y2="-9.8661" width="0.2032" layer="21" curve="176.58855"/>
<wire x1="4.6531" y1="-9.8661" x2="4.4082" y2="-16.9682" width="0.2032" layer="21"/>
<wire x1="3.8834" y1="-16.9332" x2="4.1982" y2="-8.8515" width="0.2032" layer="21"/>
<wire x1="4.1982" y1="-8.8515" x2="4.4781" y2="-8.5716" width="0.2032" layer="21" curve="-85.555511"/>
<wire x1="6.2975" y1="-8.5716" x2="4.4781" y2="-8.5716" width="0.2032" layer="21"/>
<pad name="1" x="4.445" y="2.54" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="2" x="3.175" y="0" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="3" x="1.905" y="2.54" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="4" x="0.635" y="0" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="5" x="-0.635" y="2.54" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="6" x="-1.905" y="0" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="7" x="-3.175" y="2.54" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="8" x="-4.445" y="0" drill="0.9" diameter="1.9304" shape="square"/>
<pad name="M1" x="-7.875" y="-3.3" drill="1.6" diameter="2.1844" shape="square"/>
<pad name="M2" x="7.875" y="-3.3" drill="1.6" diameter="2.1844" shape="square"/>
<pad name="9" x="5.465" y="7.37" drill="1" diameter="1.4224" shape="square"/>
<pad name="12" x="-5.465" y="7.37" drill="1" diameter="1.4224" shape="square"/>
<pad name="10" x="2.925" y="7.37" drill="1" diameter="1.4224" shape="square"/>
<pad name="11" x="-2.925" y="7.37" drill="1" diameter="1.4224" shape="square"/>
<text x="-7.62" y="8.89" size="1.27" layer="25">>NAME</text>
<text x="-6.35" y="4.445" size="1.27" layer="27">>VALUE</text>
<hole x="5.715" y="-6.35" drill="3.3"/>
<hole x="-5.715" y="-6.35" drill="3.3"/>
</package>
</packages>
<symbols>
<symbol name="J006-LED">
<wire x1="21.59" y1="-36.83" x2="20.32" y2="-39.37" width="0.254" layer="94"/>
<wire x1="20.32" y1="-39.37" x2="19.05" y2="-36.83" width="0.254" layer="94"/>
<wire x1="21.59" y1="-39.37" x2="20.32" y2="-39.37" width="0.254" layer="94"/>
<wire x1="20.32" y1="-39.37" x2="19.05" y2="-39.37" width="0.254" layer="94"/>
<wire x1="21.59" y1="-36.83" x2="20.32" y2="-36.83" width="0.254" layer="94"/>
<wire x1="20.32" y1="-36.83" x2="19.05" y2="-36.83" width="0.254" layer="94"/>
<wire x1="20.32" y1="-36.83" x2="20.32" y2="-39.37" width="0.1524" layer="94"/>
<wire x1="18.288" y1="-37.592" x2="16.891" y2="-38.989" width="0.1524" layer="94"/>
<wire x1="18.415" y1="-38.735" x2="17.018" y2="-40.132" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-40.64" x2="20.32" y2="-39.37" width="0.1524" layer="94"/>
<wire x1="-5.08" y1="2.54" x2="-3.175" y2="2.54" width="0.1524" layer="94"/>
<wire x1="-5.08" y1="10.16" x2="-3.175" y2="10.16" width="0.1524" layer="94"/>
<wire x1="-5.08" y1="17.78" x2="-3.175" y2="17.78" width="0.1524" layer="94"/>
<wire x1="-3.175" y1="10.16" x2="-3.175" y2="12.7" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="12.7" x2="-3.175" y2="15.24" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="15.24" x2="-3.175" y2="17.78" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="7.62" x2="-3.175" y2="10.16" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="5.08" x2="-3.175" y2="7.62" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="2.54" x2="-3.175" y2="5.08" width="0.1524" layer="94" curve="180"/>
<wire x1="-0.635" y1="16.51" x2="-0.635" y2="3.81" width="0.635" layer="94"/>
<wire x1="0.635" y1="16.51" x2="0.635" y2="3.81" width="0.635" layer="94"/>
<wire x1="3.175" y1="10.16" x2="3.175" y2="12.7" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="12.7" x2="3.175" y2="15.24" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="15.24" x2="3.175" y2="17.78" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="7.62" x2="3.175" y2="10.16" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="5.08" x2="3.175" y2="7.62" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="2.54" x2="3.175" y2="5.08" width="0.1524" layer="94" curve="-180"/>
<wire x1="19.05" y1="6.985" x2="16.51" y2="6.985" width="0.1524" layer="94" curve="180"/>
<wire x1="16.51" y1="6.985" x2="13.97" y2="6.985" width="0.1524" layer="94" curve="180"/>
<wire x1="13.97" y1="6.985" x2="11.43" y2="6.985" width="0.1524" layer="94" curve="180"/>
<wire x1="19.05" y1="13.335" x2="16.51" y2="13.335" width="0.1524" layer="94" curve="-180"/>
<wire x1="16.51" y1="13.335" x2="13.97" y2="13.335" width="0.1524" layer="94" curve="-180"/>
<wire x1="13.97" y1="13.335" x2="11.43" y2="13.335" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="17.78" x2="11.43" y2="17.78" width="0.1524" layer="94"/>
<wire x1="11.43" y1="17.78" x2="11.43" y2="13.335" width="0.1524" layer="94"/>
<wire x1="11.43" y1="2.54" x2="3.175" y2="2.54" width="0.1524" layer="94"/>
<wire x1="11.43" y1="2.54" x2="11.43" y2="6.985" width="0.1524" layer="94"/>
<wire x1="19.05" y1="13.335" x2="19.05" y2="17.78" width="0.1524" layer="94"/>
<wire x1="19.05" y1="17.78" x2="21.59" y2="17.78" width="0.1524" layer="94"/>
<wire x1="19.05" y1="6.985" x2="19.05" y2="2.54" width="0.1524" layer="94"/>
<wire x1="19.05" y1="2.54" x2="21.59" y2="2.54" width="0.1524" layer="94"/>
<wire x1="11.43" y1="9.525" x2="19.05" y2="9.525" width="0.635" layer="94"/>
<wire x1="11.43" y1="10.795" x2="19.05" y2="10.795" width="0.635" layer="94"/>
<wire x1="-5.08" y1="-17.78" x2="-3.175" y2="-17.78" width="0.1524" layer="94"/>
<wire x1="-5.08" y1="-10.16" x2="-3.175" y2="-10.16" width="0.1524" layer="94"/>
<wire x1="-5.08" y1="-2.54" x2="-3.175" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="-3.175" y1="-10.16" x2="-3.175" y2="-7.62" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="-7.62" x2="-3.175" y2="-5.08" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="-5.08" x2="-3.175" y2="-2.54" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="-12.7" x2="-3.175" y2="-10.16" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="-15.24" x2="-3.175" y2="-12.7" width="0.1524" layer="94" curve="180"/>
<wire x1="-3.175" y1="-17.78" x2="-3.175" y2="-15.24" width="0.1524" layer="94" curve="180"/>
<wire x1="-0.635" y1="-3.81" x2="-0.635" y2="-16.51" width="0.635" layer="94"/>
<wire x1="0.635" y1="-3.81" x2="0.635" y2="-16.51" width="0.635" layer="94"/>
<wire x1="3.175" y1="-10.16" x2="3.175" y2="-7.62" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-7.62" x2="3.175" y2="-5.08" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-5.08" x2="3.175" y2="-2.54" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-12.7" x2="3.175" y2="-10.16" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-15.24" x2="3.175" y2="-12.7" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-17.78" x2="3.175" y2="-15.24" width="0.1524" layer="94" curve="-180"/>
<wire x1="19.05" y1="-13.335" x2="16.51" y2="-13.335" width="0.1524" layer="94" curve="180"/>
<wire x1="16.51" y1="-13.335" x2="13.97" y2="-13.335" width="0.1524" layer="94" curve="180"/>
<wire x1="13.97" y1="-13.335" x2="11.43" y2="-13.335" width="0.1524" layer="94" curve="180"/>
<wire x1="19.05" y1="-6.985" x2="16.51" y2="-6.985" width="0.1524" layer="94" curve="-180"/>
<wire x1="16.51" y1="-6.985" x2="13.97" y2="-6.985" width="0.1524" layer="94" curve="-180"/>
<wire x1="13.97" y1="-6.985" x2="11.43" y2="-6.985" width="0.1524" layer="94" curve="-180"/>
<wire x1="3.175" y1="-2.54" x2="11.43" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="11.43" y1="-2.54" x2="11.43" y2="-6.985" width="0.1524" layer="94"/>
<wire x1="11.43" y1="-17.78" x2="3.175" y2="-17.78" width="0.1524" layer="94"/>
<wire x1="11.43" y1="-17.78" x2="11.43" y2="-13.335" width="0.1524" layer="94"/>
<wire x1="19.05" y1="-6.985" x2="19.05" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="19.05" y1="-2.54" x2="21.59" y2="-2.54" width="0.1524" layer="94"/>
<wire x1="19.05" y1="-13.335" x2="19.05" y2="-17.78" width="0.1524" layer="94"/>
<wire x1="19.05" y1="-17.78" x2="21.59" y2="-17.78" width="0.1524" layer="94"/>
<wire x1="11.43" y1="-10.795" x2="19.05" y2="-10.795" width="0.635" layer="94"/>
<wire x1="11.43" y1="-9.525" x2="19.05" y2="-9.525" width="0.635" layer="94"/>
<wire x1="21.59" y1="-22.86" x2="20.32" y2="-22.86" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-22.86" x2="20.32" y2="-24.13" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-24.13" x2="20.32" y2="-25.4" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-25.4" x2="21.59" y2="-25.4" width="0.1524" layer="94"/>
<wire x1="21.59" y1="-30.48" x2="20.32" y2="-30.48" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-30.48" x2="20.32" y2="-31.75" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-31.75" x2="20.32" y2="-33.02" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-33.02" x2="21.59" y2="-33.02" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-24.13" x2="17.78" y2="-24.13" width="0.1524" layer="94"/>
<wire x1="17.78" y1="-24.13" x2="17.78" y2="-31.75" width="0.1524" layer="94"/>
<wire x1="17.78" y1="-31.75" x2="20.32" y2="-31.75" width="0.1524" layer="94"/>
<wire x1="-12.7" y1="20.32" x2="-12.7" y2="-35.56" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-35.56" x2="-12.7" y2="-40.64" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-40.64" x2="-12.7" y2="-45.72" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-45.72" x2="-12.7" y2="-50.8" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-50.8" x2="-12.7" y2="-53.34" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-53.34" x2="22.86" y2="-53.34" width="0.254" layer="94"/>
<wire x1="-12.7" y1="20.32" x2="22.86" y2="20.32" width="0.254" layer="94"/>
<wire x1="22.86" y1="20.32" x2="22.86" y2="19.05" width="0.254" layer="94"/>
<wire x1="22.86" y1="-53.34" x2="22.86" y2="-34.29" width="0.254" layer="94"/>
<wire x1="22.86" y1="-29.21" x2="22.86" y2="-26.67" width="0.254" layer="94"/>
<wire x1="22.86" y1="-21.59" x2="22.86" y2="-19.05" width="0.254" layer="94"/>
<wire x1="22.86" y1="-16.51" x2="22.86" y2="-3.81" width="0.254" layer="94"/>
<wire x1="22.86" y1="-1.27" x2="22.86" y2="1.27" width="0.254" layer="94"/>
<wire x1="22.86" y1="3.81" x2="22.86" y2="16.51" width="0.254" layer="94"/>
<wire x1="-12.7" y1="-35.56" x2="20.32" y2="-35.56" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-35.56" x2="20.32" y2="-36.83" width="0.1524" layer="94"/>
<wire x1="-12.7" y1="-40.64" x2="20.32" y2="-40.64" width="0.1524" layer="94"/>
<wire x1="21.59" y1="-46.99" x2="20.32" y2="-49.53" width="0.254" layer="94"/>
<wire x1="20.32" y1="-49.53" x2="19.05" y2="-46.99" width="0.254" layer="94"/>
<wire x1="21.59" y1="-49.53" x2="20.32" y2="-49.53" width="0.254" layer="94"/>
<wire x1="20.32" y1="-49.53" x2="19.05" y2="-49.53" width="0.254" layer="94"/>
<wire x1="21.59" y1="-46.99" x2="20.32" y2="-46.99" width="0.254" layer="94"/>
<wire x1="20.32" y1="-46.99" x2="19.05" y2="-46.99" width="0.254" layer="94"/>
<wire x1="20.32" y1="-46.99" x2="20.32" y2="-49.53" width="0.1524" layer="94"/>
<wire x1="18.288" y1="-47.752" x2="16.891" y2="-49.149" width="0.1524" layer="94"/>
<wire x1="18.415" y1="-48.895" x2="17.018" y2="-50.292" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-50.8" x2="20.32" y2="-49.53" width="0.1524" layer="94"/>
<wire x1="-12.7" y1="-45.72" x2="20.32" y2="-45.72" width="0.1524" layer="94"/>
<wire x1="20.32" y1="-45.72" x2="20.32" y2="-46.99" width="0.1524" layer="94"/>
<wire x1="-12.7" y1="-50.8" x2="20.32" y2="-50.8" width="0.1524" layer="94"/>
<circle x="-3.175" y="16.51" radius="0.381" width="0" layer="94"/>
<circle x="-3.175" y="8.89" radius="0.381" width="0" layer="94"/>
<circle x="3.175" y="16.51" radius="0.381" width="0" layer="94"/>
<circle x="3.175" y="8.89" radius="0.381" width="0" layer="94"/>
<circle x="12.7" y="6.985" radius="0.381" width="0" layer="94"/>
<circle x="12.7" y="13.335" radius="0.381" width="0" layer="94"/>
<circle x="-3.175" y="-3.81" radius="0.381" width="0" layer="94"/>
<circle x="-3.175" y="-11.43" radius="0.381" width="0" layer="94"/>
<circle x="3.175" y="-3.81" radius="0.381" width="0" layer="94"/>
<circle x="3.175" y="-11.43" radius="0.381" width="0" layer="94"/>
<circle x="12.7" y="-13.335" radius="0.381" width="0" layer="94"/>
<circle x="12.7" y="-6.985" radius="0.381" width="0" layer="94"/>
<circle x="22.225" y="17.78" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="2.54" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-2.54" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-17.78" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-22.86" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-25.4" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-30.48" radius="0.635" width="0.1524" layer="94"/>
<circle x="22.225" y="-33.02" radius="0.635" width="0.1524" layer="94"/>
<circle x="20.32" y="-24.13" radius="0.381" width="0" layer="94"/>
<circle x="20.32" y="-31.75" radius="0.381" width="0" layer="94"/>
<text x="2.54" y="-38.1" size="1.778" layer="94">Right LED</text>
<text x="2.54" y="-48.26" size="1.778" layer="94">Left LED</text>
<text x="24.13" y="17.018" size="1.524" layer="94">1 TX+</text>
<text x="24.13" y="1.778" size="1.524" layer="94">2 TX-</text>
<text x="24.13" y="-3.302" size="1.524" layer="94">3 RX+</text>
<text x="24.13" y="-18.542" size="1.524" layer="94">6 RX-</text>
<text x="24.13" y="-23.622" size="1.524" layer="94">4</text>
<text x="24.13" y="-26.162" size="1.524" layer="94">5</text>
<text x="24.13" y="-31.242" size="1.524" layer="94">7</text>
<text x="24.13" y="-33.782" size="1.524" layer="94">8</text>
<text x="-12.7" y="21.59" size="1.778" layer="95">>NAME</text>
<text x="-12.7" y="-55.88" size="1.778" layer="96">>VALUE</text>
<pin name="C-R" x="-15.24" y="-40.64" visible="pad" length="short" direction="pas"/>
<pin name="A-R" x="-15.24" y="-35.56" visible="pad" length="short" direction="pas"/>
<pin name="C-L" x="-15.24" y="-50.8" visible="pad" length="short" direction="pas"/>
<pin name="A-L" x="-15.24" y="-45.72" visible="pad" length="short" direction="pas"/>
<pin name="TD+" x="-15.24" y="17.78" length="short" direction="in"/>
<pin name="CT" x="-15.24" y="10.16" length="short" direction="in"/>
<pin name="TD-" x="-15.24" y="2.54" length="short" direction="in"/>
<pin name="RD+" x="-15.24" y="-2.54" length="short" direction="in"/>
<pin name="CR" x="-15.24" y="-10.16" length="short" direction="in"/>
<pin name="RD-" x="-15.24" y="-17.78" length="short" direction="in"/>
<pin name="NC/4" x="-15.24" y="-25.4" length="short" direction="in"/>
<pin name="NC/5" x="-15.24" y="-30.48" length="short" direction="in"/>
<polygon width="0.1524" layer="94">
<vertex x="16.891" y="-38.989"/>
<vertex x="17.272" y="-38.1"/>
<vertex x="17.78" y="-38.608"/>
</polygon>
<polygon width="0.1524" layer="94">
<vertex x="17.018" y="-40.132"/>
<vertex x="17.399" y="-39.243"/>
<vertex x="17.907" y="-39.751"/>
</polygon>
<polygon width="0.1524" layer="94">
<vertex x="16.891" y="-49.149"/>
<vertex x="17.272" y="-48.26"/>
<vertex x="17.78" y="-48.768"/>
</polygon>
<polygon width="0.1524" layer="94">
<vertex x="17.018" y="-50.292"/>
<vertex x="17.399" y="-49.403"/>
<vertex x="17.907" y="-49.911"/>
</polygon>
</symbol>
</symbols>
<devicesets>
<deviceset name="J1006F01P" prefix="X">
<description>PULSEJACK (TM) 1x1 Tab-UP RJ45

10/100 Base-TX RJ45 1x1 Tab-UP with LEDs 8-pin (J1 series) and 6-pin (JP series) integrated magnetics connector,

designed to support applications, such as ADSL modems, LAN-on-Motherboard, and Hub and Switches.

Source: www.pulseeng.com .. PulseJack-J402.pdf</description>
<gates>
<gate name="G$1" symbol="J006-LED" x="0" y="0" addlevel="always"/>
</gates>
<devices>
<device name="" package="J1">
<connects>
<connect gate="G$1" pin="A-L" pad="12"/>
<connect gate="G$1" pin="A-R" pad="9"/>
<connect gate="G$1" pin="C-L" pad="11"/>
<connect gate="G$1" pin="C-R" pad="10"/>
<connect gate="G$1" pin="CR" pad="6"/>
<connect gate="G$1" pin="CT" pad="3"/>
<connect gate="G$1" pin="NC/4" pad="4"/>
<connect gate="G$1" pin="NC/5" pad="5"/>
<connect gate="G$1" pin="RD+" pad="7"/>
<connect gate="G$1" pin="RD-" pad="8"/>
<connect gate="G$1" pin="TD+" pad="1"/>
<connect gate="G$1" pin="TD-" pad="2"/>
</connects>
<technologies>
<technology name="">
<attribute name="MF" value="" constant="no"/>
<attribute name="MPN" value="" constant="no"/>
<attribute name="OC_FARNELL" value="unknown" constant="no"/>
<attribute name="OC_NEWARK" value="unknown" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
<library name="pinhead">
<description>Pin Header Connectors

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="1X02">
<description>PIN HEADER</description>
<wire x1="-1.905" y1="1.27" x2="-0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="0" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="-0.635" x2="-0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="1.27" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="-0.635" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.905" y2="1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="1.27" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-0.635" x2="1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="-1.27" x2="0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="0" y2="-0.635" width="0.1524" layer="21"/>
<pad name="1" x="-1.27" y="0" drill="1.016" diameter="2.1844" shape="long" rot="R90"/>
<pad name="2" x="1.27" y="0" drill="1.016" diameter="2.1844" shape="long" rot="R90"/>
<text x="-2.6162" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-2.54" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="-1.524" y1="-0.254" x2="-1.016" y2="0.254" layer="51"/>
<rectangle x1="1.016" y1="-0.254" x2="1.524" y2="0.254" layer="51"/>
</package>
<package name="1X02/90">
<description>PIN HEADER</description>
<wire x1="-2.54" y1="-1.905" x2="0" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="0" y1="-1.905" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-2.54" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="6.985" x2="-1.27" y2="1.27" width="0.762" layer="21"/>
<wire x1="0" y1="-1.905" x2="2.54" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-1.905" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="1.27" y1="6.985" x2="1.27" y2="1.27" width="0.762" layer="21"/>
<pad name="1" x="-1.27" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="1.27" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<text x="-3.175" y="-3.81" size="1.27" layer="25" ratio="10" rot="R90">>NAME</text>
<text x="4.445" y="-3.81" size="1.27" layer="27" rot="R90">>VALUE</text>
<rectangle x1="-1.651" y1="0.635" x2="-0.889" y2="1.143" layer="21"/>
<rectangle x1="0.889" y1="0.635" x2="1.651" y2="1.143" layer="21"/>
<rectangle x1="-1.651" y1="-2.921" x2="-0.889" y2="-1.905" layer="21"/>
<rectangle x1="0.889" y1="-2.921" x2="1.651" y2="-1.905" layer="21"/>
</package>
</packages>
<symbols>
<symbol name="PINHD2">
<wire x1="-6.35" y1="-2.54" x2="1.27" y2="-2.54" width="0.4064" layer="94"/>
<wire x1="1.27" y1="-2.54" x2="1.27" y2="5.08" width="0.4064" layer="94"/>
<wire x1="1.27" y1="5.08" x2="-6.35" y2="5.08" width="0.4064" layer="94"/>
<wire x1="-6.35" y1="5.08" x2="-6.35" y2="-2.54" width="0.4064" layer="94"/>
<text x="-6.35" y="5.715" size="1.778" layer="95">>NAME</text>
<text x="-6.35" y="-5.08" size="1.778" layer="96">>VALUE</text>
<pin name="1" x="-2.54" y="2.54" visible="pad" length="short" direction="pas" function="dot"/>
<pin name="2" x="-2.54" y="0" visible="pad" length="short" direction="pas" function="dot"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="PINHD-1X2" prefix="JP" uservalue="yes">
<description>PIN HEADER</description>
<gates>
<gate name="G$1" symbol="PINHD2" x="0" y="0"/>
</gates>
<devices>
<device name="" package="1X02">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
<connect gate="G$1" pin="2" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="/90" package="1X02/90">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
<connect gate="G$1" pin="2" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
<library name="supply1">
<description>Supply Symbols

 GND, VCC, 0V, +5V, -5V, etc.

 Please keep in mind, that these devices are necessary for the
 automatic wiring of the supply signals.

 The pin name defined in the symbol is identical to the net which is to be wired automatically.

 In this library the device names are the same as the pin names of the symbols, therefore the correct signal names appear next to the supply symbols in the schematic.

 <author>Created by librarian@cadsoft.de</author></description>
<packages>
</packages>
<symbols>
<symbol name="GND">
<wire x1="-1.905" y1="0" x2="1.905" y2="0" width="0.254" layer="94"/>
<text x="-2.54" y="-2.54" size="1.778" layer="96">>VALUE</text>
<pin name="GND" x="0" y="2.54" visible="off" length="short" direction="sup" rot="R270"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="GND" prefix="GND">
<description>SUPPLY SYMBOL</description>
<gates>
<gate name="1" symbol="GND" x="0" y="0"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<parts>
<part name="X1" library="con-pulse" deviceset="J1006F01P" device=""/>
<part name="JP1" library="pinhead" deviceset="PINHD-1X2" device=""/>
<part name="JP2" library="pinhead" deviceset="PINHD-1X2" device=""/>
<part name="GND1" library="supply1" deviceset="GND" device=""/>
<part name="GND2" library="supply1" deviceset="GND" device=""/>
</parts>
<sheets>
<sheet>
<plain>
</plain>
<instances>
<instance part="X1" gate="G$1" x="35.56" y="58.42"/>
<instance part="JP1" gate="G$1" x="-12.7" y="71.12" rot="R180"/>
<instance part="JP2" gate="G$1" x="-12.7" y="55.88" rot="R180"/>
<instance part="GND1" gate="1" x="-5.08" y="35.56"/>
<instance part="GND2" gate="1" x="5.08" y="73.66"/>
</instances>
<busses>
</busses>
<nets>
<net name="12V" class="0">
<segment>
<wire x1="12.7" y1="68.58" x2="12.7" y2="33.02" width="0.1524" layer="91"/>
<pinref part="X1" gate="G$1" pin="NC/4"/>
<wire x1="12.7" y1="33.02" x2="20.32" y2="33.02" width="0.1524" layer="91"/>
<wire x1="12.7" y1="33.02" x2="12.7" y2="27.94" width="0.1524" layer="91"/>
<junction x="12.7" y="33.02"/>
<pinref part="X1" gate="G$1" pin="NC/5"/>
<wire x1="12.7" y1="27.94" x2="20.32" y2="27.94" width="0.1524" layer="91"/>
<pinref part="JP1" gate="G$1" pin="1"/>
<wire x1="12.7" y1="68.58" x2="-10.16" y2="68.58" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TTL" class="0">
<segment>
<pinref part="X1" gate="G$1" pin="RD-"/>
<wire x1="20.32" y1="40.64" x2="0" y2="40.64" width="0.1524" layer="91"/>
<wire x1="0" y1="40.64" x2="0" y2="55.88" width="0.1524" layer="91"/>
<pinref part="JP2" gate="G$1" pin="2"/>
<wire x1="0" y1="55.88" x2="-10.16" y2="55.88" width="0.1524" layer="91"/>
</segment>
</net>
<net name="GND" class="0">
<segment>
<pinref part="JP2" gate="G$1" pin="1"/>
<wire x1="-10.16" y1="53.34" x2="-5.08" y2="53.34" width="0.1524" layer="91"/>
<wire x1="-5.08" y1="53.34" x2="-5.08" y2="38.1" width="0.1524" layer="91"/>
<pinref part="GND1" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="X1" gate="G$1" pin="TD+"/>
<wire x1="20.32" y1="76.2" x2="17.78" y2="76.2" width="0.1524" layer="91"/>
<wire x1="17.78" y1="76.2" x2="5.08" y2="76.2" width="0.1524" layer="91"/>
<wire x1="5.08" y1="76.2" x2="-2.54" y2="76.2" width="0.1524" layer="91"/>
<wire x1="-2.54" y1="76.2" x2="-2.54" y2="71.12" width="0.1524" layer="91"/>
<pinref part="X1" gate="G$1" pin="TD-"/>
<wire x1="20.32" y1="60.96" x2="17.78" y2="60.96" width="0.1524" layer="91"/>
<wire x1="17.78" y1="60.96" x2="17.78" y2="76.2" width="0.1524" layer="91"/>
<junction x="17.78" y="76.2"/>
<pinref part="JP1" gate="G$1" pin="2"/>
<wire x1="-10.16" y1="71.12" x2="-2.54" y2="71.12" width="0.1524" layer="91"/>
<pinref part="GND2" gate="1" pin="GND"/>
<junction x="5.08" y="76.2"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
</eagle>

repository: ai-evan/frankenstein-cnc

repo_name: ai-evan/frankenstein-cnc

extension: sch


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Factorial
{
    using DotNetty.Buffers;
    using DotNetty.Codecs;
    using DotNetty.Transport.Channels;
    using System.Collections.Generic;

    public class NumberEncoder : MessageToMessageEncoder<System.Numerics.BigInteger>
    {
        protected override void Encode(IChannelHandlerContext context, System.Numerics.BigInteger message, List<object> output)
        {
            IByteBuffer buffer = context.Allocator.Buffer();

            //https://msdn.microsoft.com/en-us/library/system.numerics.biginteger.tobytearray(v=vs.110).aspx
            //BigInteger.ToByteArray() return a Little-Endian bytes
            //IByteBuffer is Big-Endian by default
            byte[] data = message.ToByteArray();
            buffer.WriteByte((byte)'F');
            buffer.WriteInt(data.Length);
            buffer.WriteBytes(data);
            output.Add(buffer);
        }
    }
}

license: MIT

repository: cuteant/SpanNetty

license_type: permissive

repo_name: cuteant/SpanNetty

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: C#

extension: cs


text:
DESCRIPTION = "Snes9x 2002. Port of SNES9x 1.39 for libretro (was previously called PocketSNES). \
Heavily optimized for ARM."

LICENSE = "SNES9X"
LIC_FILES_CHKSUM = "file://${RETRO_LICENSE_DIR}/SNES9X;md5=fd974c06a4b28b4f2eaf9e9a96ed92de"

inherit libretro

LIBRETRO_GIT_REPO = "github.com/libretro/snes9x2002.git"

branch_name: refs/heads/master

gha_language: BitBake

extension: bb


text:
import chalk from 'chalk'
import indent from 'indent-string'
import { COLORS } from '../../api'
import { renderList } from '@oclif/plugin-help/lib/list'
import RootHelp from '@oclif/plugin-help/lib/root'
import { OTHER_GROUP_ID } from './constants'

export interface CommandI {
  name: string
  description: string
}

export function getHelpSubject(args: string[]): string | undefined {
  for (const arg of args) {
    if (arg === '--' || arg.startsWith('-')) return
    if (['help', '--help', '-h'].includes(arg)) continue
    return arg
  }
}

function renderCommand(commands: CommandI[], ctx: any): string {
  return renderList(
    commands.map(c => [chalk.hex(COLORS.PINK)(c.name), c.description && ctx.render(c.description.split('\n')[0])]),
    {
      spacer: '\n',
      stripAnsi: ctx.opts.stripAnsi,
      maxWidth: ctx.opts.maxWidth - 2,
    }
  )
}

export function renderCommands(commandsId: Record<number, string>, groups: CommandI[][], ctx: any) {
  const body = []
  const commandsGroupLength: number = Object.keys(commandsId).length
  const help = new RootHelp(ctx.config, ctx.opts)

  body.push(help.root())
  body.push(' ')

  for (let [key, value] of Object.entries(commandsId)) {
    key = key !== OTHER_GROUP_ID ? key : (commandsGroupLength - 1).toString()
    if (groups[key].length > 0) {
      body.push(chalk.bold(value))
      body.push(indent(renderCommand(groups[key], ctx), 2))
      body.push(' ')
    }
  }

  return body.join('\n')
}

repository: vtex/toolbelt

repo_name: vtex/toolbelt

gha_language: TypeScript

extension: ts


text:
# Copyright (C) 2015 Aananth Chellapa Natarajan <c.n.aananth@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "Aananth's wifi config files and systemd service files"
HOMEPAGE = "https://gitlab.com/aananthcn/meta-aananth"
LICENSE = "MIT"

SRC_URI[md5sum] = "80b70cf716d7ccfc5e9b79a4fd014366"
SRC_URI[sha256sum] = "9b6b6a771c908adaadd078f4d128c00468ab49230d85b57658f04a0b9549e873"

SRCREV_default_pn-sota-com="${AUTOREV}"

LIC_FILES_CHKSUM = "file://LICENSE;md5=2c1c00f9d3ed9e24fa69b932b7e7aff2"

S = "${WORKDIR}/git"

# Note: Please make sure you add gitlab.com in ~/.ssh/config with port value set to 22
#       and gitlab user name like below
#
# Host gitlab.com
#        IdentityFile ~/.ssh/id_rsa
#        Port 22
#        User aananthcn
#        TCPKeepAlive yes
#        IdentitiesOnly yes
do_fetch() {
    git clone git@gitlab.com:aananthcn/meta-aananth.git ${WORKDIR}/git
}

do_install() {
    install -m 0640 ${S}/network.service ${D}/${sysconfdir}/systemd/system/
    install -m 0640 ${S}/connman.service ${D}/${sysconfdir}/systemd/system/
    install -m 0640 ${S}/wifi.service ${D}/${sysconfdir}/systemd/system/
    install -m 0600 ${S}/default.config ${D}/var/lib/connman/
    install -m 0755 ${S}/wifi-init.sh ${D}/${bindir}
}

repository: aananthcn/meta-aananth

repo_name: aananthcn/meta-aananth


text:
package cloud

import (
	"errors"
	"fmt"
	"strconv"
	"testing"
	"time"

	"github.com/quilt/quilt/blueprint"
	"github.com/quilt/quilt/cloud/acl"
	"github.com/quilt/quilt/db"
	"github.com/quilt/quilt/join"
	"github.com/stretchr/testify/assert"
)

var FakeAmazon db.ProviderName = "FakeAmazon"
var FakeVagrant db.ProviderName = "FakeVagrant"
var testRegion = "Fake region"

type fakeProvider struct {
	providerName db.ProviderName
	region       string
	namespace    string
	machines     map[string]db.Machine
	roles        map[string]db.Role
	idCounter    int
	cloudConfig  string

	bootRequests []db.Machine
	stopRequests []string
	updatedIPs   []db.Machine
	aclRequests  []acl.ACL

	listError error
}

func fakeValidRegions(p db.ProviderName) []string {
	return []string{testRegion}
}

func (p *fakeProvider) clearLogs() {
	p.bootRequests = nil
	p.stopRequests = nil
	p.aclRequests = nil
	p.updatedIPs = nil
}

func (p *fakeProvider) List() ([]db.Machine, error) {
	if p.listError != nil {
		return nil, p.listError
	}

	var machines []db.Machine
	for _, machine := range p.machines {
		machines = append(machines, machine)
	}
	return machines, nil
}

func (p *fakeProvider) Boot(bootSet []db.Machine) error {
	for _, toBoot := range bootSet {
		// Record the boot request before we mutate it with implementation
		// details of our fakeProvider.
		p.bootRequests = append(p.bootRequests, toBoot)

		p.idCounter++
		idStr := strconv.Itoa(p.idCounter)
		toBoot.CloudID = idStr
		toBoot.PublicIP = idStr

		// A machine's role is `None` until the minion boots, at which
		// `getMachineRoles` will populate this field with the correct role.
		// We simulate this by setting the role of the machine returned by
		// `List()` to be None, and only return the correct role in
		// `getMachineRole`.
		p.roles[toBoot.PublicIP] = toBoot.Role
		toBoot.Role = db.None

		p.machines[idStr] = toBoot
	}

	return nil
}

func (p *fakeProvider) Stop(machines []db.Machine) error {
	for _, machine := range machines {
		delete(p.machines, machine.CloudID)
		p.stopRequests = append(p.stopRequests, machine.CloudID)
	}
	return nil
}

func (p *fakeProvider) SetACLs(acls []acl.ACL) error {
	p.aclRequests = acls
	return nil
}

func (p *fakeProvider) UpdateFloatingIPs(machines []db.Machine) error {
	for _, desired := range machines {
		curr := p.machines[desired.CloudID]
		curr.FloatingIP = desired.FloatingIP
		p.machines[desired.CloudID] = curr
	}
	p.updatedIPs = append(p.updatedIPs, machines...)
	return nil
}

func newTestCloud(provider db.ProviderName, region, namespace string) *cloud {
	sleep = func(t time.Duration) {}
	mock()
	cld, _ := newCloud(db.New(), provider, region, namespace)
	return &cld
}

func TestPanicBadProvider(t *testing.T) {
	temp := db.AllProviders
	defer func() {
		r := recover()
		assert.NotNil(t, r)
		db.AllProviders = temp
	}()
	db.AllProviders = []db.ProviderName{FakeAmazon}
	conn := db.New()
	newCloud(conn, FakeAmazon, testRegion, "test")
}

func TestSyncDB(t *testing.T) {
	checkSyncDB := func(cloudMachines []db.Machine,
		databaseMachines []db.Machine, expected syncDBResult) syncDBResult {
		dbRes := syncDB(cloudMachines, databaseMachines)

		assert.Equal(t, expected.boot, dbRes.boot, "boot")
		assert.Equal(t, expected.stop, dbRes.stop, "stop")
		assert.Equal(t, expected.updateIPs, dbRes.updateIPs, "updateIPs")

		return dbRes
	}

	var noMachines []db.Machine
	dbNoSize := db.Machine{Provider: FakeAmazon, Region: testRegion}
	cmNoSize := db.Machine{Provider: FakeAmazon, Region: testRegion}
	dbLarge := db.Machine{Provider: FakeAmazon, Size: "m4.large", Region: testRegion}
	cmLarge := db.Machine{
		Provider: FakeAmazon,
		Region:   testRegion,
		Size:     "m4.large",
	}

	dbMaster := db.Machine{Provider: FakeAmazon, Role: db.Master}
	cmMasterList := db.Machine{Provider: FakeAmazon, Role: db.Master}
	dbWorker := db.Machine{Provider: FakeAmazon, Role: db.Worker}
	cmWorkerList := db.Machine{Provider: FakeAmazon, Role: db.Worker}

	cmNoIP := db.Machine{Provider: FakeAmazon, CloudID: "id"}
	cmWithIP := db.Machine{
		Provider:   FakeAmazon,
		CloudID:    "id",
		FloatingIP: "ip",
	}
	dbNoIP := db.Machine{Provider: FakeAmazon, CloudID: "id"}
	dbWithIP := db.Machine{Provider: FakeAmazon, CloudID: "id", FloatingIP: "ip"}

	// Test boot with no size
	checkSyncDB(noMachines, []db.Machine{dbNoSize, dbNoSize}, syncDBResult{
		boot: []db.Machine{dbNoSize, dbNoSize},
	})

	// Test boot with size
	checkSyncDB(noMachines, []db.Machine{dbLarge, dbLarge}, syncDBResult{
		boot: []db.Machine{dbLarge, dbLarge},
	})

	// Test mixed boot
	checkSyncDB(noMachines, []db.Machine{dbNoSize, dbLarge}, syncDBResult{
		boot: []db.Machine{dbNoSize, dbLarge},
	})

	// Test partial boot
	checkSyncDB([]db.Machine{cmNoSize}, []db.Machine{dbNoSize, dbLarge},
		syncDBResult{
			boot: []db.Machine{dbLarge},
		},
	)

	// Test stop
	checkSyncDB([]db.Machine{cmNoSize, cmNoSize}, []db.Machine{}, syncDBResult{
		stop: []db.Machine{cmNoSize, cmNoSize},
	})

	// Test partial stop
	checkSyncDB([]db.Machine{cmNoSize, cmLarge}, []db.Machine{}, syncDBResult{
		stop: []db.Machine{cmNoSize, cmLarge},
	})

	// Test assign Floating IP
	checkSyncDB([]db.Machine{cmNoIP}, []db.Machine{dbWithIP}, syncDBResult{
		updateIPs: []db.Machine{cmWithIP},
	})

	// Test remove Floating IP
	checkSyncDB([]db.Machine{cmWithIP}, []db.Machine{dbNoIP}, syncDBResult{
		updateIPs: []db.Machine{cmNoIP},
	})

	// Test replace Floating IP
	cNewIP := db.Machine{
		Provider:   FakeAmazon,
		CloudID:    "id",
		FloatingIP: "ip^",
	}
	checkSyncDB([]db.Machine{cNewIP}, []db.Machine{dbWithIP}, syncDBResult{
		updateIPs: []db.Machine{cmWithIP},
	})

	// Test bad disk size
	checkSyncDB([]db.Machine{{DiskSize: 3}},
		[]db.Machine{{DiskSize: 4}},
		syncDBResult{
			stop: []db.Machine{{DiskSize: 3}},
			boot: []db.Machine{{DiskSize: 4}},
		})

	// Test different roles
	checkSyncDB([]db.Machine{cmWorkerList}, []db.Machine{dbMaster}, syncDBResult{
		boot: []db.Machine{dbMaster},
		stop: []db.Machine{cmWorkerList},
	})

	checkSyncDB([]db.Machine{cmMasterList}, []db.Machine{dbWorker}, syncDBResult{
		boot: []db.Machine{dbWorker},
		stop: []db.Machine{cmMasterList},
	})

	// Test reserved instances.
	checkSyncDB([]db.Machine{{Preemptible: true}},
		[]db.Machine{{Preemptible: false}},
		syncDBResult{
			boot: []db.Machine{{Preemptible: false}},
			stop: []db.Machine{{Preemptible: true}},
		})

	// Test matching role as priority over PublicIP
	dbMaster.PublicIP = "worker"
	cmMasterList.PublicIP = "master"
	dbWorker.PublicIP = "master"
	cmWorkerList.PublicIP = "worker"

	checkSyncDB([]db.Machine{cmMasterList, cmWorkerList},
		[]db.Machine{dbMaster, dbWorker},
		syncDBResult{})

	// Test shuffling roles before CloudID is assigned
	dbw1 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "w1"}
	dbw2 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "w2"}
	dbw3 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "w3"}

	mw1 := db.Machine{Provider: FakeAmazon, Role: db.Worker,
		CloudID: "mw1", PublicIP: "w1"}
	mw2 := db.Machine{Provider: FakeAmazon, Role: db.Worker,
		CloudID: "mw2", PublicIP: "w2"}
	mw3 := db.Machine{Provider: FakeAmazon, Role: db.Worker,
		CloudID: "mw3", PublicIP: "w3"}

	pair1 := join.Pair{L: dbw1, R: mw1}
	pair2 := join.Pair{L: dbw2, R: mw2}
	pair3 := join.Pair{L: dbw3, R: mw3}

	exp := []join.Pair{
		pair1,
		pair2,
		pair3,
	}

	pairs := checkSyncDB([]db.Machine{mw1, mw2, mw3},
		[]db.Machine{dbw1, dbw2, dbw3},
		syncDBResult{})

	assert.Equal(t, exp, pairs.pairs)

	// Test FloatingIP without role
	dbf1 := db.Machine{Provider: FakeAmazon, Role: db.Master, PublicIP: "master"}
	dbf2 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "worker",
		FloatingIP: "float"}

	cmf1 := db.Machine{Provider: FakeAmazon, PublicIP: "worker", CloudID: "worker"}
	cmf2 := db.Machine{Provider: FakeAmazon, PublicIP: "master", CloudID: "master"}

	// No roles, CloudIDs not assigned, so nothing should happen
	checkSyncDB([]db.Machine{cmf1, cmf2},
		[]db.Machine{dbf1, dbf2},
		syncDBResult{})

	cmf1.Role = db.Worker

	// One role assigned, so one CloudID to be assigned after
	checkSyncDB([]db.Machine{cmf1, cmf2},
		[]db.Machine{dbf1, dbf2},
		syncDBResult{})

	dbf2.CloudID = cmf1.CloudID
	cmf2.Role = db.Master

	// Now that CloudID of machine with FloatingIP has been assigned,
	// FloatingIP should also be assigned
	checkSyncDB([]db.Machine{cmf1, cmf2},
		[]db.Machine{dbf1, dbf2},
		syncDBResult{
			updateIPs: []db.Machine{
				{
					Provider:   FakeAmazon,
					Role:       db.Worker,
					PublicIP:   "worker",
					CloudID:    "worker",
					FloatingIP: "float",
				},
			},
		})

	// Test FloatingIP role shuffling
	dbm2 := db.Machine{Provider: FakeAmazon, Role: db.Master, PublicIP: "mIP"}
	dbm3 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "wIP1",
		FloatingIP: "flip1"}
	dbm4 := db.Machine{Provider: FakeAmazon, Role: db.Worker, PublicIP: "wIP2",
		FloatingIP: "flip2"}

	m2 := db.Machine{Provider: FakeAmazon, PublicIP: "mIP", CloudID: "m2"}
	m3 := db.Machine{Provider: FakeAmazon, PublicIP: "wIP1", CloudID: "m3"}
	m4 := db.Machine{Provider: FakeAmazon, PublicIP: "wIP2", CloudID: "m4"}

	m2.Role = db.Worker
	m3.Role = db.Master
	m4.Role = db.Worker

	// CloudIDs not assigned to db machines yet, so shouldn't update anything.
	checkSyncDB([]db.Machine{m2, m3, m4},
		[]db.Machine{dbm2, dbm3, dbm4},
		syncDBResult{})

	dbm2.CloudID = m3.CloudID
	dbm3.CloudID = m2.CloudID
	dbm4.CloudID = m4.CloudID

	// CloudIDs are now assigned, so time to update floating IPs
	checkSyncDB([]db.Machine{m2, m3, m4},
		[]db.Machine{dbm2, dbm3, dbm4},
		syncDBResult{
			updateIPs: []db.Machine{
				{
					Provider:   FakeAmazon,
					Role:       db.Worker,
					PublicIP:   "mIP",
					CloudID:    "m2",
					FloatingIP: "flip1",
				},
				{
					Provider:   FakeAmazon,
					Role:       db.Worker,
					PublicIP:   "wIP2",
					CloudID:    "m4",
					FloatingIP: "flip2",
				},
			},
		})

}

func TestCloudRunOnce(t *testing.T) {
	type ipRequest struct {
		id string
		ip string
	}

	type assertion struct {
		boot      []db.Machine
		stop      []string
		updateIPs []ipRequest
	}

	checkSync := func(cld *cloud, expected assertion) {
		cld.runOnce()
		providerInst := cld.provider.(*fakeProvider)

		assert.Equal(t, expected.boot, providerInst.bootRequests, "bootRequests")

		assert.Equal(t, expected.stop, providerInst.stopRequests, "stopRequests")

		var updatedIPs []ipRequest
		for _, m := range providerInst.updatedIPs {
			updatedIPs = append(updatedIPs,
				ipRequest{id: m.CloudID, ip: m.FloatingIP})
		}
		assert.Equal(t, expected.updateIPs, updatedIPs, "updateIPs")

		providerInst.clearLogs()
	}

	// Test initial boot
	cld := newTestCloud(FakeAmazon, testRegion, "ns")
	setNamespace(cld.conn, "ns")
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		m := view.InsertMachine()
		m.Role = db.Master
		m.Provider = FakeAmazon
		m.Region = testRegion
		m.Size = "m4.large"
		view.Commit(m)

		return nil
	})
	checkSync(cld, assertion{boot: []db.Machine{{
		Provider: FakeAmazon,
		Region:   testRegion,
		Size:     "m4.large",
		Role:     db.Master},
	}})

	// Test adding a machine with the same provider
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		m := view.InsertMachine()
		m.Role = db.Master
		m.Provider = FakeAmazon
		m.Region = testRegion
		m.Size = "m4.xlarge"
		view.Commit(m)

		return nil
	})
	checkSync(cld, assertion{boot: []db.Machine{{
		Provider: FakeAmazon,
		Region:   testRegion,
		Size:     "m4.xlarge",
		Role:     db.Master},
	}})

	// Test removing a machine
	var toRemove db.Machine
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		toRemove = view.SelectFromMachine(func(m db.Machine) bool {
			return m.Provider == FakeAmazon && m.Size == "m4.xlarge"
		})[0]
		view.Remove(toRemove)

		return nil
	})
	checkSync(cld, assertion{stop: []string{toRemove.CloudID}})

	// Test booting a machine with floating IP - shouldn't update FloatingIP yet
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		m := view.InsertMachine()
		m.Role = db.Master
		m.Provider = FakeAmazon
		m.Size = "m4.large"
		m.Region = testRegion
		m.FloatingIP = "ip"
		view.Commit(m)

		return nil
	})
	checkSync(cld, assertion{
		boot: []db.Machine{{
			Provider: FakeAmazon,
			Region:   testRegion,
			Size:     "m4.large",
			Role:     db.Master}},
	})

	// The bootRequest from the previous test is done now, and a CloudID has
	// been assigned, so we should also receive the ipRequest from before
	checkSync(cld, assertion{updateIPs: []ipRequest{{id: "3", ip: "ip"}}})

	// Test assigning a floating IP to an existing machine
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		toAssign := view.SelectFromMachine(func(m db.Machine) bool {
			return m.Provider == FakeAmazon &&
				m.Size == "m4.large" &&
				m.FloatingIP == ""
		})[0]
		toAssign.FloatingIP = "another.ip"
		view.Commit(toAssign)

		return nil
	})
	checkSync(cld, assertion{updateIPs: []ipRequest{{id: "1", ip: "another.ip"}}})

	// Test removing a floating IP
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		toUpdate := view.SelectFromMachine(func(m db.Machine) bool {
			return m.Provider == FakeAmazon &&
				m.Size == "m4.large" &&
				m.FloatingIP == "ip"
		})[0]
		toUpdate.FloatingIP = ""
		view.Commit(toUpdate)

		return nil
	})
	checkSync(cld, assertion{updateIPs: []ipRequest{{id: "3", ip: ""}}})

	// Test removing and adding a machine
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		toRemove = view.SelectFromMachine(func(m db.Machine) bool {
			return m.Provider == FakeAmazon && m.Size == "m4.large"
		})[0]
		view.Remove(toRemove)

		m := view.InsertMachine()
		m.Role = db.Worker
		m.Provider = FakeAmazon
		m.Size = "m4.xlarge"
		m.Region = testRegion
		view.Commit(m)

		return nil
	})
	checkSync(cld, assertion{
		boot: []db.Machine{{
			Provider: FakeAmazon,
			Region:   testRegion,
			Size:     "m4.xlarge",
			Role:     db.Worker}},
		stop: []string{toRemove.CloudID},
	})

	// Test adding machine with different role
	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		m := view.InsertMachine()
		m.Role = db.Master
		m.Provider = FakeAmazon
		m.Size = "m4.xlarge"
		m.Region = testRegion
		view.Commit(m)

		return nil
	})

	checkSync(cld, assertion{
		boot: []db.Machine{{
			Provider: FakeAmazon,
			Region:   testRegion,
			Size:     "m4.xlarge",
			Role:     db.Master}},
	})

	cld.conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		toRemove = view.SelectFromMachine(func(m db.Machine) bool {
			return m.Role == db.Master && m.Size == "m4.xlarge" &&
				m.Provider == FakeAmazon
		})[0]
		view.Remove(toRemove)
		m := view.InsertMachine()
		m.Role = db.Worker
		m.Provider = FakeAmazon
		m.Size = "m4.xlarge"
		m.Region = testRegion
		view.Commit(m)

		return nil
	})

	checkSync(cld, assertion{
		boot: []db.Machine{{
			Provider: FakeAmazon,
			Region:   testRegion,
			Size:     "m4.xlarge",
			Role:     db.Worker}},
		stop: []string{toRemove.CloudID},
	})
}

func TestACLs(t *testing.T) {
	myIP = func() (string, error) {
		return "5.6.7.8", nil
	}

	clst := newTestCloud(FakeAmazon, testRegion, "ns")
	clst.syncACLs([]acl.ACL{{CidrIP: "local", MinPort: 80, MaxPort: 80}})

	exp := []acl.ACL{
		{
			CidrIP:  "5.6.7.8/32",
			MinPort: 80,
			MaxPort: 80,
		},
	}
	actual := clst.provider.(*fakeProvider).aclRequests
	assert.Equal(t, exp, actual)
}

func TestGetACLs(t *testing.T) {
	cld := newTestCloud(FakeAmazon, testRegion, "ns")

	exp := map[acl.ACL]struct{}{
		{CidrIP: "local", MinPort: 1, MaxPort: 65535}: {},
	}

	// Empty blueprint should have "local" added to it.
	acls := cld.getACLs(db.Blueprint{}, nil)
	assert.Equal(t, exp, acls)

	// A blueprint with local, shouldn't have it added a second time.
	acls = cld.getACLs(db.Blueprint{
		Blueprint: blueprint.Blueprint{AdminACL: []string{"local"}},
	}, nil)
	assert.Equal(t, exp, acls)

	// Connections that aren't to or from public, shouldn't affect the acls.
	acls = cld.getACLs(db.Blueprint{
		Blueprint: blueprint.Blueprint{
			Connections: []blueprint.Connection{{
				From:    "foo",
				To:      "bar",
				MinPort: 5,
				MaxPort: 6,
			}},
		},
	}, nil)
	assert.Equal(t, exp, acls)

	// Connections from public create an ACL.
	acls = cld.getACLs(db.Blueprint{
		Blueprint: blueprint.Blueprint{
			Connections: []blueprint.Connection{{
				From:    blueprint.PublicInternetLabel,
				To:      "bar",
				MinPort: 1,
				MaxPort: 2,
			}},
		},
	}, nil)
	exp[acl.ACL{CidrIP: "0.0.0.0/0", MinPort: 1, MaxPort: 2}] = struct{}{}
	assert.Equal(t, exp, acls)

	// Machines have holes opened up for them.
	exp = map[acl.ACL]struct{}{
		{CidrIP: "local", MinPort: 1, MaxPort: 65535}:      {},
		{CidrIP: "1.2.3.4/32", MinPort: 1, MaxPort: 65535}: {},
	}
	acls = cld.getACLs(db.Blueprint{}, []db.Machine{{PublicIP: "1.2.3.4"}})
	assert.Equal(t, exp, acls)
}

func TestMakeClouds(t *testing.T) {
	stop := make(chan struct{})
	makeClouds(db.New(), "ns", stop)

	var locations []string
	for _, p := range instantiatedProviders {
		loc := fmt.Sprintf("%s-%s-%s", p.providerName, p.region, p.namespace)
		locations = append(locations, loc)
	}

	// Verify that each cloud provider gets instantiated.
	assert.Equal(t, []string{
		"FakeAmazon-Fake region-ns",
		"FakeAmazon-Fake region-ns",
		"FakeVagrant-Fake region-ns"}, locations)
	close(stop)
}

func TestGetError(t *testing.T) {
	t.Parallel()

	cld := newTestCloud(FakeAmazon, testRegion, "ns")
	cld.provider.(*fakeProvider).listError = errors.New("err")
	_, err := cld.get()
	assert.EqualError(t, err, "list FakeAmazon-Fake region-ns: err")
}

func setNamespace(conn db.Conn, ns string) {
	conn.Txn(db.AllTables...).Run(func(view db.Database) error {
		bp, err := view.GetBlueprint()
		if err != nil {
			bp = view.InsertBlueprint()
		}

		bp.Namespace = ns
		view.Commit(bp)
		return nil
	})
}

var instantiatedProviders []fakeProvider

func mock() {
	instantiatedProviders = nil
	newProvider = func(p db.ProviderName, namespace,
		region string) (provider, error) {
		ret := fakeProvider{
			providerName: p,
			region:       region,
			namespace:    namespace,
			machines:     make(map[string]db.Machine),
			roles:        make(map[string]db.Role),
		}
		ret.clearLogs()

		instantiatedProviders = append(instantiatedProviders, ret)
		return &ret, nil
	}

	validRegions = fakeValidRegions
	db.AllProviders = []db.ProviderName{FakeAmazon, FakeVagrant}
	getMachineRole = func(ip string) db.Role {
		for _, prvdr := range instantiatedProviders {
			if role, ok := prvdr.roles[ip]; ok {
				return role
			}
		}
		return db.None
	}
}

gha_language: Go

extension: go


text:
SUMMARY = "Filesystem and hardware benchmark and stress tool"
DESCRIPTION = "fio is an I/O tool meant to be used both for benchmark and \
stress/hardware verification. It has support for a number of I/O engines, \
I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, \
and much more. It can work on block devices as well as files. fio accepts \
job descriptions in a simple-to-understand text format. Several example job \
files are included. fio displays all sorts of I/O performance information."
HOMEPAGE = "http://freecode.com/projects/fio"
SECTION = "console/tests"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS = "libaio zlib coreutils-native"
DEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'pmem', 'pmdk', '', d)}"
RDEPENDS:${PN} = "python3-core bash"

PACKAGECONFIG_NUMA = "numa"
# ARM does not currently support NUMA
PACKAGECONFIG_NUMA:arm = ""
PACKAGECONFIG_NUMA:armeb = ""

PACKAGECONFIG ??= "${PACKAGECONFIG_NUMA}"
PACKAGECONFIG[numa] = ",--disable-numa,numactl"

SRCREV = "db7fc8d864dc4fb607a0379333a0db60431bd649"
SRC_URI = "git://git.kernel.dk/fio.git;branch=master"

S = "${WORKDIR}/git"

# avoids build breaks when using no-static-libs.inc
DISABLE_STATIC = ""

EXTRA_OEMAKE = "CC='${CC}' LDFLAGS='${LDFLAGS}'"
EXTRA_OECONF = "${@bb.utils.contains('MACHINE_FEATURES', 'x86', '--disable-optimizations', '', d)}"

do_configure() {
    ./configure ${EXTRA_OECONF}
}

do_install() {
    oe_runmake install DESTDIR=${D} prefix=${prefix} mandir=${mandir}
    install -d ${D}/${docdir}/${PN}
    cp -R --no-dereference --preserve=mode,links -v ${S}/examples ${D}/${docdir}/${PN}/
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded