Make sure to check things exist before actually modifying them

This fixes crashes when a system does not have squashfs-tools or
a grub dir does not exist.
Make sure hwinfo exists before calling it