Single Cylinder Ignition Control

IF the ignition sensor is on the flywheel, then it must be a 2-cycle engine. What powered the original CDI? Is there a magneto? Is there a magnet on the flywheel and a stationary coil that acts as a generator?

Paul