Buck regulator to match an analog voltage
I assume this doesn't need to be particularly precise output voltage, you just want the secondary supply to approximately match the varied voltage on the primary supply.  You may be able to use a two-input comparator as the "controller chip" that controls the gate of a P-ch MOSFET in a typical inductor-based buck topology.  

Since the comparator would probably operate at less than 12V supply (possibly 5V) you would need a small regulator, and consequently also want resistor dividers to provide a lower reference to each input.  

Basically, this would be a circuit to switch on the FET whenever supply 2 is lower than supply 1, and switch off the FET when supply 2 is higher than supply 1.  Probably also want to design in a small amount of hysterisis on the feedback side, this should allow some control of the circuit's switching speed, otherwise may be overly-sensitive with constant rapid switching.