Pull the ldlinux-specific code out into it's own method, and call it elsewhere.