Gauged supergravities from M-theory reductions