The equations for gravity waves on the free surface of a laterally unbounded inviscid fluid of uniform density and variable depth under the action of an external pressure are derived through Hamilton's principle on the assumption that the fluid moves in vertical columns. The resulting equations are equivalent to those of Green & Naghdi (1976). The conservation laws for energy, momentum and potential vorticity are inferred directly from symmetries of the Lagrangian. The potential vorticity vanishes in any flow that originates from rest; this leads to a canonical formulation in which the evolution equations are equivalent, for uniform depth, to Whitham's (1967) generalization of the Boussinesq equations, in which dispersion, but not nonlinearity, is assumed to be weak. The further approximation that nonlinearity and dispersion are comparably weak leads to a canonical form of Boussinesq's equations that conserves consistent approximations to energy, momentum (for a level bottom) and potential vorticity.