A MAJOR western defence firm was upgrading military equipment for an elite Libyan security brigade just before the uprising against Muammar Gaddafi began, documents show, revealing how the West tried to foster ties with Gaddafi during his final years in power.