Abstract We extend stochastic thermodynamics by relaxing the two assumptions that Markovian dynamics must be linear and equilibrium distribution a Boltzmann distribution. show if we require second law to hold when those are relaxed, then it cannot formulated in terms of Shannon entropy. However, thermodynamic consistency is salvaged reformulate generalized entropy; our first result an equation ...