HP is trying to overcome severe weakness in the hardware business, as PC demand continues to flag.