Disabling keyboard before login screen

My laptop’s internal keyboard has faulty keys that act as if they’re been pressed all the time, and this is causing problems on boot up. How do I disable the keyboard using software code, before boot up is complete?

I have a bootable usb drive that runs Skywave Linux, which really is Ubuntu mate, plus a few ham radio applications.

Thanks